123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- #ifndef __hal_uart_H__
- #define __hal_uart_H__
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #include "main.h"
-
- #ifdef __cplusplus
- }
- #endif
- typedef enum {
- UART_T_HEART = 0,
- UART_NUM_OF_T,
- }UART_T_n;
- typedef enum {
- UART_R_HEART = 0,
- UART_NUM_OF_R,
- }UART_R_n;
- typedef struct _UART UART_t;
- typedef void (*UART_Callback)(UART_t*);
- struct _UART{
- uint8_t id;
- uint8_t cmd;
- uint8_t* pDat;
- uint8_t datLen;
- UART_Callback cb;
- struct _UART* next;
- };
- //void DF_Rx_Regist(DF_t* handle,uint8_t cmd,DF_Callback cb);
- int UART_Regist(uint8_t id,uint8_t cmd,UART_Callback cb);
- void UART_Send(unsigned char cmd,unsigned char *pDat,unsigned char datLen);
- void UART_Process(void);
- #endif /* __DF_H */
|