Skip to content

Commit a0d2770

Browse files
committed
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>
1 parent 1fdaec3 commit a0d2770

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/spi/spi_cc23x0.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ static int spi_cc23x0_configure(const struct device *dev,
232232
protocol, SPI_MODE_CONTROLLER,
233233
config->frequency, SPI_CC23_DATA_WIDTH);
234234

235+
if (SPI_MODE_GET(config->operation) & SPI_MODE_LOOP) {
236+
HWREG(cfg->base + SPI_O_CTL1) |= SPI_CTL1_LBM;
237+
} else {
238+
HWREG(cfg->base + SPI_O_CTL1) &= ~SPI_CTL1_LBM;
239+
}
240+
235241
data->ctx.config = config;
236242

237243
/* Configure Rx FIFO level */

0 commit comments

Comments
 (0)