drivers: spi: gecko: eusart: Support LSB first and GPIO CS
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 <aksel.mellbye@silabs.com>
This commit is contained in:
parent
93cb20befd
commit
6b65d60d49
1 changed files with 2 additions and 5 deletions
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue