NUC130RC1cn I2C用作从机,程序初始化如下:
void NUCI2CInit(void)
{
uint32_t u32data=0,states = 0;
states = DrvGPIO_InitFunction(E_FUNC_I2C0);
states = DrvI2C_Open(I2C_PORT0, 300000);
states = DrvI2C_SetAddress(I2C_PORT0, 0, PCF8594_ADDR, 0);
states = DrvI2C_InstallCallback(I2C_PORT0, I2CFUNC, I2C0_Callback_Slave);
states = DrvI2C_EnableInt(I2C_PORT0);
DrvI2C_Ctrl(I2C_PORT0, 0, 0, 0, 1);
}
配置后,跟其他CPU通信,发现进不了I2C中断,请问上面的初始化代码有没有问题
|