#define I2C3_CLK_ADDR (0x4A0097B0) #define I2C3_SDA_BASE_ADDR (0x4A003774) #define I2C3_SCL_BASE_ADDR (0x4A003778) void I2C3_Init(void) { // 配置时钟使能 HW_WR_REG32(I2C3_CLK_ADDR, 0x00000002); // 配置成I2C接口 HW_WR_REG32(I2C3_SCL_BASE_ADDR, 0x00010002); HW_WR_REG32(I2C3_SDA_BASE_ADDR, 0x00050002); I2C_HwAttrs i2c_cfg; I2C_socGetInitCfg(pi2c->instance, &i2c_cfg); I2C_socSetInitCfg(pi2c->instance, &i2c_cfg); I2C_Params i2cParams; SemaphoreP_Params cbSemParams; I2C_Params_init(&i2cParams); i2cParams.transferMode = I2C_MODE_CALLBACK; i2cParams.bitRate = pi2c->bitrate; i2cParams.transferCallbackFxn = pi2c->callback; if(i2cParams.transferMode == I2C_MODE_CALLBACK) { I2C_osalSemParamsInit(&cbSemParams); cbSemParams.mode = SemaphoreP_Mode_BINARY; pi2c->cbSem = I2C_osalCreateBlockingLock(0, &cbSemParams); } pi2c->i2c_handle = I2C_open(pi2c->instance, &i2cParams); if(pi2c->i2c_handle == NULL) { M_TraceL("Error opening I2C driver\n"); } CSL_xbarIrqConfigure(CSL_XBAR_IRQ_CPU_ID_DSP1, CSL_XBAR_INST_DSP1_IRQ_87, CSL_XBAR_I2C3_IRQ); }
共2条
1/1 1 跳转至页
AM5708:I2C3配置完成之后,在读写操作过程中,无法在SCL上面接收到时钟信号
关键词: AM5708
共2条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |