1 //*****************************************************************************
2 //
3 // hw_fan.h - Macros used when accessing the fan control hardware.
4 //
5 // Copyright (c) 2010-2011 Texas Instruments Incorporated.  All rights reserved.
6 // Software License Agreement
7 //
8 // Texas Instruments (TI) is supplying this software for use solely and
9 // exclusively on TI's microcontroller products. The software is owned by
10 // TI and/or its suppliers, and is protected under applicable copyright
11 // laws. You may not combine this software with "viral" open-source
12 // software in order to form a larger program.
13 //
14 // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
15 // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
16 // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
18 // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
19 // DAMAGES, FOR ANY REASON WHATSOEVER.
20 //
21 // This is part of revision 8264 of the Stellaris Firmware Development Package.
22 //
23 //*****************************************************************************
24 
25 #ifndef __HW_FAN_H__
26 #define __HW_FAN_H__
27 
28 //*****************************************************************************
29 //
30 // The following are defines for the Fan Control register offsets.
31 //
32 //*****************************************************************************
33 #define FAN_O_STS               0x00000000  // FAN Status
34 #define FAN_O_CTL               0x00000004  // FAN Control
35 #define FAN_O_CH0               0x00000010  // FAN Channel Command
36 #define FAN_O_CMD0              0x00000014  // FAN Channel Command
37 #define FAN_O_CST0              0x00000018  // FAN Channel Status
38 #define FAN_O_CH1               0x00000020  // FAN Channel Setup
39 #define FAN_O_CMD1              0x00000024  // FAN Channel Command
40 #define FAN_O_CST1              0x00000028  // FAN Channel Status
41 #define FAN_O_CH2               0x00000030  // FAN Channel Setup
42 #define FAN_O_CMD2              0x00000034  // FAN Channel Command
43 #define FAN_O_CST2              0x00000038  // FAN Channel Status
44 #define FAN_O_CH3               0x00000040  // FAN Channel Setup
45 #define FAN_O_CMD3              0x00000044  // FAN Channel Command
46 #define FAN_O_CST3              0x00000048  // FAN Channel Status
47 #define FAN_O_CH4               0x00000050  // FAN Channel Setup
48 #define FAN_O_CMD4              0x00000054  // FAN Channel Command
49 #define FAN_O_CST4              0x00000058  // FAN Channel Status
50 #define FAN_O_CH5               0x00000060  // FAN Channel Setup
51 #define FAN_O_CMD5              0x00000064  // FAN Channel Command
52 #define FAN_O_CST5              0x00000068  // FAN Channel Status
53 #define FAN_O_CH6               0x00000070  // FAN Channel Setup
54 #define FAN_O_CMD6              0x00000074  // FAN Channel Command
55 #define FAN_O_CST6              0x00000078  // FAN Channel Status
56 #define FAN_O_CH7               0x00000080  // FAN Channel Setup
57 #define FAN_O_CMD7              0x00000084  // FAN Channel Command
58 #define FAN_O_CST7              0x00000088  // FAN Channel Status
59 #define FAN_O_IM                0x00000090  // FAN Interrupt Mask
60 #define FAN_O_RIS               0x00000094  // FAN Raw Interrupt Status
61 #define FAN_O_MIS               0x00000098  // FAN Masked Interrupt Status
62 #define FAN_O_IC                0x0000009C  // FAN Interrupt Clear
63 #define FAN_O_PP                0x00000FC0  // FAN Peripheral Properties
64 
65 //*****************************************************************************
66 //
67 // The following are defines for the bit fields in the FAN_O_STS register.
68 //
69 //*****************************************************************************
70 #define FAN_STS_FANCNT_M        0x000F0000  // Fan Count
71 #define FAN_STS_ST5_M           0x00000C00  // Fan 5 Status
72 #define FAN_STS_ST5_STALLED     0x00000000  // Stalled
73 #define FAN_STS_ST5_CHANGING    0x00000400  // Changing
74 #define FAN_STS_ST5_LOCKED      0x00000800  // Locked
75 #define FAN_STS_ST5_UNBALANCED  0x00000C00  // Unbalanced Spin
76 #define FAN_STS_ST4_M           0x00000300  // Fan 4 Status
77 #define FAN_STS_ST3_M           0x000000C0  // Fan 3 Status
78 #define FAN_STS_ST2_M           0x00000030  // Fan 2 Status
79 #define FAN_STS_ST1_M           0x0000000C  // Fan 1 Status
80 #define FAN_STS_ST0_M           0x00000003  // Fan 0 Status
81 #define FAN_STS_FANCNT_S        16
82 #define FAN_STS_ST4_S           8
83 #define FAN_STS_ST3_S           6
84 #define FAN_STS_ST2_S           4
85 #define FAN_STS_ST1_S           2
86 #define FAN_STS_ST0_S           0
87 
88 //*****************************************************************************
89 //
90 // The following are defines for the bit fields in the FAN_O_CTL register.
91 //
92 //*****************************************************************************
93 #define FAN_CTL_E5              0x00000020  // Fan 5 Enable
94 #define FAN_CTL_E4              0x00000010  // Fan 4 Enable
95 #define FAN_CTL_E3              0x00000008  // Fan 3 Enable
96 #define FAN_CTL_E2              0x00000004  // Fan 2 Enable
97 #define FAN_CTL_E1              0x00000002  // Fan 1 Enable
98 #define FAN_CTL_E0              0x00000001  // Fan 0 Enable
99 
100 //*****************************************************************************
101 //
102 // The following are defines for the bit fields in the FAN_O_CH0 register.
103 //
104 //*****************************************************************************
105 #define FAN_CH0_ASTART          0x00008000  // Auto Restart
106 #define FAN_CH0_ACCEL           0x00004000  // Acceleration and Deceleration
107                                             // Rule
108 #define FAN_CH0_HYST_M          0x00003800  // Hysteresis Adjustment on PID
109                                             // Adjust
110 #define FAN_CH0_STPER_M         0x00000700  // Start Period
111 #define FAN_CH0_START_M         0x000000C0  // Fast Start Rule
112 #define FAN_CH0_START_NOFAST    0x00000000  // No fast start
113 #define FAN_CH0_START_50DC      0x00000040  // 50% duty cycle
114 #define FAN_CH0_START_75DC      0x00000080  // 75% duty cycle
115 #define FAN_CH0_START_100DC     0x000000C0  // 100% duty cycle
116 #define FAN_CH0_AVG_M           0x00000030  // Averaging of Tachometer
117 #define FAN_CH0_AVG_0           0x00000000  // No averaging
118 #define FAN_CH0_AVG_2           0x00000010  // Average 2 edges
119 #define FAN_CH0_AVG_4           0x00000020  // Average 4 edges
120 #define FAN_CH0_AVG_8           0x00000030  // Average 8 edges
121 #define FAN_CH0_PPR_M           0x0000000C  // Pulse per Revolution on
122                                             // Tachometer
123 #define FAN_CH0_PPR_1           0x00000000  // 1 pulse per revolution
124 #define FAN_CH0_PPR_2           0x00000004  // 2 pulses per revolution
125 #define FAN_CH0_PPR_4           0x00000008  // 4 pulses per revolution
126 #define FAN_CH0_PPR_8           0x0000000C  // 8 pulses per revolution
127 #define FAN_CH0_MAN             0x00000001  // Control Type
128 #define FAN_CH0_HYST_S          11
129 #define FAN_CH0_STPER_S         8
130 
131 //*****************************************************************************
132 //
133 // The following are defines for the bit fields in the FAN_O_CMD0 register.
134 //
135 //*****************************************************************************
136 #define FAN_CMD0_DC_M           0x01FF0000  // PWM Duty Cycle
137 #define FAN_CMD0_RPM_M          0x00001FFF  // Fan Speed (in RPM)
138 #define FAN_CMD0_DC_S           16
139 #define FAN_CMD0_RPM_S          0
140 
141 //*****************************************************************************
142 //
143 // The following are defines for the bit fields in the FAN_O_CST0 register.
144 //
145 //*****************************************************************************
146 #define FAN_CST0_COUNT_M        0x07FF0000  // Last Read Tachometer Count
147 #define FAN_CST0_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
148 #define FAN_CST0_COUNT_S        16
149 #define FAN_CST0_RPM_S          0
150 
151 //*****************************************************************************
152 //
153 // The following are defines for the bit fields in the FAN_O_CH1 register.
154 //
155 //*****************************************************************************
156 #define FAN_CH1_ASTART          0x00008000  // Auto Restart
157 #define FAN_CH1_ACCEL           0x00004000  // Acceleration and Deceleration
158                                             // Rule
159 #define FAN_CH1_HYST_M          0x00003800  // Hysteresis Adjustment on PID
160                                             // Adjust
161 #define FAN_CH1_STPER_M         0x00000700  // Start Period
162 #define FAN_CH1_START_M         0x000000C0  // Fast Start Rule
163 #define FAN_CH1_START_NOFAST    0x00000000  // No fast start
164 #define FAN_CH1_START_50DC      0x00000040  // 50% duty cycle
165 #define FAN_CH1_START_75DC      0x00000080  // 75% duty cycle
166 #define FAN_CH1_START_100DC     0x000000C0  // 100% duty cycle
167 #define FAN_CH1_AVG_M           0x00000030  // Averaging of Tachometer
168 #define FAN_CH1_AVG_0           0x00000000  // No averaging
169 #define FAN_CH1_AVG_2           0x00000010  // Average 2 edges
170 #define FAN_CH1_AVG_4           0x00000020  // Average 4 edges
171 #define FAN_CH1_AVG_8           0x00000030  // Average 8 edges
172 #define FAN_CH1_PPR_M           0x0000000C  // Pulse per Revolution on
173                                             // Tachometer
174 #define FAN_CH1_PPR_1           0x00000000  // 1 pulse per revolution
175 #define FAN_CH1_PPR_2           0x00000004  // 2 pulses per revolution
176 #define FAN_CH1_PPR_4           0x00000008  // 4 pulses per revolution
177 #define FAN_CH1_PPR_8           0x0000000C  // 8 pulses per revolution
178 #define FAN_CH1_MAN             0x00000001  // Control Type
179 #define FAN_CH1_HYST_S          11
180 #define FAN_CH1_STPER_S         8
181 
182 //*****************************************************************************
183 //
184 // The following are defines for the bit fields in the FAN_O_CMD1 register.
185 //
186 //*****************************************************************************
187 #define FAN_CMD1_DC_M           0x01FF0000  // PWM Duty Cycle
188 #define FAN_CMD1_RPM_M          0x00001FFF  // Fan Speed (in RPM)
189 #define FAN_CMD1_DC_S           16
190 #define FAN_CMD1_RPM_S          0
191 
192 //*****************************************************************************
193 //
194 // The following are defines for the bit fields in the FAN_O_CST1 register.
195 //
196 //*****************************************************************************
197 #define FAN_CST1_COUNT_M        0x07FF0000  // Last Read Tachometer Count
198 #define FAN_CST1_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
199 #define FAN_CST1_COUNT_S        16
200 #define FAN_CST1_RPM_S          0
201 
202 //*****************************************************************************
203 //
204 // The following are defines for the bit fields in the FAN_O_CH2 register.
205 //
206 //*****************************************************************************
207 #define FAN_CH2_ASTART          0x00008000  // Auto Restart
208 #define FAN_CH2_ACCEL           0x00004000  // Acceleration and Deceleration
209                                             // Rule
210 #define FAN_CH2_HYST_M          0x00003800  // Hysteresis Adjustment on PID
211                                             // Adjust
212 #define FAN_CH2_STPER_M         0x00000700  // Start Period
213 #define FAN_CH2_START_M         0x000000C0  // Fast Start Rule
214 #define FAN_CH2_START_NOFAST    0x00000000  // No fast start
215 #define FAN_CH2_START_50DC      0x00000040  // 50% duty cycle
216 #define FAN_CH2_START_75DC      0x00000080  // 75% duty cycle
217 #define FAN_CH2_START_100DC     0x000000C0  // 100% duty cycle
218 #define FAN_CH2_AVG_M           0x00000030  // Averaging of Tachometer
219 #define FAN_CH2_AVG_0           0x00000000  // No averaging
220 #define FAN_CH2_AVG_2           0x00000010  // Average 2 edges
221 #define FAN_CH2_AVG_4           0x00000020  // Average 4 edges
222 #define FAN_CH2_AVG_8           0x00000030  // Average 8 edges
223 #define FAN_CH2_PPR_M           0x0000000C  // Pulse per Revolution on
224                                             // Tachometer
225 #define FAN_CH2_PPR_1           0x00000000  // 1 pulse per revolution
226 #define FAN_CH2_PPR_2           0x00000004  // 2 pulses per revolution
227 #define FAN_CH2_PPR_4           0x00000008  // 4 pulses per revolution
228 #define FAN_CH2_PPR_8           0x0000000C  // 8 pulses per revolution
229 #define FAN_CH2_MAN             0x00000001  // Control Type
230 #define FAN_CH2_HYST_S          11
231 #define FAN_CH2_STPER_S         8
232 
233 //*****************************************************************************
234 //
235 // The following are defines for the bit fields in the FAN_O_CMD2 register.
236 //
237 //*****************************************************************************
238 #define FAN_CMD2_DC_M           0x01FF0000  // PWM Duty Cycle
239 #define FAN_CMD2_RPM_M          0x00001FFF  // Fan Speed (in RPM)
240 #define FAN_CMD2_DC_S           16
241 #define FAN_CMD2_RPM_S          0
242 
243 //*****************************************************************************
244 //
245 // The following are defines for the bit fields in the FAN_O_CST2 register.
246 //
247 //*****************************************************************************
248 #define FAN_CST2_COUNT_M        0x07FF0000  // Last Read Tachometer Count
249 #define FAN_CST2_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
250 #define FAN_CST2_COUNT_S        16
251 #define FAN_CST2_RPM_S          0
252 
253 //*****************************************************************************
254 //
255 // The following are defines for the bit fields in the FAN_O_CH3 register.
256 //
257 //*****************************************************************************
258 #define FAN_CH3_ASTART          0x00008000  // Auto Restart
259 #define FAN_CH3_ACCEL           0x00004000  // Acceleration and Deceleration
260                                             // Rule
261 #define FAN_CH3_HYST_M          0x00003800  // Hysteresis Adjustment on PID
262                                             // Adjust
263 #define FAN_CH3_STPER_M         0x00000700  // Start Period
264 #define FAN_CH3_START_M         0x000000C0  // Fast Start Rule
265 #define FAN_CH3_START_NOFAST    0x00000000  // No fast start
266 #define FAN_CH3_START_50DC      0x00000040  // 50% duty cycle
267 #define FAN_CH3_START_75DC      0x00000080  // 75% duty cycle
268 #define FAN_CH3_START_100DC     0x000000C0  // 100% duty cycle
269 #define FAN_CH3_AVG_M           0x00000030  // Averaging of Tachometer
270 #define FAN_CH3_AVG_0           0x00000000  // No averaging
271 #define FAN_CH3_AVG_2           0x00000010  // Average 2 edges
272 #define FAN_CH3_AVG_4           0x00000020  // Average 4 edges
273 #define FAN_CH3_AVG_8           0x00000030  // Average 8 edges
274 #define FAN_CH3_PPR_M           0x0000000C  // Pulse per Revolution on
275                                             // Tachometer
276 #define FAN_CH3_PPR_1           0x00000000  // 1 pulse per revolution
277 #define FAN_CH3_PPR_2           0x00000004  // 2 pulses per revolution
278 #define FAN_CH3_PPR_4           0x00000008  // 4 pulses per revolution
279 #define FAN_CH3_PPR_8           0x0000000C  // 8 pulses per revolution
280 #define FAN_CH3_MAN             0x00000001  // Control Type
281 #define FAN_CH3_HYST_S          11
282 #define FAN_CH3_STPER_S         8
283 
284 //*****************************************************************************
285 //
286 // The following are defines for the bit fields in the FAN_O_CMD3 register.
287 //
288 //*****************************************************************************
289 #define FAN_CMD3_DC_M           0x01FF0000  // PWM Duty Cycle
290 #define FAN_CMD3_RPM_M          0x00001FFF  // Fan Speed (in RPM)
291 #define FAN_CMD3_DC_S           16
292 #define FAN_CMD3_RPM_S          0
293 
294 //*****************************************************************************
295 //
296 // The following are defines for the bit fields in the FAN_O_CST3 register.
297 //
298 //*****************************************************************************
299 #define FAN_CST3_COUNT_M        0x07FF0000  // Last Read Tachometer Count
300 #define FAN_CST3_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
301 #define FAN_CST3_COUNT_S        16
302 #define FAN_CST3_RPM_S          0
303 
304 //*****************************************************************************
305 //
306 // The following are defines for the bit fields in the FAN_O_CH4 register.
307 //
308 //*****************************************************************************
309 #define FAN_CH4_ASTART          0x00008000  // Auto Restart
310 #define FAN_CH4_ACCEL           0x00004000  // Acceleration and Deceleration
311                                             // Rule
312 #define FAN_CH4_HYST_M          0x00003800  // Hysteresis Adjustment on PID
313                                             // Adjust
314 #define FAN_CH4_STPER_M         0x00000700  // Start Period
315 #define FAN_CH4_START_M         0x000000C0  // Fast Start Rule
316 #define FAN_CH4_START_NOFAST    0x00000000  // No fast start
317 #define FAN_CH4_START_50DC      0x00000040  // 50% duty cycle
318 #define FAN_CH4_START_75DC      0x00000080  // 75% duty cycle
319 #define FAN_CH4_START_100DC     0x000000C0  // 100% duty cycle
320 #define FAN_CH4_AVG_M           0x00000030  // Averaging of Tachometer
321 #define FAN_CH4_AVG_0           0x00000000  // No averaging
322 #define FAN_CH4_AVG_2           0x00000010  // Average 2 edges
323 #define FAN_CH4_AVG_4           0x00000020  // Average 4 edges
324 #define FAN_CH4_AVG_8           0x00000030  // Average 8 edges
325 #define FAN_CH4_PPR_M           0x0000000C  // Pulse per Revolution on
326                                             // Tachometer
327 #define FAN_CH4_PPR_1           0x00000000  // 1 pulse per revolution
328 #define FAN_CH4_PPR_2           0x00000004  // 2 pulses per revolution
329 #define FAN_CH4_PPR_4           0x00000008  // 4 pulses per revolution
330 #define FAN_CH4_PPR_8           0x0000000C  // 8 pulses per revolution
331 #define FAN_CH4_MAN             0x00000001  // Control Type
332 #define FAN_CH4_HYST_S          11
333 #define FAN_CH4_STPER_S         8
334 
335 //*****************************************************************************
336 //
337 // The following are defines for the bit fields in the FAN_O_CMD4 register.
338 //
339 //*****************************************************************************
340 #define FAN_CMD4_DC_M           0x01FF0000  // PWM Duty Cycle
341 #define FAN_CMD4_RPM_M          0x00001FFF  // Fan Speed (in RPM)
342 #define FAN_CMD4_DC_S           16
343 #define FAN_CMD4_RPM_S          0
344 
345 //*****************************************************************************
346 //
347 // The following are defines for the bit fields in the FAN_O_CST4 register.
348 //
349 //*****************************************************************************
350 #define FAN_CST4_COUNT_M        0x07FF0000  // Last Read Tachometer Count
351 #define FAN_CST4_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
352 #define FAN_CST4_COUNT_S        16
353 #define FAN_CST4_RPM_S          0
354 
355 //*****************************************************************************
356 //
357 // The following are defines for the bit fields in the FAN_O_CH5 register.
358 //
359 //*****************************************************************************
360 #define FAN_CH5_ASTART          0x00008000  // Auto Restart
361 #define FAN_CH5_ACCEL           0x00004000  // Acceleration and Deceleration
362                                             // Rule
363 #define FAN_CH5_HYST_M          0x00003800  // Hysteresis Adjustment on PID
364                                             // Adjust
365 #define FAN_CH5_STPER_M         0x00000700  // Start Period
366 #define FAN_CH5_START_M         0x000000C0  // Fast Start Rule
367 #define FAN_CH5_START_NOFAST    0x00000000  // No fast start
368 #define FAN_CH5_START_50DC      0x00000040  // 50% duty cycle
369 #define FAN_CH5_START_75DC      0x00000080  // 75% duty cycle
370 #define FAN_CH5_START_100DC     0x000000C0  // 100% duty cycle
371 #define FAN_CH5_AVG_M           0x00000030  // Averaging of Tachometer
372 #define FAN_CH5_AVG_0           0x00000000  // No averaging
373 #define FAN_CH5_AVG_2           0x00000010  // Average 2 edges
374 #define FAN_CH5_AVG_4           0x00000020  // Average 4 edges
375 #define FAN_CH5_AVG_8           0x00000030  // Average 8 edges
376 #define FAN_CH5_PPR_M           0x0000000C  // Pulse per Revolution on
377                                             // Tachometer
378 #define FAN_CH5_PPR_1           0x00000000  // 1 pulse per revolution
379 #define FAN_CH5_PPR_2           0x00000004  // 2 pulses per revolution
380 #define FAN_CH5_PPR_4           0x00000008  // 4 pulses per revolution
381 #define FAN_CH5_PPR_8           0x0000000C  // 8 pulses per revolution
382 #define FAN_CH5_MAN             0x00000001  // Control Type
383 #define FAN_CH5_HYST_S          11
384 #define FAN_CH5_STPER_S         8
385 
386 //*****************************************************************************
387 //
388 // The following are defines for the bit fields in the FAN_O_CMD5 register.
389 //
390 //*****************************************************************************
391 #define FAN_CMD5_DC_M           0x01FF0000  // PWM Duty Cycle
392 #define FAN_CMD5_RPM_M          0x00001FFF  // Fan Speed (in RPM)
393 #define FAN_CMD5_DC_S           16
394 #define FAN_CMD5_RPM_S          0
395 
396 //*****************************************************************************
397 //
398 // The following are defines for the bit fields in the FAN_O_CST5 register.
399 //
400 //*****************************************************************************
401 #define FAN_CST5_COUNT_M        0x07FF0000  // Last Read Tachometer Count
402 #define FAN_CST5_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
403 #define FAN_CST5_COUNT_S        16
404 #define FAN_CST5_RPM_S          0
405 
406 //*****************************************************************************
407 //
408 // The following are defines for the bit fields in the FAN_O_CH6 register.
409 //
410 //*****************************************************************************
411 #define FAN_CH6_MAN             0x00000001  // Control Type
412 #define FAN_CH6_PPR_M           0x0000000C  // Pulse per Revolution on
413                                             // Tachometer
414 #define FAN_CH6_PPR_1           0x00000000  // 1 pulse per revolution
415 #define FAN_CH6_PPR_2           0x00000004  // 2 pulses per revolution
416 #define FAN_CH6_PPR_4           0x00000008  // 4 pulses per revolution
417 #define FAN_CH6_PPR_8           0x0000000C  // 8 pulses per revolution
418 #define FAN_CH6_AVG_M           0x00000030  // Averaging of Tachometer
419 #define FAN_CH6_AVG_0           0x00000000  // No averaging
420 #define FAN_CH6_AVG_2           0x00000010  // Average 2 edges
421 #define FAN_CH6_AVG_4           0x00000020  // Average 4 edges
422 #define FAN_CH6_AVG_8           0x00000030  // Average 8 edges
423 #define FAN_CH6_START_M         0x000000C0  // Fast Start Rule
424 #define FAN_CH6_START_NOFAST    0x00000000  // No fast start
425 #define FAN_CH6_START_50DC      0x00000040  // 50% duty cycle
426 #define FAN_CH6_START_75DC      0x00000080  // 75% duty cycle
427 #define FAN_CH6_START_100DC     0x000000C0  // 100% duty cycle
428 #define FAN_CH6_STPER_M         0x00000700  // Start Period
429 #define FAN_CH6_HYST_M          0x00003800  // Hysteresis Adjustment on PID
430                                             // Adjust
431 #define FAN_CH6_ACCEL           0x00004000  // Acceleration and Deceleration
432                                             // Rule
433 #define FAN_CH6_ASTART          0x00008000  // Auto Restart
434 #define FAN_CH6_STPER_S         8
435 #define FAN_CH6_HYST_S          11
436 
437 //*****************************************************************************
438 //
439 // The following are defines for the bit fields in the FAN_O_CMD6 register.
440 //
441 //*****************************************************************************
442 #define FAN_CMD6_RPM_M          0x00001FFF  // Fan Speed (in RPM)
443 #define FAN_CMD6_DC_M           0x01FF0000  // PWM Duty Cycle
444 #define FAN_CMD6_RPM_S          0
445 #define FAN_CMD6_DC_S           16
446 
447 //*****************************************************************************
448 //
449 // The following are defines for the bit fields in the FAN_O_CST6 register.
450 //
451 //*****************************************************************************
452 #define FAN_CST6_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
453 #define FAN_CST6_COUNT_M        0x07FF0000  // Last Read Tachometer Count
454 #define FAN_CST6_RPM_S          0
455 #define FAN_CST6_COUNT_S        16
456 
457 //*****************************************************************************
458 //
459 // The following are defines for the bit fields in the FAN_O_CH7 register.
460 //
461 //*****************************************************************************
462 #define FAN_CH7_MAN             0x00000001  // Control Type
463 #define FAN_CH7_PPR_M           0x0000000C  // Pulse per Revolution on
464                                             // Tachometer
465 #define FAN_CH7_PPR_1           0x00000000  // 1 pulse per revolution
466 #define FAN_CH7_PPR_2           0x00000004  // 2 pulses per revolution
467 #define FAN_CH7_PPR_4           0x00000008  // 4 pulses per revolution
468 #define FAN_CH7_PPR_8           0x0000000C  // 8 pulses per revolution
469 #define FAN_CH7_AVG_M           0x00000030  // Averaging of Tachometer
470 #define FAN_CH7_AVG_0           0x00000000  // No averaging
471 #define FAN_CH7_AVG_2           0x00000010  // Average 2 edges
472 #define FAN_CH7_AVG_4           0x00000020  // Average 4 edges
473 #define FAN_CH7_AVG_8           0x00000030  // Average 8 edges
474 #define FAN_CH7_START_M         0x000000C0  // Fast Start Rule
475 #define FAN_CH7_START_NOFAST    0x00000000  // No fast start
476 #define FAN_CH7_START_50DC      0x00000040  // 50% duty cycle
477 #define FAN_CH7_START_75DC      0x00000080  // 75% duty cycle
478 #define FAN_CH7_START_100DC     0x000000C0  // 100% duty cycle
479 #define FAN_CH7_STPER_M         0x00000700  // Start Period
480 #define FAN_CH7_HYST_M          0x00003800  // Hysteresis Adjustment on PID
481                                             // Adjust
482 #define FAN_CH7_ACCEL           0x00004000  // Acceleration and Deceleration
483                                             // Rule
484 #define FAN_CH7_ASTART          0x00008000  // Auto Restart
485 #define FAN_CH7_STPER_S         8
486 #define FAN_CH7_HYST_S          11
487 
488 //*****************************************************************************
489 //
490 // The following are defines for the bit fields in the FAN_O_CMD7 register.
491 //
492 //*****************************************************************************
493 #define FAN_CMD7_RPM_M          0x00001FFF  // Fan Speed (in RPM)
494 #define FAN_CMD7_DC_M           0x01FF0000  // PWM Duty Cycle
495 #define FAN_CMD7_RPM_S          0
496 #define FAN_CMD7_DC_S           16
497 
498 //*****************************************************************************
499 //
500 // The following are defines for the bit fields in the FAN_O_CST7 register.
501 //
502 //*****************************************************************************
503 #define FAN_CST7_RPM_M          0x00001FFF  // Last Read RPM Speed Computed
504 #define FAN_CST7_COUNT_M        0x07FF0000  // Last Read Tachometer Count
505 #define FAN_CST7_RPM_S          0
506 #define FAN_CST7_COUNT_S        16
507 
508 //*****************************************************************************
509 //
510 // The following are defines for the bit fields in the FAN_O_IM register.
511 //
512 //*****************************************************************************
513 #define FAN_IM_C5INT1IM         0x00400000  // Channel 5 Interrupt 1 Mask
514 #define FAN_IM_C5INT0IM         0x00200000  // Channel 5 Interrupt 0 Mask
515 #define FAN_IM_C5STALLIM        0x00100000  // Channel 5 Stall Interrupt Mask
516 #define FAN_IM_C4INT1IM         0x00040000  // Channel 4 Interrupt 1 Mask
517 #define FAN_IM_C4INT0IM         0x00020000  // Channel 4 Interrupt 0 Mask
518 #define FAN_IM_C4STALLIM        0x00010000  // Channel 4 Stall Interrupt Mask
519 #define FAN_IM_C3INT1IM         0x00004000  // Channel 3 Interrupt 1 Mask
520 #define FAN_IM_C3INT0IM         0x00002000  // Channel 3 Interrupt 0 Mask
521 #define FAN_IM_C3STALLIM        0x00001000  // Channel 3 Stall Interrupt Mask
522 #define FAN_IM_C2INT1IM         0x00000400  // Channel 2 Interrupt 1 Mask
523 #define FAN_IM_C2INT0IM         0x00000200  // Channel 2 Interrupt 0 Mask
524 #define FAN_IM_C2STALLIM        0x00000100  // Channel 2 Stall Interrupt Mask
525 #define FAN_IM_C1INT1IM         0x00000040  // Channel 1 Interrupt 1 Mask
526 #define FAN_IM_C1INT0IM         0x00000020  // Channel 1 Interrupt 0 Mask
527 #define FAN_IM_C1STALLIM        0x00000010  // Channel 1 Stall Interrupt Mask
528 #define FAN_IM_C0INT1IM         0x00000004  // Channel 0 Interrupt 1 Mask
529 #define FAN_IM_C0INT0IM         0x00000002  // Channel 0 Interrupt 0 Mask
530 #define FAN_IM_C0STALLIM        0x00000001  // Channel 0 Stall Interrupt Mask
531 
532 //*****************************************************************************
533 //
534 // The following are defines for the bit fields in the FAN_O_RIS register.
535 //
536 //*****************************************************************************
537 #define FAN_RIS_C5INT1RIS       0x00400000  // Channel 5 Raw Interrupt 1 Status
538 #define FAN_RIS_C5INT0RIS       0x00200000  // Channel 5 Raw Interrupt 0 Status
539 #define FAN_RIS_C5STALLRIS      0x00100000  // Channel 5 Raw Stall Interrupt
540                                             // Status
541 #define FAN_RIS_C4INT1RIS       0x00040000  // Channel 4 Raw Interrupt 1 Status
542 #define FAN_RIS_C4INT0RIS       0x00020000  // Channel 4 Raw Interrupt 0 Status
543 #define FAN_RIS_C4STALLRIS      0x00010000  // Channel 4 Raw Stall Interrupt
544                                             // Status
545 #define FAN_RIS_C3INT1RIS       0x00004000  // Channel 3 Raw Interrupt 1 Status
546 #define FAN_RIS_C3INT0RIS       0x00002000  // Channel 3 Raw Interrupt 0 Status
547 #define FAN_RIS_C3STALLRIS      0x00001000  // Channel 3 Raw Stall Interrupt
548                                             // Status
549 #define FAN_RIS_C2INT1RIS       0x00000400  // Channel 2 Raw Interrupt 1 Status
550 #define FAN_RIS_C2INT0RIS       0x00000200  // Channel 2 Raw Interrupt 0 Status
551 #define FAN_RIS_C2STALLRIS      0x00000100  // Channel 2 Raw Stall Interrupt
552                                             // Status
553 #define FAN_RIS_C1INT1RIS       0x00000040  // Channel 1 Raw Interrupt 1 Status
554 #define FAN_RIS_C1INT0RIS       0x00000020  // Channel 1 Raw Interrupt 0 Status
555 #define FAN_RIS_C1STALLRIS      0x00000010  // Channel 1 Raw Stall Interrupt
556                                             // Status
557 #define FAN_RIS_C0INT1RIS       0x00000004  // Channel 0 Raw Interrupt 1 Status
558 #define FAN_RIS_C0INT0RIS       0x00000002  // Channel 0 Raw Interrupt 0 Status
559 #define FAN_RIS_C0STALLRIS      0x00000001  // Channel 0 Raw Stall Interrupt
560                                             // Status
561 
562 //*****************************************************************************
563 //
564 // The following are defines for the bit fields in the FAN_O_MIS register.
565 //
566 //*****************************************************************************
567 #define FAN_MIS_C5INT1MIS       0x00400000  // Channel 5 Masked Interrupt 1
568                                             // Status
569 #define FAN_MIS_C5INT0MIS       0x00200000  // Channel 5 Masked Interrupt 0
570                                             // Status
571 #define FAN_MIS_C5STALLMIS      0x00100000  // Channel 5 Masked Stall Interrupt
572                                             // Status
573 #define FAN_MIS_C54NT1MIS       0x00040000  // Channel 4 Masked Interrupt 1
574                                             // Status
575 #define FAN_MIS_C4INT0MIS       0x00020000  // Channel 4 Masked Interrupt 0
576                                             // Status
577 #define FAN_MIS_C4STALLMIS      0x00010000  // Channel 4 Masked Stall Interrupt
578                                             // Status
579 #define FAN_MIS_C3INT1MIS       0x00004000  // Channel 3 Masked Interrupt 1
580                                             // Status
581 #define FAN_MIS_C3INT0MIS       0x00002000  // Channel 3 Masked Interrupt 0
582                                             // Status
583 #define FAN_MIS_C3STALLMIS      0x00001000  // Channel 3 Masked Stall Interrupt
584                                             // Status
585 #define FAN_MIS_C2INT1MIS       0x00000400  // Channel 2 Masked Interrupt 1
586                                             // Status
587 #define FAN_MIS_C2INT0MIS       0x00000200  // Channel 2 Masked Interrupt 0
588                                             // Status
589 #define FAN_MIS_C2STALLMIS      0x00000100  // Channel 2 Masked Stall Interrupt
590                                             // Status
591 #define FAN_MIS_C1INT1MIS       0x00000040  // Channel 1 Masked Interrupt 1
592                                             // Status
593 #define FAN_MIS_C1INT0MIS       0x00000020  // Channel 1 Masked Interrupt 0
594                                             // Status
595 #define FAN_MIS_C1STALLMIS      0x00000010  // Channel 1 Masked Stall Interrupt
596                                             // Status
597 #define FAN_MIS_C0INT1MIS       0x00000004  // Channel 0 Masked Interrupt 1
598                                             // Status
599 #define FAN_MIS_C0INT0MIS       0x00000002  // Channel 0 Masked Interrupt 0
600                                             // Status
601 #define FAN_MIS_C0STALLMIS      0x00000001  // Channel 0 Masked Stall Interrupt
602                                             // Status
603 
604 //*****************************************************************************
605 //
606 // The following are defines for the bit fields in the FAN_O_IC register.
607 //
608 //*****************************************************************************
609 #define FAN_IC_C5INT1IC         0x00400000  // Channel 5 Interrupt 1 Clear
610 #define FAN_IC_C5INT0IC         0x00200000  // Channel 5 Interrupt 0 Clear
611 #define FAN_IC_C5STALLIC        0x00100000  // Channel 5 Stall Interrupt Clear
612 #define FAN_IC_C4INT1IC         0x00040000  // Channel 4 Interrupt 1 Clear
613 #define FAN_IC_C4INT0IC         0x00020000  // Channel 4 Interrupt 0 Clear
614 #define FAN_IC_C4STALLIC        0x00010000  // Channel 4 Stall Interrupt Clear
615 #define FAN_IC_C3INT1IC         0x00004000  // Channel 3 Interrupt 1 Clear
616 #define FAN_IC_C53INT0IC        0x00002000  // Channel 3 Interrupt 0 Clear
617 #define FAN_IC_C3STALLIC        0x00001000  // Channel 3 Stall Interrupt Clear
618 #define FAN_IC_C2INT1IC         0x00000400  // Channel 2 Interrupt 1 Clear
619 #define FAN_IC_C2INT0IC         0x00000200  // Channel 2 Interrupt 0 Clear
620 #define FAN_IC_C2STALLIC        0x00000100  // Channel 2 Stall Interrupt Clear
621 #define FAN_IC_C1INT1IC         0x00000040  // Channel 1 Interrupt 1 Clear
622 #define FAN_IC_C1INT0IC         0x00000020  // Channel 1 Interrupt 0 Clear
623 #define FAN_IC_C1STALLIC        0x00000010  // Channel 1 Stall Interrupt Clear
624 #define FAN_IC_C0INT1IC         0x00000004  // Channel 0 Interrupt 1 Clear
625 #define FAN_IC_C0INT0IC         0x00000002  // Channel 0 Interrupt 0 Clear
626 #define FAN_IC_C0STALLIC        0x00000001  // Channel 0 Stall Interrupt Clear
627 
628 //*****************************************************************************
629 //
630 // The following are defines for the bit fields in the FAN_O_PP register.
631 //
632 //*****************************************************************************
633 #define FAN_PP_CHAN_M           0x0000000F  // Channel Count
634 #define FAN_PP_CHAN_S           0
635 
636 #endif // __HW_FAN_H__
637