I2C action from timer callback
Hi,
I am working with STM32G4 and I have problem reading/writing the I2C data with in the timer callback.
I have Timer1 calling my interrupt callback every 50 microseconds which is working well.
I have I2C read/write functions which are working well.I2C is not Interrupt based.
The problem occur while reading/writing the I2C data within the timer callback
I am unable to read/write the I2C data in the timer interrupt callback
Below is the timer callback
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if (htim == &htim1)
{
if(dcheck.flagon_2sec1){
dcount.s_2_sec1++;
if(dcount.s_2_sec1==40000){
delay.flag_2sec1 = 1;
expander_read(&hmcp,REGISTER_INPUT,data);
dcount.s_2_sec1=0;
dcheck.flagon_2sec1=0;
}
}
}
}
Normal I2C read/write working but with in the timer callback its not working.
Can anyone suggest.
Thanks
