Skip to content

Commit c0f6097

Browse files
committed
K64F SPI driver: add limitation for supported clock modes
1 parent d7e4b82 commit c0f6097

File tree

1 file changed

+4
-2
lines changed
  • targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F

1 file changed

+4
-2
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/spi_api.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,10 @@ void spi_get_capabilities(SPIName name, PinName ssel, bool slave, spi_capabiliti
333333
cap->support_slave_mode = false;
334334
cap->half_duplex = false;
335335
cap->hw_cs_handle = true;
336-
cap->clk_modes = (1 << SPI_MODE_IDLE_LOW_SAMPLE_FIRST_EDGE) | (1 << SPI_MODE_IDLE_LOW_SAMPLE_SECOND_EDGE) |
337-
(1 << SPI_MODE_IDLE_HIGH_SAMPLE_FIRST_EDGE) | (1 << SPI_MODE_IDLE_HIGH_SAMPLE_SECOND_EDGE);
336+
/* Clock Polarity High is disabled since after setting such format spi master still keeps CLK line low.
337+
Because of that if CS is not handled by hardware (CS is set manually before calling spi_transfer()) CLK line has invalid
338+
state (low) which is inconsistent with SPI standard. */
339+
cap->clk_modes = ((1 << SPI_MODE_IDLE_LOW_SAMPLE_FIRST_EDGE) | (1 << SPI_MODE_IDLE_LOW_SAMPLE_SECOND_EDGE));
338340
cap->bit_order = (1 << SPI_BIT_ORDERING_MSB_FIRST) | (1 << SPI_BIT_ORDERING_LSB_FIRST);
339341
cap->async_mode = true;
340342
cap->slave_delay_between_symbols_ns = 0;

0 commit comments

Comments
 (0)