免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2646 | 回复: 0

LPC3250 U-Boot I2C使用 [复制链接]

论坛徽章:
0
发表于 2011-12-21 08:41 |显示全部楼层

  • I2C相关命令

U-Boot$i2c nm
i2c - I2C sub-system

Usage:
i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum
i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device
i2c md chip address[.0, .1, .2] [# of objects] - read from I2C device
i2c mm chip address[.0, .1, .2] - write to I2C device (auto-incrementing)
i2c mw chip address[.0, .1, .2] value [count] - write to I2C device (fill)
i2c nm chip address[.0, .1, .2] - write to I2C device (constant address)
i2c probe - show devices on the I2C bus
i2c read chip address[.0, .1, .2] length memaddress - read to memory
i2c reset - re-init the I2C Controller
i2c speed [speed] - show or set I2C bus speed

  • 读取DS2460(从地址0x80)
U-Boot$i2c md 80 80
0080: 00 14 97 0f e0 3b 00 00 3c e7 fe 14 22 30 01 27    .....;..<..."0.'

  • 写DS2460(固定子地址):
修改地址0xA7的值为0x01:
U-Boot$i2c nm 80 a7
000000a7:len=1
 10 ? 1
000000a7:len=1



您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP