Skip to content

Commit

Permalink
drivers: spi: gecko: eusart: Support LSB first and GPIO CS
Browse files Browse the repository at this point in the history
Propagate bit ordering and type of CS pin to HAL layer. Previously,
the driver assumed MSB first and EUSART hardware CS control.

Signed-off-by: Aksel Skauge Mellbye <[email protected]>
  • Loading branch information
asmellby authored and kartben committed Dec 20, 2024
1 parent 93cb20b commit 6b65d60
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/spi/spi_gecko_eusart.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ static int spi_eusart_config(const struct device *dev, const struct spi_config *
return -ENOTSUP;
}

if (config->operation & SPI_TRANSFER_LSB) {
LOG_ERR("LSB first not supported");
return -ENOTSUP;
}

if (config->operation & SPI_OP_MODE_SLAVE) {
LOG_ERR("Slave mode not supported");
return -ENOTSUP;
Expand Down Expand Up @@ -133,6 +128,8 @@ static int spi_eusart_config(const struct device *dev, const struct spi_config *
eusartAdvancedSpiInit.csPolarity = eusartCsActiveLow;
}

eusartAdvancedSpiInit.msbFirst = !(config->operation & SPI_TRANSFER_LSB);
eusartAdvancedSpiInit.autoCsEnable = !spi_cs_is_gpio(config);
eusartInit.databits = eusartDataBits8;
eusartInit.advancedSettings = &eusartAdvancedSpiInit;

Expand Down

0 comments on commit 6b65d60

Please sign in to comment.