mirror of https://github.com/ARMmbed/mbed-os.git
DISCO_F429ZI : add SPI6
parent
b3be112ce6
commit
5fc64fff9e
|
|
@ -104,6 +104,12 @@ void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined SPI6_BASE
|
||||
if (obj->spi == SPI_6) {
|
||||
__HAL_RCC_SPI6_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Configure the SPI pins
|
||||
pinmap_pinout(mosi, PinMap_SPI_MOSI);
|
||||
pinmap_pinout(miso, PinMap_SPI_MISO);
|
||||
|
|
@ -166,6 +172,14 @@ void spi_free(spi_t *obj)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined SPI6_BASE
|
||||
if (obj->spi == SPI_6) {
|
||||
__HAL_RCC_SPI6_FORCE_RESET();
|
||||
__HAL_RCC_SPI6_RELEASE_RESET();
|
||||
__HAL_RCC_SPI6_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Configure GPIOs
|
||||
pin_function(obj->pin_miso, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0));
|
||||
pin_function(obj->pin_mosi, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0));
|
||||
|
|
|
|||
Loading…
Reference in New Issue