12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- /****************************************************************************
- *
- * Copy right: Qx.
- * File name: UartTask.h
- * Description: 串口任务
- * History: 2021-03-05
- *
- ****************************************************************************/
- #define PROC_UART_TASK_STACK_SIZE (1024)
- #define UART_READ_CODE 0x03
- #define UART_WRITE_CODE 0x10
- #define BMS_ADDRESS_CODE 0x01
- typedef struct Uart_Read_Msg_Type
- {
- uint8_t Bms_Address;
- uint8_t Bms_Funcode;
- uint8_t Reg_Begin_H;
- uint8_t Reg_Begin_L;
- uint8_t Reg_Num_H;
- uint8_t Reg_Num_L;
- uint8_t CRC_H;
- uint8_t CRC_L;
- }Uart_Read_Msg_Type;
- typedef struct Uart_Write_Msg_Type
- {
- uint8_t Bms_Address;
- uint8_t Bms_Funcode;
- uint8_t Reg_Begin_H;
- uint8_t Reg_Begin_L;
- uint8_t Reg_Num_H;
- uint8_t Reg_Num_L;
- uint8_t Data_Count;
- uint8_t Data[2];
- uint8_t CRC_H;
- uint8_t CRC_L;
- }Uart_Write_Msg_Type;
- typedef struct Uart_Write_Answer_Msg_Type
- {
- uint8_t Bms_Address;
- uint8_t Bms_Funcode;
- }Uart_Write_Answer_Msg_Type;
- typedef enum
- {
- PROCESS_UART_STATE_IDLE = 0,
- PROCESS_UART_STATE_CHECK,
- PROCESS_UART_STATE_WORK,
- PROCESS_UART_STATE_SLEEP
- }process_Uart;
- void UartTaskInit(void* arg);
- void UartTaskDeInit(void* arg);
|