| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef _API_OS_H_
- #define _API_OS_H_
- typedef struct _thread_cfg_t{
- uint8_t enable;
- uint8_t priority;
- uint16_t stack_heap_size;
- }thread_cfg_t;
- struct thread_cfg_cb{
- thread_cfg_t bt_hw;
- thread_cfg_t bt_stack;
- thread_cfg_t aupcm;
- thread_cfg_t dirver;
- thread_cfg_t timer;
- thread_cfg_t main;
- };
- typedef void (*thd_drv_callback_t)(uint8_t msg);
- typedef void (*thd_aupcm_callback_t)(uint8_t msg);
- /**
- * @brief Post a msg to driver thread.
- * @note it should be called after 'thread_driver_user_callback_register', or failed.
- * @param msg: the msg need to post to driver thread.
- * @retval true if msg post successfully, or false.
- */
- bool thread_driver_msg_post(uint8_t msg);
- /**
- * @brief Register a callback func for driver vendor msg.
- * @note the driver thread should be exists, or will failed.
- * @param callback: the callback func.
- * @retval true if func register successfully, or false.
- */
- bool thread_driver_user_callback_register(thd_drv_callback_t callback);
- /**
- * @brief Post a msg to aupcm thread.
- * @note it should be called after 'thread_aupcm_callback_register', or failed.
- * @param msg: the msg need to post to aupcm thread.
- * @retval true if msg post successfully, or false.
- */
- bool thread_aupcm_msg_post(uint8_t msg);
- /**
- * @brief Register a callback func for aupcm thread msg.
- * @note the aupcm thread should be exists, or will failed.
- * @param callback: the callback func.
- * @retval true if func register successfully, or false.
- */
- bool thread_aupcm_callback_register(thd_aupcm_callback_t callback);
- void thread_driver_create(void);
- void thread_aupcm_create(void);
- void thread_btstack_create(void);
- #endif
|