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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [Common/] [drivers/] [LuminaryMicro/] [hw_pwm.h] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 610 jeremybenn
//*****************************************************************************
2
//
3
// hw_pwm.h - Defines and Macros for Pulse Width Modulation (PWM) ports
4
//
5
// Copyright (c) 2005-2008 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 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.  You may not combine
14
// this software with "viral" open-source software in order to form a larger
15
// program.  Any use in violation of the foregoing restrictions may subject
16
// the user to criminal sanctions under applicable laws, as well as to civil
17
// liability for the breach of the terms and conditions of this license.
18
// 
19
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
20
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
21
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
22
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
23
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
24
// 
25
// This is part of revision 2523 of the Stellaris Peripheral Driver Library.
26
//
27
//*****************************************************************************
28
 
29
#ifndef __HW_PWM_H__
30
#define __HW_PWM_H__
31
 
32
//*****************************************************************************
33
//
34
// The following are defines for the PWM Module Register offsets.
35
//
36
//*****************************************************************************
37
#define PWM_O_CTL               0x00000000  // PWM Master Control register
38
#define PWM_O_SYNC              0x00000004  // PWM Time Base Sync register
39
#define PWM_O_ENABLE            0x00000008  // PWM Output Enable register
40
#define PWM_O_INVERT            0x0000000C  // PWM Output Inversion register
41
#define PWM_O_FAULT             0x00000010  // PWM Output Fault register
42
#define PWM_O_INTEN             0x00000014  // PWM Interrupt Enable register
43
#define PWM_O_RIS               0x00000018  // PWM Interrupt Raw Status reg.
44
#define PWM_O_ISC               0x0000001C  // PWM Interrupt Status register
45
#define PWM_O_STATUS            0x00000020  // PWM Status register
46
#define PWM_O_FAULTVAL          0x00000024  // PWM Fault Condition Value
47
#define PWM_O_0_CTL             0x00000040  // PWM0 Control
48
#define PWM_O_0_INTEN           0x00000044  // PWM0 Interrupt and Trigger
49
                                            // Enable
50
#define PWM_O_0_RIS             0x00000048  // PWM0 Raw Interrupt Status
51
#define PWM_O_0_ISC             0x0000004C  // PWM0 Interrupt Status and Clear
52
#define PWM_O_0_LOAD            0x00000050  // PWM0 Load
53
#define PWM_O_0_COUNT           0x00000054  // PWM0 Counter
54
#define PWM_O_0_CMPA            0x00000058  // PWM0 Compare A
55
#define PWM_O_0_CMPB            0x0000005C  // PWM0 Compare B
56
#define PWM_O_0_GENA            0x00000060  // PWM0 Generator A Control
57
#define PWM_O_0_GENB            0x00000064  // PWM0 Generator B Control
58
#define PWM_O_0_DBCTL           0x00000068  // PWM0 Dead-Band Control
59
#define PWM_O_0_DBRISE          0x0000006C  // PWM0 Dead-Band Rising-Edge Delay
60
#define PWM_O_0_DBFALL          0x00000070  // PWM0 Dead-Band
61
                                            // Falling-Edge-Delay
62
#define PWM_O_0_FLTSRC0         0x00000074  // PWM0 Fault Source 0
63
#define PWM_O_0_MINFLTPER       0x0000007C  // PWM0 Minimum Fault Period
64
#define PWM_O_1_CTL             0x00000080  // PWM1 Control
65
#define PWM_O_1_INTEN           0x00000084  // PWM1 Interrupt Enable
66
#define PWM_O_1_RIS             0x00000088  // PWM1 Raw Interrupt Status
67
#define PWM_O_1_ISC             0x0000008C  // PWM1 Interrupt Status and Clear
68
#define PWM_O_1_LOAD            0x00000090  // PWM1 Load
69
#define PWM_O_1_COUNT           0x00000094  // PWM1 Counter
70
#define PWM_O_1_CMPA            0x00000098  // PWM1 Compare A
71
#define PWM_O_1_CMPB            0x0000009C  // PWM1 Compare B
72
#define PWM_O_1_GENA            0x000000A0  // PWM1 Generator A Control
73
#define PWM_O_1_GENB            0x000000A4  // PWM1 Generator B Control
74
#define PWM_O_1_DBCTL           0x000000A8  // PWM1 Dead-Band Control
75
#define PWM_O_1_DBRISE          0x000000AC  // PWM1 Dead-Band Rising-Edge Delay
76
#define PWM_O_1_DBFALL          0x000000B0  // PWM1 Dead-Band
77
                                            // Falling-Edge-Delay
78
#define PWM_O_1_FLTSRC0         0x000000B4  // PWM1 Fault Source 0
79
#define PWM_O_1_MINFLTPER       0x000000BC  // PWM1 Minimum Fault Period
80
#define PWM_O_2_CTL             0x000000C0  // PWM2 Control
81
#define PWM_O_2_INTEN           0x000000C4  // PWM2 InterruptEnable
82
#define PWM_O_2_RIS             0x000000C8  // PWM2 Raw Interrupt Status
83
#define PWM_O_2_ISC             0x000000CC  // PWM2 Interrupt Status and Clear
84
#define PWM_O_2_LOAD            0x000000D0  // PWM2 Load
85
#define PWM_O_2_COUNT           0x000000D4  // PWM2 Counter
86
#define PWM_O_2_CMPA            0x000000D8  // PWM2 Compare A
87
#define PWM_O_2_CMPB            0x000000DC  // PWM2 Compare B
88
#define PWM_O_2_GENA            0x000000E0  // PWM2 Generator A Control
89
#define PWM_O_2_GENB            0x000000E4  // PWM2 Generator B Control
90
#define PWM_O_2_DBCTL           0x000000E8  // PWM2 Dead-Band Control
91
#define PWM_O_2_DBRISE          0x000000EC  // PWM2 Dead-Band Rising-Edge Delay
92
#define PWM_O_2_DBFALL          0x000000F0  // PWM2 Dead-Band
93
                                            // Falling-Edge-Delay
