General functions for UART driver. More...
Functions | |
| INIT_CODE uart_status_en | uart_init (uart_instance_en id) |
| INIT_CODE uart_status_en | uart_deinit (uart_instance_en id) |
| uart_status_en | uart_set_configuration (uart_instance_en id, uart_config_t *cfg, uint32_t *achieved_baudrate) |
| uart_status_en | uart_get_configuration (uart_instance_en id, uart_config_t *cfg, uint32_t *achieved_baudrate) |
General functions for UART driver.
| INIT_CODE uart_status_en uart_init | ( | uart_instance_en | id | ) |
Initializes the UART hardware and internal driver structures for the specified UART instance.
| id | UART Instance ID. |
| INIT_CODE uart_status_en uart_deinit | ( | uart_instance_en | id | ) |
Deinitializes the UART hardware and releases any resources held by the driver for the specified UART instance.
| id | UART Instance ID. |
| uart_status_en uart_set_configuration | ( | uart_instance_en | id, |
| uart_config_t * | cfg, | ||
| uint32_t * | achieved_baudrate ) |
Sets the UART hardware configuration for the specified UART instance, including data bits, stop bits, parity, flow control, and baud rate. Programs the UART registers accordingly and returns the actual baud rate achieved.
| id | UART Instance ID. |
| cfg | Pointer to the UART configuration structure specifying desired settings. |
| achieved_baudrate | Pointer to a variable to store the actual baud rate configured in bps. |
| uart_status_en uart_get_configuration | ( | uart_instance_en | id, |
| uart_config_t * | cfg, | ||
| uint32_t * | achieved_baudrate ) |
Retrieves the current UART hardware configuration for the specified UART instance, including data bits, stop bits, parity, flow control status, and the baud rate currently set. The configuration is populated into the provided structure and the actual baud rate is returned.
| id | UART Instance ID. |
| cfg | Pointer to the UART configuration structure to be populated with current settings. |
| achieved_baudrate | Pointer to a variable to receive the current baud rate (optional, can be NULL). |