HAL_ChibiOS: TBS-F7 is active low on sd power

This commit is contained in:
Andrew Tridgell 2019-02-21 20:57:39 +11:00
parent 94bace91a4
commit 27a1fec911
2 changed files with 16 additions and 2 deletions

View File

@ -24,6 +24,12 @@ undef UART8_TX
undef UART8_RX undef UART8_RX
undef AP_FEATURE_SBUS_OUT 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 # allow the first 3 capture ports to be used as PWM outputs or GPIOs
undef PA5 undef PA5
undef PB3 undef PB3

View File

@ -262,7 +262,7 @@ void set_fast_reboot(enum rtc_boot_magic v)
*/ */
void peripheral_power_enable(void) 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 // 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 // wait here with it pulled up from the PAL table for enough time
// for the radio to be definately powered down // for the radio to be definately powered down
@ -278,9 +278,17 @@ void peripheral_power_enable(void)
palWriteLine(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN, 0); palWriteLine(HAL_GPIO_PIN_nVDD_5V_HIPOWER_EN, 0);
#endif #endif
#ifdef HAL_GPIO_PIN_VDD_3V3_SENSORS_EN #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); palWriteLine(HAL_GPIO_PIN_VDD_3V3_SENSORS_EN, 1);
#endif #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 #endif
} }