94
#define PWM_O_2_FLTSRC0         0x000000F4  // PWM2 Fault Source 0
95
#define PWM_O_2_MINFLTPER       0x000000FC  // PWM2 Minimum Fault Period
96
#define PWM_O_3_CTL             0x00000100  // PWM3 Control
97
#define PWM_O_3_INTEN           0x00000104  // PWM3 Interrupt and Trigger
98
                                            // Enable
99
#define PWM_O_3_RIS             0x00000108  // PWM3 Raw Interrupt Status
100
#define PWM_O_3_ISC             0x0000010C  // PWM3 Interrupt Status and Clear
101
#define PWM_O_3_LOAD            0x00000110  // PWM3 Load
102
#define PWM_O_3_COUNT           0x00000114  // PWM3 Counter
103
#define PWM_O_3_CMPA            0x00000118  // PWM3 Compare A
104
#define PWM_O_3_CMPB            0x0000011C  // PWM3 Compare B
105
#define PWM_O_3_GENA            0x00000120  // PWM3 Generator A Control
106
#define PWM_O_3_GENB            0x00000124  // PWM3 Generator B Control
107
#define PWM_O_3_DBCTL           0x00000128  // PWM3 Dead-Band Control
108
#define PWM_O_3_DBRISE          0x0000012C  // PWM3 Dead-Band Rising-Edge Delay
109
#define PWM_O_3_DBFALL          0x00000130  // PWM3 Dead-Band
110
                                            // Falling-Edge-Delay
111
#define PWM_O_3_FLTSRC0         0x00000134  // PWM3 Fault Source 0
112
#define PWM_O_3_MINFLTPER       0x0000013C  // PWM3 Minimum Fault Period
113
#define PWM_O_0_FLTSEN          0x00000800  // PWM0 Fault Pin Logic Sense
114
#define PWM_O_0_FLTSTAT0        0x00000804  // PWM0 Fault Status 0
115
#define PWM_O_1_FLTSEN          0x00000880  // PWM1 Fault Pin Logic Sense
116
#define PWM_O_1_FLTSTAT0        0x00000884  // PWM1 Fault Status 0
117
#define PWM_O_2_FLTSEN          0x00000900  // PWM2 Fault Pin Logic Sense
118
#define PWM_O_2_FLTSTAT0        0x00000904  // PWM2 Fault Status 0
119
#define PWM_O_3_FLTSEN          0x00000980  // PWM3 Fault Pin Logic Sense
120
#define PWM_O_3_FLTSTAT0        0x00000984  // PWM3 Fault Status 0
121
 
122
//*****************************************************************************
123
//
124
// The following are defines for the bit fields in the PWM Master Control
125
// register.
126
//
127
//*****************************************************************************
128
#define PWM_CTL_GLOBALSYNC3     0x00000008  // Update PWM Generator 3.
129
#define PWM_CTL_GLOBALSYNC2     0x00000004  // Update PWM Generator 2.
130
#define PWM_CTL_GLOBALSYNC1     0x00000002  // Update PWM Generator 1.
131
#define PWM_CTL_GLOBALSYNC0     0x00000001  // Update PWM Generator 0.
132
 
133
//*****************************************************************************
134
//
135
// The following are defines for the bit fields in the PWM Time Base Sync
136
// register.
137
//
138
//*****************************************************************************
139
#define PWM_SYNC_SYNC3          0x00000008  // Reset generator 3 counter
140
#define PWM_SYNC_SYNC2          0x00000004  // Reset generator 2 counter
141
#define PWM_SYNC_SYNC1          0x00000002  // Reset generator 1 counter
142
#define PWM_SYNC_SYNC0          0x00000001  // Reset generator 0 counter
143
 
144
//*****************************************************************************
145
//
146
// The following are defines for the bit fields in the PWM Output Enable
147
// register.
148
//
149
//*****************************************************************************
150
#define PWM_ENABLE_PWM7EN       0x00000080  // PWM7 pin enable
151
#define PWM_ENABLE_PWM6EN       0x00000040  // PWM6 pin enable
152
#define PWM_ENABLE_PWM5EN       0x00000020  // PWM5 pin enable
153
#define PWM_ENABLE_PWM4EN       0x00000010  // PWM4 pin enable
154
#define PWM_ENABLE_PWM3EN       0x00000008  // PWM3 pin enable
155
#define PWM_ENABLE_PWM2EN       0x00000004  // PWM2 pin enable
156
#define PWM_ENABLE_PWM1EN       0x00000002  // PWM1 pin enable
157
#define PWM_ENABLE_PWM0EN       0x00000001  // PWM0 pin enable
158
 
159
//*****************************************************************************
160
//
161
// The following are defines for the bit fields in the PWM Inversion register.
162
//
163
//*****************************************************************************
164
#define PWM_INVERT_PWM7INV      0x00000080  // PWM7 pin invert
165
#define PWM_INVERT_PWM6INV      0x00000040  // PWM6 pin invert
166
#define PWM_INVERT_PWM5INV      0x00000020  // PWM5 pin invert
167
#define PWM_INVERT_PWM4INV      0x00000010  // PWM4 pin invert
168
#define PWM_INVERT_PWM3INV      0x00000008  // PWM3 pin invert
169
#define PWM_INVERT_PWM2INV      0x00000004  // PWM2 pin invert
170
#define PWM_INVERT_PWM1INV      0x00000002  // PWM1 pin invert
171
#define PWM_INVERT_PWM0INV      0x00000001  // PWM0 pin invert
172
 
