增加了遥控器按键功能并修改所有函数和类型定义为标准格式

This commit is contained in:
NeoZng
2022-12-05 21:01:26 +08:00
parent 3947c48230
commit 9c9ea14bde
40 changed files with 352 additions and 251 deletions

View File

@@ -10,7 +10,7 @@
/* application callback,which resolves specific protocol,解析协议的回调函数 */
typedef void (*usart_module_callback)();
/* usart_instance struct,each app would have one instance */
/* USARTInstance struct,each app would have one instance */
typedef struct
{
// 更新:弃用malloc方案,使用了固定大小的数组方便debug时查看
@@ -18,7 +18,7 @@ typedef struct
uint8_t recv_buff_size; // 模块接收一包数据的大小
UART_HandleTypeDef *usart_handle; // 实例对应的usart_handle
usart_module_callback module_callback; // 解析收到的数据的回调函数
} usart_instance;
} USARTInstance;
/* usart 初始化配置结构体 */
typedef struct
@@ -33,7 +33,7 @@ typedef struct
*
* @param init_config 传入串口初始化结构体
*/
usart_instance* USARTRegister(USART_Init_Config_s *init_config);
USARTInstance *USARTRegister(USART_Init_Config_s *init_config);
/**
* @todo 是否需要进一步封装发送buff和size,并创建一个串口任务以一定频率自动发送?
@@ -45,6 +45,6 @@ usart_instance* USARTRegister(USART_Init_Config_s *init_config);
* @param id specify which usart would be used
* @param send_size how many bytes to send
*/
void USARTSend(usart_instance *_instance, uint8_t *send_buf, uint16_t send_size);
void USARTSend(USARTInstance *_instance, uint8_t *send_buf, uint16_t send_size);
#endif