天嵌二次封装库使用手册  V2.1.2
tq_can.h
浏览该文件的文档.
1 
7 #ifndef LINUX_LIBV2_SOURCE_CAN_TQ_CAN_H_
8 #define LINUX_LIBV2_SOURCE_CAN_TQ_CAN_H_
9 
10 // Copyright 2024 广东省天嵌嵌入式技术股份有限公司
11 
12 #ifdef __cplusplus
13 #define CAN_API extern "C"
14 #else
15 #define CAN_API
16 #endif
17 
18 #include "libhardware.h"
19 
25 CAN_API int tq_check_can(const char *dev);
26 
34 CAN_API int tq_init_can(const char * dev,int bitrate, int mode);
35 
41 CAN_API int tq_can_open(const char *dev);
42 
50 CAN_API int tq_can_read_data(int fd, struct can_frame* data,unsigned int timeout_ms);
51 
58 CAN_API int tq_can_write_data(int fd, struct can_frame data);
59 
65 CAN_API int tq_can_close(int fd);
66 
67 #endif
68 
CAN_API int tq_can_close(int fd)
关闭can设备
CAN_API int tq_can_write_data(int fd, struct can_frame data)
用于向can设备中写入数据
CAN_API int tq_can_read_data(int fd, struct can_frame *data, unsigned int timeout_ms)
用于向can设备中读取数据
#define CAN_API
Definition: tq_can.h:15
CAN_API int tq_can_open(const char *dev)
打开can设备
CAN_API int tq_check_can(const char *dev)
查询tq-can-lib库中是否注册了can设备
CAN_API int tq_init_can(const char *dev, int bitrate, int mode)
初始化can设备