AnsweredAssumed Answered

CPAL library - Errors on the DualAddress code

Question asked by curran.danny on Aug 12, 2013
Latest reply on Aug 14, 2013 by curran.danny
I have set up a stm3220G dev board as a slave using the 
uint32_t CPAL_I2C_Listen(CPAL_InitTypeDef* pDevInitStruct) function to deal with any IC2 data being sent to the device.

I need to use the Dual address functionality eg Write to one address to do XYZ
then another address to do ABC

It seems that the value in OAR2 is being ignored unless 
void I2C_OwnAddress2Config(I2C_TypeDef* I2Cx, uint8_t Address) function from stm32f2xx_ic2.c is put after 
    /* If Dual Address Mode Option Bit Selected */
    if ((pDevInitStruct->wCPAL_Options & CPAL_OPT_I2C_DUALADDR) != 0)
    {
      /* Enable Dual Address Mode */
     __CPAL_I2C_HAL_ENABLE_DUALADDR(pDevInitStruct->CPAL_Dev);
      
      /* Configure OAR2 */
      __CPAL_I2C_HAL_OAR2_CONF(pDevInitStruct->CPAL_Dev, (uint8_t)(pDevInitStruct->wCPAL_Options & 0x000000FE));
 in the cpal lib file cpal_i2c.c

has anyone else come accross this ?
Before adding the code from stm32f2xx_i2c.c there would never be an interrupt when the second address was either written or read from.  
  







Outcomes