]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_LM3S316_IAR/hw_include/hw_i2c.h
Remove needs-lock SVN parameter from files in the CORTEX-LM3Sxxxx_IAR_KEIL directory.
[freertos] / Demo / CORTEX_LM3S316_IAR / hw_include / hw_i2c.h
1 //*****************************************************************************\r
2 //\r
3 // hw_i2c.h - Macros used when accessing the I2C master and slave hardware.\r
4 //\r
5 // Copyright (c) 2005,2006 Luminary Micro, Inc.  All rights reserved.\r
6 //\r
7 // Software License Agreement\r
8 //\r
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and\r
10 // exclusively on LMI's Stellaris Family of microcontroller products.\r
11 //\r
12 // The software is owned by LMI and/or its suppliers, and is protected under\r
13 // applicable copyright laws.  All rights are reserved.  Any use in violation\r
14 // of the foregoing restrictions may subject the user to criminal sanctions\r
15 // under applicable laws, as well as to civil liability for the breach of the\r
16 // terms and conditions of this license.\r
17 //\r
18 // THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
19 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
20 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\r
21 // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\r
22 // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\r
23 //\r
24 // This is part of revision 635 of the Stellaris Driver Library.\r
25 //\r
26 //*****************************************************************************\r
27 \r
28 #ifndef __HW_I2C_H__\r
29 #define __HW_I2C_H__\r
30 \r
31 //*****************************************************************************\r
32 //\r
33 // The following define the offsets of the I2C master registers.\r
34 //\r
35 //*****************************************************************************\r
36 #define I2C_MASTER_O_SA         0x00000000  // Slave address register\r
37 #define I2C_MASTER_O_CS         0x00000004  // Control and Status register\r
38 #define I2C_MASTER_O_DR         0x00000008  // Data register\r
39 #define I2C_MASTER_O_TPR        0x0000000C  // Timer period register\r
40 #define I2C_MASTER_O_IMR        0x00000010  // Interrupt mask register\r
41 #define I2C_MASTER_O_RIS        0x00000014  // Raw interrupt status register\r
42 #define I2C_MASTER_O_MIS        0x00000018  // Masked interrupt status reg\r
43 #define I2C_MASTER_O_MICR       0x0000001c  // Interrupt clear register\r
44 #define I2C_MASTER_O_CR         0x00000020  // Configuration register\r
45 \r
46 //*****************************************************************************\r
47 //\r
48 // The following define the offsets of the I2C slave registers.\r
49 //\r
50 //*****************************************************************************\r
51 #define I2C_SLAVE_O_OAR         0x00000000  // Own address register\r
52 #define I2C_SLAVE_O_CSR         0x00000004  // Control/Status register\r
53 #define I2C_SLAVE_O_DR          0x00000008  // Data register\r
54 #define I2C_SLAVE_O_IM          0x0000000C  // Interrupt mask register\r
55 #define I2C_SLAVE_O_RIS         0x00000010  // Raw interrupt status register\r
56 #define I2C_SLAVE_O_MIS         0x00000014  // Masked interrupt status reg\r
57 #define I2C_SLAVE_O_SICR        0x00000018  // Interrupt clear register\r
58 \r
59 //*****************************************************************************\r
60 //\r
61 // The followng define the bit fields in the I2C master slave address register.\r
62 //\r
63 //*****************************************************************************\r
64 #define I2C_MASTER_SA_SA_MASK   0x000000FE  // Slave address\r
65 #define I2C_MASTER_SA_RS        0x00000001  // Receive/send\r
66 #define I2C_MASTER_SA_SA_SHIFT  1\r
67 \r
68 //*****************************************************************************\r
69 //\r
70 // The following define the bit fields in the I2C Master Control and Status\r
71 // register.\r
72 //\r
73 //*****************************************************************************\r
74 #define I2C_MASTER_CS_ACK       0x00000008  // Acknowlegde\r
75 #define I2C_MASTER_CS_STOP      0x00000004  // Stop\r
76 #define I2C_MASTER_CS_START     0x00000002  // Start\r
77 #define I2C_MASTER_CS_RUN       0x00000001  // Run\r
78 #define I2C_MASTER_CS_BUS_BUSY  0x00000040  // Bus busy\r
79 #define I2C_MASTER_CS_IDLE      0x00000020  // Idle\r
80 #define I2C_MASTER_CS_ARB_LOST  0x00000010  // Lost arbitration\r
81 #define I2C_MASTER_CS_DATA_ACK  0x00000008  // Data byte not acknowledged\r
82 #define I2C_MASTER_CS_ADDR_ACK  0x00000004  // Address byte not acknowledged\r
83 #define I2C_MASTER_CS_ERROR     0x00000002  // Error occurred\r
84 #define I2C_MASTER_CS_BUSY      0x00000001  // Controller is TX/RX data\r
85 #define I2C_MASTER_CS_ERR_MASK  0x0000001C\r
86 \r
87 //*****************************************************************************\r
88 //\r
89 // The following define values used in determining the contents of the I2C\r
90 // Master Timer Period register.\r
91 //\r
92 //*****************************************************************************\r
93 #define I2C_MASTER_TPR_SCL_HP   0x00000004  // SCL high period\r
94 #define I2C_MASTER_TPR_SCL_LP   0x00000006  // SCL low period\r
95 #define I2C_SCL_STANDARD        100000      // SCL standard frequency\r
96 #define I2C_SCL_FAST            400000      // SCL fast frequency\r
97 \r
98 //*****************************************************************************\r
99 //\r
100 // The following define the bit fields in the I2C Master Interrupt Mask\r
101 // register.\r
102 //\r
103 //*****************************************************************************\r
104 #define I2C_MASTER_IMR_IM       0x00000001  // Master interrupt mask\r
105 \r
106 //*****************************************************************************\r
107 //\r
108 // The following define the bit fields in the I2C Master Raw Interrupt Status\r
109 // register.\r
110 //\r
111 //*****************************************************************************\r
112 #define I2C_MASTER_RIS_RIS      0x00000001  // Master raw interrupt status\r
113 \r
114 //*****************************************************************************\r
115 //\r
116 // The following define the bit fields in the I2C Master Masked Interrupt\r
117 // Status register.\r
118 //\r
119 //*****************************************************************************\r
120 #define I2C_MASTER_MIS_MIS      0x00000001  // Master masked interrupt status\r
121 \r
122 //*****************************************************************************\r
123 //\r
124 // The following define the bit fields in the I2C Master Interrupt Clear\r
125 // register.\r
126 //\r
127 //*****************************************************************************\r
128 #define I2C_MASTER_MICR_IC      0x00000001  // Master interrupt clear\r
129 \r
130 //*****************************************************************************\r
131 //\r
132 // The following define the bit fields in the I2C Master Configuration\r
133 // register.\r
134 //\r
135 //*****************************************************************************\r
136 #define I2C_MASTER_CR_SFE       0x00000020  // Slave function enable\r
137 #define I2C_MASTER_CR_MFE       0x00000010  // Master function enable\r
138 #define I2C_MASTER_CR_LPBK      0x00000001  // Loopback enable\r
139 \r
140 //*****************************************************************************\r
141 //\r
142 // The following define the bit fields in the I2C Slave Own Address register.\r
143 //\r
144 //*****************************************************************************\r
145 #define I2C_SLAVE_SOAR_OAR_MASK 0x0000007F  // Slave address\r
146 \r
147 //*****************************************************************************\r
148 //\r
149 // The following define the bit fields in the I2C Slave Control/Status\r
150 // register.\r
151 //\r
152 //*****************************************************************************\r
153 #define I2C_SLAVE_CSR_DA        0x00000001  // Enable the device\r
154 #define I2C_SLAVE_CSR_TREQ      0x00000002  // Transmit request received\r
155 #define I2C_SLAVE_CSR_RREQ      0x00000001  // Receive data from I2C master\r
156 \r
157 //*****************************************************************************\r
158 //\r
159 // The following define the bit fields in the I2C Slave Interrupt Mask\r
160 // register.\r
161 //\r
162 //*****************************************************************************\r
163 #define I2C_SLAVE_IMR_IM       0x00000001  // Slave interrupt mask\r
164 \r
165 //*****************************************************************************\r
166 //\r
167 // The following define the bit fields in the I2C Slave Raw Interrupt Status\r
168 // register.\r
169 //\r
170 //*****************************************************************************\r
171 #define I2C_SLAVE_RIS_RIS      0x00000001  // Slave raw interrupt status\r
172 \r
173 //*****************************************************************************\r
174 //\r
175 // The following define the bit fields in the I2C Slave Masked Interrupt\r
176 // Status register.\r
177 //\r
178 //*****************************************************************************\r
179 #define I2C_SLAVE_MIS_MIS      0x00000001  // Slave masked interrupt status\r
180 \r
181 //*****************************************************************************\r
182 //\r
183 // The following define the bit fields in the I2C Slave Interrupt Clear\r
184 // register.\r
185 //\r
186 //*****************************************************************************\r
187 #define I2C_SLAVE_SICR_IC      0x00000001  // Slave interrupt clear\r
188 \r
189 #endif // __HW_I2C_H__\r