| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- /*
- * uart_util.h
- *
- * Created on: 2025年7月30日
- * Author: wulianwei
- */
- #ifndef UITL_UART_UTIL_H_
- #define UITL_UART_UTIL_H_
- #define UART_RECV_SIZE 1024 //
- typedef enum recv_status_en
- {
- REV_WAIT,//接收未完成
- REV_OK //接收完成
- } recv_status_e;
- recv_status_e recv_status;
- typedef struct uart_recv_st
- {
- unsigned char buf[UART_RECV_SIZE]; //缓存大小
- unsigned int len; //接收长度
- recv_status_e recv_flag; //接收完成标志
- char* start_addr; //字符开始地址
- } uart_recv_t; //串口接收缓存
- void ConsoleDeviceInit(void);
- void ConsolePutsHexStr(unsigned char *source, unsigned int numBytesToWrite);
- unsigned int ConsolePuts(char *pTxBuffer, int numBytesToWrite);
- void ConsolePrintf(char *fmt,...);
- void LogPrintf(const char *pcString, ...);
- void ConsoleRecvFill(unsigned char data);
- void ConsoleRecvClear();
- void ConsoleRecvWait(int timeout);
- recv_status_e ConsoleRecvFlag();
- unsigned char* ConsoleRecvData();
- int ConsoleRecvLen();
- #endif /* UITL_UART_UTIL_H_ */
|