RTEMS
5.1
|
Typedefs | |
typedef enum ALT_16550_BAUDRATE_e | ALT_16550_BAUDRATE_t |
Enumerations | |
enum | ALT_16550_BAUDRATE_e { ALT_16550_BAUDRATE_50 = 50, ALT_16550_BAUDRATE_75 = 75, ALT_16550_BAUDRATE_150 = 150, ALT_16550_BAUDRATE_300 = 300, ALT_16550_BAUDRATE_600 = 600, ALT_16550_BAUDRATE_900 = 900, ALT_16550_BAUDRATE_1200 = 1200, ALT_16550_BAUDRATE_1800 = 1800, ALT_16550_BAUDRATE_2400 = 2400, ALT_16550_BAUDRATE_3600 = 3600, ALT_16550_BAUDRATE_4800 = 4800, ALT_16550_BAUDRATE_7200 = 7200, ALT_16550_BAUDRATE_9600 = 9600, ALT_16550_BAUDRATE_14400 = 14400, ALT_16550_BAUDRATE_19200 = 19200, ALT_16550_BAUDRATE_28800 = 28800, ALT_16550_BAUDRATE_38400 = 38400, ALT_16550_BAUDRATE_57600 = 57600, ALT_16550_BAUDRATE_115200 = 115200 } |
Functions | |
ALT_STATUS_CODE | alt_16550_baudrate_get (ALT_16550_HANDLE_t *handle, uint32_t *baudrate) |
ALT_STATUS_CODE | alt_16550_baudrate_set (ALT_16550_HANDLE_t *handle, uint32_t baudrate) |
ALT_STATUS_CODE | alt_16550_divisor_get (ALT_16550_HANDLE_t *handle, uint32_t *divisor) |
ALT_STATUS_CODE | alt_16550_divisor_set (ALT_16550_HANDLE_t *handle, uint32_t divisor) |
This group of APIs allows for the configuration of the UART's baudrate generation related functions.
The UART baudrate is determined by dividing the ALT_CLK_L4_SP clock with the configured divisor.
typedef enum ALT_16550_BAUDRATE_e ALT_16550_BAUDRATE_t |
This enumeration lists out the common baudrates used with modem and serial ports. Not every baudrate is available for the UART due to the limits of the serial clock frequency and divisor value.
enum ALT_16550_BAUDRATE_e |
This enumeration lists out the common baudrates used with modem and serial ports. Not every baudrate is available for the UART due to the limits of the serial clock frequency and divisor value.
ALT_STATUS_CODE alt_16550_baudrate_get | ( | ALT_16550_HANDLE_t * | handle, |
uint32_t * | baudrate | ||
) |
Gets the baudrate for the UART.
This is done by calculating the baudrate from the divisor and the serial clock. The reported baudrate may not correspond exactly to the request baudrate.
handle | The UART device handle. |
baudrate | [out] Pointer to an output paramter that contains the current baudrate of the UART. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
ALT_STATUS_CODE alt_16550_baudrate_set | ( | ALT_16550_HANDLE_t * | handle, |
uint32_t | baudrate | ||
) |
Sets the baudrate for the UART. This change will take effect when the UART moves from disabled to enabled.
This is done by calculating the correct divisor using the request baudrate and the known serial clock.
handle | The UART device handle. |
baudrate | The requested baudrate for the UART. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
ALT_E_ARG_RANGE | The given baudrate is not possible due to limitations of the baudrate divisor and/or serial clock. |
ALT_STATUS_CODE alt_16550_divisor_get | ( | ALT_16550_HANDLE_t * | handle, |
uint32_t * | divisor | ||
) |
Gets the baudrate divisor for the UART.
The baudrate is determined by the following formula:
handle | The UART device handle. |
divisor | [out] Pointer to an output parameter that contains the current divisor used for baudrate generation. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART device handle is invalid. |
ALT_STATUS_CODE alt_16550_divisor_set | ( | ALT_16550_HANDLE_t * | handle, |
uint32_t | divisor | ||
) |
Sets the baudrate divisor for the UART. This change will take effect when the UART moves from disabled to enabled.
The baudrate is determined by the following formula:
handle | The UART device handle. |
divisor | The specified divisor value to use for baudrate generation. Valid values are 1 - 65535. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given UART identifier is invalid or the specified divisor is not supported by the UART. |