BlueNRG-MS pack for STM32CubeMX: Exported Functions

STM32CubeMX BlueNRG-MS

BlueNRG-MS pack for STM32CubeMX  V4.4.0
The BlueNRG-MS pack is an additional software for STM32CubeMX.
Exported Functions

Functions

int hci_send_req (struct hci_request *r, BOOL async)
 Send an HCI request either in synchronous or in asynchronous mode. More...
 
void hci_register_io_bus (tHciIO *fops)
 Register IO bus services. The tHciIO structure is initialized here by assigning to each structure field a function for managing the IO Bus. E.g. In case the user needs to register the SPI bus services: More...
 
int32_t hci_notify_asynch_evt (void *pdata)
 Interrupt service routine that must be called when the BlueNRG reports a packet received or an event to the host through the BlueNRG-MS interrupt line. More...
 
void hci_resume_flow (void)
 This function resume the User Event Flow which has been stopped on return from UserEvtRx() when the User Event has not been processed. More...
 
void hci_cmd_resp_wait (uint32_t timeout)
 This function is called when an ACI/HCI command is sent and the response is waited from the BLE core. The application shall implement a mechanism to not return from this function until the waited event is received. This is notified to the application with hci_cmd_resp_release(). It is called from the same context the HCI command has been sent. More...
 
void hci_cmd_resp_release (uint32_t flag)
 This function is called when an ACI/HCI command is sent and the response is received from the BLE core. More...
 

Detailed Description

Function Documentation

◆ hci_cmd_resp_release()

void hci_cmd_resp_release ( uint32_t  flag)

This function is called when an ACI/HCI command is sent and the response is received from the BLE core.

Parameters
flagRelease flag
Return values
None

◆ hci_cmd_resp_wait()

void hci_cmd_resp_wait ( uint32_t  timeout)

This function is called when an ACI/HCI command is sent and the response is waited from the BLE core. The application shall implement a mechanism to not return from this function until the waited event is received. This is notified to the application with hci_cmd_resp_release(). It is called from the same context the HCI command has been sent.

Parameters
timeoutWaiting timeout
Return values
None

◆ hci_notify_asynch_evt()

int32_t hci_notify_asynch_evt ( void *  pdata)

Interrupt service routine that must be called when the BlueNRG reports a packet received or an event to the host through the BlueNRG-MS interrupt line.

Parameters
pdataPacket or event pointer
Return values
0packet/event processed, 1: no packet/event processed

◆ hci_register_io_bus()

void hci_register_io_bus ( tHciIO fops)

Register IO bus services. The tHciIO structure is initialized here by assigning to each structure field a function for managing the IO Bus. E.g. In case the user needs to register the SPI bus services:

{
hciContext.io.Init = fops->Init;
hciContext.io.Receive = fops->Receive;
hciContext.io.Send = fops->Send;
hciContext.io.GetTick = fops->GetTick;
hciContext.io.Reset = fops->Reset;
}

where:

  • hciContext is a static variable defined in the hci_tl.c
  • all fops fields are initialized, at user level (hci_tl_interface.c file), in the void hci_tl_lowlevel_init(void) function. All the functions for managing the initialization, de-initialization, data sending/receiving, ... must be implemented by the user. e.g.
    {
    tHciIO fops;
    //Register IO bus services
    fops.Init = HCI_TL_SPI_Init;
    fops.DeInit = HCI_TL_SPI_DeInit;
    fops.Send = HCI_TL_SPI_Send;
    fops.Receive = HCI_TL_SPI_Receive;
    fops.Reset = HCI_TL_SPI_Reset;
    fops.GetTick = BSP_GetTick;
    //Register event irq handler
    ... ... ...
    }
Parameters
fopsThe HCI IO structure managing the IO BUS
Return values
None

◆ hci_resume_flow()

void hci_resume_flow ( void  )

This function resume the User Event Flow which has been stopped on return from UserEvtRx() when the User Event has not been processed.

Parameters
None
Return values
None

◆ hci_send_req()

int hci_send_req ( struct hci_request r,
BOOL  async 
)

Send an HCI request either in synchronous or in asynchronous mode.

Parameters
rThe HCI request
asyncTRUE if asynchronous mode, FALSE if synchronous mode
Return values
int0 when success, -1 when failure
Generated on Mon Apr 15 2019 18:10:40 for BlueNRG-MS pack for STM32CubeMX by   doxygen 1.8.13