The BLE specific header file for the RAIL library.
License#
Copyright 2020 Silicon Laboratories Inc. www.silabs.com
SPDX-License-Identifier: Zlib
The licensor of this software is Silicon Laboratories Inc.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
This notice may not be removed or altered from any source distribution.
Modules#
RAIL_BLE_TxChannelHoppingConfigEntry_t
RAIL_BLE_TxChannelHoppingConfig_t
Macros#
subPhyId indicating a 500kbps packet
subPhyId indicating a 125kbps packet
subPhyId value indicating a 1Mbps packet
Invalid subPhyId value.
subPhyId indicating the total count
Backward compatible name for the RAIL_BLE_EnableSignalDetection API.
The maximum number of GPIO pins used for AoX Antenna switching.
Disable the AoX feature.
Sets one of the two AoX sampling/switching modes: 1 us or 2 us window.
Enables connectionless AoX Rx packets.
Enables connection based AoX Rx packets.
Disables CTE buffer lock.
Enables connection based or connectionless AoX Rx packets.
Enumerations#
The variant of the BLE Coded PHY.
The variant of the BLE PHY.
Available Signal Identifier modes.
Angle of Arrival/Departure options bit fields.
Variables#
Default PHY to use for BLE 1M non-Viterbi.
Default PHY to use for BLE 2M non-Viterbi.
Default PHY to use for BLE 1M Viterbi.
Default PHY to use for BLE 2M Viterbi.
PHY to use for BLE 2M with AoX functionality.
Default PHY to use for BLE Coded 125kbps.
Default PHY to use for BLE Coded 500kbps.
Default PHY to use for BLE Simulscan.
Default 1Mbps Quuppa PHY.
Functions#
Configure RAIL to run in BLE mode.
Take RAIL out of BLE mode.
Determine whether BLE mode is enabled or not.
Switch to the 1 Mbps Quuppa PHY.
Switch to the Viterbi 1 Mbps BLE PHY.
Switch to the legacy non-Viterbi 1 Mbps BLE PHY.
Switch to the Viterbi 2 Mbps BLE PHY.
Switch to the legacy non-Viterbi 2 Mbps BLE PHY.
Switch to the BLE Coded PHY.
Switch to the Simulscan PHY.
Change BLE radio parameters.
Change the current BLE PHY and go into receive.
Configure and enable signal identifier for BLE signal detection.
Enable or disable signal identifier interrupt for BLE signal detection.
Lock/unlock the CTE buffer from the application's perspective.
Determine whether the CTE buffer is currently locked or not.
Get the offset into CTE sample of CTE data.
Get the effective sample rate used by the ADC to capture the CTE samples.
Configure Angle of Arrival/Departure (AoX) functionality.
Perform one time initialization of AoX registers.
Perform initialization of AoX antenna GPIO pins.
Set up automatic repeated transmits after the next transmit.
Calibrate image rejection for Bluetooth Low Energy.
Macro Definition Documentation#
RAIL_BLE_RX_SUBPHY_ID_500K#
#define RAIL_BLE_RX_SUBPHY_ID_500KValue:
(0U)
subPhyId indicating a 500kbps packet
261
of file protocol/ble/rail_ble.h
RAIL_BLE_RX_SUBPHY_ID_125K#
#define RAIL_BLE_RX_SUBPHY_ID_125KValue:
(1U)
subPhyId indicating a 125kbps packet
263
of file protocol/ble/rail_ble.h
RAIL_BLE_RX_SUBPHY_ID_1M#
#define RAIL_BLE_RX_SUBPHY_ID_1MValue:
(2U)
subPhyId value indicating a 1Mbps packet
265
of file protocol/ble/rail_ble.h
RAIL_BLE_RX_SUBPHY_ID_INVALID#
#define RAIL_BLE_RX_SUBPHY_ID_INVALIDValue:
(3U)
Invalid subPhyId value.
267
of file protocol/ble/rail_ble.h
RAIL_BLE_RX_SUBPHY_COUNT#
#define RAIL_BLE_RX_SUBPHY_COUNTValue:
(4U)
subPhyId indicating the total count
269
of file protocol/ble/rail_ble.h
RAIL_BLE_EnableSignalIdentifier#
#define RAIL_BLE_EnableSignalIdentifierValue:
RAIL_BLE_EnableSignalDetection
Backward compatible name for the RAIL_BLE_EnableSignalDetection API.
589
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_ANTENNA_PIN_COUNT#
#define RAIL_BLE_AOX_ANTENNA_PIN_COUNTValue:
(6U)
The maximum number of GPIO pins used for AoX Antenna switching.
If the user configures more pins using RAIL_BLE_ConfigAoxAntenna than allowed RAIL_BLE_AOX_ANTENNA_PIN_COUNT, then RAIL_STATUS_INVALID_PARAMETER status will be returned.
RAIL_STATUS_INVALID_CALL is returned if : RAIL_BLE_AOX_ANTENNA_PIN_COUNT is set to 0 or The user configures no pins.
The maximum value RAIL_BLE_AOX_ANTENNA_PIN_COUNT can take depends on number of Antenna route pins , a chip provides. For EFR32XG22, the maximum value of RAIL_BLE_AOX_ANTENNA_PIN_COUNT is 6. If the user configures fewer pins than RAIL_BLE_AOX_ANTENNA_PIN_COUNT, then only number of pins asked by user will be configured with RAIL_STATUS_NO_ERROR.
625
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_DO_SWITCH#
#define RAIL_BLE_AOX_OPTIONS_DO_SWITCHValue:
(0U)
DeprecatedObsolete AOX option
645
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_TX_ENABLED#
#define RAIL_BLE_AOX_OPTIONS_TX_ENABLEDValue:
(0U)
DeprecatedObsolete AOX option
649
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_RX_ENABLED#
#define RAIL_BLE_AOX_OPTIONS_RX_ENABLEDValue:
(0U)
DeprecatedObsolete AOX option
653
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_LOCK_CTE_BUFFER_SHIFT#
#define RAIL_BLE_AOX_OPTIONS_LOCK_CTE_BUFFER_SHIFTValue:
RAIL_BLE_AOX_OPTIONS_DISABLE_BUFFER_LOCK_SHIFT
DeprecatedPlease use RAIL_BLE_AOX_OPTIONS_DISABLE_BUFFER_LOCK_SHIFT instead.
657
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_DISABLED#
#define RAIL_BLE_AOX_OPTIONS_DISABLEDValue:
(0U)
Disable the AoX feature.
662
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_SAMPLE_MODE#
#define RAIL_BLE_AOX_OPTIONS_SAMPLE_MODEValue:
(1U << RAIL_BLE_AOX_OPTIONS_SAMPLE_MODE_SHIFT)
Sets one of the two AoX sampling/switching modes: 1 us or 2 us window.
666
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_CONNLESS#
#define RAIL_BLE_AOX_OPTIONS_CONNLESSValue:
(1U << RAIL_BLE_AOX_OPTIONS_CONNLESS_SHIFT)
Enables connectionless AoX Rx packets.
670
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_CONN#
#define RAIL_BLE_AOX_OPTIONS_CONNValue:
(1U << RAIL_BLE_AOX_OPTIONS_CONN_SHIFT)
Enables connection based AoX Rx packets.
674
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_DISABLE_BUFFER_LOCK#
#define RAIL_BLE_AOX_OPTIONS_DISABLE_BUFFER_LOCKValue:
(1U << RAIL_BLE_AOX_OPTIONS_DISABLE_BUFFER_LOCK_SHIFT)
Disables CTE buffer lock.
678
of file protocol/ble/rail_ble.h
RAIL_BLE_AOX_OPTIONS_ENABLED#
#define RAIL_BLE_AOX_OPTIONS_ENABLEDValue:
(RAIL_BLE_AOX_OPTIONS_CONN | RAIL_BLE_AOX_OPTIONS_CONNLESS)
Enables connection based or connectionless AoX Rx packets.
682
of file protocol/ble/rail_ble.h
Enumeration Documentation#
RAIL_BLE_Coding_t#
RAIL_BLE_Coding_t
The variant of the BLE Coded PHY.
Enumerator | |
---|---|
RAIL_BLE_Coding_125kbps | Enables the 125 kbps variant of the BLE Coded PHY. |
RAIL_BLE_Coding_125kbps_DSA | DeprecatedWill be removed in a future version of RAIL |
RAIL_BLE_Coding_500kbps | Enables the 500 kbps variant of the BLE Coded PHY. |
RAIL_BLE_Coding_500kbps_DSA | DeprecatedWill be removed in a future version of RAIL |
130
of file protocol/ble/rail_ble.h
RAIL_BLE_Phy_t#
RAIL_BLE_Phy_t
The variant of the BLE PHY.
Enumerator | |
---|---|
RAIL_BLE_1Mbps | Use the standard BLE 1Mbps PHY. |
RAIL_BLE_2Mbps | Use the high data rate BLE 2Mbps PHY. |
RAIL_BLE_Coded125kbps | Enables the 125 kbps variant of the BLE Coded PHY. |
RAIL_BLE_Coded500kbps | Enables the 500 kbps variant of the BLE Coded PHY. |
153
of file protocol/ble/rail_ble.h
RAIL_BLE_SignalIdentifierMode_t#
RAIL_BLE_SignalIdentifierMode_t
Available Signal Identifier modes.
Enumerator | |
---|---|
RAIL_BLE_SIGNAL_IDENTIFIER_MODE_DISABLE | |
RAIL_BLE_SIGNAL_IDENTIFIER_MODE_1MBPS | |
RAIL_BLE_SIGNAL_IDENTIFIER_MODE_2MBPS |
275
of file protocol/ble/rail_ble.h
RAIL_BLE_AoxOptions_t#
RAIL_BLE_AoxOptions_t
Angle of Arrival/Departure options bit fields.
Enumerator | |
---|---|
RAIL_BLE_AOX_OPTIONS_SAMPLE_MODE_SHIFT | Shift position of RAIL_BLE_AOX_OPTIONS_SAMPLE_MODE bit. |
RAIL_BLE_AOX_OPTIONS_CONNLESS_SHIFT | Shift position of RAIL_BLE_AOX_OPTIONS_CONNLESS bit. |
RAIL_BLE_AOX_OPTIONS_CONN_SHIFT | Shift position of RAIL_BLE_AOX_OPTIONS_CONN bit. |
RAIL_BLE_AOX_OPTIONS_DISABLE_BUFFER_LOCK_SHIFT | Shift position of RAIL_BLE_AOX_OPTIONS_DISABLE_BUFFER_LOCK bit. |
631
of file protocol/ble/rail_ble.h
Variable Documentation#
RAIL_BLE_Phy1Mbps#
const RAIL_ChannelConfig_t* const RAIL_BLE_Phy1Mbps
Default PHY to use for BLE 1M non-Viterbi.
Will be NULL if RAIL_BLE_SUPPORTS_1MBPS_NON_VITERBI is 0.
188
of file protocol/ble/rail_ble.h
RAIL_BLE_Phy2Mbps#
const RAIL_ChannelConfig_t* const RAIL_BLE_Phy2Mbps
Default PHY to use for BLE 2M non-Viterbi.
Will be NULL if RAIL_BLE_SUPPORTS_2MBPS_NON_VITERBI is 0.
194
of file protocol/ble/rail_ble.h
RAIL_BLE_Phy1MbpsViterbi#
const RAIL_ChannelConfig_t* const RAIL_BLE_Phy1MbpsViterbi
Default PHY to use for BLE 1M Viterbi.
Will be NULL if RAIL_BLE_SUPPORTS_1MBPS_VITERBI is 0.
200
of file protocol/ble/rail_ble.h
RAIL_BLE_Phy2MbpsViterbi#
const RAIL_ChannelConfig_t* const RAIL_BLE_Phy2MbpsViterbi
Default PHY to use for BLE 2M Viterbi.
Will be NULL if RAIL_BLE_SUPPORTS_2MBPS_VITERBI is 0.
206
of file protocol/ble/rail_ble.h
RAIL_BLE_Phy2MbpsAox#
const RAIL_ChannelConfig_t* const RAIL_BLE_Phy2MbpsAox
PHY to use for BLE 2M with AoX functionality.
Will be NULL if either RAIL_BLE_SUPPORTS_2MBPS_VITERBI or RAIL_BLE_SUPPORTS_AOX is 0.
228
of file protocol/ble/rail_ble.h
RAIL_BLE_Phy125kbps#
const RAIL_ChannelConfig_t* const RAIL_BLE_Phy125kbps
Default PHY to use for BLE Coded 125kbps.
Will be NULL if RAIL_BLE_SUPPORTS_CODED_PHY is 0. This PHY can receive on both 125kbps and 500kbps BLE Coded, but will only transmit at 125kbps.
235
of file protocol/ble/rail_ble.h
RAIL_BLE_Phy500kbps#
const RAIL_ChannelConfig_t* const RAIL_BLE_Phy500kbps
Default PHY to use for BLE Coded 500kbps.
Will be NULL if RAIL_BLE_SUPPORTS_CODED_PHY is 0. This PHY can receive on both 125kbps and 500kbps BLE Coded, but will only transmit at 125kbps.
242
of file protocol/ble/rail_ble.h
RAIL_BLE_PhySimulscan#
const RAIL_ChannelConfig_t* const RAIL_BLE_PhySimulscan
Default PHY to use for BLE Simulscan.
Will be NULL if RAIL_BLE_SUPPORTS_SIMULSCAN_PHY is 0. This PHY can receive on 1Mbps as well as 125kbps and 500kbps BLE Coded, but will only transmit at 1Mbps.
249
of file protocol/ble/rail_ble.h
RAIL_BLE_PhyQuuppa#
const RAIL_ChannelConfig_t* const RAIL_BLE_PhyQuuppa
Default 1Mbps Quuppa PHY.
Will be NULL if RAIL_BLE_SUPPORTS_QUUPPA is 0.
255
of file protocol/ble/rail_ble.h
Function Documentation#
RAIL_BLE_Init#
RAIL_Status_t RAIL_BLE_Init (RAIL_Handle_t railHandle)
Configure RAIL to run in BLE mode.
[in] | railHandle | A handle for RAIL instance. |
Returns
Status code indicating success of the function call.
This function changes your radio, channel configuration, and other parameters to match what is needed for BLE, initially establishing the BLE 1mbps PHY. 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.
Note
BLE may not be enabled while Auto-ACKing is enabled.
321
of file protocol/ble/rail_ble.h
RAIL_BLE_Deinit#
RAIL_Status_t RAIL_BLE_Deinit (RAIL_Handle_t railHandle)
Take RAIL out of BLE mode.
[in] | railHandle | A handle for RAIL instance. |
Returns
Status code indicating success of the function call.
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 does 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.
336
of file protocol/ble/rail_ble.h
RAIL_BLE_IsEnabled#
bool RAIL_BLE_IsEnabled (RAIL_Handle_t railHandle)
Determine whether BLE mode is enabled or not.
[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().
347
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigPhyQuuppa#
RAIL_Status_t RAIL_BLE_ConfigPhyQuuppa (RAIL_Handle_t railHandle)
Switch to the 1 Mbps Quuppa PHY.
[in] | railHandle | A handle for RAIL instance. |
Returns
Status code indicating success of the function call.
You can use this function to switch to the Quuppa PHY.
Note
Not all chips support the 1Mbps Quuppa PHY. This API should return RAIL_STATUS_INVALID_CALL if unsupported by the hardware we're building for.
360
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigPhy1MbpsViterbi#
RAIL_Status_t RAIL_BLE_ConfigPhy1MbpsViterbi (RAIL_Handle_t railHandle)
Switch to the Viterbi 1 Mbps BLE PHY.
[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 default 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.
372
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigPhy1Mbps#
RAIL_Status_t RAIL_BLE_ConfigPhy1Mbps (RAIL_Handle_t railHandle)
Switch to the legacy non-Viterbi 1 Mbps BLE PHY.
[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 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.
Note
The EFR32XG2x family does not support BLE non-Viterbi PHYs.
386
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigPhy2MbpsViterbi#
RAIL_Status_t RAIL_BLE_ConfigPhy2MbpsViterbi (RAIL_Handle_t railHandle)
Switch to the Viterbi 2 Mbps BLE PHY.
[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 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.
398
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigPhy2Mbps#
RAIL_Status_t RAIL_BLE_ConfigPhy2Mbps (RAIL_Handle_t railHandle)
Switch to the legacy non-Viterbi 2 Mbps BLE PHY.
[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.
DeprecatedNo EFR32 Series 2 parts support BLE non-Viterbi 2 Mbps PHY.
413
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigPhyCoded#
RAIL_Status_t RAIL_BLE_ConfigPhyCoded (RAIL_Handle_t railHandle, RAIL_BLE_Coding_t bleCoding)
Switch to the BLE Coded PHY.
[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 RAIL_RxPacketDetails_t::subPhyId marks the coding of the received packet. A subPhyId of 0 marks a 500 kbps packet, and a subPhyId of 1 marks a 125 kbps packet.
429
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigPhySimulscan#
RAIL_Status_t RAIL_BLE_ConfigPhySimulscan (RAIL_Handle_t railHandle)
Switch to the Simulscan PHY.
[in] | railHandle | A handle for RAIL instance. |
Returns
A status code indicating success of the function call.
Use this function to switch to the BLE Simulscan PHY. You may only call this function after initializing BLE and while the radio is idle. When using Simulscan PHY, the RAIL_RxPacketDetails_t::subPhyId marks the coding of the received packet. A subPhyId of 0 marks a 500 kbps packet, a subPhyId of 1 marks a 125 kbps packet, and a subPhyId of 2 marks a 1 Mbps packet.
Note
: The Simulscan PHY is supported only on some parts. The preprocessor symbol RAIL_BLE_SUPPORTS_SIMULSCAN_PHY and the runtime function RAIL_BLE_SupportsSimulscanPhy() may be used to test for support of the Simulscan PHY.
450
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigChannelRadioParams#
RAIL_Status_t RAIL_BLE_ConfigChannelRadioParams (RAIL_Handle_t railHandle, uint32_t crcInit, uint32_t accessAddress, uint16_t channel, bool disableWhitening)
Change BLE radio 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. The bits of this parameter are transmitted or received LSB first. |
[in] | channel | The logical channel that you're changing to, which initializes 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. This function should not be called while the radio is active.
501
of file protocol/ble/rail_ble.h
RAIL_BLE_PhySwitchToRx#
RAIL_Status_t RAIL_BLE_PhySwitchToRx (RAIL_Handle_t railHandle, RAIL_BLE_Phy_t phy, uint16_t railChannel, uint32_t startRxTime, uint32_t crcInit, uint32_t accessAddress, uint16_t logicalChannel, bool disableWhitening)
Change the current BLE PHY and go into receive.
[in] | railHandle | A handle for RAIL instance. |
[in] | phy | Indicates which PHY to receive on |
[in] | railChannel | Which channel of the given PHY to receive on |
[in] | startRxTime | When to enter RX |
[in] | crcInit | The value to use for CRC initialization. |
[in] | accessAddress | The access address to use for the connection. The bits of this parameter are transmitted or received LSB first. |
[in] | logicalChannel | The logical channel that you're changing to, which initializes 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 is used to implement auxiliary packet reception, as defined in the BLE specification. The radio will be put into IDLE, the PHY and channel will be changed, and then receive will be entered at the start time given. The new receive will have a timeout of 30 us, which means that this function should only be called if the offset unit is 30 us.
This function is extremely time-sensitive, and may only be called within the interrupt context of a RAIL_EVENT_RX_PACKET_RECEIVED event.
532
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigSignalIdentifier#
RAIL_Status_t RAIL_BLE_ConfigSignalIdentifier (RAIL_Handle_t railHandle, RAIL_BLE_SignalIdentifierMode_t signalIdentifierMode)
Configure and enable signal identifier for BLE signal detection.
[in] | railHandle | A RAIL instance handle. |
[in] | signalIdentifierMode | Mode of signal identifier operation. |
This features allows detection of BLE signal on air based on the mode. This function must be called once before RAIL_BLE_EnableSignalDetection to configure and enable signal identifier.
To enable event for signal detection RAIL_ConfigEvents() must be called for enabling RAIL_EVENT_SIGNAL_DETECTED.
This function is only supported by chips where RAIL_BLE_SUPPORTS_SIGNAL_IDENTIFIER and RAIL_BLE_SupportsSignalIdentifier() are true.
Returns
Status code indicating success of the function call.
560
of file protocol/ble/rail_ble.h
RAIL_BLE_EnableSignalDetection#
RAIL_Status_t RAIL_BLE_EnableSignalDetection (RAIL_Handle_t railHandle, bool enable)
Enable or disable signal identifier interrupt for BLE signal detection.
[in] | railHandle | A RAIL instance handle. |
[in] | enable | Signal detection is enabled if true, disabled if false. |
RAIL_BLE_ConfigSignalIdentifier must be called once before calling this function to configure and enable signal identifier. Once a signal is detected signal detection will be turned off and this function should be called to re-enable the signal detection without needing to call RAIL_BLE_ConfigSignalIdentifier if the signal identifier is already configured and enabled.
This function is only supported by chips where RAIL_BLE_SUPPORTS_SIGNAL_IDENTIFIER and RAIL_BLE_SupportsSignalIdentifier() are true.
Returns
Status code indicating success of the function call.
582
of file protocol/ble/rail_ble.h
RAIL_BLE_LockCteBuffer#
bool RAIL_BLE_LockCteBuffer (RAIL_Handle_t railHandle, bool lock)
Lock/unlock the CTE buffer from the application's perspective.
[in] | railHandle | A RAIL instance handle. |
[in] | lock | Lock the CTE buffer if true and unlock it if false. |
The radio will write to the buffer only if the bit is NOT set at the beginning of the sampling period. The radio will set the bit once the sampling period starts to indicate that some CTE data has been collected, which will not be overwritten during the next sampling period, unless the buffer is unlocked by the application.
Returns
true if the CTE buffer is locked after the call, otherwise false.
760
of file protocol/ble/rail_ble.h
RAIL_BLE_CteBufferIsLocked#
bool RAIL_BLE_CteBufferIsLocked (RAIL_Handle_t railHandle)
Determine whether the CTE buffer is currently locked or not.
[in] | railHandle | A handle for RAIL instance. |
Returns
true if CTE buffer is locked and false otherwise.
768
of file protocol/ble/rail_ble.h
RAIL_BLE_GetCteSampleOffset#
uint8_t RAIL_BLE_GetCteSampleOffset (RAIL_Handle_t railHandle)
Get the offset into CTE sample of CTE data.
[in] | railHandle | A handle for RAIL instance. |
Returns
The offset of CTE data in a CTE sample in bytes. On unsupported platforms this returns 0.
777
of file protocol/ble/rail_ble.h
RAIL_BLE_GetCteSampleRate#
uint32_t RAIL_BLE_GetCteSampleRate (RAIL_Handle_t railHandle)
Get the effective sample rate used by the ADC to capture the CTE samples.
[in] | railHandle | A handle for RAIL instance. |
Returns
The actual sample rate used to capture the CTE in samples per second. On unsupported platforms this returns 0.
786
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigAox#
RAIL_Status_t RAIL_BLE_ConfigAox (RAIL_Handle_t railHandle, const RAIL_BLE_AoxConfig_t * aoxConfig)
Configure Angle of Arrival/Departure (AoX) functionality.
[in] | railHandle | A RAIL instance handle. |
[in] | aoxConfig | Configuration options for AoX |
AoX is a method of radio localization which infers angle of arrival/departure of the signal based on different phases of the raw I/Q signal from different antennas by controlling external RF switch during the continuous tone extension (CTE). Connection based AoX packets are different than normal BLE packets in that they have 3 header bytes instead of 2 and they have CTE appended after the payload's CRC. 3rd byte or CTE info contains CTE length. Connectionless AoX packets have 2 header bytes and CTE info is part of the payload. Note that calling RAIL_GetRadioEntropy during AoX reception may break receiving packets.
Returns
RAIL_Status_t indicating success or failure of the call.
804
of file protocol/ble/rail_ble.h
RAIL_BLE_InitCte#
RAIL_Status_t RAIL_BLE_InitCte (RAIL_Handle_t railHandle)
Perform one time initialization of AoX registers.
[in] | railHandle | A RAIL instance handle. |
This function must be called before RAIL_BLE_ConfigAox and before configuring the BLE PHY.
Returns
RAIL_Status_t indicating success or failure of the call.
814
of file protocol/ble/rail_ble.h
RAIL_BLE_ConfigAoxAntenna#
RAIL_Status_t RAIL_BLE_ConfigAoxAntenna (RAIL_Handle_t railHandle, RAIL_BLE_AoxAntennaConfig_t * antennaConfig)
Perform initialization of AoX antenna GPIO pins.
[in] | railHandle | A RAIL instance handle. |
[in] | antennaConfig | structure to hold the set of ports and pins to configure Antenna pins for AoX Antenna switching. |
This function must be called before calls to RAIL_BLE_InitCte and RAIL_BLE_ConfigAox, and before configuring the BLE PHY, else a RAIL_STATUS_INVALID_CALL is returned.
If user configures more pins, i.e., antCount in RAIL_BLE_AoxAntennaConfig_t, than allowed RAIL_BLE_AOX_ANTENNA_PIN_COUNT, then the API returns RAIL_STATUS_INVALID_PARAMETER.
If user configures lesser than or equal to number of pins allowed by RAIL_BLE_AOX_ANTENNA_PIN_COUNT, then the requested number of pins are configured and RAIL_STATUS_NO_ERROR is returned.
If AoX antenna switching is inactive, non-AoX transmits and receives will occur on the first antenna specified by the antenna pattern or on the default antenna if no antenna pattern is provided.
Returns
RAIL_Status_t indicating success or failure of the call.
840
of file protocol/ble/rail_ble.h
RAIL_BLE_SetNextTxRepeat#
RAIL_Status_t RAIL_BLE_SetNextTxRepeat (RAIL_Handle_t railHandle, const RAIL_BLE_TxRepeatConfig_t * repeatConfig)
Set up automatic repeated transmits after the next transmit.
[in] | railHandle | A RAIL instance handle. |
[in] | repeatConfig | The configuration structure for repeated transmits. |
Returns
Status code indicating a success of the function call.
Repeated transmits will occur after an application-initiated transmit caused by calling one of the Packet Transmit APIs. The repetition will only occur after the first application-initiated transmit after this function is called. Future repeated transmits must be requested by calling this function again.
Each repeated transmit that occurs will have full PTI Packet Trace information and will receive events such as RAIL_EVENT_TX_PACKET_SENT as normal.
If a TX error occurs during the repetition, the process will abort and the TX error transition from RAIL_SetTxTransitions will be used. If the repetition completes successfully, the TX success transition from RAIL_SetTxTransitions will be used.
Any call to RAIL_Idle or RAIL_StopTx will clear the pending repeated transmits. The state will also be cleared by another call to this function. To clear the repeated transmits before they've started without stopping other radio actions, call this function with a RAIL_BLE_TxRepeatConfig_t::iterations count of 0. A DMP switch will clear this state only if the initial transmit triggering the repeated transmits has started.
The application is responsible for populating the transmit data to be used by the repeated transmits via RAIL_SetTxFifo or RAIL_WriteTxFifo. Data will be transmitted from the TX FIFO. If the TX FIFO does not have sufficient data to transmit, a TX error and a RAIL_EVENT_TX_UNDERFLOW will occur. To avoid an underflow, the application should queue data to be transmitted as early as possible.
This function will fail to configure the repetition if a transmit of any kind is ongoing, including during the time between an initial transmit and the end of a previously-configured repetition.
Note
Use the compile time symbol RAIL_SUPPORTS_TX_TO_TX or the runtime call RAIL_SupportsTxToTx() to check whether the platform supports this feature.
1649
of file protocol/ble/rail_ble.h
RAIL_BLE_CalibrateIr#
RAIL_Status_t RAIL_BLE_CalibrateIr (RAIL_Handle_t railHandle, uint32_t * imageRejection)
Calibrate image rejection for Bluetooth Low Energy.
[in] | railHandle | A RAIL instance handle. |
[out] | imageRejection | The result of the image rejection calibration. |
Returns
A status code indicating success of the function call.
Some chips have protocol-specific image rejection calibrations programmed into their flash. This function will either get the value from flash and apply it, or run the image rejection algorithm to find the value.
1671
of file protocol/ble/rail_ble.h