mini2440 UBOOT I2C支持总结
1. mini2440开发板I2C连接的设备
SDA/SCL对应的引脚:
2. AT24C08地址
查看AT24C08芯片手册
ADDRESS数据段为1010xxx(xxx为A2/A1/A0pin脚连接的电平),由于这里A2/A1/A0都为低电平,所以地址为1010000即0x50
3. UBOOT下12C调试命令
这里假定I2C设备的地址为0x50.
1)从0寄存器开始读,读16个字节:
u-boot> i2c md 0x50 0 16
Md:12c读命令
0x50:i2c外设的地址
0:从外设芯片的第0号寄存器开始读
16:总共读16个寄存器
2)写i2c地址为0x50的外设芯片,给偏移为1的寄存器写0x12.
U-boot> i2c mw 0x20 01 0x12
Mw:i2c写
0x50:i2c外设的地址。
01:写外设芯片偏移为1的寄存器
0x12:给寄存器写的值为0x12.
4. UBOOT S3C2440 I2C code
所在文件:s3c24x0_i2c.c
/*
* (C) Copyright 2002
* David Mueller, ELSOFT AG, d.mueller@elsoft.ch
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Sof