Expand description
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:
- A SPI chip select pin, and
- 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
Modules§
- event
- Vendor-specific events for BlueNRG controllers.
- gap
- GAP commands and types needed for those commands.
- gatt
- GATT commands and types needed for those commands.
- hal
- Vendor-specific HCI commands and types needed for those commands.
- l2cap
- L2Cap-specific commands and types needed for those commands.
Structs§
- Active
BlueNRG - Handle for actively communicating with the controller over the SPI bus.
- BlueNRG
- Handle for interfacing with the BlueNRG-MS.
- BlueNRG
Types - Specify vendor-specific extensions for the BlueNRG.
- Invalid
Hardware Error - Error type for
TryFrom<u8>toHardwareError. Includes the invalid byte. - Version
- Vendor-specific interpretation of the local version information from the controller.
Enums§
- Advertising
Filter Policy - Possible filter policies used for undirected advertising.
- Advertising
Type - The advertising type is used in the
AdvertisingParametersto determine the packet type that is used for advertising when advertising is enabled. - Error
- Enumeration of potential errors that may occur when reading from or writing to the chip.
- Hardware
Error - Hardware event codes returned by the
HardwareErrorHCI event. - OwnAddress
Type - Indicates the type of address being used in the advertising packets.
Traits§
- Local
Version Info Ext - Extension trait to convert
hci::event::command::LocalVersionInfointo the BlueNRG-specificVersionstruct. - Uart
Controller - Master trait that encompasses all commands, and communicates over UART.