Skip to content

Commit a83dd0b

Browse files
committed
bluetooth: hci: spi: configurable CS delay
Make the common SPI CS delay property configurable from devicetree. This can be required for using a nRF54L as a Bluetooth controller, since it has an additional delay after waking up from the CS assertion until it is ready to accept and transmit data (see OPS t_START_HFINT). Signed-off-by: Jordan Yates <[email protected]>
1 parent 85e1353 commit a83dd0b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/bluetooth/hci/spi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ static K_KERNEL_STACK_DEFINE(spi_rx_stack, CONFIG_BT_DRV_RX_STACK_SIZE);
8686
static struct k_thread spi_rx_thread_data;
8787

8888
static const struct spi_dt_spec bus = SPI_DT_SPEC_INST_GET(
89-
0, SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB | SPI_WORD_SET(8), 0);
89+
0, SPI_OP_MODE_MASTER | SPI_TRANSFER_MSB | SPI_WORD_SET(8),
90+
DT_INST_PROP(0, controller_cs_delay_us));
9091

9192
static struct spi_buf spi_tx_buf;
9293
static struct spi_buf spi_rx_buf;

dts/bindings/bluetooth/zephyr,bt-hci-spi.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ properties:
2424
Minimum duration to hold the reset-gpios pin low for.
2525
If not specified no delay beyond the code path execution time is guaranteed.
2626

27+
controller-cs-delay-us:
28+
type: int
29+
default: 0
30+
description:
31+
Delay in microseconds to wait after asserting the CS line before starting the
32+
transmission and before releasing the CS line after the transmission.
33+
2734
controller-data-delay-us:
2835
type: int
2936
default: 20

0 commit comments

Comments
 (0)