OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [CORTEX_LM3S316_IAR/] [hw_include/] [hw_i2c.h] - Blame information for rev 581

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.