173
//*****************************************************************************
174
//
175
// The following are defines for the bit fields in the PWM Fault register.
176
//
177
//*****************************************************************************
178
#define PWM_FAULT_FAULT7        0x00000080  // PWM7 pin fault
179
#define PWM_FAULT_FAULT6        0x00000040  // PWM6 pin fault
180
#define PWM_FAULT_FAULT5        0x00000020  // PWM5 pin fault
181
#define PWM_FAULT_FAULT4        0x00000010  // PWM4 pin fault
182
#define PWM_FAULT_FAULT3        0x00000008  // PWM3 pin fault
183
#define PWM_FAULT_FAULT2        0x00000004  // PWM2 pin fault
184
#define PWM_FAULT_FAULT1        0x00000002  // PWM1 pin fault
185
#define PWM_FAULT_FAULT0        0x00000001  // PWM0 pin fault
186
 
187
//*****************************************************************************
188
//
189
// The following are defines for the bit fields in the PWM Status register.
190
//
191
//*****************************************************************************
192
#define PWM_STATUS_FAULT3       0x00000008  // Fault3 Interrupt Status.
193
#define PWM_STATUS_FAULT2       0x00000004  // Fault2 Interrupt Status.
194
#define PWM_STATUS_FAULT1       0x00000002  // Fault1 Interrupt Status.
195
#define PWM_STATUS_FAULT0       0x00000001  // Fault0 Interrupt Status.
196
 
197
//*****************************************************************************
198
//
199
// The following are defines for the PWM Generator standard offsets.
200
//
201
//*****************************************************************************
202
#define PWM_O_X_CTL             0x00000000  // Gen Control Reg
203
#define PWM_O_X_INTEN           0x00000004  // Gen Int/Trig Enable Reg
204
#define PWM_O_X_RIS             0x00000008  // Gen Raw Int Status Reg
205
#define PWM_O_X_ISC             0x0000000C  // Gen Int Status Reg
206
#define PWM_O_X_LOAD            0x00000010  // Gen Load Reg
207
#define PWM_O_X_COUNT           0x00000014  // Gen Counter Reg
208
#define PWM_O_X_CMPA            0x00000018  // Gen Compare A Reg
209
#define PWM_O_X_CMPB            0x0000001C  // Gen Compare B Reg
210
#define PWM_O_X_GENA            0x00000020  // Gen Generator A Ctrl Reg
211
#define PWM_O_X_GENB            0x00000024  // Gen Generator B Ctrl Reg
212
#define PWM_O_X_DBCTL           0x00000028  // Gen Dead Band Ctrl Reg
213
#define PWM_O_X_DBRISE          0x0000002C  // Gen DB Rising Edge Delay Reg
214
#define PWM_O_X_DBFALL          0x00000030  // Gen DB Falling Edge Delay Reg
215
#define PWM_O_X_FLTSRC0         0x00000034  // Fault pin, comparator condition
216
#define PWM_O_X_MINFLTPER       0x0000003C  // Fault minimum period extension
217
#define PWM_GEN_0_OFFSET        0x00000040  // PWM0 base
218
#define PWM_GEN_1_OFFSET        0x00000080  // PWM1 base
219
#define PWM_GEN_2_OFFSET        0x000000C0  // PWM2 base
220
#define PWM_GEN_3_OFFSET        0x00000100  // PWM3 base
221
 
222
//*****************************************************************************
223
//
224
// The following are defines for the PWM_X Control Register bit definitions.
225
//
226
//*****************************************************************************
227
#define PWM_X_CTL_LATCH         0x00040000  // Latch Fault Input.
228
#define PWM_X_CTL_MINFLTPER     0x00020000  // Minimum fault period enabled
229
#define PWM_X_CTL_FLTSRC        0x00010000  // Fault Condition Source.
230
#define PWM_X_CTL_DBFALLUPD_M   0x0000C000  // Specifies the update mode for
231
                                            // the PWMnDBFALL register.
