Skip to content

Commit bda6656

Browse files
Martin Kiepfercarlescufi
authored andcommitted
bugfix: esp32: spi: correct idle polarity and mode configuration
Possible fix for incorrection spi mode configuration on esp32 (#61866) Signed-off-by: Martin Kiepfer <[email protected]>
1 parent 8a9b337 commit bda6656

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/spi/spi_esp32_spim.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,10 @@ static int IRAM_ATTR spi_esp32_configure(const struct device *dev,
331331

332332
/* SPI mode */
333333
hal_dev->mode = 0;
334-
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPOL) {
334+
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPHA) {
335335
hal_dev->mode = BIT(0);
336336
}
337-
338-
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPHA) {
337+
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPOL) {
339338
hal_dev->mode |= BIT(1);
340339
}
341340

0 commit comments

Comments
 (0)