![]() |
Ultibo API
C/C++ API for Ultibo Core
|
#include "ultibo/globaltypes.h"#include "ultibo/globalconst.h"#include "ultibo/devices.h"#include "ultibo/serial.h"Go to the source code of this file.
Data Structures | |
| struct | _UART_PROPERTIES |
| struct | _UART_DEVICE |
Macros | |
| #define | UART_NAME_PREFIX "UART" |
| Name prefix for UART Devices. | |
| #define | UART_PUSH_TIMEOUT SERIAL_PUSH_TIMEOUT |
| Timeout (Milliseconds) for Push RX/TX (Implementation specific). | |
| #define | UART_TYPE_NONE 0 |
| #define | UART_TYPE_8250 1 |
| 8250 UART and similar variants (Differences are handled by driver) | |
| #define | UART_TYPE_16550 2 |
| 16550 UART and similar variants (eg 16550A) (Differences are handled by driver) | |
| #define | UART_TYPE_16650 3 |
| 16650 UART and similar variants (eg 16C650) (Differences are handled by driver) | |
| #define | UART_TYPE_MAX 3 |
| #define | UART_MODE_NONE 0 |
| #define | UART_MODE_UART 1 |
| The UART was opened as a UART device and all reads and writes are direct. | |
| #define | UART_MODE_SERIAL 2 |
| The UART was opened as a Serial device so reads and writes are being buffered. | |
| #define | UART_MODE_MAX 2 |
| #define | UART_STATE_DISABLED 0 |
| #define | UART_STATE_ENABLED 1 |
| #define | UART_STATE_MAX 1 |
| #define | UART_FLAG_NONE SERIAL_FLAG_NONE |
| #define | UART_FLAG_DATA_8BIT SERIAL_FLAG_DATA_8BIT |
| Device supports 8 data bits. | |
| #define | UART_FLAG_DATA_7BIT SERIAL_FLAG_DATA_7BIT |
| Device supports 7 data bits. | |
| #define | UART_FLAG_DATA_6BIT SERIAL_FLAG_DATA_6BIT |
| Device supports 6 data bits. | |
| #define | UART_FLAG_DATA_5BIT SERIAL_FLAG_DATA_5BIT |
| Device supports 5 data bits. | |
| #define | UART_FLAG_STOP_1BIT SERIAL_FLAG_STOP_1BIT |
| Device supports 1 stop bit. | |
| #define | UART_FLAG_STOP_2BIT SERIAL_FLAG_STOP_2BIT |
| Device supports 2 stop bits. | |
| #define | UART_FLAG_STOP_1BIT5 SERIAL_FLAG_STOP_1BIT5 |
| Device supports 1.5 stop bits. | |
| #define | UART_FLAG_PARITY_ODD SERIAL_FLAG_PARITY_ODD |
| Device supports odd parity. | |
| #define | UART_FLAG_PARITY_EVEN SERIAL_FLAG_PARITY_EVEN |
| Device supports even parity. | |
| #define | UART_FLAG_PARITY_MARK SERIAL_FLAG_PARITY_MARK |
| Device supports mark parity. | |
| #define | UART_FLAG_PARITY_SPACE SERIAL_FLAG_PARITY_SPACE |
| Device supports space parity. | |
| #define | UART_FLAG_FLOW_RTS_CTS SERIAL_FLAG_FLOW_RTS_CTS |
| Device supports RTS/CTS flow control. | |
| #define | UART_FLAG_FLOW_DSR_DTR SERIAL_FLAG_FLOW_DSR_DTR |
| Device supports DSR/DTR flow control. | |
| #define | UART_FLAG_PUSH_RX SERIAL_FLAG_PUSH_RX |
| Device requires pushed receive (Implementation specific). | |
| #define | UART_FLAG_PUSH_TX SERIAL_FLAG_PUSH_TX |
| Device requires pushed transmit (Implementation specific). | |
| #define | UART_READ_NONE SERIAL_READ_NONE |
| #define | UART_READ_NON_BLOCK SERIAL_READ_NON_BLOCK |
| Do not block when receiving, if the FIFO is empty return immediately. | |
| #define | UART_WRITE_NONE SERIAL_WRITE_NONE |
| #define | UART_WRITE_NON_BLOCK SERIAL_WRITE_NON_BLOCK |
| Do not block when transmitting, if the FIFO is full return immediately. | |
| #define | UART_WAIT_NONE SERIAL_WAIT_NONE |
| #define | UART_WAIT_RECEIVE SERIAL_WAIT_RECEIVE |
| Wait for data to be available in the receive FIFO. | |
| #define | UART_WAIT_TRANSMIT SERIAL_WAIT_TRANSMIT |
| Wait for space to be available in the transmit FIFO. | |
| #define | UART_STATUS_NONE SERIAL_STATUS_NONE |
| #define | UART_STATUS_RTS SERIAL_STATUS_RTS |
| #define | UART_STATUS_CTS SERIAL_STATUS_CTS |
| #define | UART_STATUS_DSR SERIAL_STATUS_DSR |
| #define | UART_STATUS_DTR SERIAL_STATUS_DTR |
| #define | UART_STATUS_RX_FULL SERIAL_STATUS_RX_FULL |
| #define | UART_STATUS_RX_EMPTY SERIAL_STATUS_RX_EMPTY |
| #define | UART_STATUS_TX_FULL SERIAL_STATUS_TX_FULL |
| #define | UART_STATUS_TX_EMPTY SERIAL_STATUS_TX_EMPTY |
| #define | UART_STATUS_BUSY SERIAL_STATUS_BUSY |
| #define | UART_STATUS_BREAK_ERROR SERIAL_STATUS_BREAK_ERROR |
| #define | UART_STATUS_PARITY_ERROR SERIAL_STATUS_PARITY_ERROR |
| #define | UART_STATUS_FRAMING_ERROR SERIAL_STATUS_FRAMING_ERROR |
| #define | UART_STATUS_OVERRUN_ERROR SERIAL_STATUS_OVERRUN_ERROR |
| #define | UART_STATUS_DCD SERIAL_STATUS_DCD |
| #define | UART_STATUS_RI SERIAL_STATUS_RI |
Typedefs | |
| typedef struct _UART_PROPERTIES | UART_PROPERTIES |
| typedef struct _UART_DEVICE | UART_DEVICE |
| typedef uint32_t STDCALL(* | uart_enumerate_cb) (UART_DEVICE *uart, void *data) |
| typedef uint32_t STDCALL(* | uart_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
| typedef uint32_t STDCALL(* | uart_device_open_proc) (UART_DEVICE *uart, uint32_t baudrate, uint32_t databits, uint32_t stopbits, uint32_t parity, uint32_t flowcontrol) |
| typedef uint32_t STDCALL(* | uart_device_close_proc) (UART_DEVICE *uart) |
| typedef uint32_t STDCALL(* | uart_device_read_proc) (UART_DEVICE *uart, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* | uart_device_write_proc) (UART_DEVICE *uart, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* | uart_device_wait_proc) (UART_DEVICE *uart, uint32_t direction, uint32_t timeout) |
| typedef uint32_t STDCALL(* | uart_device_get_status_proc) (UART_DEVICE *uart) |
| typedef uint32_t STDCALL(* | uart_device_set_status_proc) (UART_DEVICE *uart, uint32_t status) |
| typedef uint32_t STDCALL(* | uart_device_get_properties_proc) (UART_DEVICE *uart, UART_PROPERTIES *properties) |
| typedef uint32_t STDCALL(* | uart_device_set_properties_proc) (UART_DEVICE *uart, UART_PROPERTIES *properties) |
Functions | |
| uint32_t STDCALL | uart_device_open (UART_DEVICE *uart, uint32_t baudrate, uint32_t databits, uint32_t stopbits, uint32_t parity, uint32_t flowcontrol) |
| Open a UART device ready for sending and receiving. | |
| uint32_t STDCALL | uart_device_close (UART_DEVICE *uart) |
| Close a UART device and terminate sending and receiving. | |
| uint32_t STDCALL | uart_device_read (UART_DEVICE *uart, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| Read data from a UART device. | |
| uint32_t STDCALL | uart_device_write (UART_DEVICE *uart, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| Write data to a UART device. | |
| uint32_t STDCALL | uart_device_wait (UART_DEVICE *uart, uint32_t direction, uint32_t timeout) |
| Wait for data to be available in the receive or transmit FIFO of a UART device. | |
| uint32_t STDCALL | uart_device_status (UART_DEVICE *uart) |
| Get the current line status of a UART device. | |
| uint32_t STDCALL | uart_device_get_status (UART_DEVICE *uart) |
| Get the current line status of a UART device. | |
| uint32_t STDCALL | uart_device_set_status (UART_DEVICE *uart, uint32_t status) |
| Set the current line status of a UART device. | |
| uint32_t STDCALL | uart_device_properties (UART_DEVICE *uart, UART_PROPERTIES *properties) |
| Get the properties for the specified UART device. | |
| uint32_t STDCALL | uart_device_get_properties (UART_DEVICE *uart, UART_PROPERTIES *properties) |
| Get the properties for the specified UART device. | |
| uint32_t STDCALL | uart_device_set_properties (UART_DEVICE *uart, UART_PROPERTIES *properties) |
| Set the properties for the specified UART device. | |
| UART_DEVICE *STDCALL | uart_device_create (void) |
| Create a new UART entry. | |
| UART_DEVICE *STDCALL | uart_device_create_ex (uint32_t size) |
| Create a new UART entry. | |
| uint32_t STDCALL | uart_device_destroy (UART_DEVICE *uart) |
| Destroy an existing UART entry. | |
| uint32_t STDCALL | uart_device_register (UART_DEVICE *uart) |
| Register a new UART in the UART table. | |
| uint32_t STDCALL | uart_device_deregister (UART_DEVICE *uart) |
| Deregister a UART from the UART table. | |
| UART_DEVICE *STDCALL | uart_device_find (uint32_t uartid) |
| Find a UART device by ID in the UART table. | |
| UART_DEVICE *STDCALL | uart_device_find_by_name (const char *name) |
| Find a UART device by name in the UART table. | |
| UART_DEVICE *STDCALL | uart_device_find_by_description (const char *description) |
| Find a UART device by description in the UART table. | |
| uint32_t STDCALL | uart_device_enumerate (uart_enumerate_cb callback, void *data) |
| Enumerate all UART devices in the UART table. | |
| uint32_t STDCALL | uart_device_notification (UART_DEVICE *uart, uart_notification_cb callback, void *data, uint32_t notification, uint32_t flags) |
| Register a notification for UART device changes. | |
| uint32_t STDCALL | uart_get_count (void) |
| Get the current UART count. | |
| UART_DEVICE *STDCALL | uart_device_get_default (void) |
| Get the current default UART device. | |
| uint32_t STDCALL | uart_device_set_default (UART_DEVICE *uart) |
| Set the current default UART device. | |
| UART_DEVICE *STDCALL | uart_device_check (UART_DEVICE *uart) |
| Check if the supplied UART is in the UART table. | |
| uint32_t STDCALL | uart_type_to_string (uint32_t uarttype, char *string, uint32_t len) |
| Convert a UART type value to a string. | |
| uint32_t STDCALL | uart_mode_to_string (uint32_t uartmode, char *string, uint32_t len) |
| Convert a UART mode to a string. | |
| uint32_t STDCALL | uart_state_to_string (uint32_t uartstate, char *string, uint32_t len) |
| Convert a UART state value to a string. | |
| uint32_t STDCALL | uart_serial_device_receive (UART_DEVICE *uart) |
| Read data from a UART device into the receive buffer of the associated Serial device. | |
| uint32_t STDCALL | uart_serial_device_transmit (UART_DEVICE *uart) |
| Write data to a UART device from the transmit buffer of the associated Serial device. | |
| #define UART_NAME_PREFIX "UART" |
Name prefix for UART Devices.
UART specific constants
| #define UART_PUSH_TIMEOUT SERIAL_PUSH_TIMEOUT |
Timeout (Milliseconds) for Push RX/TX (Implementation specific).
| #define UART_TYPE_NONE 0 |
UART Device Types
| #define UART_TYPE_8250 1 |
8250 UART and similar variants (Differences are handled by driver)
| #define UART_TYPE_16550 2 |
16550 UART and similar variants (eg 16550A) (Differences are handled by driver)
| #define UART_TYPE_16650 3 |
16650 UART and similar variants (eg 16C650) (Differences are handled by driver)
| #define UART_TYPE_MAX 3 |
| #define UART_MODE_NONE 0 |
UART Device Modes
| #define UART_MODE_UART 1 |
The UART was opened as a UART device and all reads and writes are direct.
| #define UART_MODE_SERIAL 2 |
The UART was opened as a Serial device so reads and writes are being buffered.
| #define UART_MODE_MAX 2 |
| #define UART_STATE_DISABLED 0 |
UART Device States
| #define UART_STATE_ENABLED 1 |
| #define UART_STATE_MAX 1 |
| #define UART_FLAG_NONE SERIAL_FLAG_NONE |
UART Device Flags
| #define UART_FLAG_DATA_8BIT SERIAL_FLAG_DATA_8BIT |
Device supports 8 data bits.
| #define UART_FLAG_DATA_7BIT SERIAL_FLAG_DATA_7BIT |
Device supports 7 data bits.
| #define UART_FLAG_DATA_6BIT SERIAL_FLAG_DATA_6BIT |
Device supports 6 data bits.
| #define UART_FLAG_DATA_5BIT SERIAL_FLAG_DATA_5BIT |
Device supports 5 data bits.
| #define UART_FLAG_STOP_1BIT SERIAL_FLAG_STOP_1BIT |
Device supports 1 stop bit.
| #define UART_FLAG_STOP_2BIT SERIAL_FLAG_STOP_2BIT |
Device supports 2 stop bits.
| #define UART_FLAG_STOP_1BIT5 SERIAL_FLAG_STOP_1BIT5 |
Device supports 1.5 stop bits.
| #define UART_FLAG_PARITY_ODD SERIAL_FLAG_PARITY_ODD |
Device supports odd parity.
| #define UART_FLAG_PARITY_EVEN SERIAL_FLAG_PARITY_EVEN |
Device supports even parity.
| #define UART_FLAG_PARITY_MARK SERIAL_FLAG_PARITY_MARK |
Device supports mark parity.
| #define UART_FLAG_PARITY_SPACE SERIAL_FLAG_PARITY_SPACE |
Device supports space parity.
| #define UART_FLAG_FLOW_RTS_CTS SERIAL_FLAG_FLOW_RTS_CTS |
Device supports RTS/CTS flow control.
| #define UART_FLAG_FLOW_DSR_DTR SERIAL_FLAG_FLOW_DSR_DTR |
Device supports DSR/DTR flow control.
| #define UART_FLAG_PUSH_RX SERIAL_FLAG_PUSH_RX |
Device requires pushed receive (Implementation specific).
| #define UART_FLAG_PUSH_TX SERIAL_FLAG_PUSH_TX |
Device requires pushed transmit (Implementation specific).
| #define UART_READ_NONE SERIAL_READ_NONE |
UART Read Flags
| #define UART_READ_NON_BLOCK SERIAL_READ_NON_BLOCK |
Do not block when receiving, if the FIFO is empty return immediately.
| #define UART_WRITE_NONE SERIAL_WRITE_NONE |
UART Write Flags
| #define UART_WRITE_NON_BLOCK SERIAL_WRITE_NON_BLOCK |
Do not block when transmitting, if the FIFO is full return immediately.
| #define UART_WAIT_NONE SERIAL_WAIT_NONE |
UART Wait Directions
| #define UART_WAIT_RECEIVE SERIAL_WAIT_RECEIVE |
Wait for data to be available in the receive FIFO.
| #define UART_WAIT_TRANSMIT SERIAL_WAIT_TRANSMIT |
Wait for space to be available in the transmit FIFO.
| #define UART_STATUS_NONE SERIAL_STATUS_NONE |
UART Status Flags
| #define UART_STATUS_RTS SERIAL_STATUS_RTS |
| #define UART_STATUS_CTS SERIAL_STATUS_CTS |
| #define UART_STATUS_DSR SERIAL_STATUS_DSR |
| #define UART_STATUS_DTR SERIAL_STATUS_DTR |
| #define UART_STATUS_RX_FULL SERIAL_STATUS_RX_FULL |
| #define UART_STATUS_RX_EMPTY SERIAL_STATUS_RX_EMPTY |
| #define UART_STATUS_TX_FULL SERIAL_STATUS_TX_FULL |
| #define UART_STATUS_TX_EMPTY SERIAL_STATUS_TX_EMPTY |
| #define UART_STATUS_BUSY SERIAL_STATUS_BUSY |
| #define UART_STATUS_BREAK_ERROR SERIAL_STATUS_BREAK_ERROR |
| #define UART_STATUS_PARITY_ERROR SERIAL_STATUS_PARITY_ERROR |
| #define UART_STATUS_FRAMING_ERROR SERIAL_STATUS_FRAMING_ERROR |
| #define UART_STATUS_OVERRUN_ERROR SERIAL_STATUS_OVERRUN_ERROR |
| #define UART_STATUS_DCD SERIAL_STATUS_DCD |
| #define UART_STATUS_RI SERIAL_STATUS_RI |
| typedef struct _UART_PROPERTIES UART_PROPERTIES |
UART specific types UART Properties
| typedef struct _UART_DEVICE UART_DEVICE |
UART Device
| typedef uint32_t STDCALL(* uart_enumerate_cb) (UART_DEVICE *uart, void *data) |
UART Enumeration Callback
| typedef uint32_t STDCALL(* uart_notification_cb) (DEVICE *device, void *data, uint32_t notification) |
UART Notification Callback
| typedef uint32_t STDCALL(* uart_device_open_proc) (UART_DEVICE *uart, uint32_t baudrate, uint32_t databits, uint32_t stopbits, uint32_t parity, uint32_t flowcontrol) |
UART Device Methods
| typedef uint32_t STDCALL(* uart_device_close_proc) (UART_DEVICE *uart) |
| typedef uint32_t STDCALL(* uart_device_read_proc) (UART_DEVICE *uart, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* uart_device_write_proc) (UART_DEVICE *uart, void *buffer, uint32_t size, uint32_t flags, uint32_t *count) |
| typedef uint32_t STDCALL(* uart_device_wait_proc) (UART_DEVICE *uart, uint32_t direction, uint32_t timeout) |
| typedef uint32_t STDCALL(* uart_device_get_status_proc) (UART_DEVICE *uart) |
| typedef uint32_t STDCALL(* uart_device_set_status_proc) (UART_DEVICE *uart, uint32_t status) |
| typedef uint32_t STDCALL(* uart_device_get_properties_proc) (UART_DEVICE *uart, UART_PROPERTIES *properties) |
| typedef uint32_t STDCALL(* uart_device_set_properties_proc) (UART_DEVICE *uart, UART_PROPERTIES *properties) |
| uint32_t STDCALL uart_device_open | ( | UART_DEVICE * | uart, |
| uint32_t | baudrate, | ||
| uint32_t | databits, | ||
| uint32_t | stopbits, | ||
| uint32_t | parity, | ||
| uint32_t | flowcontrol ) |
Open a UART device ready for sending and receiving.
UART Functions
| UART | The UART device to open |
| BaudRate | Baud rate for the connection (eg 9600, 57600, 115200 etc |
| DataBits | Size of the data (eg SERIAL_DATA_8BIT) |
| StopBits | Number of stop bits (eg SERIAL_STOP_1BIT) |
| Parity | Parity type for the data (eg SERIAL_PARITY_NONE) |
| FlowControl | Flow control for the connection (eg SERIAL_FLOW_NONE) |
| uint32_t STDCALL uart_device_close | ( | UART_DEVICE * | uart | ) |
Close a UART device and terminate sending and receiving.
| UART | The UART device to close |
| uint32_t STDCALL uart_device_read | ( | UART_DEVICE * | uart, |
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | count ) |
Read data from a UART device.
| UART | The UART device to read from |
| Buffer | Pointer to a buffer to receive the data |
| Size | The size of the buffer |
| Flags | The flags to control reading (eg UART_READ_NON_BLOCK) |
| Count | The number of bytes read on return |
| uint32_t STDCALL uart_device_write | ( | UART_DEVICE * | uart, |
| void * | buffer, | ||
| uint32_t | size, | ||
| uint32_t | flags, | ||
| uint32_t * | count ) |
Write data to a UART device.
| UART | The UART device to write to |
| Buffer | Pointer to a buffer of data to transmit |
| Size | The size of the buffer |
| Flags | The flags to control writing (eg UART_WRITE_NON_BLOCK) |
| Count | The number of bytes written on return |
| uint32_t STDCALL uart_device_wait | ( | UART_DEVICE * | uart, |
| uint32_t | direction, | ||
| uint32_t | timeout ) |
Wait for data to be available in the receive or transmit FIFO of a UART device.
| UART | The UART device to wait for |
| Direction | The direction of data to wait for (eg UART_WAIT_RECEIVE) |
| Timeout | The number of milliseconds to wait for data (INFINITE to wait forever) |
| uint32_t STDCALL uart_device_status | ( | UART_DEVICE * | uart | ) |
Get the current line status of a UART device.
| UART | The UART device to get the status from |
| uint32_t STDCALL uart_device_get_status | ( | UART_DEVICE * | uart | ) |
Get the current line status of a UART device.
| UART | The UART device to get the status from |
| uint32_t STDCALL uart_device_set_status | ( | UART_DEVICE * | uart, |
| uint32_t | status ) |
Set the current line status of a UART device.
| UART | The UART device to set the status for |
| Status | The device status flags to be set (eg UART_STATUS_RTS) |
| uint32_t STDCALL uart_device_properties | ( | UART_DEVICE * | uart, |
| UART_PROPERTIES * | properties ) |
Get the properties for the specified UART device.
| UART | The UART device to get properties from |
| Properties | Pointer to a PUARTProperties structure to fill in |
| uint32_t STDCALL uart_device_get_properties | ( | UART_DEVICE * | uart, |
| UART_PROPERTIES * | properties ) |
Get the properties for the specified UART device.
| UART | The UART device to get properties from |
| Properties | Pointer to a PUARTProperties structure to fill in |
| uint32_t STDCALL uart_device_set_properties | ( | UART_DEVICE * | uart, |
| UART_PROPERTIES * | properties ) |
Set the properties for the specified UART device.
| UART | The UART device to set properties for |
| Properties | Pointer to a PUARTProperties structure to use |
| UART_DEVICE *STDCALL uart_device_create | ( | void | ) |
Create a new UART entry.
| UART_DEVICE *STDCALL uart_device_create_ex | ( | uint32_t | size | ) |
Create a new UART entry.
| Size | Size in bytes to allocate for new UART (Including the UART entry) |
| uint32_t STDCALL uart_device_destroy | ( | UART_DEVICE * | uart | ) |
Destroy an existing UART entry.
| UART | The UART device to destroy |
| uint32_t STDCALL uart_device_register | ( | UART_DEVICE * | uart | ) |
Register a new UART in the UART table.
| UART | The UART device to register |
| uint32_t STDCALL uart_device_deregister | ( | UART_DEVICE * | uart | ) |
Deregister a UART from the UART table.
| UART | The UART device to deregister |
| UART_DEVICE *STDCALL uart_device_find | ( | uint32_t | uartid | ) |
Find a UART device by ID in the UART table.
| UARTId | The ID number of the UART to find |
| UART_DEVICE *STDCALL uart_device_find_by_name | ( | const char * | name | ) |
Find a UART device by name in the UART table.
| Name | The name of the UART to find (eg UART0) |
| UART_DEVICE *STDCALL uart_device_find_by_description | ( | const char * | description | ) |
Find a UART device by description in the UART table.
| Description | The description of the UART to find (eg BCM2836 PL011 UART) |
| uint32_t STDCALL uart_device_enumerate | ( | uart_enumerate_cb | callback, |
| void * | data ) |
Enumerate all UART devices in the UART table.
| Callback | The callback function to call for each UART in the table |
| Data | A private data pointer to pass to callback for each UART in the table |
| uint32_t STDCALL uart_device_notification | ( | UART_DEVICE * | uart, |
| uart_notification_cb | callback, | ||
| void * | data, | ||
| uint32_t | notification, | ||
| uint32_t | flags ) |
Register a notification for UART device changes.
| UART | The UART device to notify changes for (Optional, pass nil for all UART devices) |
| Callback | The function to call when a notification event occurs |
| Data | A private data pointer to pass to callback when a notification event occurs |
| Notification | The events to register for notification of (eg DEVICE_NOTIFICATION_REGISTER) |
| Flags | The flags to control the notification (eg NOTIFIER_FLAG_WORKER) |
| uint32_t STDCALL uart_get_count | ( | void | ) |
Get the current UART count.
UART Helper Functions
| UART_DEVICE *STDCALL uart_device_get_default | ( | void | ) |
Get the current default UART device.
| uint32_t STDCALL uart_device_set_default | ( | UART_DEVICE * | uart | ) |
Set the current default UART device.
| UART_DEVICE *STDCALL uart_device_check | ( | UART_DEVICE * | uart | ) |
Check if the supplied UART is in the UART table.
| uint32_t STDCALL uart_type_to_string | ( | uint32_t | uarttype, |
| char * | string, | ||
| uint32_t | len ) |
Convert a UART type value to a string.
| uint32_t STDCALL uart_mode_to_string | ( | uint32_t | uartmode, |
| char * | string, | ||
| uint32_t | len ) |
Convert a UART mode to a string.
| uint32_t STDCALL uart_state_to_string | ( | uint32_t | uartstate, |
| char * | string, | ||
| uint32_t | len ) |
Convert a UART state value to a string.
| uint32_t STDCALL uart_serial_device_receive | ( | UART_DEVICE * | uart | ) |
Read data from a UART device into the receive buffer of the associated Serial device.
UART Serial Helper Functions
| uint32_t STDCALL uart_serial_device_transmit | ( | UART_DEVICE * | uart | ) |
Write data to a UART device from the transmit buffer of the associated Serial device.