STM32L4xx_HAL_Driver  1.14.0

Functions

void HAL_SMBUS_EV_IRQHandler (SMBUS_HandleTypeDef *hsmbus)
 Handle SMBUS event interrupt request. More...
 
void HAL_SMBUS_ER_IRQHandler (SMBUS_HandleTypeDef *hsmbus)
 Handle SMBUS error interrupt request. More...
 
void HAL_SMBUS_MasterTxCpltCallback (SMBUS_HandleTypeDef *hsmbus)
 Master Tx Transfer completed callback. More...
 
void HAL_SMBUS_MasterRxCpltCallback (SMBUS_HandleTypeDef *hsmbus)
 Master Rx Transfer completed callback. More...
 
void HAL_SMBUS_SlaveTxCpltCallback (SMBUS_HandleTypeDef *hsmbus)
 Slave Tx Transfer completed callback. More...
 
void HAL_SMBUS_SlaveRxCpltCallback (SMBUS_HandleTypeDef *hsmbus)
 Slave Rx Transfer completed callback. More...
 
void HAL_SMBUS_AddrCallback (SMBUS_HandleTypeDef *hsmbus, uint8_t TransferDirection, uint16_t AddrMatchCode)
 Slave Address Match callback. More...
 
void HAL_SMBUS_ListenCpltCallback (SMBUS_HandleTypeDef *hsmbus)
 Listen Complete callback. More...
 
void HAL_SMBUS_ErrorCallback (SMBUS_HandleTypeDef *hsmbus)
 SMBUS error callback. More...
 

Detailed Description

Function Documentation

◆ HAL_SMBUS_AddrCallback()

__weak void HAL_SMBUS_AddrCallback ( SMBUS_HandleTypeDef hsmbus,
uint8_t  TransferDirection,
uint16_t  AddrMatchCode 
)

Slave Address Match callback.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
TransferDirectionMaster request Transfer Direction (Write/Read)
AddrMatchCodeAddress Match Code
Return values
None

Definition at line 1698 of file stm32l4xx_hal_smbus.c.

1699 {
1700  /* Prevent unused argument(s) compilation warning */
1701  UNUSED(hsmbus);
1702  UNUSED(TransferDirection);
1703  UNUSED(AddrMatchCode);
1704 
1705  /* NOTE : This function should not be modified, when the callback is needed,
1706  the HAL_SMBUS_AddrCallback() could be implemented in the user file
1707  */
1708 }

◆ HAL_SMBUS_ER_IRQHandler()

void HAL_SMBUS_ER_IRQHandler ( SMBUS_HandleTypeDef hsmbus)

Handle SMBUS error interrupt request.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1622 of file stm32l4xx_hal_smbus.c.

1623 {
1624  SMBUS_ITErrorHandler(hsmbus);
1625 }
static void SMBUS_ITErrorHandler(struct __SMBUS_HandleTypeDef *hsmbus)
SMBUS interrupts error handler.

◆ HAL_SMBUS_ErrorCallback()

__weak void HAL_SMBUS_ErrorCallback ( SMBUS_HandleTypeDef hsmbus)

SMBUS error callback.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1732 of file stm32l4xx_hal_smbus.c.

1733 {
1734  /* Prevent unused argument(s) compilation warning */
1735  UNUSED(hsmbus);
1736 
1737  /* NOTE : This function should not be modified, when the callback is needed,
1738  the HAL_SMBUS_ErrorCallback() could be implemented in the user file
1739  */
1740 }

◆ HAL_SMBUS_EV_IRQHandler()

void HAL_SMBUS_EV_IRQHandler ( SMBUS_HandleTypeDef hsmbus)

Handle SMBUS event interrupt request.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1561 of file stm32l4xx_hal_smbus.c.

