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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [CORTEX_LM3S102_Rowley/] [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 523 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_ICR        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_ICR         0x00000018  // Interrupt clear register
58
 
59
//*****************************************************************************
60
//
61
// The following define the bit fields in the I2C Master Control and Status
62
// register.
63
//
64
//*****************************************************************************
65
#define I2C_MASTER_CS_ACK       0x00000008  // Acknowlegde
66
#define I2C_MASTER_CS_STOP      0x00000004  // Stop
67
#define I2C_MASTER_CS_START     0x00000002  // Start
68
#define I2C_MASTER_CS_RUN       0x00000001  // Run
69
#define I2C_MASTER_CS_BUS_BUSY  0x00000040  // Bus busy
70
#define I2C_MASTER_CS_IDLE      0x00000020  // Idle
71
#define I2C_MASTER_CS_ARB_LOST  0x00000010  // Lost arbitration
72
#define I2C_MASTER_CS_DATA_ACK  0x00000008  // Data byte not acknowledged
73
#define I2C_MASTER_CS_ADDR_ACK  0x00000004  // Address byte not acknowledged
74
#define I2C_MASTER_CS_ERROR     0x00000002  // Error occurred
75
#define I2C_MASTER_CS_BUSY      0x00000001  // Controller is TX/RX data
76
#define I2C_MASTER_CS_ERR_MASK  0x0000001C
77
 
78
//*****************************************************************************
79
//
80
// The following define values used in determining the contents of the I2C
81
// Master Timer Period register.
82
//
83
//*****************************************************************************
84
#define I2C_MASTER_TPR_SCL_HP   0x00000004  // SCL high period
85
#define I2C_MASTER_TPR_SCL_LP   0x00000006  // SCL low period
86
#define I2C_SCL_STANDARD        100000      // SCL standard frequency
87
#define I2C_SCL_FAST            400000      // SCL fast frequency
88
 
89
//*****************************************************************************
90
//
91
// The following define the bit fields in the I2C Master Interrupt Mask
92
// register.
93
//
94
//*****************************************************************************
95
#define I2C_MASTER_IMR_IM       0x00000001  // Master interrupt mask
96
 
97
//*****************************************************************************
98
//
99
// The following define the bit fields in the I2C Master Raw Interrupt Status
100
// register.
101
//
102
//*****************************************************************************
103
#define I2C_MASTER_RIS_RIS      0x00000001  // Master raw interrupt status
104
 
105
//*****************************************************************************
106
//
107
// The following define the bit fields in the I2C Master Masked Interrupt
108
// Status register.
109
//
110
//*****************************************************************************
111
#define I2C_MASTER_MIS_MIS      0x00000001  // Master masked interrupt status
112
 
113
//*****************************************************************************
114
//
115
// The following define the bit fields in the I2C Master Configuration
116
// register.
117
//
118
//*****************************************************************************
119
#define I2C_MASTER_CR_SFE       0x00000020  // Slave function enable
120
#define I2C_MASTER_CR_MFE       0x00000010  // Master function enable
121
#define I2C_MASTER_CR_LPBK      0x00000001  // Loopback enable
122
 
123
//*****************************************************************************
124
//
125
// The following define the bit fields in the I2C Slave Control/Status
126
// register.
127
//
128
//*****************************************************************************
129
#define I2C_SLAVE_CSR_DA        0x00000001  // Enable the device
130
#define I2C_SLAVE_CSR_TREQ      0x00000002  // Transmit request received
131
#define I2C_SLAVE_CSR_RREQ      0x00000001  // Receive data from I2C master
132
 
133
//*****************************************************************************
134
//
135
// The following define the bit fields in the I2C Slave Interrupt Mask
136
// register.
137
//
138
//*****************************************************************************
139
#define I2C_SLAVE_IMR_IM       0x00000001  // Slave interrupt mask
140
 
141
//*****************************************************************************
142
//
143
// The following define the bit fields in the I2C Slave Raw Interrupt Status
144
// register.
145
//
146
//*****************************************************************************
147
#define I2C_SLAVE_RIS_RIS      0x00000001  // Slave raw interrupt status
148
 
149
//*****************************************************************************
150
//
151
// The following define the bit fields in the I2C Slave Masked Interrupt
152
// Status register.
153
//
154
//*****************************************************************************
155
#define I2C_SLAVE_MIS_MIS      0x00000001  // Master masked interrupt status
156
 
157
#endif // __HW_I2C_H__

powered by: WebSVN 2.1.0

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