F2837xD_EPwm_defines.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. //###########################################################################
  2. //
  3. // FILE: F2837xD_EPwm_defines.h
  4. //
  5. // TITLE: #defines used in EPwm examples
  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_EPWM_DEFINES_H
  43. #define F2837xD_EPWM_DEFINES_H
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. //
  48. // Defines
  49. //
  50. //
  51. // TBCTL (Time-Base Control)
  52. //
  53. //
  54. // CTRMODE bits
  55. //
  56. #define TB_COUNT_UP 0x0
  57. #define TB_COUNT_DOWN 0x1
  58. #define TB_COUNT_UPDOWN 0x2
  59. #define TB_FREEZE 0x3
  60. //
  61. // PHSEN bit
  62. //
  63. #define TB_DISABLE 0x0
  64. #define TB_ENABLE 0x1
  65. //
  66. // PRDLD bit
  67. //
  68. #define TB_SHADOW 0x0
  69. #define TB_IMMEDIATE 0x1
  70. //
  71. // SYNCOSEL bits
  72. //
  73. #define TB_SYNC_IN 0x0
  74. #define TB_CTR_ZERO 0x1
  75. #define TB_CTR_CMPB 0x2
  76. #define TB_SYNC_DISABLE 0x3
  77. //
  78. // HSPCLKDIV and CLKDIV bits
  79. //
  80. #define TB_DIV1 0x0
  81. #define TB_DIV2 0x1
  82. #define TB_DIV4 0x2
  83. //
  84. // PHSDIR bit
  85. //
  86. #define TB_DOWN 0x0
  87. #define TB_UP 0x1
  88. //
  89. // CMPCTL (Compare Control)
  90. //
  91. //
  92. // LOADAMODE and LOADBMODE bits
  93. //
  94. #define CC_CTR_ZERO 0x0
  95. #define CC_CTR_PRD 0x1
  96. #define CC_CTR_ZERO_PRD 0x2
  97. #define CC_LD_DISABLE 0x3
  98. //
  99. // SHDWAMODE and SHDWBMODE bits
  100. //
  101. #define CC_SHADOW 0x0
  102. #define CC_IMMEDIATE 0x1
  103. //
  104. // AQCTLA and AQCTLB (Action Qualifier Control)
  105. //
  106. //
  107. // ZRO, PRD, CAU, CAD, CBU, CBD bits
  108. //
  109. #define AQ_NO_ACTION 0x0
  110. #define AQ_CLEAR 0x1
  111. #define AQ_SET 0x2
  112. #define AQ_TOGGLE 0x3
  113. //
  114. // DBCTL (Dead-Band Control)
  115. //
  116. //
  117. // OUT MODE bits
  118. //
  119. #define DB_DISABLE 0x0
  120. #define DBB_ENABLE 0x1
  121. #define DBA_ENABLE 0x2
  122. #define DB_FULL_ENABLE 0x3
  123. //
  124. // POLSEL bits
  125. //
  126. #define DB_ACTV_HI 0x0
  127. #define DB_ACTV_LOC 0x1
  128. #define DB_ACTV_HIC 0x2
  129. #define DB_ACTV_LO 0x3
  130. //
  131. // IN MODE
  132. //
  133. #define DBA_ALL 0x0
  134. #define DBB_RED_DBA_FED 0x1
  135. #define DBA_RED_DBB_FED 0x2
  136. #define DBB_ALL 0x3
  137. //
  138. // CHPCTL (chopper control)
  139. //
  140. //
  141. // CHPEN bit
  142. //
  143. #define CHP_DISABLE 0x0
  144. #define CHP_ENABLE 0x1
  145. //
  146. // CHPFREQ bits
  147. //
  148. #define CHP_DIV1 0x0
  149. #define CHP_DIV2 0x1
  150. #define CHP_DIV3 0x2
  151. #define CHP_DIV4 0x3
  152. #define CHP_DIV5 0x4
  153. #define CHP_DIV6 0x5
  154. #define CHP_DIV7 0x6
  155. #define CHP_DIV8 0x7
  156. //
  157. // CHPDUTY bits
  158. //
  159. #define CHP1_8TH 0x0
  160. #define CHP2_8TH 0x1
  161. #define CHP3_8TH 0x2
  162. #define CHP4_8TH 0x3
  163. #define CHP5_8TH 0x4
  164. #define CHP6_8TH 0x5
  165. #define CHP7_8TH 0x6
  166. //
  167. // TZSEL (Trip Zone Select)
  168. //
  169. //
  170. // CBCn and OSHTn bits
  171. //
  172. #define TZ_DISABLE 0x0
  173. #define TZ_ENABLE 0x1
  174. //
  175. // TZCTL (Trip Zone Control)
  176. //
  177. //
  178. // TZA and TZB bits
  179. //
  180. #define TZ_HIZ 0x0
  181. #define TZ_FORCE_HI 0x1
  182. #define TZ_FORCE_LO 0x2
  183. #define TZ_NO_CHANGE 0x3
  184. //
  185. // TZDCSEL (Trip Zone Digital Compare)
  186. //
  187. //
  188. // DCAEVT1, DCAEVT2, DCBEVT1, DCBEVT2 bits
  189. //
  190. #define TZ_EVT_DISABLE 0x0
  191. #define TZ_DCAH_LOW 0x1
  192. #define TZ_DCAH_HI 0x2
  193. #define TZ_DCAL_LOW 0x3
  194. #define TZ_DCAL_HI 0x4
  195. #define TZ_DCAL_HI_DCAH_LOW 0x5
  196. #define TZ_DCBH_LOW 0x1
  197. #define TZ_DCBH_HI 0x2
  198. #define TZ_DCBL_LOW 0x3
  199. #define TZ_DCBL_HI 0x4
  200. #define TZ_DCBL_HI_DCBH_LOW 0x5
  201. //
  202. // ETSEL (Event Trigger Select)
  203. //
  204. #define ET_DCAEVT1SOC 0x0
  205. #define ET_CTR_ZERO 0x1
  206. #define ET_CTR_PRD 0x2
  207. #define ET_CTR_PRDZERO 0x3
  208. #define ET_CTRU_CMPA 0x4
  209. #define ET_CTRD_CMPA 0x5
  210. #define ET_CTRU_CMPB 0x6
  211. #define ET_CTRD_CMPB 0x7
  212. //
  213. // ETPS (Event Trigger Pre-scale)
  214. //
  215. //
  216. // INTPRD, SOCAPRD, SOCBPRD bits
  217. //
  218. #define ET_DISABLE 0x0
  219. #define ET_1ST 0x1
  220. #define ET_2ND 0x2
  221. #define ET_3RD 0x3
  222. //
  223. // HRPWM (High Resolution PWM)
  224. //
  225. //
  226. // HRCNFG
  227. //
  228. #define HR_DISABLE 0x0
  229. #define HR_REP 0x1
  230. #define HR_FEP 0x2
  231. #define HR_BEP 0x3
  232. #define HR_CMP 0x0
  233. #define HR_PHS 0x1
  234. #define HR_CTR_ZERO 0x0
  235. #define HR_CTR_PRD 0x1
  236. #define HR_CTR_ZERO_PRD 0x2
  237. #define HR_NORM_B 0x0
  238. #define HR_INVERT_B 0x1
  239. //
  240. // DC (Digital Compare)
  241. //
  242. //
  243. // DCTRIPSEL
  244. //
  245. #define DC_TZ1 0x0
  246. #define DC_TZ2 0x1
  247. #define DC_TZ3 0x2
  248. #define DC_TRIPIN1 0x0
  249. #define DC_TRIPIN2 0x1
  250. #define DC_TRIPIN3 0x2
  251. #define DC_TRIPIN4 0x3
  252. #define DC_TRIPIN5 0x4
  253. #define DC_TRIPIN6 0x5
  254. #define DC_TRIPIN7 0x6
  255. #define DC_TRIPIN8 0x7
  256. #define DC_TRIPIN9 0x8
  257. #define DC_TRIPIN10 0x9
  258. #define DC_TRIPIN11 0xA
  259. #define DC_TRIPIN12 0xB
  260. // Reserved 0xC
  261. #define DC_TRIPIN14 0xD
  262. #define DC_TRIPIN15 0xE
  263. #define DC_COMBINATION 0xF
  264. //
  265. // DCFCTL
  266. //
  267. #define DC_SRC_DCAEVT1 0x0
  268. #define DC_SRC_DCAEVT2 0x1
  269. #define DC_SRC_DCBEVT1 0x2
  270. #define DC_SRC_DCBEVT2 0x3
  271. #define DC_PULSESEL_PRD 0x0
  272. #define DC_PULSESEL_ZERO 0x1
  273. #define DC_PULSESEL_ZERO_PRD 0x2
  274. #define DC_BLANK_DISABLE 0x0
  275. #define DC_BLANK_ENABLE 0x1
  276. #define DC_BLANK_NOTINV 0x0
  277. #define DC_BLANK_INV 0x1
  278. //
  279. //DCACTL/DCBCTL
  280. //
  281. #define DC_EVT1 0x0
  282. #define DC_EVT2 0x0
  283. #define DC_EVT_FLT 0x1
  284. #define DC_EVT_SYNC 0x0
  285. #define DC_EVT_ASYNC 0x1
  286. #define DC_SOC_DISABLE 0x0
  287. #define DC_SOC_ENABLE 0x1
  288. #ifdef __cplusplus
  289. }
  290. #endif /* extern "C" */
  291. #endif // - end of F2837xD_EPWM_DEFINES_H
  292. //
  293. // End of file
  294. //