我配置dsp slave 接受模式,无法接受数据
代码:
I2CPinMuxSetup(0);
HWREG(SOC_I2C_0_REGS + I2C_ICPFUNC) &= ~0x01;
// place I2C in reset
HWREG(SOC_I2C_0_REGS + I2C_ICMDR) &= ~(I2C_ICMDR_IRS);
HWREG(SOC_I2C_0_REGS + I2C_ICMDR) &= ~(I2C_ICMDR_NACKMOD // no ack
| I2C_ICMDR_MST // in slave mode
| I2C_ICMDR_FREE //
| I2C_ICMDR_RM // Nonrepeat mode. The value in the data count register (ICCNT) determines how many data words are received/transmitted by the I2C.
| I2C_ICMDR_DLB // disable loopback
| I2C_ICMDR_TRX // receive mode
| I2C_ICMDR_FDF);
//HWREG(SOC_I2C_0_REGS + I2C_ICMDR) |= I2C_ICMDR_FDF;
HWREG(SOC_I2C_0_REGS + I2C_ICOAR) = 0x28;
/* Bring the I2C module out of reset */
HWREG(SOC_I2C_0_REGS + I2C_ICMDR) |= I2C_ICMDR_IRS;
while ((HWREG(SOC_I2C_0_REGS + I2C_ICSTR) & (0x01 << 9)) != 0) {
}
Shine:
执行完上面写寄存器的代码后,ICMDR寄存器的值是多少?