Browse Source

drivers: spi: cc23x0: Add loopback mode option

When loopback mode is enabled, the output of transmit serial shifter
is connected to the input of receive serial shifter internally.

Signed-off-by: Julien Panis <jpanis@baylibre.com>
pull/74835/merge
Julien Panis 3 weeks ago committed by Benjamin Cabé
parent
commit
5b728969ce
  1. 6
      drivers/spi/spi_cc23x0.c

6
drivers/spi/spi_cc23x0.c

@ -232,6 +232,12 @@ static int spi_cc23x0_configure(const struct device *dev, @@ -232,6 +232,12 @@ static int spi_cc23x0_configure(const struct device *dev,
protocol, SPI_MODE_CONTROLLER,
config->frequency, SPI_CC23_DATA_WIDTH);
if (SPI_MODE_GET(config->operation) & SPI_MODE_LOOP) {
HWREG(cfg->base + SPI_O_CTL1) |= SPI_CTL1_LBM;
} else {
HWREG(cfg->base + SPI_O_CTL1) &= ~SPI_CTL1_LBM;
}
data->ctx.config = config;
/* Configure Rx FIFO level */

Loading…
Cancel
Save