1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef _I2C_H_
24#define _I2C_H_
25
26#define I2C_BASE1 0x44E0B000
27#define I2C_BASE2 0x4802A000
28#define I2C_BASE3 0x4819C000
29#define I2C_BUS_MAX 3
30
31#define I2C_DEFAULT_BASE I2C_BASE1
32
33struct i2c {
34 unsigned short revnb_lo;
35 unsigned short res1;
36 unsigned short revnb_hi;
37 unsigned short res2[13];
38 unsigned short sysc;
39 unsigned short res3;
40 unsigned short irqstatus_raw;
41 unsigned short res4;
42 unsigned short stat;
43 unsigned short res5;
44 unsigned short ie;
45 unsigned short res6;
46 unsigned short irqenable_clr;
47 unsigned short res7;
48 unsigned short iv;
49 unsigned short res8[45];
50 unsigned short syss;
51 unsigned short res9;
52 unsigned short buf;
53 unsigned short res10;
54 unsigned short cnt;
55 unsigned short res11;
56 unsigned short data;
57 unsigned short res13;
58 unsigned short res14;
59 unsigned short res15;
60 unsigned short con;
61 unsigned short res16;
62 unsigned short oa;
63 unsigned short res17;
64 unsigned short sa;
65 unsigned short res18;
66 unsigned short psc;
67 unsigned short res19;
68 unsigned short scll;
69 unsigned short res20;
70 unsigned short sclh;
71 unsigned short res21;
72 unsigned short systest;
73 unsigned short res22;
74 unsigned short bufstat;
75 unsigned short res23;
76};
77
78#define I2C_IP_CLK 48000000
79#define I2C_INTERNAL_SAMLPING_CLK 12000000
80
81#endif
82