zephyr/samples/bluetooth/hci_spi
Johan Hedberg 26d97164be Bluetooth: HCI: Use H:4 encoding for buffers
Encode the packet type as a H:4 payload prefix for buffers passing to &
from HCI drivers. The existing bt_buf_set/get_type functions are
deprecated, but kept compatible with the change, except that they can only
be called once, since they modify the buffer payload.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-04-29 13:00:33 +02:00
..
boards hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00
src Bluetooth: HCI: Use H:4 encoding for buffers 2025-04-29 13:00:33 +02:00
CMakeLists.txt cmake: increase minimal required version to 3.20.0 2021-08-20 09:47:34 +02:00
prj.conf Bluetooth: Controller: Fix HCI command buffer allocation failure 2025-02-21 11:30:38 +00:00
README.rst doc: boards: nordic: Adopt zephyr:board directives 2025-03-31 22:00:02 +02:00
sample.yaml hwmv2: Introduce Hardware model version 2 and convert devices 2024-03-02 16:56:33 -05:00

.. zephyr:code-sample:: bluetooth_hci_spi
   :name: HCI SPI
   :relevant-api: hci_raw bluetooth spi_interface

   Expose a Bluetooth controller to another device or CPU over SPI.

Overview
********

Expose Bluetooth Controller support over SPI to another device/CPU using
the Zephyr SPI HCI transport protocol (similar to BlueNRG).

Requirements
************

A board with SPI slave, GPIO and Bluetooth Low Energy support.

Building and Running
********************

You then need to ensure that your :ref:`devicetree <dt-guide>` defines a node
for the HCI SPI slave device with compatible
:dtcompatible:`zephyr,bt-hci-spi-slave`. This node sets an interrupt line to
the host and associates the application with a SPI bus to use.

See :zephyr_file:`boards/nrf51dk_nrf51822.overlay
<samples/bluetooth/hci_spi/boards/nrf51dk_nrf51822.overlay>` in this sample
directory for an example overlay for the :zephyr:board:`nrf51dk` board.

You can then build this application and flash it onto your board in
the usual way; see :ref:`boards` for board-specific building and
flashing information.

You will also need a separate chip acting as BT HCI SPI master. This
application is compatible with the HCI SPI master driver provided by
Zephyr's Bluetooth HCI driver core; see the help associated with the
:kconfig:option:`CONFIG_BT_SPI` configuration option for more information.

Refer to :zephyr:code-sample-category:`bluetooth` for general Bluetooth information, and
to :ref:`96b_carbon_nrf51_bluetooth` for instructions specific to the
96Boards Carbon board.