2021-11-29 10:13 PM
/**
* @brief Reports if the BlueNRG has data for the host micro.
*
* @param None
* @retval int32_t: 1 if data are present, 0 otherwise
*/
static int32_t IsDataAvailable(void)
{
return (HAL_GPIO_ReadPin(HCI_TL_SPI_EXTI_PORT, HCI_TL_SPI_EXTI_PIN) == GPIO_PIN_SET);
}
if it indicate that it has data for mater can we use this as a wake up to controller. by checking pin status can we wakeup the MCU when the data is available.
2021-12-01 05:47 AM
Hi @Nikhil Gayke ,
This is true. I confirm this SPI IRQ pin of IDBO5A1 (BlueNRG-MS) is raise High by BlueNRG-MS network processor to indicate that there is some data available and host MCU (STM32) can perform SPI read. I do not see blocking point to use it for waking up Host MCU (of course, host MCU remains SPI master and is in charge of control/configure BlueNRG-MS)
Regards,
Sebastien.
2021-12-02 12:46 AM
does this code wake the MCU from low power mode
static int32_t IsDataAvailable(void)
{
if(HAL_GPIO_ReadPin(HCI_TL_SPI_EXTI_PORT, HCI_TL_SPI_EXTI_PIN) == GPIO_PIN_SET)
{
Flag=True;
}
else
{
Flag=False;
}
}
void MX_BlueNRG_MS_Process(void)
{
if(set_connectable==TRUE && Flag==True)
{
User_Process();
hci_user_evt_proc();
}
else
{
__disable_irq();
LPM_Enter_Mode();
}
__enable_irq();
}
@Agnieszka Stawiarska @Sebastien DENOUAL @s2399 @s_abbot @s_michas