hw_fan.h 34 KB

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