Browse Source

HAL_ChibiOS: TBS-F7 is active low on sd power

master
Andrew Tridgell 6 years ago
parent
commit
27a1fec911
  1. 6
      libraries/AP_HAL_ChibiOS/hwdef/TBS-Colibri-F7/hwdef.dat
  2. 12
      libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c

6
libraries/AP_HAL_ChibiOS/hwdef/TBS-Colibri-F7/hwdef.dat

@ -24,6 +24,12 @@ undef UART8_TX @@ -24,6 +24,12 @@ undef UART8_TX
undef UART8_RX
undef AP_FEATURE_SBUS_OUT
# SD power is active low on TBS board
undef PG7
undef VDD_3V3_SD_CARD_EN
PG7 nVDD_3V3_SD_CARD_EN OUTPUT HIGH
# allow the first 3 capture ports to be used as PWM outputs or GPIOs
undef PA5
undef PB3

12
libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c

@ -262,7 +262,7 @@ void set_fast_reboot(enum rtc_boot_magic v) @@ -262,7 +262,7 @@ void set_fast_reboot(enum rtc_boot_magic v)
*/
void peripheral_power_enable(void)
{
#if defined(HAL_GPIO_PIN_nVDD_5V_PERIPH_EN) || defined(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN) || defined(HAL_GPIO_PIN_VDD_3V3_SENSORS_EN)
#if defined(HAL_GPIO_PIN_nVDD_5V_PERIPH_EN) || defined(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN) || defined(HAL_GPIO_PIN_VDD_3V3_SENSORS_EN) || defined(HAL_GPIO_PIN_nVDD_3V3_SD_CARD_EN) || defined(HAL_GPIO_PIN_VDD_3V3_SD_CARD_EN)
// we don't know what state the bootloader had the CTS pin in, so
// wait here with it pulled up from the PAL table for enough time
// for the radio to be definately powered down
@ -278,9 +278,17 @@ void peripheral_power_enable(void) @@ -278,9 +278,17 @@ void peripheral_power_enable(void)
palWriteLine(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN, 0);
#endif
#ifdef HAL_GPIO_PIN_VDD_3V3_SENSORS_EN
// the TBS-Colibri-F7 needs PE3 low
// the TBS-Colibri-F7 needs PE3 low at power on
palWriteLine(HAL_GPIO_PIN_VDD_3V3_SENSORS_EN, 1);
#endif
#ifdef HAL_GPIO_PIN_nVDD_3V3_SD_CARD_EN
// the TBS-Colibri-F7 needs PG7 low for SD card
palWriteLine(HAL_GPIO_PIN_nVDD_3V3_SD_CARD_EN, 0);
#endif
#ifdef HAL_GPIO_PIN_VDD_3V3_SD_CARD_EN
// others need it active high
palWriteLine(HAL_GPIO_PIN_VDD_3V3_SD_CARD_EN, 1);
#endif
#endif
}

Loading…
Cancel
Save