mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 03:27:45 +08:00
change all usart modules to have same api
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
* @brief module for recv&send vision data
|
||||
* @version beta
|
||||
* @date 2022-11-03
|
||||
*
|
||||
* @copyright Copyright (c) 2022
|
||||
* @todo 增加对串口调试助手协议的支持,包括vofa和serial debug
|
||||
* @copyright Copyright (c) 2022
|
||||
*
|
||||
*/
|
||||
#include "Master_process.h"
|
||||
@@ -27,12 +27,13 @@ static void DecodeVision()
|
||||
}
|
||||
|
||||
/* 视觉通信初始化 */
|
||||
void VisionInit(UART_HandleTypeDef *handle)
|
||||
Vision_Recv_s* VisionInit(UART_HandleTypeDef *handle)
|
||||
{
|
||||
vision_usart_instance.module_callback = DecodeVision;
|
||||
vision_usart_instance.recv_buff_size = VISION_RECV_SIZE;
|
||||
vision_usart_instance.usart_handle = handle;
|
||||
USARTRegister(&vision_usart_instance);
|
||||
return &recv_data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,12 +9,19 @@
|
||||
#define VISION_SEND_SIZE 36u
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief 调用此函数初始化和视觉的串口通信
|
||||
*
|
||||
* @param handle 用于和视觉通信的串口handle(C板上一般为USART1,丝印为USART2,4pin)
|
||||
*/
|
||||
void VisionInit(UART_HandleTypeDef* handle);
|
||||
Vision_Recv_s* VisionInit(UART_HandleTypeDef* handle);
|
||||
|
||||
/**
|
||||
* @brief 发送视觉视觉
|
||||
|
||||
Reference in New Issue
Block a user