From beb5a413897d003d13812998ae5896ba15c03a03 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 5 Jan 2018 16:00:31 +1100 Subject: [PATCH] AP_HAL: add radio defines for PixHawk This facilitates testing a diret-attached-radio using a PixHawk1 The AUX5 pin is used as an interrupt line. --- libraries/AP_HAL/board/px4.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/AP_HAL/board/px4.h b/libraries/AP_HAL/board/px4.h index 46c54bbe73..92bfe0cfce 100644 --- a/libraries/AP_HAL/board/px4.h +++ b/libraries/AP_HAL/board/px4.h @@ -106,6 +106,16 @@ #define HAL_PX4_HAVE_PWM_INPUT 0 #endif +/* AP_Radio configuration */ + +#ifdef HAL_RCINPUT_WITH_AP_RADIO +// this is the external SPI bus on a PixHawk1: +# define CYRF_SPI_PX4_SPI_BUS PX4_SPI_BUS_EXT +# define CYRF_SPI_PX4_SPIDEV_EXT (spi_dev_e)PX4_SPIDEV_EXT0 +// this is AUX5 on a PixHawk1: +# define CYRF_IRQ_INPUT (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTD|GPIO_PIN13) +#endif // HAL_RCINPUT_WITH_AP_RADIO + /* default values */ #ifndef HAL_SERIAL0_BAUD_DEFAULT #define HAL_SERIAL0_BAUD_DEFAULT 115200