bugfix: esp32: spi: correct idle polarity and mode configuration
Possible fix for incorrection spi mode configuration on esp32 (#61866) Signed-off-by: Martin Kiepfer <mrmarteng@teleschirm.org>
This commit is contained in:
parent
8a9b33729b
commit
bda6656eca
|
@ -331,11 +331,10 @@ static int IRAM_ATTR spi_esp32_configure(const struct device *dev,
|
|||
|
||||
/* SPI mode */
|
||||
hal_dev->mode = 0;
|
||||
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPOL) {
|
||||
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPHA) {
|
||||
hal_dev->mode = BIT(0);
|
||||
}
|
||||
|
||||
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPHA) {
|
||||
if (SPI_MODE_GET(spi_cfg->operation) & SPI_MODE_CPOL) {
|
||||
hal_dev->mode |= BIT(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue