I am using SMBus to monitor the battery, and could get all info I need, but when battery broadcast some critical info to the host, how should I be able to receive it? From the manual of the battery:

Whenever the Battery detects a critical condition, it takes the role of a bus master and sends AlarmWarning() message to the Host and/ or Charger. The Battery will broadcasts the AlarmWarning() message at 10 second intervals until the critical condition(s) has been corrected.

In CubeMX32, only limited SMBus functions are provided, such as

(++) HAL_SMBUS_EnableListen_IT() or alias HAL_SMBUS_EnableListen_IT() (++) HAL_SMBUS_DisableListen_IT() (++) HAL_SMBUS_EnableAlert_IT() (++) HAL_SMBUS_DisableAlert_IT()

for HAL_SMBUS_EnableListen_IT()

  * @brief  Enable the Address listen mode with Interrupt.
 * @param  hsmbus Pointer to a SMBUS_HandleTypeDef structure that contains
 *                the configuration information for the specified SMBUS.
 * @retval HAL status
 HAL_StatusTypeDef HAL_SMBUS_EnableListen_IT(SMBUS_HandleTypeDef *hsmbus)
  hsmbus->State = HAL_SMBUS_STATE_LISTEN;

  /* Enable the Address Match interrupt */
   SMBUS_Enable_IRQ(hsmbus, SMBUS_IT_ADDR);

  return HAL_OK;

How should I set the SMBUS_IT_ADDR here? default 0x00 for the host? when I run, it looks this function is not used by others...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.