STM32L4xx_HAL_Driver  1.14.0
IRQ Handler and Callbacks

Functions

void HAL_I2C_EV_IRQHandler (I2C_HandleTypeDef *hi2c)
 This function handles I2C event interrupt request. More...
 
void HAL_I2C_ER_IRQHandler (I2C_HandleTypeDef *hi2c)
 This function handles I2C error interrupt request. More...
 
void HAL_I2C_MasterTxCpltCallback (I2C_HandleTypeDef *hi2c)
 Master Tx Transfer completed callback. More...
 
void HAL_I2C_MasterRxCpltCallback (I2C_HandleTypeDef *hi2c)
 Master Rx Transfer completed callback. More...
 
void HAL_I2C_SlaveTxCpltCallback (I2C_HandleTypeDef *hi2c)
 Slave Tx Transfer completed callback. More...
 
void HAL_I2C_SlaveRxCpltCallback (I2C_HandleTypeDef *hi2c)
 Slave Rx Transfer completed callback. More...
 
void HAL_I2C_AddrCallback (I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode)
 Slave Address Match callback. More...
 
void HAL_I2C_ListenCpltCallback (I2C_HandleTypeDef *hi2c)
 Listen Complete callback. More...
 
void HAL_I2C_MemTxCpltCallback (I2C_HandleTypeDef *hi2c)
 Memory Tx Transfer completed callback. More...
 
void HAL_I2C_MemRxCpltCallback (I2C_HandleTypeDef *hi2c)
 Memory Rx Transfer completed callback. More...
 
void HAL_I2C_ErrorCallback (I2C_HandleTypeDef *hi2c)
 I2C error callback. More...
 
void HAL_I2C_AbortCpltCallback (I2C_HandleTypeDef *hi2c)
 I2C abort callback. More...
 

Detailed Description

Function Documentation

◆ HAL_I2C_AbortCpltCallback()

__weak void HAL_I2C_AbortCpltCallback ( I2C_HandleTypeDef hi2c)

I2C abort callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4512 of file stm32l4xx_hal_i2c.c.

4513 {
4514  /* Prevent unused argument(s) compilation warning */
4515  UNUSED(hi2c);
4516 
4517  /* NOTE : This function should not be modified, when the callback is needed,
4518  the HAL_I2C_AbortCpltCallback could be implemented in the user file
4519  */
4520 }

◆ HAL_I2C_AddrCallback()

__weak void HAL_I2C_AddrCallback ( I2C_HandleTypeDef hi2c,
uint8_t  TransferDirection,
uint16_t  AddrMatchCode 
)

Slave Address Match callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
TransferDirectionMaster request Transfer Direction (Write/Read), value of I2C Transfer Direction Master Point of View
AddrMatchCodeAddress Match Code
Return values
None

Definition at line 4430 of file stm32l4xx_hal_i2c.c.

4431 {
4432  /* Prevent unused argument(s) compilation warning */
4433  UNUSED(hi2c);
4434  UNUSED(TransferDirection);
4435  UNUSED(AddrMatchCode);
4436 
4437  /* NOTE : This function should not be modified, when the callback is needed,
4438  the HAL_I2C_AddrCallback() could be implemented in the user file
4439  */
4440 }

◆ HAL_I2C_ER_IRQHandler()

void HAL_I2C_ER_IRQHandler ( I2C_HandleTypeDef hi2c)

This function handles I2C error interrupt request.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4316 of file stm32l4xx_hal_i2c.c.

4317 {
4318  uint32_t itflags = READ_REG(hi2c->Instance->ISR);
4319  uint32_t itsources = READ_REG(hi2c->Instance->CR1);
4320  uint32_t tmperror;
4321 
4322  /* I2C Bus error interrupt occurred ------------------------------------*/
4323  if ((I2C_CHECK_FLAG(itflags, I2C_FLAG_BERR) != RESET) && (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERRI) != RESET))
4324  {
4325  hi2c->ErrorCode |= HAL_I2C_ERROR_BERR;
4326 
4327  /* Clear BERR flag */
4328  __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_BERR);
4329  }
4330 
4331  /* I2C Over-Run/Under-Run interrupt occurred ----------------------------------------*/
4332  if ((I2C_CHECK_FLAG(itflags, I2C_FLAG_OVR) != RESET) && (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERRI) != RESET))
4333  {
4334  hi2c->ErrorCode |= HAL_I2C_ERROR_OVR;
4335 
4336  /* Clear OVR flag */
4337  __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_OVR);
4338  }
4339 
4340  /* I2C Arbitration Loss error interrupt occurred -------------------------------------*/
4341  if ((I2C_CHECK_FLAG(itflags, I2C_FLAG_ARLO) != RESET) && (I2C_CHECK_IT_SOURCE(itsources, I2C_IT_ERRI) != RESET))
4342  {
4343  hi2c->ErrorCode |= HAL_I2C_ERROR_ARLO;
4344 
4345  /* Clear ARLO flag */
4346  __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ARLO);
4347  }
4348 
4349  /* Store current volatile hi2c->ErrorCode, misra rule */
4350  tmperror = hi2c->ErrorCode;
4351 
4352  /* Call the Error Callback in case of Error detected */
4353  if ((tmperror & (HAL_I2C_ERROR_BERR | HAL_I2C_ERROR_OVR | HAL_I2C_ERROR_ARLO)) != HAL_I2C_ERROR_NONE)
4354  {
4355  I2C_ITError(hi2c, tmperror);
4356  }
4357 }
static void I2C_ITError(I2C_HandleTypeDef *hi2c, uint32_t ErrorCode)
I2C interrupts error process.

