Unify UART headers (#24855)

* Remove deprecated defines

* Move default config to .c files

* Unify UART headers

* Clean up docs

* Reorganise PAL mode defaults
This commit is contained in:
Ryan 2025-01-26 23:46:46 +11:00 committed by GitHub
parent e4f736e685
commit 291d154d7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 225 additions and 252 deletions

View file

@ -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