阅读:2520回复:0
请问通过IIC读写寄存器的问题,看代码
每次从上层一调用就挂在下面的分支里,哪位大侠帮看看。没法调试。
//led rgb if((EP4FIFOBUF[0x10] == 0x06)&&(EP4FIFOBUF[0x100] == 0x06)) { for (i=0;i<1024;i++) { EP8FIFOBUF = 0xff; } buf[0] = 0x01; //value to be written to register length = 0x01; EEPROMInit(); EEPROMWrite(0x03, length, buf); SYNCDELAY; EEPROMWrite(0x04, length, buf); SYNCDELAY; EEPROMWrite(0x0c, length, buf); SYNCDELAY; EEPROMWrite(0x0d, length, buf); SYNCDELAY; EEPROMWrite(0x0e, length, buf); SYNCDELAY; buf[0] = 0x02; EEPROMWrite(0x02, length, buf); SYNCDELAY; //read rgb value rBuf[0] = 0xff; gBuf[1] = 0xff; bBuf[2] = 0xff; EEPROMRead(0x44, length, rBuf); SYNCDELAY; EEPROMRead(0x43, length, gBuf); SYNCDELAY; EEPROMRead(0x42, length, bBuf); SYNCDELAY; EP8FIFOBUF[0] = rBuf[0]; EP8FIFOBUF[1] = gBuf[0]; EP8FIFOBUF[2] = bBuf[0]; } |
|