232
#define PWM_X_CTL_DBFALLUPD_I   0x00000000  // Immediate
233
#define PWM_X_CTL_DBFALLUPD_LS  0x00008000  // Locally Synchronized
234
#define PWM_X_CTL_DBFALLUPD_GS  0x0000C000  // Globally Synchronized
235
#define PWM_X_CTL_DBRISEUPD_M   0x00003000  // PWMnDBRISE Update Mode.
236
#define PWM_X_CTL_DBRISEUPD_I   0x00000000  // Immediate
237
#define PWM_X_CTL_DBRISEUPD_LS  0x00002000  // Locally Synchronized
238
#define PWM_X_CTL_DBRISEUPD_GS  0x00003000  // Globally Synchronized
239
#define PWM_X_CTL_DBCTLUPD_M    0x00000C00  // PWMnDBCTL Update Mode.
240
#define PWM_X_CTL_DBCTLUPD_I    0x00000000  // Immediate
241
#define PWM_X_CTL_DBCTLUPD_LS   0x00000800  // Locally Synchronized
242
#define PWM_X_CTL_DBCTLUPD_GS   0x00000C00  // Globally Synchronized
243
#define PWM_X_CTL_GENBUPD_M     0x00000300  // PWMnGENB Update Mode.
244
#define PWM_X_CTL_GENBUPD_I     0x00000000  // Immediate
245
#define PWM_X_CTL_GENBUPD_LS    0x00000200  // Locally Synchronized
246
#define PWM_X_CTL_GENBUPD_GS    0x00000300  // Globally Synchronized
247
#define PWM_X_CTL_GENAUPD_M     0x000000C0  // PWMnGENA Update Mode.
248
#define PWM_X_CTL_GENAUPD_I     0x00000000  // Immediate
249
#define PWM_X_CTL_GENAUPD_LS    0x00000080  // Locally Synchronized
250
#define PWM_X_CTL_GENAUPD_GS    0x000000C0  // Globally Synchronized
251
#define PWM_X_CTL_CMPBUPD       0x00000020  // Update mode for comp B reg
252
#define PWM_X_CTL_CMPAUPD       0x00000010  // Update mode for comp A reg
253
#define PWM_X_CTL_LOADUPD       0x00000008  // Update mode for the load reg
254
#define PWM_X_CTL_DEBUG         0x00000004  // Debug mode
255
#define PWM_X_CTL_MODE          0x00000002  // Counter mode, down or up/down
256
#define PWM_X_CTL_ENABLE        0x00000001  // Master enable for gen block
257
 
258
//*****************************************************************************
259
//
260
// The following are defines for the PWM Generator extended offsets.
261
//
262
//*****************************************************************************
263
#define PWM_O_X_FLTSEN          0x00000000  // Fault logic sense
264
#define PWM_O_X_FLTSTAT0        0x00000004  // Pin and comparator status
265
#define PWM_EXT_0_OFFSET        0x00000800  // PWM0 extended base
266
#define PWM_EXT_1_OFFSET        0x00000880  // PWM1 extended base
267
#define PWM_EXT_2_OFFSET        0x00000900  // PWM2 extended base
268
#define PWM_EXT_3_OFFSET        0x00000980  // PWM3 extended base
269
 
270
//*****************************************************************************
271
//
272
// The following are defines for the PWM_X Interrupt/Trigger Enable Register
273
// bit definitions.
274
//
275
//*****************************************************************************
276
#define PWM_X_INTEN_TRCMPBD     0x00002000  // Trig if COUNT = CMPA D
277
#define PWM_X_INTEN_TRCMPBU     0x00001000  // Trig if COUNT = CMPA U
278
#define PWM_X_INTEN_TRCMPAD     0x00000800  // Trig if COUNT = CMPA D
279
#define PWM_X_INTEN_TRCMPAU     0x00000400  // Trig if COUNT = CMPA U
280
#define PWM_X_INTEN_TRCNTLOAD   0x00000200  // Trig if COUNT = LOAD
281
#define PWM_X_INTEN_TRCNTZERO   0x00000100  // Trig if COUNT = 0
282
#define PWM_X_INTEN_INTCMPBD    0x00000020  // Int if COUNT = CMPA D
283
#define PWM_X_INTEN_INTCMPBU    0x00000010  // Int if COUNT = CMPA U
284
#define PWM_X_INTEN_INTCMPAD    0x00000008  // Int if COUNT = CMPA D
285
#define PWM_X_INTEN_INTCMPAU    0x00000004  // Int if COUNT = CMPA U
286
#define PWM_X_INTEN_INTCNTLOAD  0x00000002  // Int if COUNT = LOAD
287
#define PWM_X_INTEN_INTCNTZERO  0x00000001  // Int if COUNT = 0
288
 
289
//*****************************************************************************
290
//
291
// The following are defines for the PWM_X Raw Interrupt Status Register bit
292
// definitions.
293
//
294
//*****************************************************************************
295
#define PWM_X_RIS_INTCMPBD      0x00000020  // PWM_X_COUNT = PWM_X_CMPB D int
296
#define PWM_X_RIS_INTCMPBU      0x00000010  // PWM_X_COUNT = PWM_X_CMPB U int
297
#define PWM_X_RIS_INTCMPAD      0x00000008  // PWM_X_COUNT = PWM_X_CMPA D int
298
#define PWM_X_RIS_INTCMPAU      0x00000004  // PWM_X_COUNT = PWM_X_CMPA U int
299
#define PWM_X_RIS_INTCNTLOAD    0x00000002  // PWM_X_COUNT = PWM_X_LOAD int
300
#define PWM_X_RIS_INTCNTZERO    0x00000001  // PWM_X_COUNT = 0 int
301
 
302
//*****************************************************************************
303
//
304
// The following are defines for the bit fields in the PWM_O_INTEN register.
305
//
306
//*****************************************************************************
307
#define PWM_INTEN_INTFAULT3     0x00080000  // Interrupt Fault 3.
308
#define PWM_INTEN_INTFAULT2     0x00040000  // Interrupt Fault 2.
309
#define PWM_INTEN_INTFAULT1     0x00020000  // Interrupt Fault 1.
310
#define PWM_INTEN_INTFAULT      0x00010000  // Fault Interrupt Enable.
311
#define PWM_INTEN_INTFAULT0     0x00010000  // Interrupt Fault 0.
312
#define PWM_INTEN_INTPWM3       0x00000008  // PWM3 Interrupt Enable.
313
#define PWM_INTEN_INTPWM2       0x00000004  // PWM2 Interrupt Enable.
314
#define PWM_INTEN_INTPWM1       0x00000002  // PWM1 Interrupt Enable.
315
#define PWM_INTEN_INTPWM0       0x00000001  // PWM0 Interrupt Enable.
316
 
