From 784abf2c1962dc1e1f8e0723eec4045b21e8ac63 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 10 Mar 2017 15:29:06 -1000 Subject: [PATCH] px4io-v1 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 facilitate binding. 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-v1/board_config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/drivers/boards/px4io-v1/board_config.h b/src/drivers/boards/px4io-v1/board_config.h index 114dad8866..f48516b808 100644 --- a/src/drivers/boards/px4io-v1/board_config.h +++ b/src/drivers/boards/px4io-v1/board_config.h @@ -80,11 +80,11 @@ #define GPIO_RELAY2_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN11) #define GPIO_SPEKTRUM_PWR_EN GPIO_RELAY1_EN -#define POWER_SPEKTRUM(_s) px4_arch_gpiowrite(GPIO_RELAY1_EN, (_s)) +#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_RELAY1_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) /* Analog inputs ********************************************************************/