1562 {
1563  /* Use a local variable to store the current ISR flags */
1564  /* This action will avoid a wrong treatment due to ISR flags change during interrupt handler */
1565  uint32_t tmpisrvalue = READ_REG(hsmbus->Instance->ISR);
1566  uint32_t tmpcr1value = READ_REG(hsmbus->Instance->CR1);
1567 
1568  /* SMBUS in mode Transmitter ---------------------------------------------------*/
1569  if ((SMBUS_CHECK_IT_SOURCE(tmpcr1value, (SMBUS_IT_TCI | SMBUS_IT_STOPI | SMBUS_IT_NACKI | SMBUS_IT_TXI)) != RESET) && ((SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_TXIS) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_TCR) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_TC) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_STOPF) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_AF) != RESET)))
1570  {
1571  /* Slave mode selected */
1572  if ((hsmbus->State & HAL_SMBUS_STATE_SLAVE_BUSY_TX) == HAL_SMBUS_STATE_SLAVE_BUSY_TX)
1573  {
1574  (void)SMBUS_Slave_ISR(hsmbus, tmpisrvalue);
1575  }
1576  /* Master mode selected */
1577  else if ((hsmbus->State & HAL_SMBUS_STATE_MASTER_BUSY_TX) == HAL_SMBUS_STATE_MASTER_BUSY_TX)
1578  {
1579  (void)SMBUS_Master_ISR(hsmbus, tmpisrvalue);
1580  }
1581  else
1582  {
1583  /* Nothing to do */
1584  }
1585  }
1586 
1587  /* SMBUS in mode Receiver ----------------------------------------------------*/
1588  if ((SMBUS_CHECK_IT_SOURCE(tmpcr1value, (SMBUS_IT_TCI | SMBUS_IT_STOPI | SMBUS_IT_NACKI | SMBUS_IT_RXI)) != RESET) && ((SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_RXNE) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_TCR) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_TC) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_STOPF) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_AF) != RESET)))
1589  {
1590  /* Slave mode selected */
1591  if ((hsmbus->State & HAL_SMBUS_STATE_SLAVE_BUSY_RX) == HAL_SMBUS_STATE_SLAVE_BUSY_RX)
1592  {
1593  (void)SMBUS_Slave_ISR(hsmbus, tmpisrvalue);
1594  }
1595  /* Master mode selected */
1596  else if ((hsmbus->State & HAL_SMBUS_STATE_MASTER_BUSY_RX) == HAL_SMBUS_STATE_MASTER_BUSY_RX)
1597  {
1598  (void)SMBUS_Master_ISR(hsmbus, tmpisrvalue);
1599  }
1600  else
1601  {
1602  /* Nothing to do */
1603  }
1604  }
1605 
1606  /* SMBUS in mode Listener Only --------------------------------------------------*/
1607  if (((SMBUS_CHECK_IT_SOURCE(tmpcr1value, SMBUS_IT_ADDRI) != RESET) || (SMBUS_CHECK_IT_SOURCE(tmpcr1value, SMBUS_IT_STOPI) != RESET) || (SMBUS_CHECK_IT_SOURCE(tmpcr1value, SMBUS_IT_NACKI) != RESET)) && ((SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_ADDR) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_STOPF) != RESET) || (SMBUS_CHECK_FLAG(tmpisrvalue, SMBUS_FLAG_AF) != RESET)))
1608  {
1609  if ((hsmbus->State & HAL_SMBUS_STATE_LISTEN) == HAL_SMBUS_STATE_LISTEN)
1610  {
1611  (void)SMBUS_Slave_ISR(hsmbus, tmpisrvalue);
1612  }
1613  }
1614 }
static HAL_StatusTypeDef SMBUS_Slave_ISR(struct __SMBUS_HandleTypeDef *hsmbus, uint32_t StatusFlags)
Interrupt Sub-Routine which handle the Interrupt Flags Slave Mode.
static HAL_StatusTypeDef SMBUS_Master_ISR(struct __SMBUS_HandleTypeDef *hsmbus, uint32_t StatusFlags)
Interrupt Sub-Routine which handle the Interrupt Flags Master Mode.

◆ HAL_SMBUS_ListenCpltCallback()

__weak void HAL_SMBUS_ListenCpltCallback ( SMBUS_HandleTypeDef hsmbus)

Listen Complete callback.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1716 of file stm32l4xx_hal_smbus.c.

1717 {
1718  /* Prevent unused argument(s) compilation warning */
1719  UNUSED(hsmbus);
1720 
1721  /* NOTE : This function should not be modified, when the callback is needed,
1722  the HAL_SMBUS_ListenCpltCallback() could be implemented in the user file
1723  */
1724 }

◆ HAL_SMBUS_MasterRxCpltCallback()

__weak void HAL_SMBUS_MasterRxCpltCallback ( SMBUS_HandleTypeDef hsmbus)

Master Rx Transfer completed callback.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1649 of file stm32l4xx_hal_smbus.c.

1650 {
1651  /* Prevent unused argument(s) compilation warning */
1652  UNUSED(hsmbus);
1653 
1654  /* NOTE : This function should not be modified, when the callback is needed,
1655  the HAL_SMBUS_MasterRxCpltCallback() could be implemented in the user file
1656  */
1657 }

◆ HAL_SMBUS_MasterTxCpltCallback()

__weak void HAL_SMBUS_MasterTxCpltCallback ( SMBUS_HandleTypeDef hsmbus)

Master Tx Transfer completed callback.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1633 of file stm32l4xx_hal_smbus.c.

1634 {
1635  /* Prevent unused argument(s) compilation warning */
1636  UNUSED(hsmbus);
1637 
1638  /* NOTE : This function should not be modified, when the callback is needed,
1639  the HAL_SMBUS_MasterTxCpltCallback() could be implemented in the user file
1640  */
1641 }

◆ HAL_SMBUS_SlaveRxCpltCallback()

__weak void HAL_SMBUS_SlaveRxCpltCallback ( SMBUS_HandleTypeDef hsmbus)

Slave Rx Transfer completed callback.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1680 of file stm32l4xx_hal_smbus.c.

1681 {
1682  /* Prevent unused argument(s) compilation warning */
1683  UNUSED(hsmbus);
1684 
1685  /* NOTE : This function should not be modified, when the callback is needed,
1686  the HAL_SMBUS_SlaveRxCpltCallback() could be implemented in the user file
1687  */
1688 }

◆ HAL_SMBUS_SlaveTxCpltCallback()

__weak void HAL_SMBUS_SlaveTxCpltCallback ( SMBUS_HandleTypeDef hsmbus)

Slave Tx Transfer completed callback.

Parameters
hsmbusPointer to a SMBUS_HandleTypeDef structure that contains the configuration information for the specified SMBUS.
Return values
None

Definition at line 1664 of file stm32l4xx_hal_smbus.c.

1665 {
1666  /* Prevent unused argument(s) compilation warning */
1667  UNUSED(hsmbus);
1668 
1669  /* NOTE : This function should not be modified, when the callback is needed,
1670  the HAL_SMBUS_SlaveTxCpltCallback() could be implemented in the user file
1671  */
1672 }