317
//*****************************************************************************
318
//
319
// The following are defines for the bit fields in the PWM_O_RIS register.
320
//
321
//*****************************************************************************
322
#define PWM_RIS_INTFAULT3       0x00080000  // Interrupt Fault PWM 3.
323
#define PWM_RIS_INTFAULT2       0x00040000  // Interrupt Fault PWM 2.
324
#define PWM_RIS_INTFAULT1       0x00020000  // Interrupt Fault PWM 1.
325
#define PWM_RIS_INTFAULT0       0x00010000  // Interrupt Fault PWM 0.
326
#define PWM_RIS_INTFAULT        0x00010000  // Fault Interrupt Asserted.
327
#define PWM_RIS_INTPWM3         0x00000008  // PWM3 Interrupt Asserted.
328
#define PWM_RIS_INTPWM2         0x00000004  // PWM2 Interrupt Asserted.
329
#define PWM_RIS_INTPWM1         0x00000002  // PWM1 Interrupt Asserted.
330
#define PWM_RIS_INTPWM0         0x00000001  // PWM0 Interrupt Asserted.
331
 
332
//*****************************************************************************
333
//
334
// The following are defines for the bit fields in the PWM_O_ISC register.
335
//
336
//*****************************************************************************
337
#define PWM_ISC_INTFAULT3       0x00080000  // FAULT3 Interrupt Asserted.
338
#define PWM_ISC_INTFAULT2       0x00040000  // FAULT2 Interrupt Asserted.
339
#define PWM_ISC_INTFAULT1       0x00020000  // FAULT1 Interrupt Asserted.
340
#define PWM_ISC_INTFAULT        0x00010000  // Fault Interrupt Asserted.
341
#define PWM_ISC_INTFAULT0       0x00010000  // FAULT0 Interrupt Asserted.
342
#define PWM_ISC_INTPWM3         0x00000008  // PWM3 Interrupt Status.
343
#define PWM_ISC_INTPWM2         0x00000004  // PWM2 Interrupt Status.
344
#define PWM_ISC_INTPWM1         0x00000002  // PWM1 Interrupt Status.
345
#define PWM_ISC_INTPWM0         0x00000001  // PWM0 Interrupt Status.
346
 
347
//*****************************************************************************
348
//
349
// The following are defines for the bit fields in the PWM_O_X_ISC register.
350
//
351
//*****************************************************************************
352
#define PWM_X_ISC_INTCMPBD      0x00000020  // Comparator B Down Interrupt.
353
#define PWM_X_ISC_INTCMPBU      0x00000010  // Comparator B Up Interrupt.
354
#define PWM_X_ISC_INTCMPAD      0x00000008  // Comparator A Down Interrupt.
355
#define PWM_X_ISC_INTCMPAU      0x00000004  // Comparator A Up Interrupt.
356
#define PWM_X_ISC_INTCNTLOAD    0x00000002  // Counter=Load Interrupt.
357
#define PWM_X_ISC_INTCNTZERO    0x00000001  // Counter=0 Interrupt.
358
 
359
//*****************************************************************************
360
//
361
// The following are defines for the bit fields in the PWM_O_X_LOAD register.
362
//
363
//*****************************************************************************
364
#define PWM_X_LOAD_M            0x0000FFFF  // Counter Load Value.
365
#define PWM_X_LOAD_S            0
366
 
367
//*****************************************************************************
368
//
369
// The following are defines for the bit fields in the PWM_O_X_COUNT register.
370
//
371
//*****************************************************************************
372
#define PWM_X_COUNT_M           0x0000FFFF  // Counter Value.
373
#define PWM_X_COUNT_S           0
374
 
375
//*****************************************************************************
376
//
377
// The following are defines for the bit fields in the PWM_O_X_CMPA register.
378
//
379
//*****************************************************************************
380
#define PWM_X_CMPA_M            0x0000FFFF  // Comparator A Value.
381
#define PWM_X_CMPA_S            0
382
 
383
//*****************************************************************************
384
//
385
// The following are defines for the bit fields in the PWM_O_X_CMPB register.
386
//
387
//*****************************************************************************
388
#define PWM_X_CMPB_M            0x0000FFFF  // Comparator B Value.
389
#define PWM_X_CMPB_S            0
390
 
391
//*****************************************************************************
392
//
393
// The following are defines for the bit fields in the PWM_O_X_GENA register.
394
//
395
//*****************************************************************************
396
#define PWM_X_GENA_ACTCMPBD_M   0x00000C00  // Action for Comparator B Down.
397
#define PWM_X_GENA_ACTCMPBD_NONE \
398
                                0x00000000  // Do nothing.
399
#define PWM_X_GENA_ACTCMPBD_INV 0x00000400  // Invert the output signal.
400
#define PWM_X_GENA_ACTCMPBD_ZERO \
401
                                0x00000800  // Set the output signal to 0.
402
#define PWM_X_GENA_ACTCMPBD_ONE 0x00000C00  // Set the output signal to 1.
403
#define PWM_X_GENA_ACTCMPBU_M   0x00000300  // Action for Comparator B Up.
404
#define PWM_X_GENA_ACTCMPBU_NONE \
405
                                0x00000000  // Do nothing.
406
#define PWM_X_GENA_ACTCMPBU_INV 0x00000100  // Invert the output signal.
407
#define PWM_X_GENA_ACTCMPBU_ZERO \
408
                                0x00000200  // Set the output signal to 0.
