Advertisement

linux用户层串口操作

阅读量:

1、【
1、宏定义

#define N_HW_BFG 25 //线路规程编号

/* 参数设置波特率 */

#define BOTHER 0x00001000

#define ARM_NCCS 19

#define TCGETS2 __IOR('T', 0x2A, struct termios2)

#define TCSETS2 __IOW('T', 0x2B, struct termios2)

/sysfs节点路径/

#define INSTALL_SYSTEM_ENTRY "/sys/devices/platform/hw-ps/install"

#define DEV_NAME_SYSTEM "/sys/devices/paltform/hw-ps/dev_name"

#define BAUD_RATE_SYSTEM "/sys/devices/paltform/hw-ps/baud_rate"

#define FLOW_CTRL_SYSTEM "/sys/devices/paltform/hw-ps/flow_cntrl"

2、STRUCT定义

/* 设置第二波特率的Termios结构体 */

struct termios2 {

tcflag_t c_iflag; /* 输入模式标志 */

tcflag_t c_oflag; /* 输出模式

全部评论 (0)

还没有任何评论哟~