Skip to content

Commit a540ee6

Browse files
pdgendtnashif
authored andcommitted
drivers: hdlc_rcp_if: Add HDLC SPI adapter driver
Implement the HDLC over SPI adapter driver to support the Openthread RCP with SPI communication. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent b24085d commit a540ee6

File tree

5 files changed

+544
-0
lines changed

5 files changed

+544
-0
lines changed

drivers/hdlc_rcp_if/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
zephyr_library()
44

55
zephyr_library_sources_ifdef(CONFIG_HDLC_RCP_IF_NXP hdlc_rcp_if_nxp.c)
6+
zephyr_library_sources_ifdef(CONFIG_HDLC_RCP_IF_SPI hdlc_rcp_if_spi.c)
67
zephyr_library_sources_ifdef(CONFIG_HDLC_RCP_IF_UART hdlc_rcp_if_uart.c)

drivers/hdlc_rcp_if/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ menuconfig HDLC_RCP_IF
1515
if HDLC_RCP_IF
1616

1717
source "drivers/hdlc_rcp_if/Kconfig.nxp"
18+
source "drivers/hdlc_rcp_if/Kconfig.spi"
1819
source "drivers/hdlc_rcp_if/Kconfig.uart"
1920

2021
config HDLC_RCP_IF_DRV_NAME

drivers/hdlc_rcp_if/Kconfig.spi

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Configuration options for NXP HDLC RCP SPI communication Interface
2+
3+
# Copyright (c) 2025 Basalte bv
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config HDLC_RCP_IF_SPI
7+
bool "SPI HDLC interface for Zephyr Openthread RCP host"
8+
default y
9+
depends on DT_HAS_SPI_HDLC_RCP_IF_ENABLED
10+
depends on SPI
11+
12+
if HDLC_RCP_IF_SPI
13+
14+
config HDLC_RCP_IF_SPI_MAX_FRAME_SIZE
15+
int "HDLC RCP IF SPI maximum frame size"
16+
default 2048
17+
help
18+
Maximum frame size for the OpenThread HDLC host SPI.
19+
20+
config HDLC_RCP_IF_SPI_ALIGN_ALLOWANCE
21+
int "HDLC RCP IF SPI RX align allowance"
22+
default 0
23+
range 0 16
24+
help
25+
Specify the maximum number of 0xFF bytes to clip from the start of MISO frames.
26+
27+
config HDLC_RCP_IF_SPI_SMALL_PACKET_SIZE
28+
int "HDLC RCP IF SPI small packet size"
29+
default 32
30+
help
31+
Specify the smallest packet we can receive in a single transaction.
32+
Larger packets will require multiple transactions.
33+
34+
endif

0 commit comments

Comments
 (0)