|
enum | DEVICE {
DEVICE_UART0 = 0,
DEVICE_UART1,
DEVICE_UART2,
DEVICE_UART3,
DEVICE_UART4,
DEVICE_UART5,
DEVICE_UART6,
DEVICE_UART7,
DEVICE_UART8,
DEVICE_UART9,
DEVICE_UART10,
DEVICE_UART11,
DEVICE_UART12,
DEVICE_UART13,
DEVICE_UART14,
DEVICE_UART15,
DEVICE_UART16,
DEVICE_UART17,
DEVICE_UART18,
DEVICE_UART19
} |
| Enumeration of the UART devices. More...
|
|
enum | BAUDRATE {
BAUDRATE_110,
BAUDRATE_300,
BAUDRATE_600,
BAUDRATE_1200,
BAUDRATE_2400,
BAUDRATE_4800,
BAUDRATE_9600,
BAUDRATE_19200,
BAUDRATE_38400,
BAUDRATE_57600,
BAUDRATE_115200
} |
| Enumeration of supported baud rates. More...
|
|
enum | PARITY { PARITY_NONE,
PARITY_ODD,
PARITY_EVEN
} |
| Enumeration of supported parity bit configurations. More...
|
|
enum | STOPBITS { STOPBITS_1,
STOPBITS_2
} |
| Enumeration of supported stop bit configurations. More...
|
|
enum | FLOWCONTROL { FLOW_NONE,
FLOW_RTS_CTS,
FLOW_XON_XOFF
} |
| Enumeration of supported flow control methods. More...
|
|
enum | IPIN { IPIN_CD,
IPIN_CTS,
IPIN_DSR,
IPIN_RI
} |
| Enumeration of UART pins, which can be used as discrete inputs. More...
|
|
enum | OPIN { OPIN_RTS,
OPIN_DTR
} |
| Enumeration of UART pins, which can be used as discrete outputs. More...
|
|
|
| UART (const System &sys, DEVICE device) |
| Creates the UART object. Requires to know on which system we run (a fully set System object).
|
|
| ~UART () |
| Destroys the UART object, closing it if necessary.
|
|
STATUS | setCommParams (BAUDRATE baudRate, PARITY parity, STOPBITS stopBits, FLOWCONTROL flowControl) |
| Sets the communication parameters for the UART.
|
|
STATUS | open () |
| Opens the UART device for I/O.
|
|
STATUS | close () |
| Closes the UART device.
|
|
bool | isOpen () const |
| Checks if the UART device is open.
|
|
uint32_t | write (const uint8_t *buffer, uint32_t size, STATUS *status=NULL) |
| Writes an array of bytes (at least partially) to the UART.
|
|
uint32_t | read (uint8_t *buffer, uint32_t size, STATUS *status=NULL) |
| Reads an array of bytes (at least partially) from the UART.
|
|
STATUS | setPin (OPIN pin, bool value) |
| Setting level of a pin.
|
|
bool | getPin (IPIN pin, STATUS *status=NULL) const |
| Getting status of a pin.
|
|
Provides access to an UART on a DHCOM Module. The class does not provide protection from re-opening the same UART device many times. The class provides non-blocking IO, returning the number of symbols actually sent or received.