Hello,I want to use Main domain I2c(CSL_I2C2 bitRate 400khz) in Mcu domain. Is it possible to use it in the following way?
1、Set pinmux U23 as I2c SCL, U26 as I2c SDA
2、Preventing access to I2c2 by changing the base address
#define CSL_I2C2_CFG_BASE (0x2020000UL)
#define I2C2_INSTANCE 3
void setConfigI2C(uint8_t instance, uint32_t baseAddr) /* change base address */
{
I2C_HwAttrs i2cCfg;
I2C_socGetInitCfg(instance, &i2cCfg);
i2cCfg.baseAddr = baseAddr;
i2cCfg.enableIntr = 0U;
I2C_socSetInitCfg(instance, &i2cCfg);
}
void test()
{
I2C_Params Commoni2cParams;
I2C_Transaction i2cTransaction;
I2C_Handle i2cHandle = NULL;
I2C_init();
setConfigI2C(I2C2_INSTANCE,CSL_I2C2_CFG_BASE);
I2C_Params_init(&Commoni2cParams);
Commoni2cParams.transferMode = I2C_MODE_BLOCKING;
Commoni2cParams.bitRate = I2C_400kHz;
Commoni2cParams.transferCallbackFxn = NULL;
i2cHandle = I2C_open(I2C2_INSTANCE, &Commoni2cParams);
I2C_transactionInit(&i2cTransaction);
'' set buffer and data size ''
I2C_transfer(i2cHandle, &i2cTransaction);
}
Thanks