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.

Functions

void hci_tl_lowlevel_init (void)
 Register hci_tl_interface IO bus services and the IRQ handlers. This function must be implemented by the user at the application level. E.g., in the following, it is provided an implementation example in the case of the SPI: More...
 
void hci_tl_lowlevel_isr (void)
 HCI Transport Layer Low Level Interrupt Service Routine. The Interrupt Service Routine must be called when the BlueNRG-MS reports a packet received or an event to the host through the BlueNRG-MS interrupt line. E.g. in case of data travelling over SPI. More...
 

Detailed Description

Function Documentation

◆ hci_tl_lowlevel_init()

void hci_tl_lowlevel_init ( void  )

Register hci_tl_interface IO bus services and the IRQ handlers. This function must be implemented by the user at the application level. E.g., in the following, it is provided an implementation example in the case of the SPI:

{
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
HAL_EXTI_GetHandle(&hexti0, EXTI_LINE_0);
HAL_EXTI_RegisterCallback(&hexti0, HAL_EXTI_COMMON_CB_ID, hci_tl_lowlevel_isr);
HAL_NVIC_SetPriority(EXTI0_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
}
Parameters
None
Return values
None

◆ hci_tl_lowlevel_isr()

void hci_tl_lowlevel_isr ( void  )

HCI Transport Layer Low Level Interrupt Service Routine. The Interrupt Service Routine must be called when the BlueNRG-MS reports a packet received or an event to the host through the BlueNRG-MS interrupt line. E.g. in case of data travelling over SPI.

{
while(IsDataAvailable())
{
}
}

where IsDataAvailable() checks the status of the SPI external interrupt pin

static int32_t IsDataAvailable(void)
{
return (HAL_GPIO_ReadPin(HCI_TL_SPI_EXTI_PORT, HCI_TL_SPI_EXTI_PIN) == GPIO_PIN_SET);
}
Parameters
None
Return values
None
Generated on Mon Apr 15 2019 18:10:40 for BlueNRG-MS pack for STM32CubeMX by   doxygen 1.8.13