mirror of https://github.com/ARMmbed/mbed-os.git
[HAL][KSDK] Fix issue with KSDK SPI timing
Depending on the format by default the Freescale SPI peripheral does not give proper delay between SPI transfers. So code has been added which sets half a period delay between SPI transfers.pull/1088/head
parent
e74074eba8
commit
fa63b6703f
|
@ -91,6 +91,7 @@ void spi_frequency(spi_t *obj, int hz) {
|
|||
CLOCK_SYS_GetFreq(kBusClock, &busClock);
|
||||
uint32_t spi_address[] = SPI_BASE_ADDRS;
|
||||
DSPI_HAL_SetBaudRate(spi_address[obj->instance], kDspiCtar0, (uint32_t)hz, busClock);
|
||||
DSPI_HAL_CalculateDelay(spi_address[obj->instance], kDspiCtar0, kDspiAfterTransfer, busClock, 500000000 / hz); //Half clock period delay after SPI transfer
|
||||
}
|
||||
|
||||
static inline int spi_writeable(spi_t * obj) {
|
||||
|
|
Loading…
Reference in New Issue