From 3ed5cedea3f96ab6800179363a9c3182f224923c Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 10 Mar 2017 15:29:06 -1000 Subject: [PATCH] px4io-v2 Remove GPIO_RC_OUT and vetted RC_IN wiring Removed the legacy FMUv4 define that was activating a nonexistent pull up and on some HW driving the PPM_IN aka RC_IN aka SPEKTRUM_RX to VDD. Also detailed the connections of this pins for the board. The simplest connection is RC_IN to a timer capture pin and a UART. In this case the UART_RX pin and just be left as is. While the pin can be configured as the PPM_IN (Timer capture) or as SPEKTRUM_RX_AS_GPIO_OUTPUT to use it as and GPIO to Renamed the macros and defines to be more explicit as to what Is being done and the sense of the parameters --- src/drivers/boards/px4io-v2/board_config.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/drivers/boards/px4io-v2/board_config.h b/src/drivers/boards/px4io-v2/board_config.h index 358f0eef4a..2ccc26764b 100644 --- a/src/drivers/boards/px4io-v2/board_config.h +++ b/src/drivers/boards/px4io-v2/board_config.h @@ -83,12 +83,12 @@ /* Power switch controls ******************************************************/ -#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) -#define POWER_SPEKTRUM(_s) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_s)) +#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13) +#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_on_true)) -#define SPEKTRUM_RX_HIGH(_s) px4_arch_gpiowrite(GPIO_USART1_RX_SPEKTRUM, (_s)) -#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) -#define SPEKTRUM_RX_AS_GPIO() px4_arch_configgpio(GPIO_USART1_RX_SPEKTRUM) +#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_USART1_RX_SPEKTRUM, (_one_true)) +#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX) +#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_USART1_RX_SPEKTRUM) #define GPIO_SERVO_FAULT_DETECT (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15)