Universal Asynchronous Receiver/Transmitter (UART) driver.
This module provides functions to configure and control UART input/output and interrupt behavior.
Usage & Initialization.
This is an example show how to instantiate UART Driver with uart_instance_t.
#define BSP_UART_DATA_LEN 8
#define BSP_UART_BAUDRATE 115200
#define BSP_UART_TERMINAL SYSTEM_UART_0_IO_CTRL
#define UART_BASE (uart_hwreg_t*)SYSTEM_UART_0_IO_CTRL
uart0.hwreg = UART0_BASE;
}
void bsp_init()
Initialize Board Support Package Peripherals.
#define BSP_UART_DATA_LEN
Default UART data length (bits).
uart_instance_t uart0
Primary UART instance for standard I/O mapping.
#define BSP_UART_BAUDRATE
Default UART baudrate.
#define BSP_CLINT_HZ
Primary CLINT controller clock frequency.
@ BITS_8
8-bit data length */
void uart_applyConfig(uart_instance_t *inst)
Apply stored UART configuration to hardware.
UART instance. Holds the software registers and hardware pointer.
UART driver API definitions.
- See also
- Example UART Echo Demo - Learn how to use the driver in Echo mode
-
Example UART Interrupt Demo - Learn how to use the driver in Interrupt mode