px4fmu-v4:Define GPIO GPIO_VDD_USB_VALID and initalize it.

The V4 HW replaced the LTC4417 provided valid signal for USB.
  with an active high, version. This commit configures the GIOP
  and provides 1) a MACRO to read the pin and the IOCTL defines
  to read it from the FMU. The macro result true logic: true
  when the signal is high. The IOCTL read would be the actual
  pin state.
This commit is contained in:
David Sidrane 2017-06-27 12:37:46 -10:00
parent f7cc78bffe
commit 258faeee03
2 changed files with 6 additions and 1 deletions

View File

@ -210,6 +210,7 @@
/* Power supply control and monitoring GPIOs */
#define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
#define GPIO_VDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0)
#define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN3)
/* Tone alarm output */
@ -311,6 +312,7 @@
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_USB_VALID (px4_arch_gpioread(GPIO_VDD_USB_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
@ -325,7 +327,8 @@
{GPIO_GPIO4_INPUT, GPIO_GPIO4_OUTPUT, 0}, \
{GPIO_GPIO5_INPUT, GPIO_GPIO5_OUTPUT, 0}, \
{0, GPIO_VDD_3V3_SENSORS_EN, 0}, \
{GPIO_VDD_BRICK_VALID, 0, 0}, }
{GPIO_VDD_BRICK_VALID, 0, 0}, \
{GPIO_VDD_USB_VALID, 0, 0}, }
/*
* PX4FMUv4 GPIO numbers.
@ -341,6 +344,7 @@
#define GPIO_3V3_SENSORS_EN (1<<7) /**< PE3 - VDD_3V3_SENSORS_EN */
#define GPIO_BRICK_VALID (1<<8) /**< PB5 - !VDD_BRICK_VALID */
#define GPIO_USB_VALID (1<<9) /**< PC0 - !GPIO_VDD_USB_VALID */
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120

View File

@ -213,6 +213,7 @@ stm32_boardinitialize(void)
/* configure power supply control/sense pins */
stm32_configgpio(GPIO_PERIPH_3V3_EN);
stm32_configgpio(GPIO_VDD_BRICK_VALID);
stm32_configgpio(GPIO_VDD_USB_VALID);
/* Start with Sensor voltage off We will enable it
* in board_app_initialize