F2837xD_cmpss.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_cmpss.h
  4. //
  5. // TITLE: CMPSS Register Definitions.
  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 __F2837xD_CMPSS_H__
  43. #define __F2837xD_CMPSS_H__
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //---------------------------------------------------------------------------
  48. // CMPSS Individual Register Bit Definitions:
  49. struct COMPCTL_BITS { // bits description
  50. Uint16 COMPHSOURCE:1; // 0 High Comparator Source Select
  51. Uint16 COMPHINV:1; // 1 High Comparator Invert Select
  52. Uint16 CTRIPHSEL:2; // 3:2 High Comparator Trip Select
  53. Uint16 CTRIPOUTHSEL:2; // 5:4 High Comparator Trip Output Select
  54. Uint16 ASYNCHEN:1; // 6 High Comparator Asynchronous Path Enable
  55. Uint16 rsvd1:1; // 7 Reserved
  56. Uint16 COMPLSOURCE:1; // 8 Low Comparator Source Select
  57. Uint16 COMPLINV:1; // 9 Low Comparator Invert Select
  58. Uint16 CTRIPLSEL:2; // 11:10 Low Comparator Trip Select
  59. Uint16 CTRIPOUTLSEL:2; // 13:12 Low Comparator Trip Output Select
  60. Uint16 ASYNCLEN:1; // 14 Low Comparator Asynchronous Path Enable
  61. Uint16 COMPDACE:1; // 15 Comparator/DAC Enable
  62. };
  63. union COMPCTL_REG {
  64. Uint16 all;
  65. struct COMPCTL_BITS bit;
  66. };
  67. struct COMPHYSCTL_BITS { // bits description
  68. Uint16 COMPHYS:3; // 2:0 Comparator Hysteresis Trim
  69. Uint16 rsvd1:13; // 15:3 Reserved
  70. };
  71. union COMPHYSCTL_REG {
  72. Uint16 all;
  73. struct COMPHYSCTL_BITS bit;
  74. };
  75. struct COMPSTS_BITS { // bits description
  76. Uint16 COMPHSTS:1; // 0 High Comparator Status
  77. Uint16 COMPHLATCH:1; // 1 High Comparator Latched Status
  78. Uint16 rsvd1:6; // 7:2 Reserved
  79. Uint16 COMPLSTS:1; // 8 Low Comparator Status
  80. Uint16 COMPLLATCH:1; // 9 Low Comparator Latched Status
  81. Uint16 rsvd2:6; // 15:10 Reserved
  82. };
  83. union COMPSTS_REG {
  84. Uint16 all;
  85. struct COMPSTS_BITS bit;
  86. };
  87. struct COMPSTSCLR_BITS { // bits description
  88. Uint16 rsvd1:1; // 0 Reserved
  89. Uint16 HLATCHCLR:1; // 1 High Comparator Latched Status Clear
  90. Uint16 HSYNCCLREN:1; // 2 High Comparator PWMSYNC Clear Enable
  91. Uint16 rsvd2:6; // 8:3 Reserved
  92. Uint16 LLATCHCLR:1; // 9 Low Comparator Latched Status Clear
  93. Uint16 LSYNCCLREN:1; // 10 Low Comparator PWMSYNC Clear Enable
  94. Uint16 rsvd3:5; // 15:11 Reserved
  95. };
  96. union COMPSTSCLR_REG {
  97. Uint16 all;
  98. struct COMPSTSCLR_BITS bit;
  99. };
  100. struct COMPDACCTL_BITS { // bits description
  101. Uint16 DACSOURCE:1; // 0 DAC Source Control
  102. Uint16 RAMPSOURCE:4; // 4:1 Ramp Generator Source Control
  103. Uint16 SELREF:1; // 5 DAC Reference Select
  104. Uint16 RAMPLOADSEL:1; // 6 Ramp Load Select
  105. Uint16 SWLOADSEL:1; // 7 Software Load Select
  106. Uint16 rsvd1:6; // 13:8 Reserved
  107. Uint16 FREESOFT:2; // 15:14 Free/Soft Emulation Bits
  108. };
  109. union COMPDACCTL_REG {
  110. Uint16 all;
  111. struct COMPDACCTL_BITS bit;
  112. };
  113. struct DACHVALS_BITS { // bits description
  114. Uint16 DACVAL:12; // 11:0 DAC Value Control
  115. Uint16 rsvd1:4; // 15:12 Reserved
  116. };
  117. union DACHVALS_REG {
  118. Uint16 all;
  119. struct DACHVALS_BITS bit;
  120. };
  121. struct DACHVALA_BITS { // bits description
  122. Uint16 DACVAL:12; // 11:0 DAC Value Control
  123. Uint16 rsvd1:4; // 15:12 Reserved
  124. };
  125. union DACHVALA_REG {
  126. Uint16 all;
  127. struct DACHVALA_BITS bit;
  128. };
  129. struct DACLVALS_BITS { // bits description
  130. Uint16 DACVAL:12; // 11:0 DAC Value Control
  131. Uint16 rsvd1:4; // 15:12 Reserved
  132. };
  133. union DACLVALS_REG {
  134. Uint16 all;
  135. struct DACLVALS_BITS bit;
  136. };
  137. struct DACLVALA_BITS { // bits description
  138. Uint16 DACVAL:12; // 11:0 DAC Value Control
  139. Uint16 rsvd1:4; // 15:12 Reserved
  140. };
  141. union DACLVALA_REG {
  142. Uint16 all;
  143. struct DACLVALA_BITS bit;
  144. };
  145. struct RAMPDLYA_BITS { // bits description
  146. Uint16 DELAY:13; // 12:0 Ramp Delay Value
  147. Uint16 rsvd1:3; // 15:13 Reserved
  148. };
  149. union RAMPDLYA_REG {
  150. Uint16 all;
  151. struct RAMPDLYA_BITS bit;
  152. };
  153. struct RAMPDLYS_BITS { // bits description
  154. Uint16 DELAY:13; // 12:0 Ramp Delay Value
  155. Uint16 rsvd1:3; // 15:13 Reserved
  156. };
  157. union RAMPDLYS_REG {
  158. Uint16 all;
  159. struct RAMPDLYS_BITS bit;
  160. };
  161. struct CTRIPLFILCTL_BITS { // bits description
  162. Uint16 rsvd1:4; // 3:0 Reserved
  163. Uint16 SAMPWIN:5; // 8:4 Sample Window
  164. Uint16 THRESH:5; // 13:9 Majority Voting Threshold
  165. Uint16 rsvd2:1; // 14 Reserved
  166. Uint16 FILINIT:1; // 15 Filter Initialization Bit
  167. };
  168. union CTRIPLFILCTL_REG {
  169. Uint16 all;
  170. struct CTRIPLFILCTL_BITS bit;
  171. };
  172. struct CTRIPLFILCLKCTL_BITS { // bits description
  173. Uint16 CLKPRESCALE:10; // 9:0 Sample Clock Prescale
  174. Uint16 rsvd1:6; // 15:10 Reserved
  175. };
  176. union CTRIPLFILCLKCTL_REG {
  177. Uint16 all;
  178. struct CTRIPLFILCLKCTL_BITS bit;
  179. };
  180. struct CTRIPHFILCTL_BITS { // bits description
  181. Uint16 rsvd1:4; // 3:0 Reserved
  182. Uint16 SAMPWIN:5; // 8:4 Sample Window
  183. Uint16 THRESH:5; // 13:9 Majority Voting Threshold
  184. Uint16 rsvd2:1; // 14 Reserved
  185. Uint16 FILINIT:1; // 15 Filter Initialization Bit
  186. };
  187. union CTRIPHFILCTL_REG {
  188. Uint16 all;
  189. struct CTRIPHFILCTL_BITS bit;
  190. };
  191. struct CTRIPHFILCLKCTL_BITS { // bits description
  192. Uint16 CLKPRESCALE:10; // 9:0 Sample Clock Prescale
  193. Uint16 rsvd1:6; // 15:10 Reserved
  194. };
  195. union CTRIPHFILCLKCTL_REG {
  196. Uint16 all;
  197. struct CTRIPHFILCLKCTL_BITS bit;
  198. };
  199. struct COMPLOCK_BITS { // bits description
  200. Uint16 COMPCTL:1; // 0 COMPCTL Lock
  201. Uint16 COMPHYSCTL:1; // 1 COMPHYSCTL Lock
  202. Uint16 DACCTL:1; // 2 DACCTL Lock
  203. Uint16 CTRIP:1; // 3 CTRIP Lock
  204. Uint16 rsvd1:1; // 4 Reserved
  205. Uint16 rsvd2:11; // 15:5 Reserved
  206. };
  207. union COMPLOCK_REG {
  208. Uint16 all;
  209. struct COMPLOCK_BITS bit;
  210. };
  211. struct CMPSS_REGS {
  212. union COMPCTL_REG COMPCTL; // CMPSS Comparator Control Register
  213. union COMPHYSCTL_REG COMPHYSCTL; // CMPSS Comparator Hysteresis Control Register
  214. union COMPSTS_REG COMPSTS; // CMPSS Comparator Status Register
  215. union COMPSTSCLR_REG COMPSTSCLR; // CMPSS Comparator Status Clear Register
  216. union COMPDACCTL_REG COMPDACCTL; // CMPSS DAC Control Register
  217. Uint16 rsvd1; // Reserved
  218. union DACHVALS_REG DACHVALS; // CMPSS High DAC Value Shadow Register
  219. union DACHVALA_REG DACHVALA; // CMPSS High DAC Value Active Register
  220. Uint16 RAMPMAXREFA; // CMPSS Ramp Max Reference Active Register
  221. Uint16 rsvd2; // Reserved
  222. Uint16 RAMPMAXREFS; // CMPSS Ramp Max Reference Shadow Register
  223. Uint16 rsvd3; // Reserved
  224. Uint16 RAMPDECVALA; // CMPSS Ramp Decrement Value Active Register
  225. Uint16 rsvd4; // Reserved
  226. Uint16 RAMPDECVALS; // CMPSS Ramp Decrement Value Shadow Register
  227. Uint16 rsvd5; // Reserved
  228. Uint16 RAMPSTS; // CMPSS Ramp Status Register
  229. Uint16 rsvd6; // Reserved
  230. union DACLVALS_REG DACLVALS; // CMPSS Low DAC Value Shadow Register
  231. union DACLVALA_REG DACLVALA; // CMPSS Low DAC Value Active Register
  232. union RAMPDLYA_REG RAMPDLYA; // CMPSS Ramp Delay Active Register
  233. union RAMPDLYS_REG RAMPDLYS; // CMPSS Ramp Delay Shadow Register
  234. union CTRIPLFILCTL_REG CTRIPLFILCTL; // CTRIPL Filter Control Register
  235. union CTRIPLFILCLKCTL_REG CTRIPLFILCLKCTL; // CTRIPL Filter Clock Control Register
  236. union CTRIPHFILCTL_REG CTRIPHFILCTL; // CTRIPH Filter Control Register
  237. union CTRIPHFILCLKCTL_REG CTRIPHFILCLKCTL; // CTRIPH Filter Clock Control Register
  238. union COMPLOCK_REG COMPLOCK; // CMPSS Lock Register
  239. Uint16 rsvd7[5]; // Reserved
  240. };
  241. //---------------------------------------------------------------------------
  242. // CMPSS External References & Function Declarations:
  243. //
  244. #ifdef CPU1
  245. extern volatile struct CMPSS_REGS Cmpss1Regs;
  246. extern volatile struct CMPSS_REGS Cmpss2Regs;
  247. extern volatile struct CMPSS_REGS Cmpss3Regs;
  248. extern volatile struct CMPSS_REGS Cmpss4Regs;
  249. extern volatile struct CMPSS_REGS Cmpss5Regs;
  250. extern volatile struct CMPSS_REGS Cmpss6Regs;
  251. extern volatile struct CMPSS_REGS Cmpss7Regs;
  252. extern volatile struct CMPSS_REGS Cmpss8Regs;
  253. #endif
  254. #ifdef CPU2
  255. extern volatile struct CMPSS_REGS Cmpss1Regs;
  256. extern volatile struct CMPSS_REGS Cmpss2Regs;
  257. extern volatile struct CMPSS_REGS Cmpss3Regs;
  258. extern volatile struct CMPSS_REGS Cmpss4Regs;
  259. extern volatile struct CMPSS_REGS Cmpss5Regs;
  260. extern volatile struct CMPSS_REGS Cmpss6Regs;
  261. extern volatile struct CMPSS_REGS Cmpss7Regs;
  262. extern volatile struct CMPSS_REGS Cmpss8Regs;
  263. #endif
  264. #ifdef __cplusplus
  265. }
  266. #endif /* extern "C" */
  267. #endif
  268. //===========================================================================
  269. // End of file.
  270. //===========================================================================