1      Scope of Document

This document describes i2c bus hardware design and support i2c-devices: eeprom(at24c08) rtc(rx8025).

2      Requiremen

2.1     Function Requirement

Enumerate i2c bus eeprom and rtc i2c-device, load corresponding drivers

2.2     Performance Requirement

NA

3      Hardware Overview

i2c interface,pin map:

AM335X_I2C0_SCL------------------I2C0_SCL

AM335X_I2C0_SDA------------------I2C0_SDA

Figure 1 tf interface block diagram

4      Functional Description

4.1     I2C

4.1.1 Overview

Figure 2  timing diagram

  1. Data transfer is initiated with a start bit (S) signaled by SDA being pulled low while SCL stays high.
  2. SCL is pulled low, and SDA sets the first data bit level while keeping SCL low (during blue bar time).
  3. The data are sampled (received) when SCL rises for the first bit (B1). For a bit to be valid, SDA must not change between a rising edge of SCL and the subsequent falling edge (the entire green bar time).
  4. This process repeats, SDA transitioning while SCL is low, and the data being read while SCL is high (B2, ...Bn).
  5. The final bit is followed by a clock pulse, during which SDA is pulled low in preparation for the stop bit.
  6. A stop bit (P) is signaled when SCL rises, followed by SDA rising.

5      Porting

5.1     Kernel porting

Dts file :

i2c0_pins: pinmux_i2c0_pins {

pinctrl-single,pins = <

AM33XX_IOPAD(0x988, PIN_INPUT_PULLUP | MUX_MODE0)

AM33XX_IOPAD(0x98c, PIN_INPUT_PULLUP | MUX_MODE0)

>;

};

&i2c0 {

pinctrl-names = "default";

pinctrl-0 = <&i2c0_pins>;

status = "okay";

clock-frequency = <400000>;

at24c08@50 {

compatible = "atmel,24c08";

     pagesize = <16>

reg = <0x50>;

};

rtc@32 {

compatible = "epson,rx8025";

reg = <0x32>;

};

};

[    1.795430] at24 0-0050: 1024 byte 24c08 EEPROM, writable, 16 bytes/write

[    1.803203] rtc-rx8025 0-0032: rx8025_get_time: read 0x09 0x01 0x06 0x06 0x16 0x11 0x18

[    1.803220] rtc-rx8025 0-0032: rx8025_get_time: date 9s 1m 6h 16md 10m 118y

[    1.803504] rtc rtc0: rx8025: dev (253:0)

[    1.803534] rtc-rx8025 0-0032: rtc core: registered rx8025 as rtc0

[    1.809854] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz

[    3.179312] rtc-rx8025 0-0032: rx8025_get_time: read 0x10 0x01 0x06 0x06 0x16 0x11 0x18

[    3.179330] rtc-rx8025 0-0032: rx8025_get_time: date 10s 1m 6h 16md 10m 118y

[    3.179373] rtc-rx8025 0-0032: setting system clock to 2018-11-16 06:01:10 UTC (1542348070)

6      Follow-up

Read rtc:

Write rtc:

test rtc:

eeprom access dir:

/sys/bus/i2c/devices/0-0050

最新文章

  1. 从随机过程到马尔科夫链蒙特卡洛方法(MCMC)
  2. Ubuntu中root用户和user用户
  3. [20140928]创建连接到MySQL的连接服务器
  4. C++拷贝构造函数(深拷贝,浅拷贝)
  5. TCP状态转移图学习总结
  6. ajax post提交的方式
  7. 【MVC 4】5.SportsSore —— 一个真实的应用程序
  8. weka特征选择(IG、chi-square)
  9. http://blog.csdn.net/lvyuanj/article/details/51235135
  10. [翻译]Behavior-Driven Development (BDD)行为驱动开发(一)
  11. outlook 2007 IMAP设置和配置
  12. IO(Input&amp;Output)流の介绍
  13. 洛谷 [P1024]一元三次方程求解
  14. Unity AssetBundle的生成、加载和热更新
  15. [jzoj]4216.【NOIP2015模拟9.12】平方和
  16. Perl:undef类型和defined()函数
  17. Hadoop生态圈-构建企业级平台安全方案
  18. new
  19. python abc模块
  20. 【BZOJ4310】跳蚤

热门文章

  1. 颜色转换、随机、16进制转换、HSV
  2. ArcGIS Server SOE地图服务重启特别卡
  3. xxx商城之架构和功能简述
  4. VBA 打印及破密
  5. HTML—链接
  6. 微信小程序自定义toast的实现
  7. 用D3.js画树状图
  8. 修改Mysql 字符集,支持Emoji表情
  9. Python学习日记(二) list操作
  10. spark 机器学习 决策树 原理(一)