409
#define PWM_X_GENA_ACTCMPBU_ONE 0x00000300  // Set the output signal to 1.
410
#define PWM_X_GENA_ACTCMPAD_M   0x000000C0  // Action for Comparator A Down.
411
#define PWM_X_GENA_ACTCMPAD_NONE \
412
                                0x00000000  // Do nothing.
413
#define PWM_X_GENA_ACTCMPAD_INV 0x00000040  // Invert the output signal.
414
#define PWM_X_GENA_ACTCMPAD_ZERO \
415
                                0x00000080  // Set the output signal to 0.
416
#define PWM_X_GENA_ACTCMPAD_ONE 0x000000C0  // Set the output signal to 1.
417
#define PWM_X_GENA_ACTCMPAU_M   0x00000030  // Action for Comparator A Up.
418
#define PWM_X_GENA_ACTCMPAU_NONE \
419
                                0x00000000  // Do nothing.
420
#define PWM_X_GENA_ACTCMPAU_INV 0x00000010  // Invert the output signal.
421
#define PWM_X_GENA_ACTCMPAU_ZERO \
422
                                0x00000020  // Set the output signal to 0.
423
#define PWM_X_GENA_ACTCMPAU_ONE 0x00000030  // Set the output signal to 1.
424
#define PWM_X_GENA_ACTLOAD_M    0x0000000C  // Action for Counter=Load.
425
#define PWM_X_GENA_ACTLOAD_NONE 0x00000000  // Do nothing.
426
#define PWM_X_GENA_ACTLOAD_INV  0x00000004  // Invert the output signal.
427
#define PWM_X_GENA_ACTLOAD_ZERO 0x00000008  // Set the output signal to 0.
428
#define PWM_X_GENA_ACTLOAD_ONE  0x0000000C  // Set the output signal to 1.
429
#define PWM_X_GENA_ACTZERO_M    0x00000003  // Action for Counter=0.
430
#define PWM_X_GENA_ACTZERO_NONE 0x00000000  // Do nothing.
431
#define PWM_X_GENA_ACTZERO_INV  0x00000001  // Invert the output signal.
432
#define PWM_X_GENA_ACTZERO_ZERO 0x00000002  // Set the output signal to 0.
433
#define PWM_X_GENA_ACTZERO_ONE  0x00000003  // Set the output signal to 1.
434
 
435
//*****************************************************************************
436
//
437
// The following are defines for the bit fields in the PWM_O_X_GENB register.
438
//
439
//*****************************************************************************
440
#define PWM_X_GENB_ACTCMPBD_M   0x00000C00  // Action for Comparator B Down.
441
#define PWM_X_GENB_ACTCMPBD_NONE \
442
                                0x00000000  // Do nothing.
443
#define PWM_X_GENB_ACTCMPBD_INV 0x00000400  // Invert the output signal.
444
#define PWM_X_GENB_ACTCMPBD_ZERO \
445
                                0x00000800  // Set the output signal to 0.
446
#define PWM_X_GENB_ACTCMPBD_ONE 0x00000C00  // Set the output signal to 1.
447
#define PWM_X_GENB_ACTCMPBU_M   0x00000300  // Action for Comparator B Up.
448
#define PWM_X_GENB_ACTCMPBU_NONE \
449
                                0x00000000  // Do nothing.
450
#define PWM_X_GENB_ACTCMPBU_INV 0x00000100  // Invert the output signal.
451
#define PWM_X_GENB_ACTCMPBU_ZERO \
452
                                0x00000200  // Set the output signal to 0.
453
#define PWM_X_GENB_ACTCMPBU_ONE 0x00000300  // Set the output signal to 1.
454
#define PWM_X_GENB_ACTCMPAD_M   0x000000C0  // Action for Comparator A Down.
455
#define PWM_X_GENB_ACTCMPAD_NONE \
456
                                0x00000000  // Do nothing.
457
#define PWM_X_GENB_ACTCMPAD_INV 0x00000040  // Invert the output signal.
458
#define PWM_X_GENB_ACTCMPAD_ZERO \
459
                                0x00000080  // Set the output signal to 0.
460
#define PWM_X_GENB_ACTCMPAD_ONE 0x000000C0  // Set the output signal to 1.
461
#define PWM_X_GENB_ACTCMPAU_M   0x00000030  // Action for Comparator A Up.
462
#define PWM_X_GENB_ACTCMPAU_NONE \
463
                                0x00000000  // Do nothing.
464
#define PWM_X_GENB_ACTCMPAU_INV 0x00000010  // Invert the output signal.
465
#define PWM_X_GENB_ACTCMPAU_ZERO \
466
                                0x00000020  // Set the output signal to 0.
467
#define PWM_X_GENB_ACTCMPAU_ONE 0x00000030  // Set the output signal to 1.
468
#define PWM_X_GENB_ACTLOAD_M    0x0000000C  // Action for Counter=Load.
469
#define PWM_X_GENB_ACTLOAD_NONE 0x00000000  // Do nothing.
470
#define PWM_X_GENB_ACTLOAD_INV  0x00000004  // Invert the output signal.
471
#define PWM_X_GENB_ACTLOAD_ZERO 0x00000008  // Set the output signal to 0.
472
#define PWM_X_GENB_ACTLOAD_ONE  0x0000000C  // Set the output signal to 1.
473
#define PWM_X_GENB_ACTZERO_M    0x00000003  // Action for Counter=0.
474
#define PWM_X_GENB_ACTZERO_NONE 0x00000000  // Do nothing.
475
#define PWM_X_GENB_ACTZERO_INV  0x00000001  // Invert the output signal.
476
#define PWM_X_GENB_ACTZERO_ZERO 0x00000002  // Set the output signal to 0.
477
#define PWM_X_GENB_ACTZERO_ONE  0x00000003  // Set the output signal to 1.
478
 
