4 releases

0.1.0 May 8, 2020
0.0.3 Sep 16, 2018
0.0.2 Sep 15, 2018
0.0.1 Sep 4, 2018

#665 in Embedded development

Download history 4709/week @ 2023-11-26 4960/week @ 2023-12-03 5397/week @ 2023-12-10 4872/week @ 2023-12-17 4635/week @ 2023-12-24 4640/week @ 2023-12-31 4472/week @ 2024-01-07 4654/week @ 2024-01-14 5190/week @ 2024-01-21 4867/week @ 2024-01-28 4212/week @ 2024-02-04 4204/week @ 2024-02-11 3723/week @ 2024-02-18 3617/week @ 2024-02-25 3339/week @ 2024-03-03 1141/week @ 2024-03-10

12,407 downloads per month
Used in ockam_transport_ble

MIT/Apache

395KB
5.5K SLoC

BlueNRG

Build Status

This crate provides the vendor-specific Bluetooth HCI for STMicro's BlueNRG family of Bluetooth RF modules. It extends bluetooth-hci with vendor-specific commands and events (and associated errors).

BlueNRG and BlueNRG-MS

This crate supports both the older BlueNRG version of the HCI, and the newer BlueNRG-MS version. By default, the crate implements BlueNRG-MS.

Work in Progress...

As you will notice, documentation is woefully lacking. This is still (as of April 2018) actively developed, so more is on the way!


lib.rs:

Bluetooth HCI for STMicro's BlueNRG-MS Bluetooth controllers.

Note: This crate does not provide support for the BlueNRG-1 or BlueNRG-2 SoCs.

Design

The BlueNRG-MS is an external Bluetooth Radio Controller that communicates with the application processor over SPI and two dedicated pins:

  1. A SPI chip select pin, and
  2. A data ready signal.

This crate defines a public struct, BlueNRG that owns the chip select and data ready pins, and a receive buffer for the data that comes from the controller. It also defines a private struct, ActiveBlueNRG that borrows a handle to the SPI bus. ActiveBlueNRG implements bluetooth_hci::Controller, which provides access to the full Bluetooth HCI.

BlueNRG-MS implements parts of version 4.1 of the Bluetooth specification.

The fundamental way to use the BlueNRG is its with_spi function, which invokes its closure on at ActiveBlueNRG, so sending HCI commands and reading HCI events can only be done from within that closure.

Vendor-Specific Commands

BlueNRG-MS provides several vendor-specific commands that control the behavior of the controller.

Vendor-Specific Events

BlueNRG-MS provides several vendor-specific events that provide data related to the controller. Many of these events are forwarded from the link layer, and these are documented with a reference to the appropriate section of the Bluetooth specification.

Example

TODO

Dependencies

~575KB