LPC1114 I2C 的问题?

2019-03-25 20:46发布

不知大家有没有弄过I2C的 原来没有弄过, 想弄下, 前几天看啦1114的例程大概了解,这几天 寻思再研究下, 不知有没有弄过的 , 分享下,     单片机的I2C 倒是弄啦下, 就是AT24C02 的EEPROM , 但是弄到1114上, 应该是有点不得要领吧, 哈哈 , 最近时间少啦点, 没有一直在弄这个, 今天发个贴, 有机会多多学习!!! [ 本帖最后由 lanyu345 于 2010-5-27 09:09 编辑 ] 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
7条回答
lanyu345
2019-03-26 14:49

  /* In order to start the I2CEngine, the all the parameters
  must be set in advance, including I2CWriteLength, I2CReadLength,
  I2CCmd, and the I2cMasterBuffer which contains the stream
  command/data to the I2c slave device.
  (1) If it's a I2C write only, the number of bytes to be written is
  I2CWriteLength, I2CReadLength is zero, the content will be filled
  in the I2CMasterBuffer.
  (2) If it's a I2C read only, the number of bytes to be read is
  I2CReadLength, I2CWriteLength is 0, the read value will be filled
  in the I2CMasterBuffer.
  (3) If it's a I2C Write/Read with repeated start, specify the
  I2CWriteLength, fill the content of bytes to be written in
  I2CMasterBuffer, specify the I2CReadLength, after the repeated
  start and the device address with RD bit set, the content of the
  reading will be filled in I2CMasterBuffer index at
  I2CMasterBuffer[I2CWriteLength+2].
 
  e.g. Start, DevAddr(W), WRByte1...WRByteN, Repeated-Start, DevAddr(R),


  RDByte1...RDByteN Stop. The content of the reading will be filled
  after (I2CWriteLength + two devaddr) bytes. */

 

一周热门 更多>