aboutsummaryrefslogtreecommitdiff
path: root/platforms/chibios/drivers/uart_sio.c
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2025-02-28 09:23:04 +1100
committerNick Brassel <nick@tzarc.org>2025-02-28 09:23:04 +1100
commita63fd7f01cdabd9ce85bb09ae2b573fd3b8e60aa (patch)
tree35d817580e5244d62a150a2d012f72906a610977 /platforms/chibios/drivers/uart_sio.c
parent6d0e5728aa61b442885d48caf49d29e5c60e8197 (diff)
parentcdb865cf60b17593f5c811c24a21d7b3030d8653 (diff)
Merge remote-tracking branch 'upstream/develop'
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