![]() |
API Reference
The NEORV32 RISC-V Processor
|
Universal asynchronous receiver/transmitter (UART0/UART1) HW driver source file. More...
Functions | |
| int | neorv32_uart_available (neorv32_uart_t *uartx) |
| void | neorv32_uart_setup (neorv32_uart_t *uartx, uint32_t baud, int rx_irq, int tx_irq) |
| void | neorv32_uart_putc (neorv32_uart_t *uartx, char c) |
| char | neorv32_uart_getc (neorv32_uart_t *uartx) |
| void | neorv32_uart_puts (neorv32_uart_t *uartx, const char *s) |
| void | neorv32_uart_vprintf (neorv32_uart_t *uartx, const char *format, va_list args) |
| void | neorv32_uart_printf (neorv32_uart_t *uartx, const char *format,...) |
| int | neorv32_uart_scan (neorv32_uart_t *uartx, char *buffer, int max_size, int echo) |
Universal asynchronous receiver/transmitter (UART0/UART1) HW driver source file.
| int neorv32_uart_available | ( | neorv32_uart_t * | uartx | ) |
Check if UART module was synthesized.
| [in,out] | uartx | UART hardware struct. |
| char neorv32_uart_getc | ( | neorv32_uart_t * | uartx | ) |
Get received char.
| [in,out] | uartx | UART hardware struct. |
| void neorv32_uart_printf | ( | neorv32_uart_t * | uartx, |
| const char * | format, | ||
| ... ) |
Custom version of 'printf'. This functions only provides a minimal subset of the 'printf' formatting features.
| [in,out] | uartx | UART hardware struct. |
| [in] | format | Pointer to format string. See neorv32_uart_vprintf. |
| void neorv32_uart_putc | ( | neorv32_uart_t * | uartx, |
| char | c ) |
Transmit char.
| [in,out] | uartx | UART hardware struct. |
| [in] | c | Char to be send. |
| void neorv32_uart_puts | ( | neorv32_uart_t * | uartx, |
| const char * | s ) |
Print zero-terminated string. No trailing line break is added. Newline (LF) line breaks are automatically converted to CR-LF.
| [in,out] | uartx | UART hardware struct. |
| [in] | s | Pointer to string. |
| int neorv32_uart_scan | ( | neorv32_uart_t * | uartx, |
| char * | buffer, | ||
| int | max_size, | ||
| int | echo ) |
Custom version of 'scanf'.
| [in,out] | uartx | UART hardware struct. |
| [in,out] | buffer | Pointer to array of chars to store string. |
| [in] | max_size | Maximum number of chars to sample (including zero-termination). |
| [in] | echo | Echo UART input when 1. |
| void neorv32_uart_setup | ( | neorv32_uart_t * | uartx, |
| uint32_t | baud, | ||
| int | rx_irq, | ||
| int | tx_irq ) |
Reset, configure and enable UART.
| [in,out] | uartx | UART hardware struct. |
| [in] | baud | Targeted BAUD rate (e.g. 19200, must be greater than zero). |
| [in] | rx_irq | RX interrupt condition (NEORV32_UART_RX_IRQ_SEL_enum). |
| [in] | tx_irq | TX interrupt condition (NEORV32_UART_TX_IRQ_SEL_enum). |
| void neorv32_uart_vprintf | ( | neorv32_uart_t * | uartx, |
| const char * | format, | ||
| va_list | args ) |
Custom version of 'vprintf'. This functions only provides a minimal subset of the original formatting features. Newline (LF) line breaks are automatically converted to CR-LF.
| [in,out] | uartx | UART hardware struct. |
| [in] | format | Pointer to format string. |
| [in] | args | A value identifying a variable arguments list. |