[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
Sissors 2015-05-03 17:37:16 +02:00
parent e74074eba8
commit fa63b6703f
1 changed files with 1 additions and 0 deletions

View File

@ -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) {