Skip to content

Commit 9f16e75

Browse files
committed
[HAL][KSDK] Switched delay type of SPI
Even though it does not actually toggle the CS signal, we can also use the delay to CS toggle to get proper waveforms. This also fixes SPI in mode 3.
1 parent fa63b67 commit 9f16e75

File tree

1 file changed

+1
-1
lines changed
  • libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS

1 file changed

+1
-1
lines changed

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/spi_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void spi_frequency(spi_t *obj, int hz) {
9191
CLOCK_SYS_GetFreq(kBusClock, &busClock);
9292
uint32_t spi_address[] = SPI_BASE_ADDRS;
9393
DSPI_HAL_SetBaudRate(spi_address[obj->instance], kDspiCtar0, (uint32_t)hz, busClock);
94-
DSPI_HAL_CalculateDelay(spi_address[obj->instance], kDspiCtar0, kDspiAfterTransfer, busClock, 500000000 / hz); //Half clock period delay after SPI transfer
94+
DSPI_HAL_CalculateDelay(spi_address[obj->instance], kDspiCtar0, kDspiLastSckToPcs, busClock, 500000000 / hz); //Half clock period delay after SPI transfer
9595
}
9696

9797
static inline int spi_writeable(spi_t * obj) {

0 commit comments

Comments
 (0)