aboutsummaryrefslogtreecommitdiff
path: root/platforms/chibios/drivers/uart_sio.c
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/chibios/drivers/uart_sio.c')
-rw-r--r--platforms/chibios/drivers/uart_sio.c67
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