From aabb6f7c5964f896ca6e932ae9f5f3996d89448d Mon Sep 17 00:00:00 2001 From: kniuk <57300765+kniuk@users.noreply.github.com> Date: Fri, 8 Oct 2021 03:19:08 +0200 Subject: [PATCH] AP_HAL_ChibiOS: add alt config GPIO to Matek F765-Wing Based on new functionality introduced in #18753 --- .../AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat index 92080364a4..df1b8cbbe5 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat @@ -119,10 +119,11 @@ PB8 UART5_RX UART5 NODMA PC7 TIM3_CH2 TIM3 RCININT PULLDOWN LOW PC6 USART6_TX USART6 NODMA -# as an alternative config setup the RX6 pin as a uart. This allows +# as an alternative config setup the RX6 pin as an uart. This allows # for bi-directional UART based receiver protocols such as FPort # without any extra hardware PC7 USART6_RX USART6 NODMA ALT(1) +PC7 USART6_RX USART6 NODMA ALT(3) # UART7 (telem1) PE7 UART7_RX UART7 @@ -130,6 +131,17 @@ PE8 UART7_TX UART7 PE10 UART7_CTS UART7 PE9 UART7_RTS UART7 +# telem1-UART7 RTS and CTS as GPIO in alternative configs +PE10 EXTERN_GPIO1 OUTPUT GPIO(1) ALT(2) # Cts7 pin as GPIO 1 (set RELAY_PINx = 1 to use it) +PE9 EXTERN_GPIO2 OUTPUT GPIO(2) ALT(2) # Rts7 pin as GPIO 2 (set RELAY_PINx = 2 to use it) +PE10 EXTERN_GPIO1 OUTPUT GPIO(1) ALT(3) # Cts7 pin as GPIO 1 (set RELAY_PINx = 1 to use it) +PE9 EXTERN_GPIO2 OUTPUT GPIO(2) ALT(3) # Rts7 pin as GPIO 2 (set RELAY_PINx = 2 to use it) + +# alternative configs: +# 1: bidirectional receiver protocol on RX6 pin +# 2: extra GPIOs instead of Cts/Rts on UART7_CTS +# 3: both 1 and 2 combined, GPIO numbers differ to avoid "Duplicate GPIO value" error while generating hwdef.h + # UART8 (spare) PE0 UART8_RX UART8 NODMA PE1 UART8_TX UART8 NODMA