User's Manual

12 How to manage interfaces in Linux ReliaGATE 10-12 User manual Rev. 2-1
12.9.3.2 How to implement the ioctl in the source code to configure the COM ports
To implement the ioctl in the source code, enter the following commands:
/*Ioctl to read */
#define TIOCGRS485 0x542E
/*Ioctl to write */
#define TIOCSRS485 0x542F
Definition of the flags bit
/*FLAGS */
//#define SER_RS485_ENABLED (1 << 0)
/* Logical level for RTS pin when sending */
//#define SER_RS485_RTS_ON_SEND (1 << 1)
/* Logical level for RTS pin after sent*/
//#define SER_RS485_RTS_AFTER_SEND (1 << 2)
//#define SER_RS485_RX_DURING_TX (1 << 4)
/* Inverted logic level for RS485 gpio */
#define SER_RS485_INVERT (1 << 5)
/* if enabled serial line drivers must be configured in HiZ*/
#define SER_HIZ_ENABLED (1 << 31)
Linux kernel data structure
struct serial_rs485 {
__u32 flags; /* RS485 feature flags */
__u32 delay_rts_before_send; /* Delay before send (milliseconds) */
__u32 delay_rts_after_send; /* Delay after send (milliseconds) */
__u32 padding[5]; /* Memory is cheap, new structs
};
82 / 118