1 |
786 |
skrzyp |
#ifndef CYGONCE_HAL_VAR_IO_H
|
2 |
|
|
#define CYGONCE_HAL_VAR_IO_H
|
3 |
|
|
//=============================================================================
|
4 |
|
|
//
|
5 |
|
|
// var_io.h
|
6 |
|
|
//
|
7 |
|
|
// Variant specific registers
|
8 |
|
|
//
|
9 |
|
|
//=============================================================================
|
10 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
11 |
|
|
// -------------------------------------------
|
12 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
13 |
|
|
// Copyright (C) 2011 Free Software Foundation, Inc.
|
14 |
|
|
//
|
15 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
16 |
|
|
// the terms of the GNU General Public License as published by the Free
|
17 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
18 |
|
|
// version.
|
19 |
|
|
//
|
20 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
21 |
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
22 |
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
23 |
|
|
// for more details.
|
24 |
|
|
//
|
25 |
|
|
// You should have received a copy of the GNU General Public License
|
26 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
27 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
28 |
|
|
//
|
29 |
|
|
// As a special exception, if other files instantiate templates or use
|
30 |
|
|
// macros or inline functions from this file, or you compile this file
|
31 |
|
|
// and link it with other works to produce a work based on this file,
|
32 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
33 |
|
|
// the GNU General Public License. However the source code for this file
|
34 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
35 |
|
|
// General Public License v2.
|
36 |
|
|
//
|
37 |
|
|
// This exception does not invalidate any other reasons why a work based
|
38 |
|
|
// on this file might be covered by the GNU General Public License.
|
39 |
|
|
// -------------------------------------------
|
40 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
41 |
|
|
//=============================================================================
|
42 |
|
|
//#####DESCRIPTIONBEGIN####
|
43 |
|
|
//
|
44 |
|
|
// Author(s): ccoutand
|
45 |
|
|
// Date: 2011-01-18
|
46 |
|
|
// Purpose: Stellaris Cortex-M3 variant specific registers
|
47 |
|
|
// Description:
|
48 |
|
|
// Usage: #include <cyg/hal/var_io.h>
|
49 |
|
|
//
|
50 |
|
|
//####DESCRIPTIONEND####
|
51 |
|
|
//
|
52 |
|
|
//=============================================================================
|
53 |
|
|
|
54 |
|
|
#include <pkgconf/hal_cortexm_lm3s.h>
|
55 |
|
|
|
56 |
|
|
#include <cyg/hal/plf_io.h>
|
57 |
|
|
|
58 |
|
|
//=============================================================================
|
59 |
|
|
// Peripherals
|
60 |
|
|
|
61 |
|
|
#define CYGHWR_HAL_LM3S_FLASH 0x00000000
|
62 |
|
|
#define CYGHWR_HAL_LM3S_SRAM 0x20000000
|
63 |
|
|
|
64 |
|
|
#define CYGHWR_HAL_LM3S_WDT0 0x40000000
|
65 |
|
|
#define CYGHWR_HAL_LM3S_GPIOA 0x40004000
|
66 |
|
|
#define CYGHWR_HAL_LM3S_GPIOB 0x40005000
|
67 |
|
|
#define CYGHWR_HAL_LM3S_GPIOC 0x40006000
|
68 |
|
|
#define CYGHWR_HAL_LM3S_GPIOD 0x40007000
|
69 |
|
|
#define CYGHWR_HAL_LM3S_SSI0 0x40008000
|
70 |
|
|
#define CYGHWR_HAL_LM3S_SSI1 0x40009000
|
71 |
|
|
#define CYGHWR_HAL_LM3S_UART0 0x4000C000
|
72 |
|
|
#define CYGHWR_HAL_LM3S_UART1 0x4000D000
|
73 |
|
|
#define CYGHWR_HAL_LM3S_UART2 0x4000E000
|
74 |
|
|
#define CYGHWR_HAL_LM3S_I2C_M0 0x40020000
|
75 |
|
|
#define CYGHWR_HAL_LM3S_I2C_S0 0x40020800
|
76 |
|
|
#define CYGHWR_HAL_LM3S_GPIOE 0x40024000
|
77 |
|
|
#define CYGHWR_HAL_LM3S_GPIOF 0x40025000
|
78 |
|
|
#define CYGHWR_HAL_LM3S_GPIOG 0x40026000
|
79 |
|
|
#define CYGHWR_HAL_LM3S_GPIOH 0x40027000
|
80 |
|
|
#define CYGHWR_HAL_LM3S_PWM 0x40028000
|
81 |
|
|
#define CYGHWR_HAL_LM3S_QEI0 0x4002C000
|
82 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM0 0x40030000
|
83 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM1 0x40031000
|
84 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM2 0x40032000
|
85 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM3 0x40033000
|
86 |
|
|
#define CYGHWR_HAL_LM3S_ADC0 0x40038000
|
87 |
|
|
#define CYGHWR_HAL_LM3S_AC 0x4003C000
|
88 |
|
|
#define CYGHWR_HAL_LM3S_CAN0 0x40040000
|
89 |
|
|
#define CYGHWR_HAL_LM3S_ETH0 0x40048000
|
90 |
|
|
#define CYGHWR_HAL_LM3S_FMC 0x400FD000
|
91 |
|
|
#define CYGHWR_HAL_LM3S_SC 0x400FE000
|
92 |
|
|
|
93 |
|
|
#define CYGHWR_HAL_LM3S_ITM 0xE0000000
|
94 |
|
|
#define CYGHWR_HAL_LM3S_DWT 0xE0001000
|
95 |
|
|
#define CYGHWR_HAL_LM3S_FPB 0xE0002000
|
96 |
|
|
#define CYGHWR_HAL_LM3S_CORTEXM3 0xE000E000
|
97 |
|
|
#define CYGHWR_HAL_LM3S_TPIU 0xE0040000
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
//=============================================================================
|
101 |
|
|
// Device signature and ID registers
|
102 |
|
|
|
103 |
|
|
#define CYGHWR_HAL_LM3S_MCU_ID (CYGHWR_HAL_LM3S_CORTEXM3 + 0xD00)
|
104 |
|
|
#define CYGHWR_HAL_LM3S_MCU_ID_REV(__x) ((__x)&0xF)
|
105 |
|
|
#define CYGHWR_HAL_LM3S_MCU_PART_NO(__x) (((__x)>>4)&0x0FFF)
|
106 |
|
|
#define CYGHWR_HAL_LM3S_MCU_VAR_NO(__x) (((__x)>>20)&0xF)
|
107 |
|
|
|
108 |
|
|
|
109 |
|
|
//=============================================================================
|
110 |
|
|
// System Control
|
111 |
|
|
|
112 |
|
|
#define CYGHWR_HAL_LM3S_SC_DID0 0x000
|
113 |
|
|
#define CYGHWR_HAL_LM3S_SC_DID1 0x004
|
114 |
|
|
#define CYGHWR_HAL_LM3S_SC_DIC0 0x008
|
115 |
|
|
#define CYGHWR_HAL_LM3S_SC_DIC1 0x010
|
116 |
|
|
#define CYGHWR_HAL_LM3S_SC_DIC2 0x014
|
117 |
|
|
#define CYGHWR_HAL_LM3S_SC_DIC3 0x018
|
118 |
|
|
#define CYGHWR_HAL_LM3S_SC_DIC4 0x01c
|
119 |
|
|
#define CYGHWR_HAL_LM3S_SC_PBORCTL 0x030
|
120 |
|
|
#define CYGHWR_HAL_LM3S_SC_LDORCTL 0x034
|
121 |
|
|
#define CYGHWR_HAL_LM3S_SC_SRCR0 0x040
|
122 |
|
|
#define CYGHWR_HAL_LM3S_SC_SRCR1 0x044
|
123 |
|
|
#define CYGHWR_HAL_LM3S_SC_SRCR2 0x048
|
124 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS 0x050
|
125 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC 0x054
|
126 |
|
|
#define CYGHWR_HAL_LM3S_SC_MISC 0x058
|
127 |
|
|
#define CYGHWR_HAL_LM3S_SC_RESC 0x05C
|
128 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC 0x060
|
129 |
|
|
#define CYGHWR_HAL_LM3S_SC_PLLCFG 0x064
|
130 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC0 0x100
|
131 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1 0x104
|
132 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC2 0x108
|
133 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC0 0x110
|
134 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1 0x114
|
135 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC2 0x118
|
136 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC0 0x120
|
137 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1 0x124
|
138 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC2 0x128
|
139 |
|
|
#define CYGHWR_HAL_LM3S_SC_FMPRE 0x130
|
140 |
|
|
#define CYGHWR_HAL_LM3S_SC_FMPPE 0x134
|
141 |
|
|
#define CYGHWR_HAL_LM3S_SC_USECRL 0x140
|
142 |
|
|
#define CYGHWR_HAL_LM3S_SC_DSLPCLKCFG 0x144
|
143 |
|
|
#define CYGHWR_HAL_LM3S_SC_CLKVCLR 0x150
|
144 |
|
|
#define CYGHWR_HAL_LM3S_SC_LDOARST 0x160
|
145 |
|
|
|
146 |
|
|
// PBORCTL bits
|
147 |
|
|
#define CYGHWR_HAL_LM3S_SC_PBORCTL_BORWT BIT_(0)
|
148 |
|
|
#define CYGHWR_HAL_LM3S_SC_PBORCTL_BORIOR BIT_(1)
|
149 |
|
|
#define CYGHWR_HAL_LM3S_SC_PBORCTL_BORTIM(__x) VALUE_(2,__x)
|
150 |
|
|
|
151 |
|
|
// RIS bits
|
152 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS_PLLFRIS BIT_(0)
|
153 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS_BORRIS BIT_(1)
|
154 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS_LDORIS BIT_(2)
|
155 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS_MOFRIS BIT_(3)
|
156 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS_IOFRIS BIT_(4)
|
157 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS_CLFRIS BIT_(5)
|
158 |
|
|
#define CYGHWR_HAL_LM3S_SC_RIS_PLLLRIS BIT_(6)
|
159 |
|
|
|
160 |
|
|
// IMC bits
|
161 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC_PLLFIM BIT_(0)
|
162 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC_BORRIM BIT_(1)
|
163 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC_LDOIM BIT_(2)
|
164 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC_MOFIM BIT_(3)
|
165 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC_IOFIM BIT_(4)
|
166 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC_CLIM BIT_(5)
|
167 |
|
|
#define CYGHWR_HAL_LM3S_SC_IMC_PLLLFIM BIT_(6)
|
168 |
|
|
|
169 |
|
|
// MISC bits
|
170 |
|
|
#define CYGHWR_HAL_LM3S_SC_MISC_BORMIS BIT_(1)
|
171 |
|
|
#define CYGHWR_HAL_LM3S_SC_MISC_LDOMIS BIT_(2)
|
172 |
|
|
#define CYGHWR_HAL_LM3S_SC_MISC_MOFMIS BIT_(3)
|
173 |
|
|
#define CYGHWR_HAL_LM3S_SC_MISC_IOFMIS BIT_(4)
|
174 |
|
|
#define CYGHWR_HAL_LM3S_SC_MISC_CLMIS BIT_(5)
|
175 |
|
|
#define CYGHWR_HAL_LM3S_SC_MISC_PLLLMIS BIT_(6)
|
176 |
|
|
|
177 |
|
|
// RESC bits
|
178 |
|
|
#define CYGHWR_HAL_LM3S_SC_RESC_EXT BIT_(0)
|
179 |
|
|
#define CYGHWR_HAL_LM3S_SC_RESC_POR BIT_(1)
|
180 |
|
|
#define CYGHWR_HAL_LM3S_SC_RESC_BOR BIT_(2)
|
181 |
|
|
#define CYGHWR_HAL_LM3S_SC_RESC_WDT BIT_(3)
|
182 |
|
|
#define CYGHWR_HAL_LM3S_SC_RESC_SW BIT_(4)
|
183 |
|
|
#define CYGHWR_HAL_LM3S_SC_RESC_LDO BIT_(5)
|
184 |
|
|
|
185 |
|
|
// RCC bits
|
186 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_MOSCDIS BIT_(0)
|
187 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_IOSCDIS BIT_(1)
|
188 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_MOSCVER BIT_(2)
|
189 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_IOSCVER BIT_(3)
|
190 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_OSCSRC_MOSC VALUE_(4,0)
|
191 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_OSCSRC_IOSC VALUE_(4,1)
|
192 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_OSCSRC_IOSC_DIV4 VALUE_(4,2)
|
193 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_OSCSRC_MASK 0x00000030
|
194 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_XTAL(__x) VALUE_(6,__x)
|
195 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_XTAL_MASK 0x000003C0
|
196 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PLLVER BIT_(10)
|
197 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_BYPASS BIT_(11)
|
198 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_OEN BIT_(12)
|
199 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PWRDN BIT_(13)
|
200 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PWMDIV_DIV2 VALUE_(14, 0x0)
|
201 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PWMDIV_DIV4 VALUE_(14, 0x1)
|
202 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PWMDIV_DIV8 VALUE_(14, 0x2)
|
203 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PWMDIV_DIV16 VALUE_(14, 0x3)
|
204 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PWMDIV_DIV32 VALUE_(14, 0x4)
|
205 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_PWMDIV_DIV64 VALUE_(14, 0x5)
|
206 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_USEPWMDIV BIT_(20)
|
207 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_USESYSDIV BIT_(22)
|
208 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_SYSDIV(__x) VALUE_(23, __x)
|
209 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_SYSDIV_MASK 0x07800000
|
210 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCC_ACG BIT_(27)
|
211 |
|
|
|
212 |
|
|
// DSLPCLKCFG bits
|
213 |
|
|
#define CYGHWR_HAL_LM3S_SC_DSLPCLKCFG_IOSC BIT_(0)
|
214 |
|
|
|
215 |
|
|
// CLKVCLR bits
|
216 |
|
|
#define CYGHWR_HAL_LM3S_SC_CLKVCLR_VERCLR BIT_(0)
|
217 |
|
|
|
218 |
|
|
// LDOARST bits
|
219 |
|
|
#define CYGHWR_HAL_LM3S_SC_LDOARST_BIT BIT_(0)
|
220 |
|
|
|
221 |
|
|
// RCGC0 bits
|
222 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC0_WDT0 BIT_(3)
|
223 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC0_MAXADCSPD_125K VALUE_(8, 0x0)
|
224 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC0_MAXADCSPD_250K VALUE_(8, 0x1)
|
225 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC0_MAXADCSPD_500K VALUE_(8, 0x2)
|
226 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC0_ADC0 BIT_(16)
|
227 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC0_PWM0 BIT_(20)
|
228 |
|
|
|
229 |
|
|
// SCGC0 bits
|
230 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC0_WDT0 BIT_(3)
|
231 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC0_MAXADCSPD_125K VALUE_(8, 0x0)
|
232 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC0_MAXADCSPD_250K VALUE_(8, 0x1)
|
233 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC0_MAXADCSPD_500K VALUE_(8, 0x2)
|
234 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC0_ADC0 BIT_(16)
|
235 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC0_PWM0 BIT_(20)
|
236 |
|
|
|
237 |
|
|
// DCGC0 bits
|
238 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC0_WDT0 BIT_(3)
|
239 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC0_ADC0 BIT_(16)
|
240 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC0_PWM0 BIT_(20)
|
241 |
|
|
|
242 |
|
|
// RCGC1 bits
|
243 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_UART0 BIT_(0)
|
244 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_UART1 BIT_(1)
|
245 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_SSI0 BIT_(4)
|
246 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_I2C0 BIT_(12)
|
247 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_TIMER0 BIT_(16)
|
248 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_TIMER1 BIT_(17)
|
249 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_TIMER2 BIT_(18)
|
250 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC1_COMP0 BIT_(24)
|
251 |
|
|
|
252 |
|
|
// SCSG1 bits
|
253 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_UART0 BIT_(0)
|
254 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_UART1 BIT_(1)
|
255 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_SSI0 BIT_(4)
|
256 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_I2C0 BIT_(12)
|
257 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_TIMER0 BIT_(16)
|
258 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_TIMER1 BIT_(17)
|
259 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_TIMER2 BIT_(18)
|
260 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC1_COMP0 BIT_(24)
|
261 |
|
|
|
262 |
|
|
// DCSG1 bits
|
263 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_UART0 BIT_(0)
|
264 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_UART1 BIT_(1)
|
265 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_SSI0 BIT_(4)
|
266 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_I2C0 BIT_(12)
|
267 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_TIMER0 BIT_(16)
|
268 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_TIMER1 BIT_(17)
|
269 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_TIMER2 BIT_(18)
|
270 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC1_COMP0 BIT_(24)
|
271 |
|
|
|
272 |
|
|
// RCGC2 bits
|
273 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC2_GPIOA BIT_(0)
|
274 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC2_GPIOB BIT_(1)
|
275 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC2_GPIOC BIT_(2)
|
276 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC2_GPIOD BIT_(3)
|
277 |
|
|
#define CYGHWR_HAL_LM3S_SC_RCGC2_GPIOE BIT_(4)
|
278 |
|
|
|
279 |
|
|
// SCSG2 bits
|
280 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC2_GPIOA BIT_(0)
|
281 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC2_GPIOB BIT_(1)
|
282 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC2_GPIOC BIT_(2)
|
283 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC2_GPIOD BIT_(3)
|
284 |
|
|
#define CYGHWR_HAL_LM3S_SC_SCGC2_GPIOE BIT_(4)
|
285 |
|
|
|
286 |
|
|
// DCSG2 bits
|
287 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC2_GPIOA BIT_(0)
|
288 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC2_GPIOB BIT_(1)
|
289 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC2_GPIOC BIT_(2)
|
290 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC2_GPIOD BIT_(3)
|
291 |
|
|
#define CYGHWR_HAL_LM3S_SC_DCGC2_GPIOE BIT_(4)
|
292 |
|
|
|
293 |
|
|
// Define peripheral
|
294 |
|
|
#define CYGHWR_HAL_LM3S_PERIPH_GC0 BIT_(31)
|
295 |
|
|
#define CYGHWR_HAL_LM3S_P_WDT0 ( BIT_(31) | CYGHWR_HAL_LM3S_SC_SCGC0_WDT0 )
|
296 |
|
|
#define CYGHWR_HAL_LM3S_P_ADC0 ( BIT_(31) | CYGHWR_HAL_LM3S_SC_SCGC0_ADC0 )
|
297 |
|
|
#define CYGHWR_HAL_LM3S_P_PWM ( BIT_(31) | CYGHWR_HAL_LM3S_SC_SCGC0_PWM0 )
|
298 |
|
|
#define CYGHWR_HAL_LM3S_PERIPH_GC1 BIT_(30)
|
299 |
|
|
#define CYGHWR_HAL_LM3S_P_UART0 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_UART0 )
|
300 |
|
|
#define CYGHWR_HAL_LM3S_P_UART1 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_UART1 )
|
301 |
|
|
#define CYGHWR_HAL_LM3S_P_SSI0 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_SSI0 )
|
302 |
|
|
#define CYGHWR_HAL_LM3S_P_I2C0 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_I2C0 )
|
303 |
|
|
#define CYGHWR_HAL_LM3S_P_TIMER0 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_TIMER0 )
|
304 |
|
|
#define CYGHWR_HAL_LM3S_P_TIMER1 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_TIMER1 )
|
305 |
|
|
#define CYGHWR_HAL_LM3S_P_TIMER2 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_TIMER2 )
|
306 |
|
|
#define CYGHWR_HAL_LM3S_P_COMP0 ( BIT_(30) | CYGHWR_HAL_LM3S_SC_SCGC1_COMP0 )
|
307 |
|
|
#define CYGHWR_HAL_LM3S_PERIPH_GC2 BIT_(29)
|
308 |
|
|
#define CYGHWR_HAL_LM3S_P_GPIOA ( BIT_(29) | CYGHWR_HAL_LM3S_SC_RCGC2_GPIOA )
|
309 |
|
|
#define CYGHWR_HAL_LM3S_P_GPIOB ( BIT_(29) | CYGHWR_HAL_LM3S_SC_RCGC2_GPIOB )
|
310 |
|
|
#define CYGHWR_HAL_LM3S_P_GPIOC ( BIT_(29) | CYGHWR_HAL_LM3S_SC_RCGC2_GPIOC )
|
311 |
|
|
#define CYGHWR_HAL_LM3S_P_GPIOD ( BIT_(29) | CYGHWR_HAL_LM3S_SC_RCGC2_GPIOD )
|
312 |
|
|
#define CYGHWR_HAL_LM3S_P_GPIOE ( BIT_(29) | CYGHWR_HAL_LM3S_SC_RCGC2_GPIOE )
|
313 |
|
|
|
314 |
|
|
__externC void hal_lm3s_periph_set( cyg_uint32 periph, cyg_uint32 on_off );
|
315 |
|
|
|
316 |
|
|
#define CYGHWR_HAL_LM3S_PERIPH_SET(__periph, __on_off ) hal_lm3s_periph_set( __periph, __on_off )
|
317 |
|
|
|
318 |
|
|
//=============================================================================
|
319 |
|
|
// Watchdog
|
320 |
|
|
|
321 |
|
|
#define CYGHWR_HAL_LM3S_WDT_LOAD 0x000
|
322 |
|
|
#define CYGHWR_HAL_LM3S_WDT_VALUE 0x004
|
323 |
|
|
#define CYGHWR_HAL_LM3S_WDT_CTL 0x008
|
324 |
|
|
#define CYGHWR_HAL_LM3S_WDT_ICR 0x00c
|
325 |
|
|
#define CYGHWR_HAL_LM3S_WDT_RIS 0x010
|
326 |
|
|
#define CYGHWR_HAL_LM3S_WDT_MIS 0x014
|
327 |
|
|
#define CYGHWR_HAL_LM3S_WDT_TEST 0x418
|
328 |
|
|
#define CYGHWR_HAL_LM3S_WDT_LOCK 0xc00
|
329 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID4 0xfd0
|
330 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID5 0xfd4
|
331 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID6 0xfd8
|
332 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID7 0xfdc
|
333 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID0 0xfe0
|
334 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID1 0xfe4
|
335 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID2 0xfe8
|
336 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID3 0xfec
|
337 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PCID0 0xff0
|
338 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PCID1 0xff4
|
339 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PCID2 0xff8
|
340 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PCID3 0xffc
|
341 |
|
|
|
342 |
|
|
|
343 |
|
|
#define CYGHWR_HAL_LM3S_WDT_CTL_INTEN BIT_(0)
|
344 |
|
|
#define CYGHWR_HAL_LM3S_WDT_CTL_RESEN BIT_(1)
|
345 |
|
|
|
346 |
|
|
#define CYGHWR_HAL_LM3S_WDT_RIS_RIS BIT_(0)
|
347 |
|
|
|
348 |
|
|
#define CYGHWR_HAL_LM3S_WDT_MIS_MIS BIT_(0)
|
349 |
|
|
|
350 |
|
|
#define CYGHWR_HAL_LM3S_WDT_TEST_STALL BIT_(8)
|
351 |
|
|
|
352 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PID(__x) ((__x)&0xFF)
|
353 |
|
|
#define CYGHWR_HAL_LM3S_WDT_PCID(__x) ((__x)&0xFF)
|
354 |
|
|
|
355 |
|
|
|
356 |
|
|
//=============================================================================
|
357 |
|
|
// GPIO ports
|
358 |
|
|
|
359 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DATA 0x000
|
360 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DIR 0x400
|
361 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IS 0x404
|
362 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IBE 0x408
|
363 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IEV 0x40c
|
364 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IM 0x410
|
365 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_RIS 0x414
|
366 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_MIS 0x418
|
367 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_ICR 0x41c
|
368 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_AFSEL 0x420
|
369 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DR2R 0x500
|
370 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DR4R 0x504
|
371 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DR8R 0x508
|
372 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_ODR 0x50c
|
373 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PUR 0x510
|
374 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PDR 0x514
|
375 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_SLR 0x518
|
376 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DEN 0x51c
|
377 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID4 0xfd0
|
378 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID5 0xfd4
|
379 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID6 0xfd8
|
380 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID7 0xfdc
|
381 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID0 0xfe0
|
382 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID1 0xfe4
|
383 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID2 0xfe8
|
384 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PID3 0xfec
|
385 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PCID0 0xff0
|
386 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PCID1 0xff4
|
387 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PCID2 0xff8
|
388 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PCID3 0xffc
|
389 |
|
|
|
390 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DIR_IN VALUE_(0,0) // Input mode
|
391 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_DIR_OUT VALUE_(0,1) // Output mode
|
392 |
|
|
|
393 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IS_EDGE_SENSE VALUE_(0,0) // Interrupt edge sensitive
|
394 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IS_LEV_SENSE VALUE_(0,1) // Interrupt level sensitive
|
395 |
|
|
|
396 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IBE_GPIOIEV VALUE_(0,0) // Interrupt control from GPIOIEV
|
397 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IBE_BOTH_EDGE VALUE_(0,1) // Both edges can trigger interrupt
|
398 |
|
|
|
399 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IEV_LOW VALUE_(0,0) // Falling edge or low triggers interrupt
|
400 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IEV_HIGH VALUE_(0,1) // Rising edge or low triggers interrupt
|
401 |
|
|
|
402 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IM_MASK VALUE_(0,0) // Interrupt is masked
|
403 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IM_UMASK VALUE_(0,1)
|
404 |
|
|
|
405 |
|
|
// HAL definitions
|
406 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_MODE_IN VALUE_(0,0) // Input mode
|
407 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_MODE_OUT VALUE_(0,1) // Output mode
|
408 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_MODE_PERIPH VALUE_(0,2) // Peripheral function mode
|
409 |
|
|
|
410 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_STRENGTH_NONE VALUE_(2,0) // Strength not specified
|
411 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_STRENGTH_2_MA VALUE_(2,1) // Strength 2 mA
|
412 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_STRENGTH_4_MA VALUE_(2,2) // Strength 4 mA
|
413 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_STRENGTH_8_MA VALUE_(2,3) // Strength 8 mA
|
414 |
|
|
|
415 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CNF_NONE VALUE_(4,0) // Configuration not specified
|
416 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CNF_PULLUP VALUE_(4,1) // Pull-up
|
417 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CNF_PULLDOWN VALUE_(4,2) // Pull-down
|
418 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CNF_OP VALUE_(4,3) // Open-drain
|
419 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CNF_OP_PULLUP VALUE_(4,4) // Open-drain / Pull-up
|
420 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CNF_OP_PULLDOWN VALUE_(4,5) // Open-drain / Pull-down
|
421 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CNF_AIN VALUE_(4,6) // Analog
|
422 |
|
|
|
423 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IRQ_DISABLE VALUE_(9,0) // Interrupt disable
|
424 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IRQ_FALLING_EDGE VALUE_(9,1) // Interrupt on falling edge
|
425 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IRQ_RISING_EDGE VALUE_(9,2) // Interrupt on rising edge
|
426 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IRQ_BOTH_EDGES VALUE_(9,3) // Interrupt on both edges
|
427 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IRQ_LOW_LEVEL VALUE_(9,4) // Interrupt on low level
|
428 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IRQ_HIGH_LEVEL VALUE_(9,5) // Interrupt on high level
|
429 |
|
|
|
430 |
|
|
// This macro packs the port number, bit number, mode, strength, irq and
|
431 |
|
|
// configuration for a GPIO pin into a single word.
|
432 |
|
|
// The packing puts:
|
433 |
|
|
|
434 |
|
|
#define CYGHWR_HAL_LM3S_GPIO( \
|
435 |
|
|
__port, \
|
436 |
|
|
__bit, \
|
437 |
|
|
__mode, \
|
438 |
|
|
__strength, \
|
439 |
|
|
__cnf, \
|
440 |
|
|
__irq) \
|
441 |
|
|
( \
|
442 |
|
|
(CYGHWR_HAL_LM3S_GPIO ## __port - CYGHWR_HAL_LM3S_GPIOA) | \
|
443 |
|
|
(__bit << 24) | \
|
444 |
|
|
(CYGHWR_HAL_LM3S_GPIO_MODE_ ## __mode) | \
|
445 |
|
|
(CYGHWR_HAL_LM3S_GPIO_STRENGTH_ ## __strength) | \
|
446 |
|
|
(CYGHWR_HAL_LM3S_GPIO_IRQ_ ## __irq) | \
|
447 |
|
|
(CYGHWR_HAL_LM3S_GPIO_CNF_ ## __cnf) \
|
448 |
|
|
)
|
449 |
|
|
|
450 |
|
|
// Macros to extract encoded values
|
451 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_PORT(__pin) (CYGHWR_HAL_LM3S_GPIOA+((__pin)&0x000FF000))
|
452 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_BIT(__pin) (((__pin)>>24)&0x07)
|
453 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_MODE(__pin) ((__pin)&0x0003)
|
454 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_STRENGTH(__pin) ((__pin)&VALUE_(2,3))
|
455 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_CFG(__pin) ((__pin)&VALUE_(4,7))
|
456 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IRQ(__pin) ((__pin)&VALUE_(9,7))
|
457 |
|
|
|
458 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_NONE (0xFFFFFFFF)
|
459 |
|
|
|
460 |
|
|
|
461 |
|
|
// Functions and macros to configure GPIO ports.
|
462 |
|
|
|
463 |
|
|
__externC void hal_lm3s_gpio_set( cyg_uint32 pin );
|
464 |
|
|
__externC void hal_lm3s_gpio_out( cyg_uint32 pin, int val );
|
465 |
|
|
__externC void hal_lm3s_gpio_in ( cyg_uint32 pin, int *val );
|
466 |
|
|
|
467 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_SET(__pin ) hal_lm3s_gpio_set( __pin )
|
468 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_OUT(__pin, __val ) hal_lm3s_gpio_out( __pin, __val )
|
469 |
|
|
#define CYGHWR_HAL_LM3S_GPIO_IN(__pin, __val ) hal_lm3s_gpio_in( __pin, __val )
|
470 |
|
|
|
471 |
|
|
|
472 |
|
|
//=============================================================================
|
473 |
|
|
// UARTs
|
474 |
|
|
|
475 |
|
|
#define CYGHWR_HAL_LM3S_UART_DR 0x000
|
476 |
|
|
#define CYGHWR_HAL_LM3S_UART_SR 0x004
|
477 |
|
|
#define CYGHWR_HAL_LM3S_UART_FR 0x018
|
478 |
|
|
#define CYGHWR_HAL_LM3S_UART_IBRD 0x024
|
479 |
|
|
#define CYGHWR_HAL_LM3S_UART_FBRD 0x028
|
480 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH 0x02c
|
481 |
|
|
#define CYGHWR_HAL_LM3S_UART_CTL 0x030
|
482 |
|
|
#define CYGHWR_HAL_LM3S_UART_IFLS 0x034
|
483 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM 0x038
|
484 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS 0x03c
|
485 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS 0x040
|
486 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR 0x044
|
487 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID4 0xfd0
|
488 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID5 0xfd4
|
489 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID6 0xfd8
|
490 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID7 0xfdc
|
491 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID0 0xfe0
|
492 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID1 0xfe4
|
493 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID2 0xfe8
|
494 |
|
|
#define CYGHWR_HAL_LM3S_UART_PID3 0xfec
|
495 |
|
|
#define CYGHWR_HAL_LM3S_UART_PCID0 0xff0
|
496 |
|
|
#define CYGHWR_HAL_LM3S_UART_PCID1 0xff4
|
497 |
|
|
#define CYGHWR_HAL_LM3S_UART_PCID2 0xff8
|
498 |
|
|
#define CYGHWR_HAL_LM3S_UART_PCID3 0xffc
|
499 |
|
|
|
500 |
|
|
|
501 |
|
|
// DR Bits
|
502 |
|
|
#define CYGHWR_HAL_LM3S_UART_DR_FE BIT_(8)
|
503 |
|
|
#define CYGHWR_HAL_LM3S_UART_DR_PE BIT_(9)
|
504 |
|
|
#define CYGHWR_HAL_LM3S_UART_DR_BE BIT_(10)
|
505 |
|
|
#define CYGHWR_HAL_LM3S_UART_DR_OE BIT_(11)
|
506 |
|
|
|
507 |
|
|
// SR Bits
|
508 |
|
|
#define CYGHWR_HAL_LM3S_UART_SR_FE BIT_(0)
|
509 |
|
|
#define CYGHWR_HAL_LM3S_UART_SR_PE BIT_(1)
|
510 |
|
|
#define CYGHWR_HAL_LM3S_UART_SR_BE BIT_(2)
|
511 |
|
|
#define CYGHWR_HAL_LM3S_UART_SR_OE BIT_(3)
|
512 |
|
|
|
513 |
|
|
// FR bits
|
514 |
|
|
#define CYGHWR_HAL_LM3S_UART_FR_BUSY BIT_(3)
|
515 |
|
|
#define CYGHWR_HAL_LM3S_UART_FR_RXFE BIT_(4)
|
516 |
|
|
#define CYGHWR_HAL_LM3S_UART_FR_TXFF BIT_(5)
|
517 |
|
|
#define CYGHWR_HAL_LM3S_UART_FR_RXFF BIT_(6)
|
518 |
|
|
#define CYGHWR_HAL_LM3S_UART_FR_TXFE BIT_(7)
|
519 |
|
|
|
520 |
|
|
// LCRH bits
|
521 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_BRK BIT_(0)
|
522 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_PEN BIT_(1)
|
523 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_EPS BIT_(2)
|
524 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_STP2 BIT_(3)
|
525 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_FEN BIT_(4)
|
526 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_WLEN(__x) VALUE_(5,__x)
|
527 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_WLEN_MASK 0x00000060
|
528 |
|
|
#define CYGHWR_HAL_LM3S_UART_LCRH_SPS BIT_(7)
|
529 |
|
|
|
530 |
|
|
// CTL bits
|
531 |
|
|
#define CYGHWR_HAL_LM3S_UART_CTL_UARTEN BIT_(0)
|
532 |
|
|
#define CYGHWR_HAL_LM3S_UART_CTL_LBE BIT_(7)
|
533 |
|
|
#define CYGHWR_HAL_LM3S_UART_CTL_TXE BIT_(8)
|
534 |
|
|
#define CYGHWR_HAL_LM3S_UART_CTL_RXE BIT_(9)
|
535 |
|
|
|
536 |
|
|
// IFLS bits
|
537 |
|
|
#define CYGHWR_HAL_LM3S_UART_IFLS_RXIFLSEL(__x) VALUE_(0,__x)
|
538 |
|
|
#define CYGHWR_HAL_LM3S_UART_IFLS_RXIFLSEL_MASK 0x00000007
|
539 |
|
|
#define CYGHWR_HAL_LM3S_UART_IFLS_TXIFLSEL(__x) VALUE_(3,__x)
|
540 |
|
|
#define CYGHWR_HAL_LM3S_UART_IFLS_TXIFLSEL_MASK 0x00000038
|
541 |
|
|
|
542 |
|
|
// IM bits
|
543 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM_RXIM BIT_(4)
|
544 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM_TXIM BIT_(5)
|
545 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM_RTIM BIT_(6)
|
546 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM_FEIM BIT_(7)
|
547 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM_PEIM BIT_(8)
|
548 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM_BEIM BIT_(9)
|
549 |
|
|
#define CYGHWR_HAL_LM3S_UART_IM_OEIM BIT_(10)
|
550 |
|
|
|
551 |
|
|
// RIS bits
|
552 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS_RXRIS BIT_(4)
|
553 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS_TXRIS BIT_(5)
|
554 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS_RTRIS BIT_(6)
|
555 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS_FERIS BIT_(7)
|
556 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS_PERIS BIT_(8)
|
557 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS_BERIS BIT_(9)
|
558 |
|
|
#define CYGHWR_HAL_LM3S_UART_RIS_OERIS BIT_(10)
|
559 |
|
|
|
560 |
|
|
// MIS bits
|
561 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS_RXMIS BIT_(4)
|
562 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS_TXMIS BIT_(5)
|
563 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS_RTMIS BIT_(6)
|
564 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS_FEMIS BIT_(7)
|
565 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS_PEMIS BIT_(8)
|
566 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS_BEMIS BIT_(9)
|
567 |
|
|
#define CYGHWR_HAL_LM3S_UART_MIS_OEMIS BIT_(10)
|
568 |
|
|
|
569 |
|
|
// ICR bits
|
570 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR_RXIC BIT_(4)
|
571 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR_TXIC BIT_(5)
|
572 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR_RTIC BIT_(6)
|
573 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR_FEIC BIT_(7)
|
574 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR_PEIC BIT_(8)
|
575 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR_BEIC BIT_(9)
|
576 |
|
|
#define CYGHWR_HAL_LM3S_UART_ICR_OEIC BIT_(10)
|
577 |
|
|
|
578 |
|
|
// UARTO shall be connected to PortA 0/1 on all device
|
579 |
|
|
#ifndef CYGHWR_HAL_LM3S_UART0_TX
|
580 |
|
|
# define CYGHWR_HAL_LM3S_UART0_TX CYGHWR_HAL_LM3S_GPIO( A, 0, PERIPH, NONE, NONE, DISABLE )
|
581 |
|
|
#endif
|
582 |
|
|
#ifndef CYGHWR_HAL_LM3S_UART0_RX
|
583 |
|
|
# define CYGHWR_HAL_LM3S_UART0_RX CYGHWR_HAL_LM3S_GPIO( A, 1, PERIPH, NONE, NONE, DISABLE )
|
584 |
|
|
#endif
|
585 |
|
|
#ifndef CYGHWR_HAL_LM3S_P_UART0_GPIO
|
586 |
|
|
# define CYGHWR_HAL_LM3S_P_UART0_GPIO CYGHWR_HAL_LM3S_P_GPIOA
|
587 |
|
|
#endif
|
588 |
|
|
|
589 |
|
|
#ifndef __ASSEMBLER__
|
590 |
|
|
|
591 |
|
|
__externC void hal_lm3s_uart_setbaud( CYG_ADDRESS uart, cyg_uint32 baud );
|
592 |
|
|
|
593 |
|
|
#endif
|
594 |
|
|
|
595 |
|
|
//=============================================================================
|
596 |
|
|
// ADCs
|
597 |
|
|
|
598 |
|
|
#ifdef CYGHWR_HAL_LM3S_ADC0_CHAN
|
599 |
|
|
|
600 |
|
|
#define CYGHWR_HAL_LM3S_ADC_ACTSS 0x0
|
601 |
|
|
#define CYGHWR_HAL_LM3S_ADC_RIS 0x4
|
602 |
|
|
#define CYGHWR_HAL_LM3S_ADC_IMR 0x8
|
603 |
|
|
#define CYGHWR_HAL_LM3S_ADC_ISCR 0xc
|
604 |
|
|
#define CYGHWR_HAL_LM3S_ADC_OSR 0x10
|
605 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX 0x14
|
606 |
|
|
#define CYGHWR_HAL_LM3S_ADC_USR 0x18
|
607 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SSPRI 0x20
|
608 |
|
|
#define CYGHWR_HAL_LM3S_ADC_PSSI 0x28
|
609 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC 0x30
|
610 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_MUX0 0x40
|
611 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0 0x44
|
612 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO0 0x48
|
613 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO0_SR 0x4c
|
614 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_MUX1 0x60
|
615 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL1 0x64
|
616 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO1 0x68
|
617 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO1_SR 0x6c
|
618 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_MUX2 0x80
|
619 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL2 0x84
|
620 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO2 0x88
|
621 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO2_SR 0x8c
|
622 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_MUX3 0xa0
|
623 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL3 0xa4
|
624 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO3 0xa8
|
625 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO3_SR 0xac
|
626 |
|
|
#define CYGHWR_HAL_LM3S_ADC_TMLB 0x100
|
627 |
|
|
|
628 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAMPLE_SIZE 10
|
629 |
|
|
|
630 |
|
|
// Active Sample Sequencer
|
631 |
|
|
#define CYGHWR_HAL_LM3S_ADC_ACTSS_ASEN(__x) VALUE_(((__x)&3),1)
|
632 |
|
|
|
633 |
|
|
// Raw Interrupt Status
|
634 |
|
|
#define CYGHWR_HAL_LM3S_ADC_RIS_INR(__x) VALUE_(((__x)&3),1)
|
635 |
|
|
|
636 |
|
|
// Interrupt Mask Register
|
637 |
|
|
#define CYGHWR_HAL_LM3S_ADC_IMR_MASK(__x) VALUE_(((__x)&3),1)
|
638 |
|
|
|
639 |
|
|
// Interrupt Status and Clear Register
|
640 |
|
|
#define CYGHWR_HAL_LM3S_ADC_ISCR_IN(__x) VALUE_(((__x)&3),1)
|
641 |
|
|
|
642 |
|
|
// Overflow Status Register
|
643 |
|
|
#define CYGHWR_HAL_LM3S_ADC_OSR_OV(__x) VALUE_(((__x)&3),1)
|
644 |
|
|
|
645 |
|
|
// Event Multiplexer Select
|
646 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_CTRL(__x) VALUE_((((__x)&3)<<2),0)
|
647 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_AC0(__x) VALUE_((((__x)&3)<<2),1)
|
648 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_EXT(__x) VALUE_((((__x)&3)<<2),4)
|
649 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_TIMER(__x) VALUE_((((__x)&3)<<2),5)
|
650 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_PWM0(__x) VALUE_((((__x)&3)<<2),6)
|
651 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_PWM1(__x) VALUE_((((__x)&3)<<2),7)
|
652 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_PWM2(__x) VALUE_((((__x)&3)<<2),8)
|
653 |
|
|
#define CYGHWR_HAL_LM3S_ADC_EMUX_EM_ALWS(__x) VALUE_((((__x)&3)<<2),15)
|
654 |
|
|
|
655 |
|
|
// Underflow Status
|
656 |
|
|
#define CYGHWR_HAL_LM3S_ADC_USR_UV(__x) VALUE_(((__x)&3),1)
|
657 |
|
|
|
658 |
|
|
// Sample Sequence Priority
|
659 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SSPRI_SS(__x, __y) VALUE_((((__x)&3)<<2),(__y)&3)
|
660 |
|
|
|
661 |
|
|
// Processor Sample Sequence Initiate
|
662 |
|
|
#define CYGHWR_HAL_LM3S_ADC_PSSI_SS(__x) VALUE_(((__x)&3),1)
|
663 |
|
|
|
664 |
|
|
// Sample Averaging Control
|
665 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC_NO_OVER 0x0
|
666 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC_2X 0x1
|
667 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC_4X 0x2
|
668 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC_8X 0x3
|
669 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC_16X 0x4
|
670 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC_32X 0x5
|
671 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SAC_64X 0x6
|
672 |
|
|
|
673 |
|
|
// Sample Sequence Input Multiplexer Select 0
|
674 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_MUX0_V(_p_, _x_) VALUE_((((_x_)&3)<<2),_p_)
|
675 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_MUX0_M(_x_) VALUE_((((_x_)&3)<<2), 0x3)
|
676 |
|
|
|
677 |
|
|
// Sample Sequence Control 0
|
678 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D0 BIT_(0)
|
679 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END0 BIT_(1)
|
680 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE0 BIT_(2)
|
681 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS0 BIT_(3)
|
682 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D1 BIT_(4)
|
683 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END1 BIT_(5)
|
684 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE1 BIT_(6)
|
685 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS1 BIT_(7)
|
686 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D2 BIT_(8)
|
687 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END2 BIT_(9)
|
688 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE2 BIT_(10)
|
689 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS2 BIT_(11)
|
690 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D3 BIT_(12)
|
691 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END3 BIT_(13)
|
692 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE3 BIT_(14)
|
693 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS3 BIT_(15)
|
694 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D4 BIT_(16)
|
695 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END4 BIT_(17)
|
696 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE4 BIT_(18)
|
697 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS4 BIT_(19)
|
698 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D5 BIT_(20)
|
699 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END5 BIT_(21)
|
700 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE5 BIT_(22)
|
701 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS5 BIT_(23)
|
702 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D6 BIT_(24)
|
703 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END6 BIT_(25)
|
704 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE6 BIT_(26)
|
705 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS6 BIT_(27)
|
706 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D7 BIT_(28)
|
707 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END7 BIT_(29)
|
708 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE7 BIT_(30)
|
709 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS7 BIT_(31)
|
710 |
|
|
|
711 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_MASK(_x_) VALUE_((((_x_)&3)<<2), 0x15)
|
712 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_D(_x_) VALUE_((((_x_)&3)<<2), 0x1)
|
713 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_END(_x_) VALUE_((((_x_)&3)<<2), 0x2)
|
714 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_IE(_x_) VALUE_((((_x_)&3)<<2), 0x4)
|
715 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_CTL0_TS(_x_) VALUE_((((_x_)&3)<<2), 0x8)
|
716 |
|
|
|
717 |
|
|
// Sequence FIFO Status
|
718 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO_SR_TPTR 0x0
|
719 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO_SR_HPTR 0x0
|
720 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO_SR_EMPTY BIT_(8)
|
721 |
|
|
#define CYGHWR_HAL_LM3S_ADC_SS_FIFO_SR_FULL BIT_(12)
|
722 |
|
|
|
723 |
|
|
#endif // CYGHWR_HAL_LM3S_ADC0_CHAN
|
724 |
|
|
|
725 |
|
|
|
726 |
|
|
//=============================================================================
|
727 |
|
|
// SSI interface register definitions.
|
728 |
|
|
|
729 |
|
|
#ifdef CYGHWR_HAL_LM3S_SSI_CHAN
|
730 |
|
|
|
731 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0 0x000
|
732 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR1 0x004
|
733 |
|
|
#define CYGHWR_HAL_LM3S_SSI_DR 0x008
|
734 |
|
|
#define CYGHWR_HAL_LM3S_SSI_SR 0x00C
|
735 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CPSR 0x010
|
736 |
|
|
#define CYGHWR_HAL_LM3S_SSI_IM 0x014
|
737 |
|
|
#define CYGHWR_HAL_LM3S_SSI_RIS 0x018
|
738 |
|
|
#define CYGHWR_HAL_LM3S_SSI_MIS 0x01c
|
739 |
|
|
#define CYGHWR_HAL_LM3S_SSI_ICR 0x020
|
740 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID4 0xfd0
|
741 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID5 0xfd4
|
742 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID6 0xfd8
|
743 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID7 0xfdc
|
744 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID0 0xfe0
|
745 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID1 0xfe4
|
746 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID2 0xfe8
|
747 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PID3 0xfec
|
748 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PCID0 0xff0
|
749 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PCID1 0xff4
|
750 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PCID2 0xff8
|
751 |
|
|
#define CYGHWR_HAL_LM3S_SSI_PCID3 0xffc
|
752 |
|
|
|
753 |
|
|
|
754 |
|
|
// CR0 bits
|
755 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_4BIT VALUE_(0, 0x3)
|
756 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_5BIT VALUE_(0, 0x4)
|
757 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_6BIT VALUE_(0, 0x5)
|
758 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_7BIT VALUE_(0, 0x6)
|
759 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_8BIT VALUE_(0, 0x7)
|
760 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_9BIT VALUE_(0, 0x8)
|
761 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_10BIT VALUE_(0, 0x9)
|
762 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_11BIT VALUE_(0, 0xa)
|
763 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_12BIT VALUE_(0, 0xb)
|
764 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_13BIT VALUE_(0, 0xc)
|
765 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_14BIT VALUE_(0, 0xd)
|
766 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_15BIT VALUE_(0, 0xe)
|
767 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_16BIT VALUE_(0, 0xf)
|
768 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_DSS_MASK 0x0000000f
|
769 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_FRF_FSPIFF VALUE_(4, 0x0)
|
770 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_FRF_TISSFF VALUE_(4, 0x1)
|
771 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_FRF_MFF VALUE_(4, 0x2)
|
772 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_FRF_MASK 0x00000030
|
773 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_SPO BIT_(6)
|
774 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_SPH BIT_(7)
|
775 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR0_SCR(__x) VALUE_(8, ((__x)&0xff))
|
776 |
|
|
|
777 |
|
|
// CR1 bits
|
778 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR1_LBM BIT_(0)
|
779 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR1_SSE BIT_(1)
|
780 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR1_MS BIT_(2)
|
781 |
|
|
#define CYGHWR_HAL_LM3S_SSI_CR1_SOD BIT_(3)
|
782 |
|
|
|
783 |
|
|
// SR bits
|
784 |
|
|
#define CYGHWR_HAL_LM3S_SSI_SR_TFE BIT_(0)
|
785 |
|
|
#define CYGHWR_HAL_LM3S_SSI_SR_TNF BIT_(1)
|
786 |
|
|
#define CYGHWR_HAL_LM3S_SSI_SR_RNE BIT_(2)
|
787 |
|
|
#define CYGHWR_HAL_LM3S_SSI_SR_RFF BIT_(3)
|
788 |
|
|
#define CYGHWR_HAL_LM3S_SSI_SR_BSY BIT_(4)
|
789 |
|
|
|
790 |
|
|
// IM bits
|
791 |
|
|
#define CYGHWR_HAL_LM3S_SSI_IM_RORIM BIT_(0)
|
792 |
|
|
#define CYGHWR_HAL_LM3S_SSI_IM_RTIM BIT_(1)
|
793 |
|
|
#define CYGHWR_HAL_LM3S_SSI_IM_RXIM BIT_(2)
|
794 |
|
|
#define CYGHWR_HAL_LM3S_SSI_IM_TXIM BIT_(3)
|
795 |
|
|
|
796 |
|
|
// RIS bits
|
797 |
|
|
#define CYGHWR_HAL_LM3S_SSI_RIS_RORRIS BIT_(0)
|
798 |
|
|
#define CYGHWR_HAL_LM3S_SSI_RIS_RTRIS BIT_(1)
|
799 |
|
|
#define CYGHWR_HAL_LM3S_SSI_RIS_RXRIS BIT_(2)
|
800 |
|
|
#define CYGHWR_HAL_LM3S_SSI_RIS_TXRIS BIT_(3)
|
801 |
|
|
|
802 |
|
|
// MIS bits
|
803 |
|
|
#define CYGHWR_HAL_LM3S_SSI_MIS_RORMIS BIT_(0)
|
804 |
|
|
#define CYGHWR_HAL_LM3S_SSI_MIS_RTMIS BIT_(1)
|
805 |
|
|
#define CYGHWR_HAL_LM3S_SSI_MIS_RXMIS BIT_(2)
|
806 |
|
|
#define CYGHWR_HAL_LM3S_SSI_MIS_TXMIS BIT_(3)
|
807 |
|
|
|
808 |
|
|
// ICR bits
|
809 |
|
|
#define CYGHWR_HAL_LM3S_SSI_ICR_RORIC BIT_(0)
|
810 |
|
|
#define CYGHWR_HAL_LM3S_SSI_ICR_RTIC BIT_(1)
|
811 |
|
|
|
812 |
|
|
#endif // CYGHWR_HAL_LM3S_SSI_CHAN
|
813 |
|
|
|
814 |
|
|
//=============================================================================
|
815 |
|
|
// PWM register definitions.
|
816 |
|
|
|
817 |
|
|
#ifdef CYGHWR_HAL_LM3S_PWM_CHAN
|
818 |
|
|
|
819 |
|
|
#define CYGHWR_HAL_LM3S_PWM_CTL 0x000
|
820 |
|
|
#define CYGHWR_HAL_LM3S_PWM_SYNC 0x004
|
821 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ENABLE 0x008
|
822 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INVERT 0x00c
|
823 |
|
|
#define CYGHWR_HAL_LM3S_PWM_FAULT 0x010
|
824 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INTEN 0x014
|
825 |
|
|
#define CYGHWR_HAL_LM3S_PWM_RIS 0x018
|
826 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ISC 0x01c
|
827 |
|
|
#define CYGHWR_HAL_LM3S_PWM_STATUS 0x020
|
828 |
|
|
|
829 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_CTL 0x040
|
830 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_INTEN 0x044
|
831 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_RIS 0x048
|
832 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_ISC 0x04c
|
833 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_LOAD 0x050
|
834 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_COUNT 0x054
|
835 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_CMPA 0x058
|
836 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_CMPB 0x05c
|
837 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_GENA 0x060
|
838 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_GENB 0x064
|
839 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_DBCTL 0x068
|
840 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_DBRISE 0x06c
|
841 |
|
|
#define CYGHWR_HAL_LM3S_PWM0_DBFALL 0x070
|
842 |
|
|
|
843 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_CTL 0x080
|
844 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_INTEN 0x084
|
845 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_RIS 0x088
|
846 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_ISC 0x08c
|
847 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_LOAD 0x090
|
848 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_COUNT 0x094
|
849 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_CMPA 0x098
|
850 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_CMPB 0x09c
|
851 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_GENA 0x0a0
|
852 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_GENB 0x0a4
|
853 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_DBCTL 0x0a8
|
854 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_DBRISE 0x0ac
|
855 |
|
|
#define CYGHWR_HAL_LM3S_PWM1_DBFALL 0x0b0
|
856 |
|
|
|
857 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_CTL 0x0c0
|
858 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_INTEN 0x0c4
|
859 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_RIS 0x0c8
|
860 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_ISC 0x0cc
|
861 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_LOAD 0x0d0
|
862 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_COUNT 0x0d4
|
863 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_CMPA 0x0d8
|
864 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_CMPB 0x0dc
|
865 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_GENA 0x0e0
|
866 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_GENB 0x0e4
|
867 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_DBCTL 0x0e8
|
868 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_DBRISE 0x0ec
|
869 |
|
|
#define CYGHWR_HAL_LM3S_PWM2_DBFALL 0x0f0
|
870 |
|
|
|
871 |
|
|
|
872 |
|
|
// CTL bits
|
873 |
|
|
#define CYGHWR_HAL_LM3S_PWM_CTL_GSYNC0 BIT_(0)
|
874 |
|
|
#define CYGHWR_HAL_LM3S_PWM_CTL_GSYNC1 BIT_(1)
|
875 |
|
|
#define CYGHWR_HAL_LM3S_PWM_CTL_GSYNC2 BIT_(2)
|
876 |
|
|
|
877 |
|
|
// SYNC bits
|
878 |
|
|
#define CYGHWR_HAL_LM3S_PWM_SYNC_SYNC0 BIT_(0)
|
879 |
|
|
#define CYGHWR_HAL_LM3S_PWM_SYNC_SYNC1 BIT_(1)
|
880 |
|
|
#define CYGHWR_HAL_LM3S_PWM_SYNC_SYNC2 BIT_(2)
|
881 |
|
|
|
882 |
|
|
// ENABLE bits
|
883 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ENABLE_PWM0 BIT_(0)
|
884 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ENABLE_PWM1 BIT_(1)
|
885 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ENABLE_PWM2 BIT_(2)
|
886 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ENABLE_PWM3 BIT_(3)
|
887 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ENABLE_PWM4 BIT_(4)
|
888 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ENABLE_PWM5 BIT_(5)
|
889 |
|
|
|
890 |
|
|
// INVERT bits
|
891 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INVERT_PWM0 BIT_(0)
|
892 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INVERT_PWM1 BIT_(1)
|
893 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INVERT_PWM2 BIT_(2)
|
894 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INVERT_PWM3 BIT_(3)
|
895 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INVERT_PWM4 BIT_(4)
|
896 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INVERT_PWM5 BIT_(5)
|
897 |
|
|
|
898 |
|
|
// FAULT bits
|
899 |
|
|
#define CYGHWR_HAL_LM3S_PWM_FAULT_PWM0 BIT_(0)
|
900 |
|
|
#define CYGHWR_HAL_LM3S_PWM_FAULT_PWM1 BIT_(1)
|
901 |
|
|
#define CYGHWR_HAL_LM3S_PWM_FAULT_PWM2 BIT_(2)
|
902 |
|
|
#define CYGHWR_HAL_LM3S_PWM_FAULT_PWM3 BIT_(3)
|
903 |
|
|
#define CYGHWR_HAL_LM3S_PWM_FAULT_PWM4 BIT_(4)
|
904 |
|
|
#define CYGHWR_HAL_LM3S_PWM_FAULT_PWM5 BIT_(5)
|
905 |
|
|
|
906 |
|
|
// INTEN bits
|
907 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INTEN_PWM0 BIT_(0)
|
908 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INTEN_PWM1 BIT_(1)
|
909 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INTEN_PWM2 BIT_(2)
|
910 |
|
|
#define CYGHWR_HAL_LM3S_PWM_INTEN_FAULT BIT_(16)
|
911 |
|
|
|
912 |
|
|
// RIS bits
|
913 |
|
|
#define CYGHWR_HAL_LM3S_PWM_RIS_PWM0 BIT_(0)
|
914 |
|
|
#define CYGHWR_HAL_LM3S_PWM_RIS_PWM1 BIT_(1)
|
915 |
|
|
#define CYGHWR_HAL_LM3S_PWM_RIS_PWM2 BIT_(2)
|
916 |
|
|
#define CYGHWR_HAL_LM3S_PWM_RIS_FAULT BIT_(16)
|
917 |
|
|
|
918 |
|
|
// ISC bits
|
919 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ISC_PWM0 BIT_(0)
|
920 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ISC_PWM1 BIT_(1)
|
921 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ISC_PWM2 BIT_(2)
|
922 |
|
|
#define CYGHWR_HAL_LM3S_PWM_ISC_FAULT BIT_(16)
|
923 |
|
|
|
924 |
|
|
// STATUS bits
|
925 |
|
|
#define CYGHWR_HAL_LM3S_PWM_STATUS_FAULT BIT_(0)
|
926 |
|
|
|
927 |
|
|
// PWMx CTL Bits
|
928 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_CTL_ENABLE BIT_(0)
|
929 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_CTL_MODE BIT_(1)
|
930 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_CTL_DEBUG BIT_(2)
|
931 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_CTL_LOAD_UPD BIT_(3)
|
932 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_CTL_CMPA_UPD BIT_(4)
|
933 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_CTL_CMPB_UPD BIT_(5)
|
934 |
|
|
|
935 |
|
|
// PWMx INTEN Bits
|
936 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_CNT_ZERO BIT_(0)
|
937 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_CNT_LOAD BIT_(1)
|
938 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_CMPA_UP BIT_(2)
|
939 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_CMPA_DOWN BIT_(3)
|
940 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_CMPB_UP BIT_(4)
|
941 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_CMPB_DOWN BIT_(5)
|
942 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_TRIG_CNT_ZERO BIT_(8)
|
943 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_TRIG_CNT_LOAD BIT_(9)
|
944 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_TRIG_CMPA_UP BIT_(10)
|
945 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_TRIG_CMPA_DOWN BIT_(11)
|
946 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_TRIG_CMPB_UP BIT_(12)
|
947 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_INTEN_TRIG_CMPB_DOWN BIT_(13)
|
948 |
|
|
|
949 |
|
|
// PWMx RIS Bits
|
950 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_RIS_CNT_ZERO BIT_(0)
|
951 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_RIS_CNT_LOAD BIT_(1)
|
952 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_RIS_CMPA_UP BIT_(2)
|
953 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_RIS_CMPA_DOWN BIT_(3)
|
954 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_RIS_CMPB_UP BIT_(4)
|
955 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_RIS_CMPB_DOWN BIT_(5)
|
956 |
|
|
|
957 |
|
|
// PWMx ISC Bits
|
958 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_ISC_CNT_ZERO BIT_(0)
|
959 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_ISC_CNT_LOAD BIT_(1)
|
960 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_ISC_CMPA_UP BIT_(2)
|
961 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_ISC_CMPA_DOWN BIT_(3)
|
962 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_ISC_CMPB_UP BIT_(4)
|
963 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_ISC_CMPB_DOWN BIT_(5)
|
964 |
|
|
|
965 |
|
|
// PWMx GENA Bits
|
966 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_ZERO_NONE VALUE_(0, 0x0)
|
967 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_ZERO_INVS VALUE_(0, 0x1)
|
968 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_ZERO_SET0 VALUE_(0, 0x2)
|
969 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_ZERO_SET1 VALUE_(0, 0x3)
|
970 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_ZERO_MASK 0x00000003
|
971 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_LOAD_NONE VALUE_(2, 0x0)
|
972 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_LOAD_INVS VALUE_(2, 0x1)
|
973 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_LOAD_SET0 VALUE_(2, 0x2)
|
974 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_LOAD_SET1 VALUE_(2, 0x3)
|
975 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_ACT_LOAD_MASK 0x0000000c
|
976 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_UP_NONE VALUE_(4, 0x0)
|
977 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_UP_INVS VALUE_(4, 0x1)
|
978 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_UP_SET0 VALUE_(4, 0x2)
|
979 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_UP_SET1 VALUE_(4, 0x3)
|
980 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_UP_MASK 0x00000030
|
981 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_DOWN_NONE VALUE_(6, 0x0)
|
982 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_DOWN_INVS VALUE_(6, 0x1)
|
983 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_DOWN_SET0 VALUE_(6, 0x2)
|
984 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_DOWN_SET1 VALUE_(6, 0x3)
|
985 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPA_DOWN_MASK 0x000000c0
|
986 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_UP_NONE VALUE_(8, 0x0)
|
987 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_UP_INVS VALUE_(8, 0x1)
|
988 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_UP_SET0 VALUE_(8, 0x2)
|
989 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_UP_SET1 VALUE_(8, 0x3)
|
990 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_UP_MASK 0x00000300
|
991 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_DOWN_NONE VALUE_(10, 0x0)
|
992 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_DOWN_INVS VALUE_(10, 0x1)
|
993 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_DOWN_SET0 VALUE_(10, 0x2)
|
994 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_DOWN_SET1 VALUE_(10, 0x3)
|
995 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENA_CMPB_DOWN_MASK 0x00000c00
|
996 |
|
|
|
997 |
|
|
// PWMx GENB Bits
|
998 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_ZERO_NONE VALUE_(0, 0x0)
|
999 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_ZERO_INVS VALUE_(0, 0x1)
|
1000 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_ZERO_SET0 VALUE_(0, 0x2)
|
1001 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_ZERO_SET1 VALUE_(0, 0x3)
|
1002 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_ZERO_MASK 0x00000003
|
1003 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_LOAD_NONE VALUE_(2, 0x0)
|
1004 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_LOAD_INVS VALUE_(2, 0x1)
|
1005 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_LOAD_SET0 VALUE_(2, 0x2)
|
1006 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_LOAD_SET1 VALUE_(2, 0x3)
|
1007 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_ACT_LOAD_MASK 0x0000000c
|
1008 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_UP_NONE VALUE_(4, 0x0)
|
1009 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_UP_INVS VALUE_(4, 0x1)
|
1010 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_UP_SET0 VALUE_(4, 0x2)
|
1011 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_UP_SET1 VALUE_(4, 0x3)
|
1012 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_UP_MASK 0x00000030
|
1013 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_DOWN_NONE VALUE_(6, 0x0)
|
1014 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_DOWN_INVS VALUE_(6, 0x1)
|
1015 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_DOWN_SET0 VALUE_(6, 0x2)
|
1016 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_DOWN_SET1 VALUE_(6, 0x3)
|
1017 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPA_DOWN_MASK 0x000000c0
|
1018 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_UP_NONE VALUE_(8, 0x0)
|
1019 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_UP_INVS VALUE_(8, 0x1)
|
1020 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_UP_SET0 VALUE_(8, 0x2)
|
1021 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_UP_SET1 VALUE_(8, 0x3)
|
1022 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_UP_MASK 0x00000300
|
1023 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_DOWN_NONE VALUE_(10, 0x0)
|
1024 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_DOWN_INVS VALUE_(10, 0x1)
|
1025 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_DOWN_SET0 VALUE_(10, 0x2)
|
1026 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_DOWN_SET1 VALUE_(10, 0x3)
|
1027 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_GENB_CMPB_DOWN_MASK 0x00000c00
|
1028 |
|
|
|
1029 |
|
|
// PWMx DBCTL Bits
|
1030 |
|
|
#define CYGHWR_HAL_LM3S_PWMx_DBCTL_ENABLE BIT_(0)
|
1031 |
|
|
|
1032 |
|
|
#endif // CYGHWR_HAL_LM3S_PWM_CHAN
|
1033 |
|
|
|
1034 |
|
|
|
1035 |
|
|
//=============================================================================
|
1036 |
|
|
// Global Timers register definitions.
|
1037 |
|
|
|
1038 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CFG 0x000
|
1039 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMR 0x004
|
1040 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMR 0x008
|
1041 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL 0x00c
|
1042 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR 0x018
|
1043 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS 0x01C
|
1044 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS 0x020
|
1045 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR 0x024
|
1046 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAILR 0x028
|
1047 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBILR 0x02c
|
1048 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMATCHR 0x030
|
1049 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMATCHR 0x034
|
1050 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAPR 0x038
|
1051 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBPR 0x03c
|
1052 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAPMR 0x040
|
1053 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBPMR 0x044
|
1054 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAR 0x048
|
1055 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBR 0x04c
|
1056 |
|
|
|
1057 |
|
|
// CFG bits
|
1058 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CFG_32BIT VALUE_(0, 0x0)
|
1059 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CFG_32BIT_RTC VALUE_(0, 0x1)
|
1060 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CFG_16BIT VALUE_(0, 0x4)
|
1061 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CFG_MASK 0x00000007
|
1062 |
|
|
|
1063 |
|
|
// TAMR bits
|
1064 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMR_ONE_SHOT VALUE_(0, 0x1)
|
1065 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMR_PERIODIC VALUE_(0, 0x2)
|
1066 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMR_CAPTURE VALUE_(0, 0x3)
|
1067 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMR_MASK 0x00000003
|
1068 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMR_TACMR BIT_(2)
|
1069 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TAMR_TAAMS BIT_(3)
|
1070 |
|
|
|
1071 |
|
|
// TBMR bits
|
1072 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMR_ONE_SHOT VALUE_(0, 0x1)
|
1073 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMR_PERIODIC VALUE_(0, 0x2)
|
1074 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMR_CAPTURE VALUE_(0, 0x3)
|
1075 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMR_MASK 0x00000003
|
1076 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMR_TBCMR BIT_(2)
|
1077 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_TBMR_TBAMS BIT_(3)
|
1078 |
|
|
|
1079 |
|
|
// CTL bits
|
1080 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TAEN BIT_(0)
|
1081 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TASTALL BIT_(1)
|
1082 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TAEVENT_POS VALUE_(2, 0x0)
|
1083 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TAEVENT_NEG VALUE_(2, 0x1)
|
1084 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TAEVENT_BOTH VALUE_(2, 0x3)
|
1085 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_RTCEN BIT_(4)
|
1086 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TAOTE BIT_(5)
|
1087 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TAPWML BIT_(6)
|
1088 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TBEN BIT_(8)
|
1089 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TBSTALL BIT_(9)
|
1090 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TBEVENT_POS VALUE_(10, 0x0)
|
1091 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TBEVENT_NEG VALUE_(10, 0x1)
|
1092 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TBEVENT_BOTH VALUE_(10, 0x3)
|
1093 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TBOTE BIT_(13)
|
1094 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_CTL_TBPWML BIT_(14)
|
1095 |
|
|
|
1096 |
|
|
// IMR bits
|
1097 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR_TATOIM BIT_(0)
|
1098 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR_CAMIM BIT_(1)
|
1099 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR_CAEIM BIT_(2)
|
1100 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR_RTCIM BIT_(3)
|
1101 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR_TBTOIM BIT_(8)
|
1102 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR_CBMIM BIT_(9)
|
1103 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_IMR_CBEIM BIT_(10)
|
1104 |
|
|
|
1105 |
|
|
// RIS bits
|
1106 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS_TATORIS BIT_(0)
|
1107 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS_CAMRIS BIT_(1)
|
1108 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS_CAERIS BIT_(2)
|
1109 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS_RTCRIS BIT_(3)
|
1110 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS_TBTORIS BIT_(8)
|
1111 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS_CBMRIS BIT_(9)
|
1112 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_RIS_CBERIS BIT_(10)
|
1113 |
|
|
|
1114 |
|
|
// MIS bits
|
1115 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS_TATOMIS BIT_(0)
|
1116 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS_CAMMIS BIT_(1)
|
1117 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS_CAEMIS BIT_(2)
|
1118 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS_RTCMIS BIT_(3)
|
1119 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS_TBTOMIS BIT_(8)
|
1120 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS_CBMMIS BIT_(9)
|
1121 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_MIS_CBEMIS BIT_(10)
|
1122 |
|
|
|
1123 |
|
|
// ICR bits
|
1124 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR_TATOCINT BIT_(0)
|
1125 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR_CAMCINT BIT_(1)
|
1126 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR_CAECINT BIT_(2)
|
1127 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR_RTCCINT BIT_(3)
|
1128 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR_TBTOCINT BIT_(8)
|
1129 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR_CBMCINT BIT_(9)
|
1130 |
|
|
#define CYGHWR_HAL_LM3S_GPTIM_ICR_CBECINT BIT_(10)
|
1131 |
|
|
|
1132 |
|
|
cyg_uint32 hal_lm3s_timer_clock( void );
|
1133 |
|
|
|
1134 |
|
|
#ifndef __ASSEMBLER__
|
1135 |
|
|
|
1136 |
|
|
__externC cyg_uint32 hal_stellaris_lm3s_timer_clock( CYG_ADDRESS base );
|
1137 |
|
|
|
1138 |
|
|
#endif
|
1139 |
|
|
|
1140 |
|
|
|
1141 |
|
|
//=============================================================================
|
1142 |
|
|
// I2C register definitions.
|
1143 |
|
|
|
1144 |
|
|
#ifdef CYGHWR_HAL_LM3S_I2C_CHAN
|
1145 |
|
|
|
1146 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MSA 0x000
|
1147 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS 0x004
|
1148 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MDR 0x008
|
1149 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MTPR 0x00c
|
1150 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MIMR 0x010
|
1151 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MRIS 0x014
|
1152 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MMIS 0x018
|
1153 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MICR 0x01c
|
1154 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCR 0x020
|
1155 |
|
|
|
1156 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SOAR 0x000
|
1157 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SCSR 0x004
|
1158 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SDR 0x008
|
1159 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SIMR 0x00c
|
1160 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SRIS 0x010
|
1161 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SMIS 0x014
|
1162 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SICR 0x018
|
1163 |
|
|
|
1164 |
|
|
// MSA bits
|
1165 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MSA_RS BIT_(0)
|
1166 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MSA_SA(__x) VALUE_(1, __x)
|
1167 |
|
|
|
1168 |
|
|
// MCS bits
|
1169 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_BUSY BIT_(0)
|
1170 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_ERR BIT_(1)
|
1171 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_ADRACK BIT_(2)
|
1172 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_DATACK BIT_(3)
|
1173 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_ARBLST BIT_(4)
|
1174 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_IDLE BIT_(5)
|
1175 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_BUSBSY BIT_(6)
|
1176 |
|
|
|
1177 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_RUN BIT_(0)
|
1178 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_START BIT_(1)
|
1179 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_STOP BIT_(2)
|
1180 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCS_ACK BIT_(3)
|
1181 |
|
|
|
1182 |
|
|
// MIMR bits
|
1183 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MIMR_IM BIT_(0)
|
1184 |
|
|
|
1185 |
|
|
// MRIS bits
|
1186 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MRIS_RIS BIT_(0)
|
1187 |
|
|
|
1188 |
|
|
// MMIS bits
|
1189 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MMIS_MIS BIT_(0)
|
1190 |
|
|
|
1191 |
|
|
// MICR bits
|
1192 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MICR_IC BIT_(0)
|
1193 |
|
|
|
1194 |
|
|
// MCR bits
|
1195 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCR_LPBK BIT_(0)
|
1196 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCR_MFE BIT_(4)
|
1197 |
|
|
#define CYGHWR_HAL_LM3S_I2C_MCR_SFE BIT_(5)
|
1198 |
|
|
|
1199 |
|
|
// SCSR bits
|
1200 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SCSR_READ_RREQ BIT_(0)
|
1201 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SCSR_READ_TREQ BIT_(1)
|
1202 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SCSR_READ_FBR BIT_(2)
|
1203 |
|
|
|
1204 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SCSR_WRITE_DA BIT_(0)
|
1205 |
|
|
|
1206 |
|
|
// SIMR bits
|
1207 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SIMR_DATAIM BIT_(0)
|
1208 |
|
|
|
1209 |
|
|
// SRIS bits
|
1210 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SRIS_DATARIS BIT_(0)
|
1211 |
|
|
|
1212 |
|
|
// SMIS bits
|
1213 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SMIS_DATAMIS BIT_(0)
|
1214 |
|
|
|
1215 |
|
|
// SICR bits
|
1216 |
|
|
#define CYGHWR_HAL_LM3S_I2C_SICR_DATAMIC BIT_(0)
|
1217 |
|
|
|
1218 |
|
|
__externC cyg_uint32 hal_lm3s_i2c_clock( void );
|
1219 |
|
|
|
1220 |
|
|
#endif // CYGHWR_HAL_LM3S_I2C_CHAN
|
1221 |
|
|
|
1222 |
|
|
|
1223 |
|
|
//=============================================================================
|
1224 |
|
|
// AC register definitions.
|
1225 |
|
|
|
1226 |
|
|
#ifdef CYGHWR_HAL_LM3S_AC_CHAN
|
1227 |
|
|
|
1228 |
|
|
#define CYGHWR_HAL_LM3S_AC_MIS 0x000
|
1229 |
|
|
#define CYGHWR_HAL_LM3S_AC_RIS 0x004
|
1230 |
|
|
#define CYGHWR_HAL_LM3S_AC_INTEN 0x008
|
1231 |
|
|
#define CYGHWR_HAL_LM3S_AC_REFCTL 0x010
|
1232 |
|
|
#define CYGHWR_HAL_LM3S_AC_STAT0 0x020
|
1233 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTL0 0x024
|
1234 |
|
|
#define CYGHWR_HAL_LM3S_AC_STAT1 0x040
|
1235 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTL1 0x044
|
1236 |
|
|
#define CYGHWR_HAL_LM3S_AC_STAT2 0x060
|
1237 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTL2 0x064
|
1238 |
|
|
|
1239 |
|
|
// MIS bits
|
1240 |
|
|
#define CYGHWR_HAL_LM3S_AC_MIS_IN0 BIT_(0)
|
1241 |
|
|
#define CYGHWR_HAL_LM3S_AC_MIS_IN1 BIT_(1)
|
1242 |
|
|
#define CYGHWR_HAL_LM3S_AC_MIS_IN2 BIT_(2)
|
1243 |
|
|
|
1244 |
|
|
// RIS bits
|
1245 |
|
|
#define CYGHWR_HAL_LM3S_AC_RIS_IN0 BIT_(0)
|
1246 |
|
|
#define CYGHWR_HAL_LM3S_AC_RIS_IN1 BIT_(1)
|
1247 |
|
|
#define CYGHWR_HAL_LM3S_AC_RIS_IN2 BIT_(2)
|
1248 |
|
|
|
1249 |
|
|
// INTEN bits
|
1250 |
|
|
#define CYGHWR_HAL_LM3S_AC_INTEN_IN0 BIT_(0)
|
1251 |
|
|
#define CYGHWR_HAL_LM3S_AC_INTEN_IN1 BIT_(1)
|
1252 |
|
|
#define CYGHWR_HAL_LM3S_AC_INTEN_IN2 BIT_(2)
|
1253 |
|
|
|
1254 |
|
|
// REFCTL bits
|
1255 |
|
|
#define CYGHWR_HAL_LM3S_AC_REFCTL_RNG BIT_(8)
|
1256 |
|
|
#define CYGHWR_HAL_LM3S_AC_REFCTL_EN BIT_(9)
|
1257 |
|
|
|
1258 |
|
|
// STAT0, STAT1 and STAT2 bits
|
1259 |
|
|
#define CYGHWR_HAL_LM3S_AC_STATx_OVAL BIT_(1)
|
1260 |
|
|
|
1261 |
|
|
// CTL0, CTL1 anf CTL2 bits
|
1262 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_CINV BIT_(1)
|
1263 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ISEN_LEV_SENSE VALUE_(2, 0x0)
|
1264 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ISEN_FALL_EDGE VALUE_(2, 0x1)
|
1265 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ISEN_RISE_EDGE VALUE_(2, 0x2)
|
1266 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ISEN_BOTH_EDGE VALUE_(2, 0x3)
|
1267 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ISLVAL BIT_(4)
|
1268 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ASRCP_PIN_VAL VALUE_(9, 0x0)
|
1269 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ASRCP_PIN_VAL_C0 VALUE_(9, 0x1)
|
1270 |
|
|
#define CYGHWR_HAL_LM3S_AC_CTLx_ASRCP_IVOLTREF VALUE_(9, 0x2)
|
1271 |
|
|
|
1272 |
|
|
#endif // CYGHWR_HAL_LM3S_AC_CHAN
|
1273 |
|
|
|
1274 |
|
|
|
1275 |
|
|
//=============================================================================
|
1276 |
|
|
// QEI register definitions.
|
1277 |
|
|
|
1278 |
|
|
#ifdef CYGHWR_HAL_LM3S_QEI_CHAN
|
1279 |
|
|
|
1280 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL 0x000
|
1281 |
|
|
#define CYGHWR_HAL_LM3S_QEI_STAT 0x004
|
1282 |
|
|
#define CYGHWR_HAL_LM3S_QEI_POS 0x008
|
1283 |
|
|
#define CYGHWR_HAL_LM3S_QEI_MAXPOS 0x00c
|
1284 |
|
|
#define CYGHWR_HAL_LM3S_QEI_LOAD 0x010
|
1285 |
|
|
#define CYGHWR_HAL_LM3S_QEI_TIME 0x014
|
1286 |
|
|
#define CYGHWR_HAL_LM3S_QEI_COUNT 0x018
|
1287 |
|
|
#define CYGHWR_HAL_LM3S_QEI_SPEED 0x01c
|
1288 |
|
|
#define CYGHWR_HAL_LM3S_QEI_INTEN 0x020
|
1289 |
|
|
#define CYGHWR_HAL_LM3S_QEI_RIS 0x024
|
1290 |
|
|
#define CYGHWR_HAL_LM3S_QEI_ISC 0x028
|
1291 |
|
|
|
1292 |
|
|
// CTL bits
|
1293 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_EN BIT_(0)
|
1294 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_SWAP BIT_(1)
|
1295 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_SIGMODE BIT_(2)
|
1296 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_CAPMODE BIT_(3)
|
1297 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_RESMODE BIT_(4)
|
1298 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELEN BIT_(5)
|
1299 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_1 VALUE_(6, 0x0)
|
1300 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_2 VALUE_(6, 0x1)
|
1301 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_4 VALUE_(6, 0x2)
|
1302 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_8 VALUE_(6, 0x3)
|
1303 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_16 VALUE_(6, 0x4)
|
1304 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_32 VALUE_(6, 0x5)
|
1305 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_64 VALUE_(6, 0x6)
|
1306 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_VELDIV_128 VALUE_(6, 0x7)
|
1307 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_INVA BIT_(9)
|
1308 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_INVB BIT_(10)
|
1309 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_INVI BIT_(11)
|
1310 |
|
|
#define CYGHWR_HAL_LM3S_QEI_CTL_SATLLEN BIT_(12)
|
1311 |
|
|
|
1312 |
|
|
// STAT bits
|
1313 |
|
|
#define CYGHWR_HAL_LM3S_QEI_STAT_ERR BIT_(0)
|
1314 |
|
|
#define CYGHWR_HAL_LM3S_QEI_STAT_DIR BIT_(1)
|
1315 |
|
|
|
1316 |
|
|
// INTEN bits
|
1317 |
|
|
#define CYGHWR_HAL_LM3S_QEI_INTEN_INTINDEX BIT_(0)
|
1318 |
|
|
#define CYGHWR_HAL_LM3S_QEI_INTEN_INTTIMER BIT_(1)
|
1319 |
|
|
#define CYGHWR_HAL_LM3S_QEI_INTEN_INTDIR BIT_(2)
|
1320 |
|
|
#define CYGHWR_HAL_LM3S_QEI_INTEN_INTERROR BIT_(3)
|
1321 |
|
|
|
1322 |
|
|
// RIS bits
|
1323 |
|
|
#define CYGHWR_HAL_LM3S_QEI_RIS_INTINDEX BIT_(0)
|
1324 |
|
|
#define CYGHWR_HAL_LM3S_QEI_RIS_INTTIMER BIT_(1)
|
1325 |
|
|
#define CYGHWR_HAL_LM3S_QEI_RIS_INTDIR BIT_(2)
|
1326 |
|
|
#define CYGHWR_HAL_LM3S_QEI_RIS_INTERROR BIT_(3)
|
1327 |
|
|
|
1328 |
|
|
// ISC bits
|
1329 |
|
|
#define CYGHWR_HAL_LM3S_QEI_ISC_INTINDEX BIT_(0)
|
1330 |
|
|
#define CYGHWR_HAL_LM3S_QEI_ISC_INTTIMER BIT_(1)
|
1331 |
|
|
#define CYGHWR_HAL_LM3S_QEI_ISC_INTDIR BIT_(2)
|
1332 |
|
|
#define CYGHWR_HAL_LM3S_QEI_ISC_INTERROR BIT_(3)
|
1333 |
|
|
|
1334 |
|
|
#endif // CYGHWR_HAL_LM3S_QEI_CHAN
|
1335 |
|
|
|
1336 |
|
|
|
1337 |
|
|
//=============================================================================
|
1338 |
|
|
// Flash controller
|
1339 |
|
|
|
1340 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FMA 0x000
|
1341 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FMD 0x004
|
1342 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FMC 0x008
|
1343 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCRIS 0x00c
|
1344 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCIM 0x010
|
1345 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCMISC 0x014
|
1346 |
|
|
|
1347 |
|
|
// Key value
|
1348 |
|
|
#define CYGHWR_HAL_LM3S_FMC_WRKEY 0xA4420000
|
1349 |
|
|
|
1350 |
|
|
// FMC bits
|
1351 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FMC_WRITE BIT_(0)
|
1352 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FMC_ERASE BIT_(1)
|
1353 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FMC_MERASE BIT_(2)
|
1354 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FMC_COMT BIT_(3)
|
1355 |
|
|
|
1356 |
|
|
// RIS bits
|
1357 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCRIS_ARIS BIT_(0)
|
1358 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCRIS_PRIS BIT_(1)
|
1359 |
|
|
|
1360 |
|
|
// IM bits
|
1361 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCIM_AMASK BIT_(0)
|
1362 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCIM_PMASK BIT_(1)
|
1363 |
|
|
|
1364 |
|
|
// MISC bits
|
1365 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCMISC_AMASK BIT_(0)
|
1366 |
|
|
#define CYGHWR_HAL_LM3S_FMC_FCMISC_PMASK BIT_(0)
|
1367 |
|
|
|
1368 |
|
|
|
1369 |
|
|
//-----------------------------------------------------------------------------
|
1370 |
|
|
#endif // CYGONCE_HAL_VAR_IO_H
|
1371 |
|
|
// EOF of var_io.h
|