Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60
BLE Interrupt Notification Callback

General Description

API exposes BLE interrupt notifications to the application which indicates a different link layer and radio state transitions to the user from the BLESS interrupt context.

The user registers for a particular type of a callback and the PSoC 6 BLE Middleware will call that registered callback basing on the registered mask. Refer to section BLE Interrupt Notification Callback.

Functions

cy_en_ble_api_result_t Cy_BLE_RegisterInterruptCallback (uint32_t intrMask, cy_ble_intr_callback_t CallBack)
 This function registers a callback to expose BLE interrupt notifications to an application that indicates a different link layer and radio state transition to the user from the BLESS interrupt context. More...
 
cy_en_ble_api_result_t Cy_BLE_UnRegisterInterruptCallback (void)
 This function un-registers the callback that exposed BLE interrupt notifications to the application. More...
 
cy_en_ble_api_result_t Cy_BLE_ConfigureIpcForInterruptCallback (uint32_t ipcChan, uint32_t ipcIntr, uint32_t ipcIntrPrior)
 This function configures IPC channel for BLE interrupt notifications feature, when BLE is operating in BLE dual CPU mode. More...
 
void Cy_BLE_IntrNotifyIsrHandler (void)
 This function sends notification (with interrupt type information) to user callback for the BLE interrupts subscribed by user. More...
 

Function Documentation

◆ Cy_BLE_RegisterInterruptCallback()

cy_en_ble_api_result_t Cy_BLE_RegisterInterruptCallback ( uint32_t  intrMask,
cy_ble_intr_callback_t  CallBack 
)

This function registers a callback to expose BLE interrupt notifications to an application that indicates a different link layer and radio state transition to the user from the BLESS interrupt context.

This callback is triggered at the beginning of a received BLESS interrupt (based on the registered interrupt mask).

An application can use an interrupt callback to know when:

  • the RF activity is about to begin/end;
  • the BLE device changes its state from advertising to connected;
  • BLESS transits between BLESS active and BLESS low-power modes.

These BLESS real-time states can be used to synchronize an application with the BLESS or prevent radio interference with other peripherals, etc.

BLE dual CPU mode requires an additional configuration IPC channel and IPC Interrupt structure to send notifications from the controller core to Host core. Refer to Cy_BLE_ConfigureIpcForInterruptCallback() for details.

Note
The user must call Cy_BLE_IntrNotifyIsrHandler() inside the user-defined BLESS interrupt service routine (ISR)
Parameters
intrMaskAll interrupts masks are specified in the cy_en_ble_interrupt_callback_feature_t enumeration.
CallBackThe pointer to an application notify callback.
Returns
cy_en_ble_api_result_t : The return value indicates whether the function succeeded or failed. The possible error codes:
Errors codes Description
CY_BLE_SUCCESS The callback is registered successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameters failed.

◆ Cy_BLE_UnRegisterInterruptCallback()

cy_en_ble_api_result_t Cy_BLE_UnRegisterInterruptCallback ( void  )

This function un-registers the callback that exposed BLE interrupt notifications to the application.

Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. The following are possible error codes.
Errors codes Description
CY_BLE_SUCCESS The callback registered successfully.
CY_BLE_ERROR_INVALID_OPERATION The IPC channel is busy (BLE dual CPU mode only).

◆ Cy_BLE_ConfigureIpcForInterruptCallback()

cy_en_ble_api_result_t Cy_BLE_ConfigureIpcForInterruptCallback ( uint32_t  ipcChan,
uint32_t  ipcIntr,
uint32_t  ipcIntrPrior 
)

This function configures IPC channel for BLE interrupt notifications feature, when BLE is operating in BLE dual CPU mode.

This function must be called only on the Host CPU core.

Parameters
ipcChanIPC channel. Valid range: 9..15
ipcIntrIPC Interrupt structure. Valid range: 9..15
ipcIntrPriorIPC Interrupt priority. Valid range: 0..7
Returns
cy_en_ble_api_result_t : The return value indicates whether the function succeeded or failed. The possible error codes:
Errors codes Description
CY_BLE_SUCCESS The callback is registered successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameters failed.
CY_BLE_ERROR_INVALID_OPERATION The IPC channel is busy (BLE dual CPU mode only).

◆ Cy_BLE_IntrNotifyIsrHandler()

void Cy_BLE_IntrNotifyIsrHandler ( void  )

This function sends notification (with interrupt type information) to user callback for the BLE interrupts subscribed by user.

The list of supported interrupts described in the enumeration cy_en_ble_interrupt_callback_feature_t. Cy_BLE_RegisterInterruptCallback() API used to register callback for receiving the BLE interrupts.

This function must be called inside the user-defined BLESS interrupt service routine (ISR) if user uses Interrupt Notifications Feature.

Updates the firmware and hardware to exit sleep mode, when called from the interrupt mode, after checking the state machine.