PX4 System changes for new Boards

This commit is contained in:
David Sidrane 2016-12-12 14:35:25 -10:00 committed by Lorenz Meier
parent f5a0c04ae8
commit cc0a4248f8
3 changed files with 121 additions and 36 deletions

View File

@ -122,30 +122,76 @@
#endif
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V4
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V5
/*
* PX4FMUv5 GPIO numbers.
*
* There are no alternate functions on this board.
*/
# define GPIO_SERVO_1 (1<<0) /**< servo 1 output */
# define GPIO_SERVO_2 (1<<1) /**< servo 2 output */
# define GPIO_SERVO_3 (1<<2) /**< servo 3 output */
# define GPIO_SERVO_4 (1<<3) /**< servo 4 output */
# define GPIO_SERVO_5 (1<<4) /**< servo 5 output */
# define GPIO_SERVO_6 (1<<5) /**< servo 6 output */
# define GPIO_3V3_SENSORS_EN (1<<7) /**< PE3 - VDD_3V3_SENSORS_EN */
# define GPIO_BRICK_VALID (1<<8) /**< PB5 - !VDD_BRICK_VALID */
/**
* Device paths for things that support the GPIO ioctl protocol.
*/
# define PX4FMU_DEVICE_PATH "/dev/px4fmu"
#endif
#ifdef CONFIG_ARCH_BOARD_PX4NUCLEOF767ZI_V1
/*
* PX4FMUv3 GPIO numbers.
*
* There are no alternate functions on this board.
*/
# define GPIO_SERVO_1 (1<<0) /**< servo 1 output */
# define GPIO_SERVO_2 (1<<1) /**< servo 2 output */
# define GPIO_SERVO_3 (1<<2) /**< servo 3 output */
# define GPIO_SERVO_4 (1<<3) /**< servo 4 output */
# define GPIO_SERVO_5 (1<<4) /**< servo 5 output */
# define GPIO_SERVO_6 (1<<5) /**< servo 6 output */
# define GPIO_SERVO_1 (1<<0) /**< servo 1 output */
# define GPIO_SERVO_2 (1<<1) /**< servo 2 output */
# define GPIO_SERVO_3 (1<<2) /**< servo 3 output */
# define GPIO_SERVO_4 (1<<3) /**< servo 4 output */
# define GPIO_SERVO_5 (1<<4) /**< servo 5 output */
# define GPIO_SERVO_6 (1<<5) /**< servo 6 output */
# define GPIO_3V3_SENSORS_EN (1<<7) /**< PE3 - VDD_3V3_SENSORS_EN */
# define GPIO_BRICK_VALID (1<<8) /**< PB5 - !VDD_BRICK_VALID */
# define GPIO_3V3_SENSORS_EN (1<<7) /**< PE3 - VDD_3V3_SENSORS_EN */
# define GPIO_BRICK_VALID (1<<8) /**< PB5 - !VDD_BRICK_VALID */
/**
* Device paths for things that support the GPIO ioctl protocol.
*/
# define PX4FMU_DEVICE_PATH "/dev/px4fmu"
# define PX4FMU_DEVICE_PATH "/dev/px4fmu"
#endif
#ifdef CONFIG_ARCH_BOARD_MINDPX_V2
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V4
/*
* PX4FMUv4 GPIO numbers.
*
* There are no alternate functions on this board.
*/
# define GPIO_SERVO_1 (1<<0) /**< servo 1 output */
# define GPIO_SERVO_2 (1<<1) /**< servo 2 output */
# define GPIO_SERVO_3 (1<<2) /**< servo 3 output */
# define GPIO_SERVO_4 (1<<3) /**< servo 4 output */
# define GPIO_SERVO_5 (1<<4) /**< servo 5 output */
# define GPIO_SERVO_6 (1<<5) /**< servo 6 output */
# define GPIO_3V3_SENSORS_EN (1<<7) /**< PE3 - VDD_3V3_SENSORS_EN */
# define GPIO_BRICK_VALID (1<<8) /**< PB5 - !VDD_BRICK_VALID */
/**
* Device paths for things that support the GPIO ioctl protocol.
*/
# define PX4FMU_DEVICE_PATH "/dev/px4fmu"
#endif
#if defined(CONFIG_ARCH_BOARD_MINDPX_V2)
/*
* MindPXv2 GPIO numbers.
*
@ -167,6 +213,30 @@
#endif
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO)
/*
* PX4FMUv4PRO GPIO numbers.
*
* There are no alternate functions on this board.
*/
# define GPIO_SERVO_1 (1<<0) /**< servo 1 output */
# define GPIO_SERVO_2 (1<<1) /**< servo 2 output */
# define GPIO_SERVO_3 (1<<2) /**< servo 3 output */
# define GPIO_SERVO_4 (1<<3) /**< servo 4 output */
# define GPIO_SERVO_5 (1<<4) /**< servo 5 output */
# define GPIO_SERVO_6 (1<<5) /**< servo 6 output */
# define GPIO_3V3_SENSORS_EN (1<<7) /**< PE3 - VDD_3V3_SENSORS_EN */
# define GPIO_BRICK_VALID (1<<8) /**< PB5 - !VDD_BRICK_VALID */
/**
* Device paths for things that support the GPIO ioctl protocol.
*/
# define PX4FMU_DEVICE_PATH "/dev/px4fmu"
# define PX4IO_DEVICE_PATH "/dev/px4io"
#endif
#ifdef CONFIG_ARCH_BOARD_TAP_V1
/*
* PX4FMUv3 GPIO numbers.
@ -225,25 +295,29 @@
#ifdef CONFIG_ARCH_BOARD_AEROFC_V1
/* no GPIO driver on the ASC board */
# define PX4FMU_DEVICE_PATH "/dev/px4fmu"
#endif
#ifdef CONFIG_ARCH_BOARD_SITL
/* no GPIO driver on the SITL configuration */
#endif
#if !defined(CONFIG_ARCH_BOARD_PX4IO_V1) && \
!defined(CONFIG_ARCH_BOARD_PX4IO_V2) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V1) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V2) && \
!defined(CONFIG_ARCH_BOARD_AUAV_X21) && \
!defined(CONFIG_ARCH_BOARD_AEROCORE) && \
#if !defined(CONFIG_ARCH_BOARD_AEROCORE) && \
!defined(CONFIG_ARCH_BOARD_AEROFC_V1) && \
!defined(CONFIG_ARCH_BOARD_AUAV_X21) && \
!defined(CONFIG_ARCH_BOARD_CRAZYFLIE) && \
!defined(CONFIG_ARCH_BOARD_MINDPX_V2) && \
!defined(CONFIG_ARCH_BOARD_PX4_STM32F4DISCOVERY) && \
!defined(CONFIG_ARCH_BOARD_MINDPX_V2) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V4) && \
!defined(CONFIG_ARCH_BOARD_SITL) && \
!defined(CONFIG_ARCH_BOARD_TAP_V1) && \
!defined(CONFIG_ARCH_BOARD_AEROFC_V1) && \
!defined(CONFIG_ARCH_BOARD_CRAZYFLIE)
!defined(CONFIG_ARCH_BOARD_PX4FMU_V1) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V2) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V4) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO) && \
!defined(CONFIG_ARCH_BOARD_PX4FMU_V5) && \
!defined(CONFIG_ARCH_BOARD_PX4IO_V1) && \
!defined(CONFIG_ARCH_BOARD_PX4IO_V2) && \
!defined(CONFIG_ARCH_BOARD_PX4NUCLEOF767ZI_V1) && \
!defined(CONFIG_ARCH_BOARD_SITL) && \
!defined(CONFIG_ARCH_BOARD_TAP_V1)
# error No CONFIG_ARCH_BOARD_xxxx set
#endif
/*

View File

@ -3720,7 +3720,8 @@ px4io_main(int argc, char *argv[])
fn[2] = "/fs/microsd/px4io.bin";
fn[3] = nullptr;
#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || \
defined(CONFIG_ARCH_BOARD_AUAV_X21)
defined(CONFIG_ARCH_BOARD_AUAV_X21) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO)
fn[0] = "/etc/extras/px4io-v2.bin";
fn[1] = "/fs/microsd/px4io2.bin";
fn[2] = "/fs/microsd/px4io.bin";

View File

@ -92,10 +92,14 @@ int gpio_led_main(int argc, char *argv[])
"\t\tr2\tPX4IO RELAY2"
);
#endif
#if defined(CONFIG_ARCH_BOARD_AUAV_X21) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4) || \
defined(CONFIG_ARCH_BOARD_MINDPX_V2)
#if defined(CONFIG_ARCH_BOARD_AUAV_X21) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V5) || \
defined(CONFIG_ARCH_BOARD_MINDPX_V2) || \
defined(CONFIG_ARCH_BOARD_PX4NUCLEOF767ZI_V1)
errx(1, "usage: gpio_led {start|stop} [-p <n>]\n"
"\t-p <n>\tUse specified AUX OUT pin number (default: 1)"
);
@ -117,10 +121,13 @@ int gpio_led_main(int argc, char *argv[])
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
char *pin_name = "PX4FMU GPIO_EXT1";
#endif
#if defined(CONFIG_ARCH_BOARD_AUAV_X21) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4) || \
defined(CONFIG_ARCH_BOARD_MINDPX_V2)
#if defined(CONFIG_ARCH_BOARD_AUAV_X21) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V5) || \
defined(CONFIG_ARCH_BOARD_MINDPX_V2) || \
defined(CONFIG_ARCH_BOARD_PX4NUCLEOF767ZI_V1)
char pin_name[] = "AUX OUT 1";
#endif
@ -163,10 +170,13 @@ int gpio_led_main(int argc, char *argv[])
}
#endif
#if defined(CONFIG_ARCH_BOARD_AUAV_X21) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4) || \
defined(CONFIG_ARCH_BOARD_MINDPX_V2)
#if defined(CONFIG_ARCH_BOARD_AUAV_X21) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V2) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO) || \
defined(CONFIG_ARCH_BOARD_PX4FMU_V5) || \
defined(CONFIG_ARCH_BOARD_MINDPX_V2) || \
defined(CONFIG_ARCH_BOARD_PX4NUCLEOF767ZI_V1)
unsigned int n = strtoul(argv[3], NULL, 10);
if (n >= 1 && n <= 6) {