1 |
610 |
jeremybenn |
//*****************************************************************************
|
2 |
|
|
//
|
3 |
|
|
// hw_watchdog.h - Macros used when accessing the Watchdog Timer hardware.
|
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_WATCHDOG_H__
|
30 |
|
|
#define __HW_WATCHDOG_H__
|
31 |
|
|
|
32 |
|
|
//*****************************************************************************
|
33 |
|
|
//
|
34 |
|
|
// The following are defines for the Watchdog Timer register offsets.
|
35 |
|
|
//
|
36 |
|
|
//*****************************************************************************
|
37 |
|
|
#define WDT_O_LOAD 0x00000000 // Load register
|
38 |
|
|
#define WDT_O_VALUE 0x00000004 // Current value register
|
39 |
|
|
#define WDT_O_CTL 0x00000008 // Control register
|
40 |
|
|
#define WDT_O_ICR 0x0000000C // Interrupt clear register
|
41 |
|
|
#define WDT_O_RIS 0x00000010 // Raw interrupt status register
|
42 |
|
|
#define WDT_O_MIS 0x00000014 // Masked interrupt status register
|
43 |
|
|
#define WDT_O_TEST 0x00000418 // Test register
|
44 |
|
|
#define WDT_O_LOCK 0x00000C00 // Lock register
|
45 |
|
|
|
46 |
|
|
//*****************************************************************************
|
47 |
|
|
//
|
48 |
|
|
// The following are defines for the bit fields in the WDT_CTL register.
|
49 |
|
|
//
|
50 |
|
|
//*****************************************************************************
|
51 |
|
|
#define WDT_CTL_RESEN 0x00000002 // Enable reset output
|
52 |
|
|
#define WDT_CTL_INTEN 0x00000001 // Enable the WDT counter and int
|
53 |
|
|
|
54 |
|
|
//*****************************************************************************
|
55 |
|
|
//
|
56 |
|
|
// The following are defines for the bit fields in the WDT_ISR, WDT_RIS, and
|
57 |
|
|
// WDT_MIS registers.
|
58 |
|
|
//
|
59 |
|
|
//*****************************************************************************
|
60 |
|
|
#define WDT_INT_TIMEOUT 0x00000001 // Watchdog timer expired
|
61 |
|
|
|
62 |
|
|
//*****************************************************************************
|
63 |
|
|
//
|
64 |
|
|
// The following are defines for the bit fields in the WDT_TEST register.
|
65 |
|
|
//
|
66 |
|
|
//*****************************************************************************
|
67 |
|
|
#define WDT_TEST_STALL 0x00000100 // Watchdog stall enable
|
68 |
|
|
|
69 |
|
|
//*****************************************************************************
|
70 |
|
|
//
|
71 |
|
|
// The following are defines for the bit fields in the WDT_LOCK register.
|
72 |
|
|
//
|
73 |
|
|
//*****************************************************************************
|
74 |
|
|
#define WDT_LOCK_M 0xFFFFFFFF // Watchdog Lock.
|
75 |
|
|
#define WDT_LOCK_UNLOCK 0x1ACCE551 // Unlocks the watchdog timer
|
76 |
|
|
#define WDT_LOCK_LOCKED 0x00000001 // Watchdog timer is locked
|
77 |
|
|
#define WDT_LOCK_UNLOCKED 0x00000000 // Watchdog timer is unlocked
|
78 |
|
|
|
79 |
|
|
//*****************************************************************************
|
80 |
|
|
//
|
81 |
|
|
// The following are defines for the bit fields in the WDT_O_LOAD register.
|
82 |
|
|
//
|
83 |
|
|
//*****************************************************************************
|
84 |
|
|
#define WDT_LOAD_M 0xFFFFFFFF // Watchdog Load Value.
|
85 |
|
|
#define WDT_LOAD_S 0
|
86 |
|
|
|
87 |
|
|
//*****************************************************************************
|
88 |
|
|
//
|
89 |
|
|
// The following are defines for the bit fields in the WDT_O_VALUE register.
|
90 |
|
|
//
|
91 |
|
|
//*****************************************************************************
|
92 |
|
|
#define WDT_VALUE_M 0xFFFFFFFF // Watchdog Value.
|
93 |
|
|
#define WDT_VALUE_S 0
|
94 |
|
|
|
95 |
|
|
//*****************************************************************************
|
96 |
|
|
//
|
97 |
|
|
// The following are defines for the bit fields in the WDT_O_ICR register.
|
98 |
|
|
//
|
99 |
|
|
//*****************************************************************************
|
100 |
|
|
#define WDT_ICR_M 0xFFFFFFFF // Watchdog Interrupt Clear.
|
101 |
|
|
#define WDT_ICR_S 0
|
102 |
|
|
|
103 |
|
|
//*****************************************************************************
|
104 |
|
|
//
|
105 |
|
|
// The following are defines for the bit fields in the WDT_O_RIS register.
|
106 |
|
|
//
|
107 |
|
|
//*****************************************************************************
|
108 |
|
|
#define WDT_RIS_WDTRIS 0x00000001 // Watchdog Raw Interrupt Status.
|
109 |
|
|
|
110 |
|
|
//*****************************************************************************
|
111 |
|
|
//
|
112 |
|
|
// The following are defines for the bit fields in the WDT_O_MIS register.
|
113 |
|
|
//
|
114 |
|
|
//*****************************************************************************
|
115 |
|
|
#define WDT_MIS_WDTMIS 0x00000001 // Watchdog Masked Interrupt
|
116 |
|
|
// Status.
|
117 |
|
|
|
118 |
|
|
//*****************************************************************************
|
119 |
|
|
//
|
120 |
|
|
// The following definitions are deprecated.
|
121 |
|
|
//
|
122 |
|
|
//*****************************************************************************
|
123 |
|
|
#ifndef DEPRECATED
|
124 |
|
|
|
125 |
|
|
//*****************************************************************************
|
126 |
|
|
//
|
127 |
|
|
// The following are deprecated defines for the Watchdog Timer register
|
128 |
|
|
// offsets.
|
129 |
|
|
//
|
130 |
|
|
//*****************************************************************************
|
131 |
|
|
#define WDT_O_PeriphID4 0x00000FD0
|
132 |
|
|
#define WDT_O_PeriphID5 0x00000FD4
|
133 |
|
|
#define WDT_O_PeriphID6 0x00000FD8
|
134 |
|
|
#define WDT_O_PeriphID7 0x00000FDC
|
135 |
|
|
#define WDT_O_PeriphID0 0x00000FE0
|
136 |
|
|
#define WDT_O_PeriphID1 0x00000FE4
|
137 |
|
|
#define WDT_O_PeriphID2 0x00000FE8
|
138 |
|
|
#define WDT_O_PeriphID3 0x00000FEC
|
139 |
|
|
#define WDT_O_PCellID0 0x00000FF0
|
140 |
|
|
#define WDT_O_PCellID1 0x00000FF4
|
141 |
|
|
#define WDT_O_PCellID2 0x00000FF8
|
142 |
|
|
#define WDT_O_PCellID3 0x00000FFC
|
143 |
|
|
|
144 |
|
|
//*****************************************************************************
|
145 |
|
|
//
|
146 |
|
|
// The following are deprecated defines for the bit fields in the WDT_TEST
|
147 |
|
|
// register.
|
148 |
|
|
//
|
149 |
|
|
//*****************************************************************************
|
150 |
|
|
#define WDT_TEST_STALL_EN 0x00000100 // Watchdog stall enable
|
151 |
|
|
|
152 |
|
|
//*****************************************************************************
|
153 |
|
|
//
|
154 |
|
|
// The following are deprecated defines for the reset values for the WDT
|
155 |
|
|
// registers.
|
156 |
|
|
//
|
157 |
|
|
//*****************************************************************************
|
158 |
|
|
#define WDT_RV_VALUE 0xFFFFFFFF // Current value register
|
159 |
|
|
#define WDT_RV_LOAD 0xFFFFFFFF // Load register
|
160 |
|
|
#define WDT_RV_PCellID1 0x000000F0
|
161 |
|
|
#define WDT_RV_PCellID3 0x000000B1
|
162 |
|
|
#define WDT_RV_PeriphID1 0x00000018
|
163 |
|
|
#define WDT_RV_PeriphID2 0x00000018
|
164 |
|
|
#define WDT_RV_PCellID0 0x0000000D
|
165 |
|
|
#define WDT_RV_PCellID2 0x00000005
|
166 |
|
|
#define WDT_RV_PeriphID0 0x00000005
|
167 |
|
|
#define WDT_RV_PeriphID3 0x00000001
|
168 |
|
|
#define WDT_RV_PeriphID5 0x00000000
|
169 |
|
|
#define WDT_RV_RIS 0x00000000 // Raw interrupt status register
|
170 |
|
|
#define WDT_RV_CTL 0x00000000 // Control register
|
171 |
|
|
#define WDT_RV_PeriphID4 0x00000000
|
172 |
|
|
#define WDT_RV_PeriphID6 0x00000000
|
173 |
|
|
#define WDT_RV_PeriphID7 0x00000000
|
174 |
|
|
#define WDT_RV_LOCK 0x00000000 // Lock register
|
175 |
|
|
#define WDT_RV_MIS 0x00000000 // Masked interrupt status register
|
176 |
|
|
|
177 |
|
|
#endif
|
178 |
|
|
|
179 |
|
|
#endif // __HW_WATCHDOG_H__
|