cancel
Showing results for 
Search instead for 
Did you mean: 

I am working on using an STM32L4 as a SMBus host to communicate to a battery monitor IC with many different registers. Using cubeMX and HAL to generate my code, I am having trouble understanding the functions and variables. Help!

JLand.8
Associate

From what I understand, the slave device I want to communicate with has many addressed registers than I need to specify in addition to the slave device's address. If the slave device's address is 0x16, and the registers I need to read on that device range from between 0x01 to 0x82, how do I select the specific registers?

Example:

HAL_SMBUS_Master_Transmit_IT(SMBUS_HandleTypeDef *hsmbus, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions)

I only see room for the slave device's address, not any specific register?

I am clearly missing something here, a quick sample of how to get the info from slave device 0x16 register 0x01 would be much appreciated.

It should be noted that the battery monitor IC I am using is running off of SMBus 1.1, and it seems that the STM32L4 uses SMBus 2.0. I am not sure of the backwards compatibility, but am hoping for the best.

Thank you for your help,

Joseph

0 REPLIES 0