hw_cmpss.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. //###########################################################################
  2. //
  3. // FILE: hw_cmpss.h
  4. //
  5. // TITLE: Definitions for the C28x CMPSS registers.
  6. //
  7. //###########################################################################
  8. // $TI Release: F2837xD Support Library v3.05.00.00 $
  9. // $Release Date: Tue Jun 26 03:15:23 CDT 2018 $
  10. // $Copyright:
  11. // Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/
  12. //
  13. // Redistribution and use in source and binary forms, with or without
  14. // modification, are permitted provided that the following conditions
  15. // are met:
  16. //
  17. // Redistributions of source code must retain the above copyright
  18. // notice, this list of conditions and the following disclaimer.
  19. //
  20. // Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the
  23. // distribution.
  24. //
  25. // Neither the name of Texas Instruments Incorporated nor the names of
  26. // its contributors may be used to endorse or promote products derived
  27. // from this software without specific prior written permission.
  28. //
  29. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  30. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  31. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  32. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  33. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  34. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  35. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  36. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  37. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  39. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. // $
  41. //###########################################################################
  42. #ifndef __HW_CMPSS_H__
  43. #define __HW_CMPSS_H__
  44. //*****************************************************************************
  45. //
  46. // The following are defines for the CMPSS register offsets
  47. //
  48. //*****************************************************************************
  49. #define CMPSS_O_COMPCTL 0x0 // CMPSS Comparator Control
  50. // Register
  51. #define CMPSS_O_COMPHYSCTL 0x1 // CMPSS Comparator Hysteresis
  52. // Control Register
  53. #define CMPSS_O_COMPSTS 0x2 // CMPSS Comparator Status
  54. // Register
  55. #define CMPSS_O_COMPSTSCLR 0x3 // CMPSS Comparator Status Clear
  56. // Register
  57. #define CMPSS_O_COMPDACCTL 0x4 // CMPSS DAC Control Register
  58. #define CMPSS_O_DACHVALS 0x6 // CMPSS High DAC Value Shadow
  59. // Register
  60. #define CMPSS_O_DACHVALA 0x7 // CMPSS High DAC Value Active
  61. // Register
  62. #define CMPSS_O_RAMPMAXREFA 0x8 // CMPSS Ramp Max Reference Active
  63. // Register
  64. #define CMPSS_O_RAMPMAXREFS 0xA // CMPSS Ramp Max Reference Shadow
  65. // Register
  66. #define CMPSS_O_RAMPDECVALA 0xC // CMPSS Ramp Decrement Value
  67. // Active Register
  68. #define CMPSS_O_RAMPDECVALS 0xE // CMPSS Ramp Decrement Value
  69. // Shadow Register
  70. #define CMPSS_O_RAMPSTS 0x10 // CMPSS Ramp Status Register
  71. #define CMPSS_O_DACLVALS 0x12 // CMPSS Low DAC Value Shadow
  72. // Register
  73. #define CMPSS_O_DACLVALA 0x13 // CMPSS Low DAC Value Active
  74. // Register
  75. #define CMPSS_O_RAMPDLYA 0x14 // CMPSS Ramp Delay Active
  76. // Register
  77. #define CMPSS_O_RAMPDLYS 0x15 // CMPSS Ramp Delay Shadow
  78. // Register
  79. #define CMPSS_O_CTRIPLFILCTL 0x16 // CTRIPL Filter Control Register
  80. #define CMPSS_O_CTRIPLFILCLKCTL 0x17 // CTRIPL Filter Clock Control
  81. // Register
  82. #define CMPSS_O_CTRIPHFILCTL 0x18 // CTRIPH Filter Control Register
  83. #define CMPSS_O_CTRIPHFILCLKCTL 0x19 // CTRIPH Filter Clock Control
  84. // Register
  85. #define CMPSS_O_COMPLOCK 0x1A // CMPSS Lock Register
  86. //*****************************************************************************
  87. //
  88. // The following are defines for the bit fields in the COMPCTL register
  89. //
  90. //*****************************************************************************
  91. #define CMPSS_COMPCTL_COMPHSOURCE 0x1 // High Comparator Source Select
  92. #define CMPSS_COMPCTL_COMPHINV 0x2 // High Comparator Invert Select
  93. #define CMPSS_COMPCTL_CTRIPHSEL_S 2
  94. #define CMPSS_COMPCTL_CTRIPHSEL_M 0xC // High Comparator Trip Select
  95. #define CMPSS_COMPCTL_CTRIPOUTHSEL_S 4
  96. #define CMPSS_COMPCTL_CTRIPOUTHSEL_M 0x30 // High Comparator Trip Output
  97. // Select
  98. #define CMPSS_COMPCTL_ASYNCHEN 0x40 // High Comparator Asynchronous
  99. // Path Enable
  100. #define CMPSS_COMPCTL_COMPLSOURCE 0x100 // Low Comparator Source Select
  101. #define CMPSS_COMPCTL_COMPLINV 0x200 // Low Comparator Invert Select
  102. #define CMPSS_COMPCTL_CTRIPLSEL_S 10
  103. #define CMPSS_COMPCTL_CTRIPLSEL_M 0xC00 // Low Comparator Trip Select
  104. #define CMPSS_COMPCTL_CTRIPOUTLSEL_S 12
  105. #define CMPSS_COMPCTL_CTRIPOUTLSEL_M 0x3000 // Low Comparator Trip Output
  106. // Select
  107. #define CMPSS_COMPCTL_ASYNCLEN 0x4000 // Low Comparator Asynchronous
  108. // Path Enable
  109. #define CMPSS_COMPCTL_COMPDACE 0x8000 // Comparator/DAC Enable
  110. //*****************************************************************************
  111. //
  112. // The following are defines for the bit fields in the COMPHYSCTL register
  113. //
  114. //*****************************************************************************
  115. #define CMPSS_COMPHYSCTL_COMPHYS_S 0
  116. #define CMPSS_COMPHYSCTL_COMPHYS_M 0x7 // Comparator Hysteresis Trim
  117. //*****************************************************************************
  118. //
  119. // The following are defines for the bit fields in the COMPSTS register
  120. //
  121. //*****************************************************************************
  122. #define CMPSS_COMPSTS_COMPHSTS 0x1 // High Comparator Status
  123. #define CMPSS_COMPSTS_COMPHLATCH 0x2 // High Comparator Latched Status
  124. #define CMPSS_COMPSTS_COMPLSTS 0x100 // Low Comparator Status
  125. #define CMPSS_COMPSTS_COMPLLATCH 0x200 // Low Comparator Latched Status
  126. //*****************************************************************************
  127. //
  128. // The following are defines for the bit fields in the COMPSTSCLR register
  129. //
  130. //*****************************************************************************
  131. #define CMPSS_COMPSTSCLR_HLATCHCLR 0x2 // High Comparator Latched Status
  132. // Clear
  133. #define CMPSS_COMPSTSCLR_HSYNCCLREN 0x4 // High Comparator PWMSYNC Clear
  134. // Enable
  135. #define CMPSS_COMPSTSCLR_LLATCHCLR 0x200 // Low Comparator Latched Status
  136. // Clear
  137. #define CMPSS_COMPSTSCLR_LSYNCCLREN 0x400 // Low Comparator PWMSYNC Clear
  138. // Enable
  139. //*****************************************************************************
  140. //
  141. // The following are defines for the bit fields in the COMPDACCTL register
  142. //
  143. //*****************************************************************************
  144. #define CMPSS_COMPDACCTL_DACSOURCE 0x1 // DAC Source Control
  145. #define CMPSS_COMPDACCTL_RAMPSOURCE_S 1
  146. #define CMPSS_COMPDACCTL_RAMPSOURCE_M 0x1E // Ramp Generator Source Control
  147. #define CMPSS_COMPDACCTL_SELREF 0x20 // DAC Reference Select
  148. #define CMPSS_COMPDACCTL_RAMPLOADSEL 0x40 // Ramp Load Select
  149. #define CMPSS_COMPDACCTL_SWLOADSEL 0x80 // Software Load Select
  150. #define CMPSS_COMPDACCTL_FREESOFT_S 14
  151. #define CMPSS_COMPDACCTL_FREESOFT_M 0xC000 // Free/Soft Emulation Bits
  152. //*****************************************************************************
  153. //
  154. // The following are defines for the bit fields in the DACHVALS register
  155. //
  156. //*****************************************************************************
  157. #define CMPSS_DACHVALS_DACVAL_S 0
  158. #define CMPSS_DACHVALS_DACVAL_M 0xFFF // DAC Value Control
  159. //*****************************************************************************
  160. //
  161. // The following are defines for the bit fields in the DACHVALA register
  162. //
  163. //*****************************************************************************
  164. #define CMPSS_DACHVALA_DACVAL_S 0
  165. #define CMPSS_DACHVALA_DACVAL_M 0xFFF // DAC Value Control
  166. //*****************************************************************************
  167. //
  168. // The following are defines for the bit fields in the RAMPMAXREFA register
  169. //
  170. //*****************************************************************************
  171. #define CMPSS_RAMPMAXREFA_RAMPMAXREF_S 0
  172. #define CMPSS_RAMPMAXREFA_RAMPMAXREF_M 0xFFFF // Ramp Maximum Reference Active
  173. //*****************************************************************************
  174. //
  175. // The following are defines for the bit fields in the RAMPMAXREFS register
  176. //
  177. //*****************************************************************************
  178. #define CMPSS_RAMPMAXREFS_RAMPMAXREF_S 0
  179. #define CMPSS_RAMPMAXREFS_RAMPMAXREF_M 0xFFFF // Ramp Maximum Reference Shadow
  180. //*****************************************************************************
  181. //
  182. // The following are defines for the bit fields in the RAMPDECVALA register
  183. //
  184. //*****************************************************************************
  185. #define CMPSS_RAMPDECVALA_RAMPDECVAL_S 0
  186. #define CMPSS_RAMPDECVALA_RAMPDECVAL_M 0xFFFF // Ramp Decrement Value Active
  187. //*****************************************************************************
  188. //
  189. // The following are defines for the bit fields in the RAMPDECVALS register
  190. //
  191. //*****************************************************************************
  192. #define CMPSS_RAMPDECVALS_RAMPDECVAL_S 0
  193. #define CMPSS_RAMPDECVALS_RAMPDECVAL_M 0xFFFF // Ramp Decrement Value Shadow
  194. //*****************************************************************************
  195. //
  196. // The following are defines for the bit fields in the RAMPSTS register
  197. //
  198. //*****************************************************************************
  199. #define CMPSS_RAMPSTS_RAMPVALUE_S 0
  200. #define CMPSS_RAMPSTS_RAMPVALUE_M 0xFFFF // Ramp Value
  201. //*****************************************************************************
  202. //
  203. // The following are defines for the bit fields in the DACLVALS register
  204. //
  205. //*****************************************************************************
  206. #define CMPSS_DACLVALS_DACVAL_S 0
  207. #define CMPSS_DACLVALS_DACVAL_M 0xFFF // DAC Value Control
  208. //*****************************************************************************
  209. //
  210. // The following are defines for the bit fields in the DACLVALA register
  211. //
  212. //*****************************************************************************
  213. #define CMPSS_DACLVALA_DACVAL_S 0
  214. #define CMPSS_DACLVALA_DACVAL_M 0xFFF // DAC Value Control
  215. //*****************************************************************************
  216. //
  217. // The following are defines for the bit fields in the RAMPDLYA register
  218. //
  219. //*****************************************************************************
  220. #define CMPSS_RAMPDLYA_DELAY_S 0
  221. #define CMPSS_RAMPDLYA_DELAY_M 0x1FFF // Ramp Delay Value
  222. //*****************************************************************************
  223. //
  224. // The following are defines for the bit fields in the RAMPDLYS register
  225. //
  226. //*****************************************************************************
  227. #define CMPSS_RAMPDLYS_DELAY_S 0
  228. #define CMPSS_RAMPDLYS_DELAY_M 0x1FFF // Ramp Delay Value
  229. //*****************************************************************************
  230. //
  231. // The following are defines for the bit fields in the CTRIPLFILCTL register
  232. //
  233. //*****************************************************************************
  234. #define CMPSS_CTRIPLFILCTL_SAMPWIN_S 4
  235. #define CMPSS_CTRIPLFILCTL_SAMPWIN_M 0x1F0 // Sample Window
  236. #define CMPSS_CTRIPLFILCTL_THRESH_S 9
  237. #define CMPSS_CTRIPLFILCTL_THRESH_M 0x3E00 // Majority Voting Threshold
  238. #define CMPSS_CTRIPLFILCTL_FILINIT 0x8000 // Filter Initialization Bit
  239. //*****************************************************************************
  240. //
  241. // The following are defines for the bit fields in the CTRIPLFILCLKCTL register
  242. //
  243. //*****************************************************************************
  244. #define CMPSS_CTRIPLFILCLKCTL_CLKPRESCALE_S 0
  245. #define CMPSS_CTRIPLFILCLKCTL_CLKPRESCALE_M 0x3FF // Sample Clock Prescale
  246. //*****************************************************************************
  247. //
  248. // The following are defines for the bit fields in the CTRIPHFILCTL register
  249. //
  250. //*****************************************************************************
  251. #define CMPSS_CTRIPHFILCTL_SAMPWIN_S 4
  252. #define CMPSS_CTRIPHFILCTL_SAMPWIN_M 0x1F0 // Sample Window
  253. #define CMPSS_CTRIPHFILCTL_THRESH_S 9
  254. #define CMPSS_CTRIPHFILCTL_THRESH_M 0x3E00 // Majority Voting Threshold
  255. #define CMPSS_CTRIPHFILCTL_FILINIT 0x8000 // Filter Initialization Bit
  256. //*****************************************************************************
  257. //
  258. // The following are defines for the bit fields in the CTRIPHFILCLKCTL register
  259. //
  260. //*****************************************************************************
  261. #define CMPSS_CTRIPHFILCLKCTL_CLKPRESCALE_S 0
  262. #define CMPSS_CTRIPHFILCLKCTL_CLKPRESCALE_M 0x3FF // Sample Clock Prescale
  263. //*****************************************************************************
  264. //
  265. // The following are defines for the bit fields in the COMPLOCK register
  266. //
  267. //*****************************************************************************
  268. #define CMPSS_COMPLOCK_COMPCTL 0x1 // COMPCTL Lock
  269. #define CMPSS_COMPLOCK_COMPHYSCTL 0x2 // COMPHYSCTL Lock
  270. #define CMPSS_COMPLOCK_DACCTL 0x4 // DACCTL Lock
  271. #define CMPSS_COMPLOCK_CTRIP 0x8 // CTRIP Lock
  272. #endif