From f69360844fa7d62759f5d4e7367c514e99d6f06b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 1 Nov 2018 09:05:14 +1100 Subject: [PATCH] HAL_ChibiOS: enable USART1 for iomcu for spektrum input --- libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.dat | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.dat index 2c5c90bab3..c595075e0d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/iomcu/hwdef.dat @@ -29,6 +29,7 @@ define HAL_USE_UART TRUE PA2 USART2_TX USART2 PA3 USART2_RX USART2 +define STM32_UART_USE_USART1 FALSE define STM32_UART_USE_USART2 TRUE define STM32_UART_USE_USART3 FALSE @@ -37,6 +38,8 @@ define HAL_USE_SERIAL TRUE PB4 SBUS_OUT_EN OUTPUT LOW GPIO(1) PB10 USART3_TX USART3 PB11 USART3_RX USART3 + +define STM32_SERIAL_USE_USART1 TRUE define STM32_SERIAL_USE_USART2 FALSE define STM32_SERIAL_USE_USART3 TRUE @@ -62,6 +65,14 @@ PB14 HEATER OUTPUT GPIO(0) PB5 SAFETY_INPUT INPUT PULLDOWN PB13 SAFETY_LED OUTPUT HIGH +# UART for DSM input +# TX side is for IO debug, and is unused +PA9 USART1_TX USART1 +PA10 USART1_RX USART1 + +PC13 SPEKTRUM_PWR_EN OUTPUT LOW +define HAL_GPIO_PIN_SPEKTRUM_OUT PAL_LINE(GPIOA,10U) + PA8 INPUT PULLUP # RC Input PPM # analog inputs @@ -91,8 +102,6 @@ define HAL_INS_DEFAULT HAL_INS_NONE define HAL_BARO_DEFAULT HAL_BARO_NONE define HAL_NO_GPIO_IRQ define CH_CFG_ST_TIMEDELTA 0 -define TIMER_THD_WA_SIZE 256 -define RCIN_THD_WA_SIZE 768 #define CH_CFG_USE_DYNAMIC FALSE define SERIAL_BUFFERS_SIZE 32 define HAL_USE_EMPTY_IO TRUE