1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: 15: 16: 17: 18:
19:
20: #ifndef __DEV_I2C_RX231_H__
21: #define __DEV_I2C_RX231_H__
22:
23: #define DEV_I2C_UNITNM (1)
24:
25:
26: #define I2C_STS_START 0x0000
27: #define I2C_STS_RESTART 0x0001
28: #define I2C_STS_STOP 0x0003
29: #define I2C_STS_SEND 0x0004
30: #define I2C_STS_RECV 0x0005
31: #define I2C_STS_TOP 0x8000
32: #define I2C_STS_LAST 0x0800
33:
34: 35: 36:
37: #define RIIC_BASE 0x00088300
38:
39: #define RIIC_ICCR1 (RIIC_BASE+0x00)
40: #define RIIC_ICCR2 (RIIC_BASE+0x01)
41: #define RIIC_ICMR1 (RIIC_BASE+0x02)
42: #define RIIC_ICMR2 (RIIC_BASE+0x03)
43: #define RIIC_ICMR3 (RIIC_BASE+0x04)
44: #define RIIC_ICFER (RIIC_BASE+0x05)
45: #define RIIC_ICSER (RIIC_BASE+0x06)
46: #define RIIC_ICIER (RIIC_BASE+0x07)
47: #define RIIC_ICSR1 (RIIC_BASE+0x08)
48: #define RIIC_ICSR2 (RIIC_BASE+0x09)
49:
50: #define RIIC_SARL(y) (RIIC_BASE+0x0A+(y<<1))
51: #define RIIC_SARU(y) (RIIC_BASE+0x0B+(y<<1))
52:
53: #define RIIC_ICBRL (RIIC_BASE+ 0x10)
54: #define RIIC_ICBRH (RIIC_BASE+ 0x11)
55: #define RIIC_ICDRT (RIIC_BASE+ 0x12)
56: #define RIIC_ICDRR (RIIC_BASE+ 0x13)
57:
58: #define RIIC_ICCR1_ICE (1<<7)
59: #define RIIC_ICCR1_IICRST (1<<6)
60: #define RIIC_ICCR1_SOWP (1<<4)
61:
62: #define RIIC_IICR2_BBSY (1<<7)
63: #define RIIC_IICR2_ST (1<<1)
64: #define RIIC_IICR2_RS (1<<2)
65: #define RIIC_IICR2_SP (1<<3)
66:
67: #define RIIC_ICMR3_WAIT (1<<6)
68: #define RIIC_ICMR3_ACKWP (1<<4)
69: #define RIIC_ICMR3_ACKBT (1<<3)
70:
71: #define RIIC_ICIER_TIE (1<<7)
72: #define RIIC_ICIER_TEIE (1<<6)
73: #define RIIC_ICIER_RIE (1<<5)
74: #define RIIC_ICIER_NAKIE (1<<4)
75: #define RIIC_ICIER_SPIE (1<<3)
76: #define RIIC_ICIER_STIE (1<<2)
77: #define RIIC_ICIER_ALIE (1<<1)
78: #define RIIC_ICIER_TMOIE (1<<0)
79:
80: #define RIIC_ICSR2_TDRE (1<<7)
81: #define RIIC_ICSR2_TEND (1<<6)
82: #define RIIC_ICSR2_RDRF (1<<5)
83: #define RIIC_ICSR2_NACKF (1<<4)
84: #define RIIC_ICSR2_STOP (1<<3)
85: #define RIIC_ICSR2_START (1<<2)
86: #define RIIC_ICSR2_AL (1<<1)
87: #define RIIC_ICSR2_TMOF (1<<0)
88:
89:
90:
91: #define RIIC_ICMR1_INI (1<<4)
92: #define RIIC_ICBRH_INI (14-1)
93: #define RIIC_ICBRL_INI (21-1)
94:
95: 96: 97:
98: #define INTNO_RIIC_EEI 246
99: #define INTNO_RIIC_RXI 247
100: #define INTNO_RIIC_TXI 248
101: #define INTNO_RIIC_TEI 249
102:
103:
104:
105: #endif