2020-05-06 01:58 PM
I have connected a peripheral to STM32WB via I2C,.The functions HAL_I2C_Mem_Write() and I2C, HAL_I2C_Mem_Read() are designed for upto 16 bit register address. (The function checks if MemAddSize is 8 bit or 16 bit).
Do I have to rewrite the implementation or I can use HAL_I2C_Master_Transmit_IT() for writing [send pointer to 32 bit address + 16 bit/32 bit data] and together HAL_I2C_Master_Transmit_IT() (to write address) and HAL_I2C_Master_Receive_IT() (to get the data) to read data
for reference:
I2C functions available: http://www.disca.upv.es/aperles/arm_cortex_m3/llibre/st/STM32F439xx_User_Manual/group__i2c__exported__functions__group2.html
Thank you
2020-05-06 02:11 PM
>>Do I have to rewrite the implementation..
Yes, probably going to have to code your own variant of the routine, or perhaps consider the efficacy of putting a 4/8 GB addressable device onto an I2C bus connection
2020-05-11 12:26 AM
Hi,
To perform this communication with a peripheral which have quite same fonctionnality as a memory. Mean which have an I2C physical address and a memory register mapping.
You can use HAL I2C sequential interfaces.
For usage, you can check this example I2C_TwoBoards_RestartComIT or I2C_TwoBoards_RestartAdvComIT present in the STM32WB firmware package in path P-NUCLEO-WB55.Nucleo\Examples\I2C.
Regards.