+/rtos

git clone https://git.julia.blue/+/rtos

Joseph RyanRedo adc initialization0f0b895

master
42.8 KiB837 linesraw
1//*****************************************************************************
2//
3// hw_timer.h - Defines and macros used when accessing the timer.
4//
5// Copyright (c) 2005-2017 Texas Instruments Incorporated.  All rights reserved.
6// Software License Agreement
7//
8//   Redistribution and use in source and binary forms, with or without
9//   modification, are permitted provided that the following conditions
10//   are met:
11//
12//   Redistributions of source code must retain the above copyright
13//   notice, this list of conditions and the following disclaimer.
14//
15//   Redistributions in binary form must reproduce the above copyright
16//   notice, this list of conditions and the following disclaimer in the
17//   documentation and/or other materials provided with the
18//   distribution.
19//
20//   Neither the name of Texas Instruments Incorporated nor the names of
21//   its contributors may be used to endorse or promote products derived
22//   from this software without specific prior written permission.
23//
24// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35//
36// This is part of revision 2.1.4.178 of the Tiva Firmware Development Package.
37//
38//*****************************************************************************
39
40#ifndef __HW_TIMER_H__
41#define __HW_TIMER_H__
42
43//*****************************************************************************
44//
45// The following are defines for the Timer register offsets.
46//
47//*****************************************************************************
48#define TIMER_O_CFG 0x00000000      // GPTM Configuration
49#define TIMER_O_TAMR 0x00000004     // GPTM Timer A Mode
50#define TIMER_O_TBMR 0x00000008     // GPTM Timer B Mode
51#define TIMER_O_CTL 0x0000000C      // GPTM Control
52#define TIMER_O_SYNC 0x00000010     // GPTM Synchronize
53#define TIMER_O_IMR 0x00000018      // GPTM Interrupt Mask
54#define TIMER_O_RIS 0x0000001C      // GPTM Raw Interrupt Status
55#define TIMER_O_MIS 0x00000020      // GPTM Masked Interrupt Status
56#define TIMER_O_ICR 0x00000024      // GPTM Interrupt Clear
57#define TIMER_O_TAILR 0x00000028    // GPTM Timer A Interval Load
58#define TIMER_O_TBILR 0x0000002C    // GPTM Timer B Interval Load
59#define TIMER_O_TAMATCHR 0x00000030 // GPTM Timer A Match
60#define TIMER_O_TBMATCHR 0x00000034 // GPTM Timer B Match
61#define TIMER_O_TAPR 0x00000038     // GPTM Timer A Prescale
62#define TIMER_O_TBPR 0x0000003C     // GPTM Timer B Prescale
63#define TIMER_O_TAPMR 0x00000040    // GPTM TimerA Prescale Match
64#define TIMER_O_TBPMR 0x00000044    // GPTM TimerB Prescale Match
65#define TIMER_O_TAR 0x00000048      // GPTM Timer A
66#define TIMER_O_TBR 0x0000004C      // GPTM Timer B
67#define TIMER_O_TAV 0x00000050      // GPTM Timer A Value
68#define TIMER_O_TBV 0x00000054      // GPTM Timer B Value
69#define TIMER_O_RTCPD 0x00000058    // GPTM RTC Predivide
70#define TIMER_O_TAPS 0x0000005C     // GPTM Timer A Prescale Snapshot
71#define TIMER_O_TBPS 0x00000060     // GPTM Timer B Prescale Snapshot
72#define TIMER_O_TAPV 0x00000064     // GPTM Timer A Prescale Value
73#define TIMER_O_TBPV 0x00000068     // GPTM Timer B Prescale Value
74#define TIMER_O_DMAEV 0x0000006C    // GPTM DMA Event
75#define TIMER_O_ADCEV 0x00000070    // GPTM ADC Event
76#define TIMER_O_PP 0x00000FC0       // GPTM Peripheral Properties
77#define TIMER_O_CC 0x00000FC8       // GPTM Clock Configuration
78
79//*****************************************************************************
80//
81// The following are defines for the bit fields in the TIMER_O_CFG register.
82//
83//*****************************************************************************
84#define TIMER_CFG_M 0x00000007 // GPTM Configuration
85#define TIMER_CFG_32_BIT_TIMER                                                 \
86    0x00000000 // For a 16/32-bit timer, this
87               // value selects the 32-bit timer
88               // configuration
89#define TIMER_CFG_32_BIT_RTC                                                   \
90    0x00000001 // For a 16/32-bit timer, this
91               // value selects the 32-bit
92               // real-time clock (RTC) counter
93               // configuration
94#define TIMER_CFG_16_BIT                                                       \
95    0x00000004 // For a 16/32-bit timer, this
96               // value selects the 16-bit timer
97               // configuration
98
99//*****************************************************************************
100//
101// The following are defines for the bit fields in the TIMER_O_TAMR register.
102//
103//*****************************************************************************
104#define TIMER_TAMR_TCACT_M 0x0000E000      // Timer Compare Action Select
105#define TIMER_TAMR_TCACT_NONE 0x00000000   // Disable compare operations
106#define TIMER_TAMR_TCACT_TOGGLE 0x00002000 // Toggle State on Time-Out
107#define TIMER_TAMR_TCACT_CLRTO 0x00004000  // Clear CCP on Time-Out
108#define TIMER_TAMR_TCACT_SETTO 0x00006000  // Set CCP on Time-Out
109#define TIMER_TAMR_TCACT_SETTOGTO                                              \
110    0x00008000 // Set CCP immediately and toggle
111               // on Time-Out
112#define TIMER_TAMR_TCACT_CLRTOGTO                                              \
113    0x0000A000 // Clear CCP immediately and toggle
114               // on Time-Out
115#define TIMER_TAMR_TCACT_SETCLRTO                                              \
116    0x0000C000 // Set CCP immediately and clear on
117               // Time-Out
118#define TIMER_TAMR_TCACT_CLRSETTO                                              \
119    0x0000E000 // Clear CCP immediately and set on
120               // Time-Out
121#define TIMER_TAMR_TACINTD                                                     \
122    0x00001000 // One-shot/Periodic Interrupt
123               // Disable
124#define TIMER_TAMR_TAPLO                                                       \
125    0x00000800 // GPTM Timer A PWM Legacy
126               // Operation
127#define TIMER_TAMR_TAMRSU                                                      \
128    0x00000400 // GPTM Timer A Match Register
129               // Update
130#define TIMER_TAMR_TAPWMIE                                                     \
131    0x00000200                        // GPTM Timer A PWM Interrupt
132                                      // Enable
133#define TIMER_TAMR_TAILD 0x00000100   // GPTM Timer A Interval Load Write
134#define TIMER_TAMR_TASNAPS 0x00000080 // GPTM Timer A Snap-Shot Mode
135#define TIMER_TAMR_TAWOT 0x00000040   // GPTM Timer A Wait-on-Trigger
136#define TIMER_TAMR_TAMIE                                                       \
137    0x00000020                       // GPTM Timer A Match Interrupt
138                                     // Enable
139#define TIMER_TAMR_TACDIR 0x00000010 // GPTM Timer A Count Direction
140#define TIMER_TAMR_TAAMS                                                       \
141    0x00000008                            // GPTM Timer A Alternate Mode
142                                          // Select
143#define TIMER_TAMR_TACMR 0x00000004       // GPTM Timer A Capture Mode
144#define TIMER_TAMR_TAMR_M 0x00000003      // GPTM Timer A Mode
145#define TIMER_TAMR_TAMR_1_SHOT 0x00000001 // One-Shot Timer mode
146#define TIMER_TAMR_TAMR_PERIOD 0x00000002 // Periodic Timer mode
147#define TIMER_TAMR_TAMR_CAP 0x00000003    // Capture mode
148
149//*****************************************************************************
150//
151// The following are defines for the bit fields in the TIMER_O_TBMR register.
152//
153//*****************************************************************************
154#define TIMER_TBMR_TCACT_M 0x0000E000      // Timer Compare Action Select
155#define TIMER_TBMR_TCACT_NONE 0x00000000   // Disable compare operations
156#define TIMER_TBMR_TCACT_TOGGLE 0x00002000 // Toggle State on Time-Out
157#define TIMER_TBMR_TCACT_CLRTO 0x00004000  // Clear CCP on Time-Out
158#define TIMER_TBMR_TCACT_SETTO 0x00006000  // Set CCP on Time-Out
159#define TIMER_TBMR_TCACT_SETTOGTO                                              \
160    0x00008000 // Set CCP immediately and toggle
161               // on Time-Out
162#define TIMER_TBMR_TCACT_CLRTOGTO                                              \
163    0x0000A000 // Clear CCP immediately and toggle
164               // on Time-Out
165#define TIMER_TBMR_TCACT_SETCLRTO                                              \
166    0x0000C000 // Set CCP immediately and clear on
167               // Time-Out
168#define TIMER_TBMR_TCACT_CLRSETTO                                              \
169    0x0000E000 // Clear CCP immediately and set on
170               // Time-Out
171#define TIMER_TBMR_TBCINTD                                                     \
172    0x00001000 // One-Shot/Periodic Interrupt
173               // Disable
174#define TIMER_TBMR_TBPLO                                                       \
175    0x00000800 // GPTM Timer B PWM Legacy
176               // Operation
177#define TIMER_TBMR_TBMRSU                                                      \
178    0x00000400 // GPTM Timer B Match Register
179               // Update
180#define TIMER_TBMR_TBPWMIE                                                     \
181    0x00000200                        // GPTM Timer B PWM Interrupt
182                                      // Enable
183#define TIMER_TBMR_TBILD 0x00000100   // GPTM Timer B Interval Load Write
184#define TIMER_TBMR_TBSNAPS 0x00000080 // GPTM Timer B Snap-Shot Mode
185#define TIMER_TBMR_TBWOT 0x00000040   // GPTM Timer B Wait-on-Trigger
186#define TIMER_TBMR_TBMIE                                                       \
187    0x00000020                       // GPTM Timer B Match Interrupt
188                                     // Enable
189#define TIMER_TBMR_TBCDIR 0x00000010 // GPTM Timer B Count Direction
190#define TIMER_TBMR_TBAMS                                                       \
191    0x00000008                            // GPTM Timer B Alternate Mode
192                                          // Select
193#define TIMER_TBMR_TBCMR 0x00000004       // GPTM Timer B Capture Mode
194#define TIMER_TBMR_TBMR_M 0x00000003      // GPTM Timer B Mode
195#define TIMER_TBMR_TBMR_1_SHOT 0x00000001 // One-Shot Timer mode
196#define TIMER_TBMR_TBMR_PERIOD 0x00000002 // Periodic Timer mode
197#define TIMER_TBMR_TBMR_CAP 0x00000003    // Capture mode
198
199//*****************************************************************************
200//
201// The following are defines for the bit fields in the TIMER_O_CTL register.
202//
203//*****************************************************************************
204#define TIMER_CTL_TBPWML 0x00004000 // GPTM Timer B PWM Output Level
205#define TIMER_CTL_TBOTE                                                        \
206    0x00002000                            // GPTM Timer B Output Trigger
207                                          // Enable
208#define TIMER_CTL_TBEVENT_M 0x00000C00    // GPTM Timer B Event Mode
209#define TIMER_CTL_TBEVENT_POS 0x00000000  // Positive edge
210#define TIMER_CTL_TBEVENT_NEG 0x00000400  // Negative edge
211#define TIMER_CTL_TBEVENT_BOTH 0x00000C00 // Both edges
212#define TIMER_CTL_TBSTALL 0x00000200      // GPTM Timer B Stall Enable
213#define TIMER_CTL_TBEN 0x00000100         // GPTM Timer B Enable
214#define TIMER_CTL_TAPWML 0x00000040       // GPTM Timer A PWM Output Level
215#define TIMER_CTL_TAOTE                                                        \
216    0x00000020                            // GPTM Timer A Output Trigger
217                                          // Enable
218#define TIMER_CTL_RTCEN 0x00000010        // GPTM RTC Stall Enable
219#define TIMER_CTL_TAEVENT_M 0x0000000C    // GPTM Timer A Event Mode
220#define TIMER_CTL_TAEVENT_POS 0x00000000  // Positive edge
221#define TIMER_CTL_TAEVENT_NEG 0x00000004  // Negative edge
222#define TIMER_CTL_TAEVENT_BOTH 0x0000000C // Both edges
223#define TIMER_CTL_TASTALL 0x00000002      // GPTM Timer A Stall Enable
224#define TIMER_CTL_TAEN 0x00000001         // GPTM Timer A Enable
225
226//*****************************************************************************
227//
228// The following are defines for the bit fields in the TIMER_O_SYNC register.
229//
230//*****************************************************************************
231#define TIMER_SYNC_SYNCWT5_M                                                   \
232    0x00C00000 // Synchronize GPTM 32/64-Bit Timer
233               // 5
234#define TIMER_SYNC_SYNCWT5_NONE                                                \
235    0x00000000 // GPTM 32/64-Bit Timer 5 is not
236               // affected
237#define TIMER_SYNC_SYNCWT5_TA                                                  \
238    0x00400000 // A timeout event for Timer A of
239               // GPTM 32/64-Bit Timer 5 is
240               // triggered
241#define TIMER_SYNC_SYNCWT5_TB                                                  \
242    0x00800000 // A timeout event for Timer B of
243               // GPTM 32/64-Bit Timer 5 is
244               // triggered
245#define TIMER_SYNC_SYNCWT5_TATB                                                \
246    0x00C00000 // A timeout event for both Timer A
247               // and Timer B of GPTM 32/64-Bit
248               // Timer 5 is triggered
249#define TIMER_SYNC_SYNCWT4_M                                                   \
250    0x00300000 // Synchronize GPTM 32/64-Bit Timer
251               // 4
252#define TIMER_SYNC_SYNCWT4_NONE                                                \
253    0x00000000 // GPTM 32/64-Bit Timer 4 is not
254               // affected
255#define TIMER_SYNC_SYNCWT4_TA                                                  \
256    0x00100000 // A timeout event for Timer A of
257               // GPTM 32/64-Bit Timer 4 is
258               // triggered
259#define TIMER_SYNC_SYNCWT4_TB                                                  \
260    0x00200000 // A timeout event for Timer B of
261               // GPTM 32/64-Bit Timer 4 is
262               // triggered
263#define TIMER_SYNC_SYNCWT4_TATB                                                \
264    0x00300000 // A timeout event for both Timer A
265               // and Timer B of GPTM 32/64-Bit
266               // Timer 4 is triggered
267#define TIMER_SYNC_SYNCWT3_M                                                   \
268    0x000C0000 // Synchronize GPTM 32/64-Bit Timer
269               // 3
270#define TIMER_SYNC_SYNCWT3_NONE                                                \
271    0x00000000 // GPTM 32/64-Bit Timer 3 is not
272               // affected
273#define TIMER_SYNC_SYNCWT3_TA                                                  \
274    0x00040000 // A timeout event for Timer A of
275               // GPTM 32/64-Bit Timer 3 is
276               // triggered
277#define TIMER_SYNC_SYNCWT3_TB                                                  \
278    0x00080000 // A timeout event for Timer B of
279               // GPTM 32/64-Bit Timer 3 is
280               // triggered
281#define TIMER_SYNC_SYNCWT3_TATB                                                \
282    0x000C0000 // A timeout event for both Timer A
283               // and Timer B of GPTM 32/64-Bit
284               // Timer 3 is triggered
285#define TIMER_SYNC_SYNCWT2_M                                                   \
286    0x00030000 // Synchronize GPTM 32/64-Bit Timer
287               // 2
288#define TIMER_SYNC_SYNCWT2_NONE                                                \
289    0x00000000 // GPTM 32/64-Bit Timer 2 is not
290               // affected
291#define TIMER_SYNC_SYNCWT2_TA                                                  \
292    0x00010000 // A timeout event for Timer A of
293               // GPTM 32/64-Bit Timer 2 is
294               // triggered
295#define TIMER_SYNC_SYNCWT2_TB                                                  \
296    0x00020000 // A timeout event for Timer B of
297               // GPTM 32/64-Bit Timer 2 is
298               // triggered
299#define TIMER_SYNC_SYNCWT2_TATB                                                \
300    0x00030000                            // A timeout event for both Timer A
301                                          // and Timer B of GPTM 32/64-Bit
302                                          // Timer 2 is triggered
303#define TIMER_SYNC_SYNCT7_M 0x0000C000    // Synchronize GPTM Timer 7
304#define TIMER_SYNC_SYNCT7_NONE 0x00000000 // GPT7 is not affected
305#define TIMER_SYNC_SYNCT7_TA                                                   \
306    0x00004000 // A timeout event for Timer A of
307               // GPTM7 is triggered
308#define TIMER_SYNC_SYNCT7_TB                                                   \
309    0x00008000 // A timeout event for Timer B of
310               // GPTM7 is triggered
311#define TIMER_SYNC_SYNCT7_TATB                                                 \
312    0x0000C000 // A timeout event for both Timer A
313               // and Timer B of GPTM7 is
314               // triggered
315#define TIMER_SYNC_SYNCWT1_M                                                   \
316    0x0000C000 // Synchronize GPTM 32/64-Bit Timer
317               // 1
318#define TIMER_SYNC_SYNCWT1_NONE                                                \
319    0x00000000 // GPTM 32/64-Bit Timer 1 is not
320               // affected
321#define TIMER_SYNC_SYNCWT1_TA                                                  \
322    0x00004000 // A timeout event for Timer A of
323               // GPTM 32/64-Bit Timer 1 is
324               // triggered
325#define TIMER_SYNC_SYNCWT1_TB                                                  \
326    0x00008000 // A timeout event for Timer B of
327               // GPTM 32/64-Bit Timer 1 is
328               // triggered
329#define TIMER_SYNC_SYNCWT1_TATB                                                \
330    0x0000C000 // A timeout event for both Timer A
331               // and Timer B of GPTM 32/64-Bit
332               // Timer 1 is triggered
333#define TIMER_SYNC_SYNCWT0_M                                                   \
334    0x00003000 // Synchronize GPTM 32/64-Bit Timer
335               // 0
336#define TIMER_SYNC_SYNCWT0_NONE                                                \
337    0x00000000 // GPTM 32/64-Bit Timer 0 is not
338               // affected
339#define TIMER_SYNC_SYNCWT0_TA                                                  \
340    0x00001000 // A timeout event for Timer A of
341               // GPTM 32/64-Bit Timer 0 is
342               // triggered
343#define TIMER_SYNC_SYNCWT0_TB                                                  \
344    0x00002000 // A timeout event for Timer B of
345               // GPTM 32/64-Bit Timer 0 is
346               // triggered
347#define TIMER_SYNC_SYNCWT0_TATB                                                \
348    0x00003000                            // A timeout event for both Timer A
349                                          // and Timer B of GPTM 32/64-Bit
350                                          // Timer 0 is triggered
351#define TIMER_SYNC_SYNCT6_M 0x00003000    // Synchronize GPTM Timer 6
352#define TIMER_SYNC_SYNCT6_NONE 0x00000000 // GPTM6 is not affected
353#define TIMER_SYNC_SYNCT6_TA                                                   \
354    0x00001000 // A timeout event for Timer A of
355               // GPTM6 is triggered
356#define TIMER_SYNC_SYNCT6_TB                                                   \
357    0x00002000 // A timeout event for Timer B of
358               // GPTM6 is triggered
359#define TIMER_SYNC_SYNCT6_TATB                                                 \
360    0x00003000                            // A timeout event for both Timer A
361                                          // and Timer B of GPTM6 is
362                                          // triggered
363#define TIMER_SYNC_SYNCT5_M 0x00000C00    // Synchronize GPTM Timer 5
364#define TIMER_SYNC_SYNCT5_NONE 0x00000000 // GPTM5 is not affected
365#define TIMER_SYNC_SYNCT5_TA                                                   \
366    0x00000400 // A timeout event for Timer A of
367               // GPTM5 is triggered
368#define TIMER_SYNC_SYNCT5_TB                                                   \
369    0x00000800 // A timeout event for Timer B of
370               // GPTM5 is triggered
371#define TIMER_SYNC_SYNCT5_TATB                                                 \
372    0x00000C00                            // A timeout event for both Timer A
373                                          // and Timer B of GPTM5 is
374                                          // triggered
375#define TIMER_SYNC_SYNCT4_M 0x00000300    // Synchronize GPTM Timer 4
376#define TIMER_SYNC_SYNCT4_NONE 0x00000000 // GPTM4 is not affected
377#define TIMER_SYNC_SYNCT4_TA                                                   \
378    0x00000100 // A timeout event for Timer A of
379               // GPTM4 is triggered
380#define TIMER_SYNC_SYNCT4_TB                                                   \
381    0x00000200 // A timeout event for Timer B of
382               // GPTM4 is triggered
383#define TIMER_SYNC_SYNCT4_TATB                                                 \
384    0x00000300                            // A timeout event for both Timer A
385                                          // and Timer B of GPTM4 is
386                                          // triggered
387#define TIMER_SYNC_SYNCT3_M 0x000000C0    // Synchronize GPTM Timer 3
388#define TIMER_SYNC_SYNCT3_NONE 0x00000000 // GPTM3 is not affected
389#define TIMER_SYNC_SYNCT3_TA                                                   \
390    0x00000040 // A timeout event for Timer A of
391               // GPTM3 is triggered
392#define TIMER_SYNC_SYNCT3_TB                                                   \
393    0x00000080 // A timeout event for Timer B of
394               // GPTM3 is triggered
395#define TIMER_SYNC_SYNCT3_TATB                                                 \
396    0x000000C0                            // A timeout event for both Timer A
397                                          // and Timer B of GPTM3 is
398                                          // triggered
399#define TIMER_SYNC_SYNCT2_M 0x00000030    // Synchronize GPTM Timer 2
400#define TIMER_SYNC_SYNCT2_NONE 0x00000000 // GPTM2 is not affected
401#define TIMER_SYNC_SYNCT2_TA                                                   \
402    0x00000010 // A timeout event for Timer A of
403               // GPTM2 is triggered
404#define TIMER_SYNC_SYNCT2_TB                                                   \
405    0x00000020 // A timeout event for Timer B of
406               // GPTM2 is triggered
407#define TIMER_SYNC_SYNCT2_TATB                                                 \
408    0x00000030                            // A timeout event for both Timer A
409                                          // and Timer B of GPTM2 is
410                                          // triggered
411#define TIMER_SYNC_SYNCT1_M 0x0000000C    // Synchronize GPTM Timer 1
412#define TIMER_SYNC_SYNCT1_NONE 0x00000000 // GPTM1 is not affected
413#define TIMER_SYNC_SYNCT1_TA                                                   \
414    0x00000004 // A timeout event for Timer A of
415               // GPTM1 is triggered
416#define TIMER_SYNC_SYNCT1_TB                                                   \
417    0x00000008 // A timeout event for Timer B of
418               // GPTM1 is triggered
419#define TIMER_SYNC_SYNCT1_TATB                                                 \
420    0x0000000C                            // A timeout event for both Timer A
421                                          // and Timer B of GPTM1 is
422                                          // triggered
423#define TIMER_SYNC_SYNCT0_M 0x00000003    // Synchronize GPTM Timer 0
424#define TIMER_SYNC_SYNCT0_NONE 0x00000000 // GPTM0 is not affected
425#define TIMER_SYNC_SYNCT0_TA                                                   \
426    0x00000001 // A timeout event for Timer A of
427               // GPTM0 is triggered
428#define TIMER_SYNC_SYNCT0_TB                                                   \
429    0x00000002 // A timeout event for Timer B of
430               // GPTM0 is triggered
431#define TIMER_SYNC_SYNCT0_TATB                                                 \
432    0x00000003 // A timeout event for both Timer A
433               // and Timer B of GPTM0 is
434               // triggered
435
436//*****************************************************************************
437//
438// The following are defines for the bit fields in the TIMER_O_IMR register.
439//
440//*****************************************************************************
441#define TIMER_IMR_WUEIM                                                        \
442    0x00010000 // 32/64-Bit Wide GPTM Write Update
443               // Error Interrupt Mask
444#define TIMER_IMR_DMABIM                                                       \
445    0x00002000 // GPTM Timer B DMA Done Interrupt
446               // Mask
447#define TIMER_IMR_TBMIM                                                        \
448    0x00000800 // GPTM Timer B Match Interrupt
449               // Mask
450#define TIMER_IMR_CBEIM                                                        \
451    0x00000400 // GPTM Timer B Capture Mode Event
452               // Interrupt Mask
453#define TIMER_IMR_CBMIM                                                        \
454    0x00000200 // GPTM Timer B Capture Mode Match
455               // Interrupt Mask
456#define TIMER_IMR_TBTOIM                                                       \
457    0x00000100 // GPTM Timer B Time-Out Interrupt
458               // Mask
459#define TIMER_IMR_DMAAIM                                                       \
460    0x00000020 // GPTM Timer A DMA Done Interrupt
461               // Mask
462#define TIMER_IMR_TAMIM                                                        \
463    0x00000010                     // GPTM Timer A Match Interrupt
464                                   // Mask
465#define TIMER_IMR_RTCIM 0x00000008 // GPTM RTC Interrupt Mask
466#define TIMER_IMR_CAEIM                                                        \
467    0x00000004 // GPTM Timer A Capture Mode Event
468               // Interrupt Mask
469#define TIMER_IMR_CAMIM                                                        \
470    0x00000002 // GPTM Timer A Capture Mode Match
471               // Interrupt Mask
472#define TIMER_IMR_TATOIM                                                       \
473    0x00000001 // GPTM Timer A Time-Out Interrupt
474               // Mask
475
476//*****************************************************************************
477//
478// The following are defines for the bit fields in the TIMER_O_RIS register.
479//
480//*****************************************************************************
481#define TIMER_RIS_WUERIS                                                       \
482    0x00010000 // 32/64-Bit Wide GPTM Write Update
483               // Error Raw Interrupt Status
484#define TIMER_RIS_DMABRIS                                                      \
485    0x00002000                      // GPTM Timer B DMA Done Raw
486                                    // Interrupt Status
487#define TIMER_RIS_TBMRIS 0x00000800 // GPTM Timer B Match Raw Interrupt
488#define TIMER_RIS_CBERIS                                                       \
489    0x00000400 // GPTM Timer B Capture Mode Event
490               // Raw Interrupt
491#define TIMER_RIS_CBMRIS                                                       \
492    0x00000200 // GPTM Timer B Capture Mode Match
493               // Raw Interrupt
494#define TIMER_RIS_TBTORIS                                                      \
495    0x00000100 // GPTM Timer B Time-Out Raw
496               // Interrupt
497#define TIMER_RIS_DMAARIS                                                      \
498    0x00000020                      // GPTM Timer A DMA Done Raw
499                                    // Interrupt Status
500#define TIMER_RIS_TAMRIS 0x00000010 // GPTM Timer A Match Raw Interrupt
501#define TIMER_RIS_RTCRIS 0x00000008 // GPTM RTC Raw Interrupt
502#define TIMER_RIS_CAERIS                                                       \
503    0x00000004 // GPTM Timer A Capture Mode Event
504               // Raw Interrupt
505#define TIMER_RIS_CAMRIS                                                       \
506    0x00000002 // GPTM Timer A Capture Mode Match
507               // Raw Interrupt
508#define TIMER_RIS_TATORIS                                                      \
509    0x00000001 // GPTM Timer A Time-Out Raw
510               // Interrupt
511
512//*****************************************************************************
513//
514// The following are defines for the bit fields in the TIMER_O_MIS register.
515//
516//*****************************************************************************
517#define TIMER_MIS_WUEMIS                                                       \
518    0x00010000 // 32/64-Bit Wide GPTM Write Update
519               // Error Masked Interrupt Status
520#define TIMER_MIS_DMABMIS                                                      \
521    0x00002000 // GPTM Timer B DMA Done Masked
522               // Interrupt
523#define TIMER_MIS_TBMMIS                                                       \
524    0x00000800 // GPTM Timer B Match Masked
525               // Interrupt
526#define TIMER_MIS_CBEMIS                                                       \
527    0x00000400 // GPTM Timer B Capture Mode Event
528               // Masked Interrupt
529#define TIMER_MIS_CBMMIS                                                       \
530    0x00000200 // GPTM Timer B Capture Mode Match
531               // Masked Interrupt
532#define TIMER_MIS_TBTOMIS                                                      \
533    0x00000100 // GPTM Timer B Time-Out Masked
534               // Interrupt
535#define TIMER_MIS_DMAAMIS                                                      \
536    0x00000020 // GPTM Timer A DMA Done Masked
537               // Interrupt
538#define TIMER_MIS_TAMMIS                                                       \
539    0x00000010                      // GPTM Timer A Match Masked
540                                    // Interrupt
541#define TIMER_MIS_RTCMIS 0x00000008 // GPTM RTC Masked Interrupt
542#define TIMER_MIS_CAEMIS                                                       \
543    0x00000004 // GPTM Timer A Capture Mode Event
544               // Masked Interrupt
545#define TIMER_MIS_CAMMIS                                                       \
546    0x00000002 // GPTM Timer A Capture Mode Match
547               // Masked Interrupt
548#define TIMER_MIS_TATOMIS                                                      \
549    0x00000001 // GPTM Timer A Time-Out Masked
550               // Interrupt
551
552//*****************************************************************************
553//
554// The following are defines for the bit fields in the TIMER_O_ICR register.
555//
556//*****************************************************************************
557#define TIMER_ICR_WUECINT                                                      \
558    0x00010000 // 32/64-Bit Wide GPTM Write Update
559               // Error Interrupt Clear
560#define TIMER_ICR_DMABINT                                                      \
561    0x00002000 // GPTM Timer B DMA Done Interrupt
562               // Clear
563#define TIMER_ICR_TBMCINT                                                      \
564    0x00000800 // GPTM Timer B Match Interrupt
565               // Clear
566#define TIMER_ICR_CBECINT                                                      \
567    0x00000400 // GPTM Timer B Capture Mode Event
568               // Interrupt Clear
569#define TIMER_ICR_CBMCINT                                                      \
570    0x00000200 // GPTM Timer B Capture Mode Match
571               // Interrupt Clear
572#define TIMER_ICR_TBTOCINT                                                     \
573    0x00000100 // GPTM Timer B Time-Out Interrupt
574               // Clear
575#define TIMER_ICR_DMAAINT                                                      \
576    0x00000020 // GPTM Timer A DMA Done Interrupt
577               // Clear
578#define TIMER_ICR_TAMCINT                                                      \
579    0x00000010                       // GPTM Timer A Match Interrupt
580                                     // Clear
581#define TIMER_ICR_RTCCINT 0x00000008 // GPTM RTC Interrupt Clear
582#define TIMER_ICR_CAECINT                                                      \
583    0x00000004 // GPTM Timer A Capture Mode Event
584               // Interrupt Clear
585#define TIMER_ICR_CAMCINT                                                      \
586    0x00000002 // GPTM Timer A Capture Mode Match
587               // Interrupt Clear
588#define TIMER_ICR_TATOCINT                                                     \
589    0x00000001 // GPTM Timer A Time-Out Raw
590               // Interrupt
591
592//*****************************************************************************
593//
594// The following are defines for the bit fields in the TIMER_O_TAILR register.
595//
596//*****************************************************************************
597#define TIMER_TAILR_M                                                          \
598    0xFFFFFFFF // GPTM Timer A Interval Load
599               // Register
600#define TIMER_TAILR_S 0
601
602//*****************************************************************************
603//
604// The following are defines for the bit fields in the TIMER_O_TBILR register.
605//
606//*****************************************************************************
607#define TIMER_TBILR_M                                                          \
608    0xFFFFFFFF // GPTM Timer B Interval Load
609               // Register
610#define TIMER_TBILR_S 0
611
612//*****************************************************************************
613//
614// The following are defines for the bit fields in the TIMER_O_TAMATCHR
615// register.
616//
617//*****************************************************************************
618#define TIMER_TAMATCHR_TAMR_M 0xFFFFFFFF // GPTM Timer A Match Register
619#define TIMER_TAMATCHR_TAMR_S 0
620
621//*****************************************************************************
622//
623// The following are defines for the bit fields in the TIMER_O_TBMATCHR
624// register.
625//
626//*****************************************************************************
627#define TIMER_TBMATCHR_TBMR_M 0xFFFFFFFF // GPTM Timer B Match Register
628#define TIMER_TBMATCHR_TBMR_S 0
629
630//*****************************************************************************
631//
632// The following are defines for the bit fields in the TIMER_O_TAPR register.
633//
634//*****************************************************************************
635#define TIMER_TAPR_TAPSRH_M 0x0000FF00 // GPTM Timer A Prescale High Byte
636#define TIMER_TAPR_TAPSR_M 0x000000FF  // GPTM Timer A Prescale
637#define TIMER_TAPR_TAPSRH_S 8
638#define TIMER_TAPR_TAPSR_S 0
639
640//*****************************************************************************
641//
642// The following are defines for the bit fields in the TIMER_O_TBPR register.
643//
644//*****************************************************************************
645#define TIMER_TBPR_TBPSRH_M 0x0000FF00 // GPTM Timer B Prescale High Byte
646#define TIMER_TBPR_TBPSR_M 0x000000FF  // GPTM Timer B Prescale
647#define TIMER_TBPR_TBPSRH_S 8
648#define TIMER_TBPR_TBPSR_S 0
649
650//*****************************************************************************
651//
652// The following are defines for the bit fields in the TIMER_O_TAPMR register.
653//
654//*****************************************************************************
655#define TIMER_TAPMR_TAPSMRH_M                                                  \
656    0x0000FF00                          // GPTM Timer A Prescale Match High
657                                        // Byte
658#define TIMER_TAPMR_TAPSMR_M 0x000000FF // GPTM TimerA Prescale Match
659#define TIMER_TAPMR_TAPSMRH_S 8
660#define TIMER_TAPMR_TAPSMR_S 0
661
662//*****************************************************************************
663//
664// The following are defines for the bit fields in the TIMER_O_TBPMR register.
665//
666//*****************************************************************************
667#define TIMER_TBPMR_TBPSMRH_M                                                  \
668    0x0000FF00                          // GPTM Timer B Prescale Match High
669                                        // Byte
670#define TIMER_TBPMR_TBPSMR_M 0x000000FF // GPTM TimerB Prescale Match
671#define TIMER_TBPMR_TBPSMRH_S 8
672#define TIMER_TBPMR_TBPSMR_S 0
673
674//*****************************************************************************
675//
676// The following are defines for the bit fields in the TIMER_O_TAR register.
677//
678//*****************************************************************************
679#define TIMER_TAR_M 0xFFFFFFFF // GPTM Timer A Register
680#define TIMER_TAR_S 0
681
682//*****************************************************************************
683//
684// The following are defines for the bit fields in the TIMER_O_TBR register.
685//
686//*****************************************************************************
687#define TIMER_TBR_M 0xFFFFFFFF // GPTM Timer B Register
688#define TIMER_TBR_S 0
689
690//*****************************************************************************
691//
692// The following are defines for the bit fields in the TIMER_O_TAV register.
693//
694//*****************************************************************************
695#define TIMER_TAV_M 0xFFFFFFFF // GPTM Timer A Value
696#define TIMER_TAV_S 0
697
698//*****************************************************************************
699//
700// The following are defines for the bit fields in the TIMER_O_TBV register.
701//
702//*****************************************************************************
703#define TIMER_TBV_M 0xFFFFFFFF // GPTM Timer B Value
704#define TIMER_TBV_S 0
705
706//*****************************************************************************
707//
708// The following are defines for the bit fields in the TIMER_O_RTCPD register.
709//
710//*****************************************************************************
711#define TIMER_RTCPD_RTCPD_M 0x0000FFFF // RTC Predivide Counter Value
712#define TIMER_RTCPD_RTCPD_S 0
713
714//*****************************************************************************
715//
716// The following are defines for the bit fields in the TIMER_O_TAPS register.
717//
718//*****************************************************************************
719#define TIMER_TAPS_PSS_M 0x0000FFFF // GPTM Timer A Prescaler Snapshot
720#define TIMER_TAPS_PSS_S 0
721
722//*****************************************************************************
723//
724// The following are defines for the bit fields in the TIMER_O_TBPS register.
725//
726//*****************************************************************************
727#define TIMER_TBPS_PSS_M 0x0000FFFF // GPTM Timer A Prescaler Value
728#define TIMER_TBPS_PSS_S 0
729
730//*****************************************************************************
731//
732// The following are defines for the bit fields in the TIMER_O_TAPV register.
733//
734//*****************************************************************************
735#define TIMER_TAPV_PSV_M 0x0000FFFF // GPTM Timer A Prescaler Value
736#define TIMER_TAPV_PSV_S 0
737
738//*****************************************************************************
739//
740// The following are defines for the bit fields in the TIMER_O_TBPV register.
741//
742//*****************************************************************************
743#define TIMER_TBPV_PSV_M 0x0000FFFF // GPTM Timer B Prescaler Value
744#define TIMER_TBPV_PSV_S 0
745
746//*****************************************************************************
747//
748// The following are defines for the bit fields in the TIMER_O_DMAEV register.
749//
750//*****************************************************************************
751#define TIMER_DMAEV_TBMDMAEN                                                   \
752    0x00000800 // GPTM B Mode Match Event DMA
753               // Trigger Enable
754#define TIMER_DMAEV_CBEDMAEN                                                   \
755    0x00000400 // GPTM B Capture Event DMA Trigger
756               // Enable
757#define TIMER_DMAEV_CBMDMAEN                                                   \
758    0x00000200 // GPTM B Capture Match Event DMA
759               // Trigger Enable
760#define TIMER_DMAEV_TBTODMAEN                                                  \
761    0x00000100 // GPTM B Time-Out Event DMA
762               // Trigger Enable
763#define TIMER_DMAEV_TAMDMAEN                                                   \
764    0x00000010 // GPTM A Mode Match Event DMA
765               // Trigger Enable
766#define TIMER_DMAEV_RTCDMAEN                                                   \
767    0x00000008 // GPTM A RTC Match Event DMA
768               // Trigger Enable
769#define TIMER_DMAEV_CAEDMAEN                                                   \
770    0x00000004 // GPTM A Capture Event DMA Trigger
771               // Enable
772#define TIMER_DMAEV_CAMDMAEN                                                   \
773    0x00000002 // GPTM A Capture Match Event DMA
774               // Trigger Enable
775#define TIMER_DMAEV_TATODMAEN                                                  \
776    0x00000001 // GPTM A Time-Out Event DMA
777               // Trigger Enable
778
779//*****************************************************************************
780//
781// The following are defines for the bit fields in the TIMER_O_ADCEV register.
782//
783//*****************************************************************************
784#define TIMER_ADCEV_TBMADCEN                                                   \
785    0x00000800 // GPTM B Mode Match Event ADC
786               // Trigger Enable
787#define TIMER_ADCEV_CBEADCEN                                                   \
788    0x00000400 // GPTM B Capture Event ADC Trigger
789               // Enable
790#define TIMER_ADCEV_CBMADCEN                                                   \
791    0x00000200 // GPTM B Capture Match Event ADC
792               // Trigger Enable
793#define TIMER_ADCEV_TBTOADCEN                                                  \
794    0x00000100 // GPTM B Time-Out Event ADC
795               // Trigger Enable
796#define TIMER_ADCEV_TAMADCEN                                                   \
797    0x00000010 // GPTM A Mode Match Event ADC
798               // Trigger Enable
799#define TIMER_ADCEV_RTCADCEN                                                   \
800    0x00000008 // GPTM RTC Match Event ADC Trigger
801               // Enable
802#define TIMER_ADCEV_CAEADCEN                                                   \
803    0x00000004 // GPTM A Capture Event ADC Trigger
804               // Enable
805#define TIMER_ADCEV_CAMADCEN                                                   \
806    0x00000002 // GPTM A Capture Match Event ADC
807               // Trigger Enable
808#define TIMER_ADCEV_TATOADCEN                                                  \
809    0x00000001 // GPTM A Time-Out Event ADC
810               // Trigger Enable
811
812//*****************************************************************************
813//
814// The following are defines for the bit fields in the TIMER_O_PP register.
815//
816//*****************************************************************************
817#define TIMER_PP_ALTCLK 0x00000040  // Alternate Clock Source
818#define TIMER_PP_SYNCCNT 0x00000020 // Synchronize Start
819#define TIMER_PP_CHAIN 0x00000010   // Chain with Other Timers
820#define TIMER_PP_SIZE_M 0x0000000F  // Count Size
821#define TIMER_PP_SIZE_16                                                       \
822    0x00000000 // Timer A and Timer B counters are
823               // 16 bits each with an 8-bit
824               // prescale counter
825#define TIMER_PP_SIZE_32                                                       \
826    0x00000001 // Timer A and Timer B counters are
827               // 32 bits each with a 16-bit
828               // prescale counter
829
830//*****************************************************************************
831//
832// The following are defines for the bit fields in the TIMER_O_CC register.
833//
834//*****************************************************************************
835#define TIMER_CC_ALTCLK 0x00000001 // Alternate Clock Source
836
837#endif // __HW_TIMER_H__