479
//*****************************************************************************
480
//
481
// The following are defines for the bit fields in the PWM_O_X_DBCTL register.
482
//
483
//*****************************************************************************
484
#define PWM_X_DBCTL_ENABLE      0x00000001  // Dead-Band Generator Enable.
485
 
486
//*****************************************************************************
487
//
488
// The following are defines for the bit fields in the PWM_O_X_DBRISE register.
489
//
490
//*****************************************************************************
491
#define PWM_X_DBRISE_DELAY_M    0x00000FFF  // Dead-Band Rise Delay.
492
#define PWM_X_DBRISE_DELAY_S    0
493
 
494
//*****************************************************************************
495
//
496
// The following are defines for the bit fields in the PWM_O_X_DBFALL register.
497
//
498
//*****************************************************************************
499
#define PWM_X_DBFALL_DELAY_M    0x00000FFF  // Dead-Band Fall Delay.
500
#define PWM_X_DBFALL_DELAY_S    0
501
 
502
//*****************************************************************************
503
//
504
// The following are defines for the bit fields in the PWM_O_FAULTVAL register.
505
//
506
//*****************************************************************************
507
#define PWM_FAULTVAL_PWM7       0x00000080  // PWM7 Fault Value.
508
#define PWM_FAULTVAL_PWM6       0x00000040  // PWM6 Fault Value.
509
#define PWM_FAULTVAL_PWM5       0x00000020  // PWM5 Fault Value.
510
#define PWM_FAULTVAL_PWM4       0x00000010  // PWM4 Fault Value.
511
#define PWM_FAULTVAL_PWM3       0x00000008  // PWM3 Fault Value.
512
#define PWM_FAULTVAL_PWM2       0x00000004  // PWM2 Fault Value.
513
#define PWM_FAULTVAL_PWM1       0x00000002  // PWM1 Fault Value.
514
#define PWM_FAULTVAL_PWM0       0x00000001  // PWM0 Fault Value.
515
 
516
//*****************************************************************************
517
//
518
// The following are defines for the bit fields in the PWM_O_X_MINFLTPER
519
// register.
520
//
521
//*****************************************************************************
522
#define PWM_X_MINFLTPER_M       0x0000FFFF  // Minimum Fault Period.
523
#define PWM_X_MINFLTPER_S       0
524
 
525
//*****************************************************************************
526
//
527
// The following are defines for the bit fields in the PWM_O_X_FLTSEN register.
528
//
529
//*****************************************************************************
530
#define PWM_X_FLTSEN_FAULT3     0x00000008  // Fault3 Sense.
531
#define PWM_X_FLTSEN_FAULT2     0x00000004  // Fault2 Sense.
532
#define PWM_X_FLTSEN_FAULT1     0x00000002  // Fault1 Sense.
533
#define PWM_X_FLTSEN_FAULT0     0x00000001  // Fault0 Sense.
534
 
535
//*****************************************************************************
536
//
537
// The following are defines for the bit fields in the PWM_O_X_FLTSRC0
538
// register.
539
//
540
//*****************************************************************************
541
#define PWM_X_FLTSRC0_FAULT3    0x00000008  // Fault3.
542
#define PWM_X_FLTSRC0_FAULT2    0x00000004  // Fault2.
543
#define PWM_X_FLTSRC0_FAULT1    0x00000002  // Fault1.
544
#define PWM_X_FLTSRC0_FAULT0    0x00000001  // Fault0.
545
 
546
//*****************************************************************************
547
//
548
// The following are defines for the bit fields in the PWM_O_X_FLTSTAT0
549
// register.
550
//
551
//*****************************************************************************
552
#define PWM_X_FLTSTAT0_FAULT3   0x00000008  // Fault Input 3.
553
#define PWM_X_FLTSTAT0_FAULT2   0x00000004  // Fault Input 2.
554
#define PWM_X_FLTSTAT0_FAULT1   0x00000002  // Fault Input 1.
555
#define PWM_X_FLTSTAT0_FAULT0   0x00000001  // Fault Input 0.
556
 
557
//*****************************************************************************
558
//
559
// The following definitions are deprecated.
560
//
561
//*****************************************************************************
562
#ifndef DEPRECATED
563
 
564
//*****************************************************************************
565
//
566
// The following are deprecated defines for the bit fields in the PWM Master
567
// Control register.
568
//
569
//*****************************************************************************
570
#define PWM_CTL_GLOBAL_SYNC2    0x00000004  // Global sync generator 2
571
#define PWM_CTL_GLOBAL_SYNC1    0x00000002  // Global sync generator 1
572
#define PWM_CTL_GLOBAL_SYNC0    0x00000001  // Global sync generator 0
573
 
574
//*****************************************************************************
575
//
576
// The following are deprecated defines for the PWM Interrupt Register bit
577
// definitions.
578
//
579
//*****************************************************************************
580
#define PWM_INT_INTFAULT        0x00010000  // Fault interrupt pending
581
 
582
//*****************************************************************************
583
//
584
// The following are deprecated defines for the bit fields in the PWM Status
585
// register.
586
//
587
//*****************************************************************************
588
#define PWM_STATUS_FAULT        0x00000001  // Fault status
589
 
