Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

UART Control Macros
[XNUT-100 & XNUT-105 DIN-rail SBC]

Collaboration diagram for UART Control Macros:


Detailed Description

Functions to control UART modes.


Defines

#define SER0_RS232_MODE()   (PORTB |= _BV(0))
#define SER0_RS485_MODE()   (PORTB &= ~_BV(0))
#define SER0_RS485_DRV_ON()   (PORTB |= _BV(1))
#define SER0_RS485_DRV_OFF()   (PORTB &= ~_BV(1))
#define SER1_RS232_MODE()   (PORTB |= _BV(2))
#define SER1_RS485_MODE()   (PORTB &= ~_BV(2))
#define SER1_RS485_DRV_ON()   (PORTB |= _BV(3))
#define SER1_RS485_DRV_OFF()   (PORTB &= ~_BV(3))
#define SER0_GET_CD()   bit_is_set(PINB, 6)
#define SER0_GET_RI()   bit_is_set(PINB, 7)
#define SER0_GET_CTS()   bit_is_set(PINE, 6)
#define SER0_SET_RTS()   (PORTB |= _BV(4))
#define SER0_CLR_RTS()   (PORTB &= ~_BV(4))


Define Documentation

 
#define SER0_RS232_MODE  )     (PORTB |= _BV(0))
 

Configure Ser 0 to operate in RS232 mode.

In RS232 mode receiption from SUB-D connector J9 is enabled and the receiver on connector J6-2/3 is disabled.

 
#define SER0_RS485_MODE  )     (PORTB &= ~_BV(0))
 

Configure Ser 0 to operate in RS485 mode.

In RS485 mode receiption from connector J6-2/3 is enabled and the receiver on SUB-D connector J9 is disabled.

 
#define SER0_RS485_DRV_ON  )     (PORTB |= _BV(1))
 

Switches the RS485 line driver of Ser 0 on.

RS485 is a half-duplex link and the line driver must be switched off to allow receiption of data.

 
#define SER0_RS485_DRV_OFF  )     (PORTB &= ~_BV(1))
 

Switches the RS485 line driver of Ser 0 off.

 
#define SER1_RS232_MODE  )     (PORTB |= _BV(2))
 

Configure Ser 1 to operate in RS232 mode.

In RS232 mode receiption from SUB-D connector J7 is enabled and the receiver on connector J6-5/6 is disabled.

 
#define SER1_RS485_MODE  )     (PORTB &= ~_BV(2))
 

Configure Ser 1 to operate in RS485 mode.

In RS485 mode receiption from connector J6-5/6 is enabled and the receiver on SUB-D connector J7 is disabled.

 
#define SER1_RS485_DRV_ON  )     (PORTB |= _BV(3))
 

Switches the RS485 line driver of Ser 1 on.

RS485 is a half-duplex link and the line driver must be switched off to allow receiption of data.

 
#define SER1_RS485_DRV_OFF  )     (PORTB &= ~_BV(3))
 

Switches the RS485 line driver of Ser 1 off.

 
#define SER0_GET_CD  )     bit_is_set(PINB, 6)
 

Returns the status of the RS232 CD signal input of Ser 0 on SUB-D connector J9

Returns:
1 if CD is asserted

 
#define SER0_GET_RI  )     bit_is_set(PINB, 7)
 

Returns the status of the RS232 RI signal input of Ser 0 on SUB-D connector J9

Returns:
1 if RI is asserted

 
#define SER0_GET_CTS  )     bit_is_set(PINE, 6)
 

Returns the status of the RS232 CTS signal input of Ser 0 on SUB-D connector J9

Returns:
1 if CTS is asserted

 
#define SER0_SET_RTS  )     (PORTB |= _BV(4))
 

Asserts the RS232 RTS signal output of Ser 0 on SUB-D connector J9

 
#define SER0_CLR_RTS  )     (PORTB &= ~_BV(4))
 

Clears the RS232 RTS signal output of Ser 0 on SUB-D connector J9


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/