天嵌二次封装库使用手册  V2.1.2
tq_uart.h
浏览该文件的文档.
1 
7 #ifndef LINUX_LIBV2_SOURCE_TQUART_TQ_UART_H_
8 #define LINUX_LIBV2_SOURCE_TQUART_TQ_UART_H_
9 
10 // Copyright 2024 广东省天嵌嵌入式技术股份有限公司
11 
12 
13 #ifdef __cplusplus
14 #define UART_API extern "C"
15 #else
16 #define UART_API
17 #endif
18 
28  UART_API int tq_uart_init(char *dev, int nBaud, int nBits, char nEvent, int nStop);
29 
35  UART_API int tq_uart_open(char *dev_name);
36 
44  UART_API int tq_uart_write_data(int fd, char *buff, int len);
45 
54  UART_API int tq_uart_read_data(int fd, char *buff, int len, int timeout_ms);
55 
60  UART_API void tq_uart_close(int fd);
61 
67  UART_API int tq_uart_open(char *dev_name);
68 
76  UART_API int tq_uart_write(int fd, char *buff, int len);
77 
85  UART_API int tq_uart_read(int fd, char *buff, int len);
86 
87 #endif
#define UART_API
Definition: tq_uart.h:16
UART_API int tq_uart_read_data(int fd, char *buff, int len, int timeout_ms)
读取串口信息
UART_API int tq_uart_init(char *dev, int nBaud, int nBits, char nEvent, int nStop)
初始化串口
UART_API void tq_uart_close(int fd)
关闭串口
UART_API int tq_uart_read(int fd, char *buff, int len)
读取串口信息,默认读取超时时间为1秒
UART_API int tq_uart_write(int fd, char *buff, int len)
向串口写数据,,参数和使用方法与 uart_write_data 函数一样
UART_API int tq_uart_open(char *dev_name)
打开串口
UART_API int tq_uart_write_data(int fd, char *buff, int len)
向串口写数据