590
//*****************************************************************************
591
//
592
// The following are deprecated defines for the PWM_X Interrupt Status Register
593
// bit definitions.
594
//
595
//*****************************************************************************
596
#define PWM_X_INT_INTCMPBD      0x00000020  // PWM_X_COUNT = PWM_X_CMPB D rcvd
597
#define PWM_X_INT_INTCMPBU      0x00000010  // PWM_X_COUNT = PWM_X_CMPB U rcvd
598
#define PWM_X_INT_INTCMPAD      0x00000008  // PWM_X_COUNT = PWM_X_CMPA D rcvd
599
#define PWM_X_INT_INTCMPAU      0x00000004  // PWM_X_COUNT = PWM_X_CMPA U rcvd
600
#define PWM_X_INT_INTCNTLOAD    0x00000002  // PWM_X_COUNT = PWM_X_LOAD rcvd
601
#define PWM_X_INT_INTCNTZERO    0x00000001  // PWM_X_COUNT = 0 received
602
 
603
//*****************************************************************************
604
//
605
// The following are deprecated defines for the PWM_X Generator A/B Control
606
// Register bit definitions.
607
//
608
//*****************************************************************************
609
#define PWM_X_GEN_Y_ACTCMPBD    0x00000C00  // Act PWM_X_COUNT = PWM_X_CMPB D
610
#define PWM_X_GEN_Y_ACTCMPBU    0x00000300  // Act PWM_X_COUNT = PWM_X_CMPB U
611
#define PWM_X_GEN_Y_ACTCMPAD    0x000000C0  // Act PWM_X_COUNT = PWM_X_CMPA D
612
#define PWM_X_GEN_Y_ACTCMPAU    0x00000030  // Act PWM_X_COUNT = PWM_X_CMPA U
613
#define PWM_X_GEN_Y_ACTLOAD     0x0000000C  // Act PWM_X_COUNT = PWM_X_LOAD
614
#define PWM_X_GEN_Y_ACTZERO     0x00000003  // Act PWM_X_COUNT = 0
615
 
616
//*****************************************************************************
617
//
618
// The following are deprecated defines for the PWM_X Generator A/B Control
619
// Register action definitions.
620
//
621
//*****************************************************************************
622
#define PWM_GEN_ACT_ONE         0x00000003  // Set the output signal to one
623
#define PWM_GEN_ACT_ZERO        0x00000002  // Set the output signal to zero
624
#define PWM_GEN_ACT_INV         0x00000001  // Invert the output signal
625
#define PWM_GEN_ACT_NONE        0x00000000  // Do nothing
626
#define PWM_GEN_ACT_B_DN_SHIFT  10          // Shift amount for the B dn action
627
#define PWM_GEN_ACT_B_UP_SHIFT  8           // Shift amount for the B up action
628
#define PWM_GEN_ACT_A_DN_SHIFT  6           // Shift amount for the A dn action
629
#define PWM_GEN_ACT_A_UP_SHIFT  4           // Shift amount for the A up action
630
#define PWM_GEN_ACT_LOAD_SHIFT  2           // Shift amount for the load action
631
#define PWM_GEN_ACT_ZERO_SHIFT  0           // Shift amount for the zero action
632
 
633
//*****************************************************************************
634
//
635
// The following are deprecated defines for the PWM_X Dead Band Control
636
// Register bit definitions.
637
//
638
//*****************************************************************************
639
#define PWM_DBCTL_ENABLE        0x00000001  // Enable dead band insertion
640
 
641
//*****************************************************************************
642
//
643
// The following are deprecated defines for the PWM Register reset values.
644
//
645
//*****************************************************************************
646
#define PWM_RV_X_DBCTL          0x00000000  // Control the dead band generator
647
#define PWM_RV_STATUS           0x00000000  // Status
648
#define PWM_RV_X_ISC            0x00000000  // Interrupt status and clearing
649
#define PWM_RV_X_RIS            0x00000000  // Raw interrupt status
650
#define PWM_RV_X_CTL            0x00000000  // Master control of the PWM
651
                                            // generator block
652
#define PWM_RV_SYNC             0x00000000  // Counter synch for PWM generators
653
#define PWM_RV_X_DBFALL         0x00000000  // The dead band falling edge delay
654
                                            // count
655
#define PWM_RV_X_INTEN          0x00000000  // Interrupt and trigger enable
656
#define PWM_RV_X_LOAD           0x00000000  // The load value for the counter
657
#define PWM_RV_X_GENA           0x00000000  // Controls PWM generator A
658
#define PWM_RV_CTL              0x00000000  // Master control of the PWM module
659
#define PWM_RV_FAULT            0x00000000  // Fault handling for the PWM
660
                                            // output pins
661
#define PWM_RV_RIS              0x00000000  // Raw interrupt status
662
#define PWM_RV_X_CMPA           0x00000000  // The comparator A value
663
#define PWM_RV_INVERT           0x00000000  // Inversion control for PWM output
664
                                            // pins
665
#define PWM_RV_X_DBRISE         0x00000000  // The dead band rising edge delay
666
                                            // count
667
#define PWM_RV_ENABLE           0x00000000  // Master enable for the PWM output
668
                                            // pins
669
#define PWM_RV_X_GENB           0x00000000  // Controls PWM generator B
670
#define PWM_RV_X_CMPB           0x00000000  // The comparator B value
671
#define PWM_RV_ISC              0x00000000  // Interrupt status and clearing
672
#define PWM_RV_INTEN            0x00000000  // Interrupt enable
673
#define PWM_RV_X_COUNT          0x00000000  // The current counter value
674
 
675
#endif
676
 
677
#endif // __HW_PWM_H__

powered by: WebSVN 2.1.0

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