diff options
author | Ryan <[email protected]> | 2025-01-26 23:46:46 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2025-01-26 13:46:46 +0100 |
commit | 291d154d7b13efb83f24c76df26277f32b9f0a58 (patch) | |
tree | d7d2e05a18bdfbdd83258c8a91a70f16e57792e9 /platforms/chibios/drivers/uart_sio.c | |
parent | e4f736e68518a09a922caf4638fca10f2ee3f38c (diff) | |
download | qmk_firmware-291d154d7b13efb83f24c76df26277f32b9f0a58.tar.gz qmk_firmware-291d154d7b13efb83f24c76df26277f32b9f0a58.zip |
Unify UART headers (#24855)
* Remove deprecated defines
* Move default config to .c files
* Unify UART headers
* Clean up docs
* Reorganise PAL mode defaults
Diffstat (limited to 'platforms/chibios/drivers/uart_sio.c')
-rw-r--r-- | platforms/chibios/drivers/uart_sio.c | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/platforms/chibios/drivers/uart_sio.c b/platforms/chibios/drivers/uart_sio.c index 442df1c54d..fc12f0abed 100644 --- a/platforms/chibios/drivers/uart_sio.c +++ b/platforms/chibios/drivers/uart_sio.c @@ -3,6 +3,73 @@ // SPDX-License-Identifier: GPL-2.0-or-later #include "uart.h" +#include "gpio.h" +#include "chibios_config.h" +#include <hal.h> + +#ifndef UART_DRIVER +# define UART_DRIVER SIOD1 +#endif + +#ifndef UART_TX_PIN +# define UART_TX_PIN A9 +#endif + +#ifndef UART_TX_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_TX_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define UART_TX_PAL_MODE 7 +# endif +#endif + +#ifndef UART_RX_PIN +# define UART_RX_PIN A10 +#endif + +#ifndef UART_RX_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_RX_PAL_MODE PAL_MODE_INPUT +# else +# define UART_RX_PAL_MODE 7 +# endif +#endif + +#ifndef UART_CTS_PIN +# define UART_CTS_PIN A11 +#endif + +#ifndef UART_CTS_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_CTS_PAL_MODE PAL_MODE_INPUT +# else +# define UART_CTS_PAL_MODE 7 +# endif +#endif + +#ifndef UART_RTS_PIN +# define UART_RTS_PIN A12 +#endif + +#ifndef UART_RTS_PAL_MODE +# ifdef USE_GPIOV1 +# define UART_RTS_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL +# else +# define UART_RTS_PAL_MODE 7 +# endif +#endif + +#ifndef UART_CR1 +# define UART_CR1 0 +#endif + +#ifndef UART_CR2 +# define UART_CR2 0 +#endif + +#ifndef UART_CR3 +# define UART_CR3 0 +#endif #if defined(MCU_RP) // 38400 baud, 8 data bits, 1 stop bit, no parity, no flow control |