BLE
Accelerator routines for Bluetooth Low Energy (BLE).
Data Structures |
|
struct | RAIL_BLE_State_t |
A state structure for BLE.
|
Enumerations |
|
enum |
RAIL_BLE_Coding_t
{
RAIL_BLE_Coding_125kbps = 0, RAIL_BLE_Coding_125kbps_DSA = 1, RAIL_BLE_Coding_500kbps = 2, RAIL_BLE_Coding_500kbps_DSA = 3 } |
The variant of the BLE Coded PHY.
|
Functions |
|
void | RAIL_BLE_Init ( RAIL_Handle_t railHandle) |
Configures RAIL to run in BLE mode.
|
|
void | RAIL_BLE_Deinit ( RAIL_Handle_t railHandle) |
Takes RAIL out of BLE mode.
|
|
bool | RAIL_BLE_IsEnabled ( RAIL_Handle_t railHandle) |
Determines whether BLE mode is enabled or not.
|
|
RAIL_Status_t | RAIL_BLE_ConfigPhy1MbpsViterbi ( RAIL_Handle_t railHandle) |
Switches the Viterbi 1 Mbps BLE PHY.
|
|
RAIL_Status_t | RAIL_BLE_ConfigPhy1Mbps ( RAIL_Handle_t railHandle) |
Switches the legacy non-Viterbi 1 Mbps BLE PHY.
|
|
RAIL_Status_t | RAIL_BLE_ConfigPhy2MbpsViterbi ( RAIL_Handle_t railHandle) |
Switches the Viterbi 2 Mbps BLE PHY.
|
|
RAIL_Status_t | RAIL_BLE_ConfigPhy2Mbps ( RAIL_Handle_t railHandle) |
Switches the legacy non-Viterbi 2 Mbps BLE PHY.
|
|
RAIL_Status_t | RAIL_BLE_ConfigPhyCoded ( RAIL_Handle_t railHandle, RAIL_BLE_Coding_t bleCoding) |
Switches to the BLE Coded PHY.
|
|
RAIL_Status_t | RAIL_BLE_ConfigChannelRadioParams ( RAIL_Handle_t railHandle, uint32_t crcInit, uint32_t accessAddress, uint16_t channel, bool disableWhitening) |
Helper function to change BLE radio parameters.
|
Detailed Description
Accelerator routines for Bluetooth Low Energy (BLE).
The APIs in this module configure the radio for BLE operation and provide additional helper routines necessary for normal BLE send/receive that aren't available directly in RAIL. RAIL APIs should be used to set up the application. However, RAIL_ConfigChannels() and RAIL_ConfigRadio() should not be called to set up the PHY. Instead, RAIL_BLE_Config* APIs should be used to set up the 1 Mbps, 2 Mbps, or Coded PHY configurations needed by the application. These APIs will configure the hardware and also configure the set of valid BLE channels.
To implement a standard BLE link layer, you will also need to handle tight turnaround times and send packets at specific instants. This can all be managed through general RAIL functions, such as RAIL_ScheduleTx(), RAIL_ScheduleRx() , and RAIL_SetStateTiming() . See RAIL APIs for more useful functions.
A simple example to set up the application to be in BLE mode is shown below. Note that this will put the radio on the first advertising channel with the advertising Access Address. In any full-featured BLE application you will need to use the RAIL_BLE_ConfigChannelRadioParams() function to change the sync word and other parameters as needed based on your connection.
Function Documentation
RAIL_Status_t RAIL_BLE_ConfigChannelRadioParams | ( | RAIL_Handle_t |
railHandle,
|
uint32_t |
crcInit,
|
||
uint32_t |
accessAddress,
|
||
uint16_t |
channel,
|
||
bool |
disableWhitening
|
||
) |
Helper function to change BLE radio parameters.
- Parameters
-
[in] railHandle
A handle for RAIL instance. [in] crcInit
The value to use for CRC initialization. [in] accessAddress
The access address to use for the connection. [in] channel
The logical channel that you're changing to, which is used to initialize the whitener if used. [in] disableWhitening
This can turn off the whitening engine and is useful for sending BLE test mode packets that don't have this turned on.
- Returns
- A status code indicating success of the function call.
This function can be used to switch radio parameters on every connection and/or channel change. It is BLE-aware and will set the access address, preamble, CRC initialization value, and whitening configuration without requiring you to load a new radio configuration.
RAIL_Status_t RAIL_BLE_ConfigPhy1Mbps | ( | RAIL_Handle_t |
railHandle
|
) |
Switches the legacy non-Viterbi 1 Mbps BLE PHY.
- Parameters
-
[in] railHandle
A handle for RAIL instance.
- Returns
- A status code indicating success of the function call.
You can use this function to switch back to the legacy BLE 1 Mbps PHY if you have switched to the 2 Mbps or another configuration. You may only call this function after initializing BLE and while the radio is idle.
RAIL_Status_t RAIL_BLE_ConfigPhy1MbpsViterbi | ( | RAIL_Handle_t |
railHandle
|
) |
Switches the Viterbi 1 Mbps BLE PHY.
- Parameters
-
[in] railHandle
A handle for RAIL instance.
- Returns
- A status code indicating success of the function call.
Use this function to switch back to the defualt BLE 1 Mbps PHY if you have switched to the 2 Mbps or another configuration. You may only call this function after initializing BLE and while the radio is idle.
RAIL_Status_t RAIL_BLE_ConfigPhy2Mbps | ( | RAIL_Handle_t |
railHandle
|
) |
Switches the legacy non-Viterbi 2 Mbps BLE PHY.
- Parameters
-
[in] railHandle
A handle for RAIL instance.
- Returns
- A status code indicating success of the function call.
Use this function to switch back to legacy BLE 2Mbps PHY from the default 1 Mbps option. You may only call this function after initializing BLE and while the radio is idle.
- Note
- Not all chips support the 2 Mbps PHY. See the reference manual before trying this.
RAIL_Status_t RAIL_BLE_ConfigPhy2MbpsViterbi | ( | RAIL_Handle_t |
railHandle
|
) |
Switches the Viterbi 2 Mbps BLE PHY.
- Parameters
-
[in] railHandle
A handle for RAIL instance.
- Returns
- A status code indicating success of the function call.
You can use this function to switch back to the BLE 2 Mbps PHY from the default 1 Mbps option. You may only call this function after initializing BLE and while the radio is idle.
- Note
- Not all chips support the 2 Mbps PHY. See the reference manual before trying this.
RAIL_Status_t RAIL_BLE_ConfigPhyCoded | ( | RAIL_Handle_t |
railHandle,
|
RAIL_BLE_Coding_t |
bleCoding
|
||
) |
Switches to the BLE Coded PHY.
- Parameters
-
[in] railHandle
A handle for RAIL instance. [in] bleCoding
The RAIL_BLE_Coding_t to use
- Returns
- A status code indicating success of the function call.
Use this function to switch back to BLE Coded PHY from the default 1 Mbps option. You may only call this function after initializing BLE and while the radio is idle. When using a BLE Coded PHY, the subPhy in RAIL_AppendedInfo_t marks the coding of the received packet. A subPhy of 0 marks a 500 kbps packet, and a subPhy of 1 marks a 125 kbps packet.
- Note
- Not all chips support the BLE Coded PHY. See the reference manual before trying this.
void RAIL_BLE_Deinit | ( | RAIL_Handle_t |
railHandle
|
) |
Takes RAIL out of BLE mode.
- Parameters
-
[in] railHandle
A handle for RAIL instance. This function will undo some of the configuration that happens when you call RAIL_BLE_Init() . After this you can safely run your normal radio initialization code to use a non-BLE configuration. This function will not change back your radio or channel configurations so you must do this by manually reinitializing. This also resets the protocol output on PTI to RAIL_PTI_PROTOCOL_CUSTOM .
void RAIL_BLE_Init | ( | RAIL_Handle_t |
railHandle
|
) |
Configures RAIL to run in BLE mode.
- Parameters
-
[in] railHandle
A handle for RAIL instance. This function will change your radio, channel configuration, and other parameters to match what is needed for BLE. To switch back to a default RAIL mode, call RAIL_BLE_Deinit() first. This function will configure the protocol output on PTI to RAIL_PTI_PROTOCOL_BLE .
bool RAIL_BLE_IsEnabled | ( | RAIL_Handle_t |
railHandle
|
) |
Determines whether BLE mode is enabled or not.
- Parameters
-
[in] railHandle
A handle for RAIL instance.
- Returns
- True if BLE mode is enabled and false otherwise. This function returns the current status of RAIL's BLE mode. It is enabled by a call to RAIL_BLE_Init() and disabled by a call to RAIL_BLE_Deinit() .