Added a bootloader config parameter (UART_HW_HANDSHAKE_EN) to enable UART hardware flow control. Defaults to disabled.

This commit is contained in:
Brian Nemetz 2023-03-30 20:00:16 -07:00
parent 476012c74f
commit 39a119f6b3
2 changed files with 9 additions and 0 deletions

View file

@ -22,6 +22,7 @@ minimal base + privileged ISA `rv32i_zicsr` only to ensure it can work independe
4+^| Serial console interface
| `UART_EN` | `1` | `0`, `1` | Set to `0` to disable UART0 (no serial console at all)
| `UART_BAUD` | `19200` | _any_ | Baud rate of UART0
| `UART_HW_HANDSHAKE_EN` | `0` | `0`, `1` | Set to `1` to enable UART0 hardware flow control
4+^| Status LED
| `STATUS_LED_EN` | `1` | `0`, `1` | Enable bootloader status led ("heart beat") at `GPIO` output port pin #`STATUS_LED_PIN` when `1`
| `STATUS_LED_PIN` | `0` | `0` ... `31` | `GPIO` output pin used for the high-active status LED

View file

@ -61,6 +61,11 @@
#define UART_BAUD 19200
#endif
/** Set to 1 to enable UART HW handshaking */
#ifndef UART_HW_HANDSHAKE_EN
#define UART_HW_HANDSHAKE_EN 0
#endif
/* -------- Status LED -------- */
/** Set to 0 to disable bootloader status LED (heart beat) at GPIO.gpio_o(STATUS_LED_PIN) */
@ -303,6 +308,9 @@ int main(void) {
#if (UART_EN != 0)
// setup UART0
neorv32_uart0_setup(UART_BAUD, 0);
#if (UART_HW_HANDSHAKE_EN != 0)
neorv32_uart0_rtscts_enable();
#endif
#endif
// Configure machine system timer interrupt