◆ HAL_I2C_ErrorCallback()

__weak void HAL_I2C_ErrorCallback ( I2C_HandleTypeDef hi2c)

I2C error callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4496 of file stm32l4xx_hal_i2c.c.

4497 {
4498  /* Prevent unused argument(s) compilation warning */
4499  UNUSED(hi2c);
4500 
4501  /* NOTE : This function should not be modified, when the callback is needed,
4502  the HAL_I2C_ErrorCallback could be implemented in the user file
4503  */
4504 }

◆ HAL_I2C_EV_IRQHandler()

void HAL_I2C_EV_IRQHandler ( I2C_HandleTypeDef hi2c)

This function handles I2C event interrupt request.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4297 of file stm32l4xx_hal_i2c.c.

4298 {
4299  /* Get current IT Flags and IT sources value */
4300  uint32_t itflags = READ_REG(hi2c->Instance->ISR);
4301  uint32_t itsources = READ_REG(hi2c->Instance->CR1);
4302 
4303  /* I2C events treatment -------------------------------------*/
4304  if (hi2c->XferISR != NULL)
4305  {
4306  hi2c->XferISR(hi2c, itflags, itsources);
4307  }
4308 }
HAL_StatusTypeDef(* XferISR)(struct __I2C_HandleTypeDef *hi2c, uint32_t ITFlags, uint32_t ITSources)

◆ HAL_I2C_ListenCpltCallback()

__weak void HAL_I2C_ListenCpltCallback ( I2C_HandleTypeDef hi2c)

Listen Complete callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4448 of file stm32l4xx_hal_i2c.c.

4449 {
4450  /* Prevent unused argument(s) compilation warning */
4451  UNUSED(hi2c);
4452 
4453  /* NOTE : This function should not be modified, when the callback is needed,
4454  the HAL_I2C_ListenCpltCallback() could be implemented in the user file
4455  */
4456 }

◆ HAL_I2C_MasterRxCpltCallback()

__weak void HAL_I2C_MasterRxCpltCallback ( I2C_HandleTypeDef hi2c)

Master Rx Transfer completed callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4381 of file stm32l4xx_hal_i2c.c.

4382 {
4383  /* Prevent unused argument(s) compilation warning */
4384  UNUSED(hi2c);
4385 
4386  /* NOTE : This function should not be modified, when the callback is needed,
4387  the HAL_I2C_MasterRxCpltCallback could be implemented in the user file
4388  */
4389 }

◆ HAL_I2C_MasterTxCpltCallback()

__weak void HAL_I2C_MasterTxCpltCallback ( I2C_HandleTypeDef hi2c)

Master Tx Transfer completed callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4365 of file stm32l4xx_hal_i2c.c.

4366 {
4367  /* Prevent unused argument(s) compilation warning */
4368  UNUSED(hi2c);
4369 
4370  /* NOTE : This function should not be modified, when the callback is needed,
4371  the HAL_I2C_MasterTxCpltCallback could be implemented in the user file
4372  */
4373 }

◆ HAL_I2C_MemRxCpltCallback()

__weak void HAL_I2C_MemRxCpltCallback ( I2C_HandleTypeDef hi2c)

Memory Rx Transfer completed callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4480 of file stm32l4xx_hal_i2c.c.

4481 {
4482  /* Prevent unused argument(s) compilation warning */
4483  UNUSED(hi2c);
4484 
4485  /* NOTE : This function should not be modified, when the callback is needed,
4486  the HAL_I2C_MemRxCpltCallback could be implemented in the user file
4487  */
4488 }

◆ HAL_I2C_MemTxCpltCallback()

__weak void HAL_I2C_MemTxCpltCallback ( I2C_HandleTypeDef hi2c)

Memory Tx Transfer completed callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4464 of file stm32l4xx_hal_i2c.c.

4465 {
4466  /* Prevent unused argument(s) compilation warning */
4467  UNUSED(hi2c);
4468 
4469  /* NOTE : This function should not be modified, when the callback is needed,
4470  the HAL_I2C_MemTxCpltCallback could be implemented in the user file
4471  */
4472 }

◆ HAL_I2C_SlaveRxCpltCallback()

__weak void HAL_I2C_SlaveRxCpltCallback ( I2C_HandleTypeDef hi2c)

Slave Rx Transfer completed callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4412 of file stm32l4xx_hal_i2c.c.

4413 {
4414  /* Prevent unused argument(s) compilation warning */
4415  UNUSED(hi2c);
4416 
4417  /* NOTE : This function should not be modified, when the callback is needed,
4418  the HAL_I2C_SlaveRxCpltCallback could be implemented in the user file
4419  */
4420 }

◆ HAL_I2C_SlaveTxCpltCallback()

__weak void HAL_I2C_SlaveTxCpltCallback ( I2C_HandleTypeDef hi2c)

Slave Tx Transfer completed callback.

Parameters
hi2cPointer to a I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
Return values
None

Definition at line 4396 of file stm32l4xx_hal_i2c.c.

4397 {
4398  /* Prevent unused argument(s) compilation warning */
4399  UNUSED(hi2c);
4400 
4401  /* NOTE : This function should not be modified, when the callback is needed,
4402  the HAL_I2C_SlaveTxCpltCallback could be implemented in the user file
4403  */
4404 }