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:
parent
e4f736e685
commit
291d154d7b
6 changed files with 225 additions and 252 deletions
|
@ -3,6 +3,89 @@
|
|||
// 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 SD1
|
||||
#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
|
||||
|
||||
#ifndef UART_WRDLEN
|
||||
# define UART_WRDLEN 3
|
||||
#endif
|
||||
|
||||
#ifndef UART_STPBIT
|
||||
# define UART_STPBIT 0
|
||||
#endif
|
||||
|
||||
#ifndef UART_PARITY
|
||||
# define UART_PARITY 0
|
||||
#endif
|
||||
|
||||
#ifndef UART_ATFLCT
|
||||
# define UART_ATFLCT 0
|
||||
#endif
|
||||
|
||||
#if defined(MCU_KINETIS)
|
||||
static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue