From cc432b761c884a0bd8e9d83db0a4e26109fc08b1 Mon Sep 17 00:00:00 2001 From: chen <15335560115@163.com> Date: 星期五, 08 十一月 2024 15:35:38 +0800 Subject: [PATCH] 安邦手环GPS删除部分无用数据和修改4G波特率9600出厂测试固件 --- keil/include/components/wsf/include/wsf_msg.h | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 162 insertions(+), 0 deletions(-) diff --git a/keil/include/components/wsf/include/wsf_msg.h b/keil/include/components/wsf/include/wsf_msg.h new file mode 100644 index 0000000..f6cdd42 --- /dev/null +++ b/keil/include/components/wsf/include/wsf_msg.h @@ -0,0 +1,162 @@ +/*************************************************************************************************/ +/*! + * \file wsf_msg.h + * + * \brief Message passing service. + * + * Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. + * + * Copyright (c) 2019-2020 Packetcraft, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/*************************************************************************************************/ +#ifndef WSF_MSG_H +#define WSF_MSG_H + +#include "wsf_queue.h" +#include "wsf_os.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// Build the message ID of a task +#define OS_MSG_ID_BUILD(type, idx) ((uint8_t)(((type) << 4) | (idx))) + +/// Retrieves task type from message id. +#define OS_MSG_TASK_TYPE_GET(os_msg_id) (((os_msg_id) >> 4) & 0xF) + +/// Tasks types definition +enum OS_TASK_TYPE +{ + OS_TASK_APP, + OS_TASK_UWB, + OS_TASK_RANGING, + OS_TASK_AOA, + OS_TASK_UL_TDOA, + OS_TASK_UWB_TEST, + OS_TASK_UCI_TL, + OS_TASK_UWB_RADAR, + OS_TASK_OTA, + + /// Maximum number of tasks + OS_TASK_NUM, + + OS_TASK_NONE = 0xFF, +}; + +/*! \addtogroup WSF_MSG_API + * \{ */ + +/************************************************************************************************** + Function Declarations +**************************************************************************************************/ + +/*************************************************************************************************/ +/*! + * \brief Allocate a data message buffer to be sent with WsfMsgSend(). + * + * \param len Message length in bytes. + * \param tailroom Tailroom length in bytes. + * + * \return Pointer to data message buffer or NULL if allocation failed. + */ +/*************************************************************************************************/ +void *WsfMsgDataAlloc(uint16_t len, uint8_t tailroom); + +/*************************************************************************************************/ +/*! + * \brief Allocate a message buffer to be sent with WsfMsgSend(). + * + * \param len Message length in bytes. + * + * \return Pointer to message buffer or NULL if allocation failed. + */ +/*************************************************************************************************/ +void *WsfMsgAlloc(uint16_t len); + +/*************************************************************************************************/ +/*! + * \brief Free a message buffer allocated with WsfMsgAlloc(). + * + * \param pMsg Pointer to message buffer. + */ +/*************************************************************************************************/ +void WsfMsgFree(void *pMsg); + +/*************************************************************************************************/ +/*! + * \brief Send a message to an event handler. + * + * \param handlerId Event handler ID. + * \param pMsg Pointer to message buffer. + */ +/*************************************************************************************************/ +void WsfMsgSend(wsfHandlerId_t handlerId, void *pMsg); + +/*************************************************************************************************/ +/*! + * \brief Enqueue a message. + * + * \param pQueue Pointer to queue. + * \param handlerId Set message handler ID to this value. + * \param pMsg Pointer to message buffer. + */ +/*************************************************************************************************/ +void WsfMsgEnq(wsfQueue_t *pQueue, wsfHandlerId_t handlerId, void *pMsg); + +/*************************************************************************************************/ +/*! + * \brief Dequeue a message. + * + * \param pQueue Pointer to queue. + * \param pHandlerId Handler ID of returned message; this is a return parameter. + * + * \return Pointer to message that has been dequeued or NULL if queue is empty. + */ +/*************************************************************************************************/ +void *WsfMsgDeq(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId); + +/*************************************************************************************************/ +/*! + * \brief Get the next message without removing it from the queue. + * + * \param pQueue Pointer to queue. + * \param pHandlerId Handler ID of returned message; this is a return parameter. + * + * \return Pointer to the next message on the queue or NULL if queue is empty. + */ +/*************************************************************************************************/ +void *WsfMsgPeek(wsfQueue_t *pQueue, wsfHandlerId_t *pHandlerId); + +/*************************************************************************************************/ +/*! + * \brief Get the Nth message without removing it from the queue. + * + * \param pQueue Pointer to queue. + * \param n Nth item from the top (0 = top element). + * \param pHandlerId Handler ID of returned message; this is a return parameter. + * + * \return Pointer to the next message on the queue or NULL if queue is empty. + */ +/*************************************************************************************************/ +void *WsfMsgNPeek(wsfQueue_t *pQueue, uint8_t n, wsfHandlerId_t *pHandlerId); + +/*! \} */ /* WSF_MSG_API */ + +#ifdef __cplusplus +}; +#endif + +#endif /* WSF_MSG_H */ -- Gitblit v1.9.3