DSP2803x_EPwm_defines.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. //###########################################################################
  2. //
  3. // FILE: DSP2803x_EPwm_defines.h
  4. //
  5. // TITLE: #defines used in EPwm examples
  6. //
  7. //###########################################################################
  8. // $TI Release: F2803x C/C++ Header Files and Peripheral Examples V130 $
  9. // $Release Date: May 8, 2015 $
  10. // $Copyright: Copyright (C) 2009-2015 Texas Instruments Incorporated -
  11. // http://www.ti.com/ ALL RIGHTS RESERVED $
  12. //###########################################################################
  13. #ifndef DSP2803x_EPWM_DEFINES_H
  14. #define DSP2803x_EPWM_DEFINES_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. // TBCTL (Time-Base Control)
  19. //==========================
  20. // CTRMODE bits
  21. #define TB_COUNT_UP 0x0
  22. #define TB_COUNT_DOWN 0x1
  23. #define TB_COUNT_UPDOWN 0x2
  24. #define TB_FREEZE 0x3
  25. // PHSEN bit
  26. #define TB_DISABLE 0x0
  27. #define TB_ENABLE 0x1
  28. // PRDLD bit
  29. #define TB_SHADOW 0x0
  30. #define TB_IMMEDIATE 0x1
  31. // SYNCOSEL bits
  32. #define TB_SYNC_IN 0x0
  33. #define TB_CTR_ZERO 0x1
  34. #define TB_CTR_CMPB 0x2
  35. #define TB_SYNC_DISABLE 0x3
  36. // HSPCLKDIV and CLKDIV bits
  37. #define TB_DIV1 0x0
  38. #define TB_DIV2 0x1
  39. #define TB_DIV4 0x2
  40. // PHSDIR bit
  41. #define TB_DOWN 0x0
  42. #define TB_UP 0x1
  43. // CMPCTL (Compare Control)
  44. //==========================
  45. // LOADAMODE and LOADBMODE bits
  46. #define CC_CTR_ZERO 0x0
  47. #define CC_CTR_PRD 0x1
  48. #define CC_CTR_ZERO_PRD 0x2
  49. #define CC_LD_DISABLE 0x3
  50. // SHDWAMODE and SHDWBMODE bits
  51. #define CC_SHADOW 0x0
  52. #define CC_IMMEDIATE 0x1
  53. // AQCTLA and AQCTLB (Action Qualifier Control)
  54. //=============================================
  55. // ZRO, PRD, CAU, CAD, CBU, CBD bits
  56. #define AQ_NO_ACTION 0x0
  57. #define AQ_CLEAR 0x1
  58. #define AQ_SET 0x2
  59. #define AQ_TOGGLE 0x3
  60. // DBCTL (Dead-Band Control)
  61. //==========================
  62. // OUT MODE bits
  63. #define DB_DISABLE 0x0
  64. #define DBB_ENABLE 0x1
  65. #define DBA_ENABLE 0x2
  66. #define DB_FULL_ENABLE 0x3
  67. // POLSEL bits
  68. #define DB_ACTV_HI 0x0
  69. #define DB_ACTV_LOC 0x1
  70. #define DB_ACTV_HIC 0x2
  71. #define DB_ACTV_LO 0x3
  72. // IN MODE
  73. #define DBA_ALL 0x0
  74. #define DBB_RED_DBA_FED 0x1
  75. #define DBA_RED_DBB_FED 0x2
  76. #define DBB_ALL 0x3
  77. // CHPCTL (chopper control)
  78. //==========================
  79. // CHPEN bit
  80. #define CHP_DISABLE 0x0
  81. #define CHP_ENABLE 0x1
  82. // CHPFREQ bits
  83. #define CHP_DIV1 0x0
  84. #define CHP_DIV2 0x1
  85. #define CHP_DIV3 0x2
  86. #define CHP_DIV4 0x3
  87. #define CHP_DIV5 0x4
  88. #define CHP_DIV6 0x5
  89. #define CHP_DIV7 0x6
  90. #define CHP_DIV8 0x7
  91. // CHPDUTY bits
  92. #define CHP1_8TH 0x0
  93. #define CHP2_8TH 0x1
  94. #define CHP3_8TH 0x2
  95. #define CHP4_8TH 0x3
  96. #define CHP5_8TH 0x4
  97. #define CHP6_8TH 0x5
  98. #define CHP7_8TH 0x6
  99. // TZSEL (Trip Zone Select)
  100. //==========================
  101. // CBCn and OSHTn bits
  102. #define TZ_DISABLE 0x0
  103. #define TZ_ENABLE 0x1
  104. // TZCTL (Trip Zone Control)
  105. //==========================
  106. // TZA and TZB bits
  107. #define TZ_HIZ 0x0
  108. #define TZ_FORCE_HI 0x1
  109. #define TZ_FORCE_LO 0x2
  110. #define TZ_NO_CHANGE 0x3
  111. // TZDCSEL (Trip Zone Digital Compare)
  112. //==========================
  113. // DCAEVT1, DCAEVT2, DCBEVT1, DCBEVT2 bits
  114. #define TZ_EVT_DISABLE 0x0
  115. #define TZ_DCAH_LOW 0x1
  116. #define TZ_DCAH_HI 0x2
  117. #define TZ_DCAL_LOW 0x3
  118. #define TZ_DCAL_HI 0x4
  119. #define TZ_DCAL_HI_DCAH_LOW 0x5
  120. #define TZ_DCBH_LOW 0x1
  121. #define TZ_DCBH_HI 0x2
  122. #define TZ_DCBL_LOW 0x3
  123. #define TZ_DCBL_HI 0x4
  124. #define TZ_DCBL_HI_DCBH_LOW 0x5
  125. // ETSEL (Event Trigger Select)
  126. //=============================
  127. #define ET_DCAEVT1SOC 0x0
  128. #define ET_CTR_ZERO 0x1
  129. #define ET_CTR_PRD 0x2
  130. #define ET_CTR_PRDZERO 0x3
  131. #define ET_CTRU_CMPA 0x4
  132. #define ET_CTRD_CMPA 0x5
  133. #define ET_CTRU_CMPB 0x6
  134. #define ET_CTRD_CMPB 0x7
  135. // ETPS (Event Trigger Pre-scale)
  136. //===============================
  137. // INTPRD, SOCAPRD, SOCBPRD bits
  138. #define ET_DISABLE 0x0
  139. #define ET_1ST 0x1
  140. #define ET_2ND 0x2
  141. #define ET_3RD 0x3
  142. //--------------------------------
  143. // HRPWM (High Resolution PWM)
  144. //================================
  145. // HRCNFG
  146. #define HR_DISABLE 0x0
  147. #define HR_REP 0x1
  148. #define HR_FEP 0x2
  149. #define HR_BEP 0x3
  150. #define HR_CMP 0x0
  151. #define HR_PHS 0x1
  152. #define HR_CTR_ZERO 0x0
  153. #define HR_CTR_PRD 0x1
  154. #define HR_CTR_ZERO_PRD 0x2
  155. #define HR_NORM_B 0x0
  156. #define HR_INVERT_B 0x1
  157. //--------------------------------
  158. // DC (Digital Compare)
  159. //================================
  160. // DCTRIPSEL
  161. #define DC_TZ1 0x0
  162. #define DC_TZ2 0x1
  163. #define DC_TZ3 0x2
  164. #define DC_COMP1OUT 0x8
  165. #define DC_COMP2OUT 0x9
  166. #define DC_COMP3OUT 0xA
  167. // DCFCTL
  168. #define DC_SRC_DCAEVT1 0x0
  169. #define DC_SRC_DCAEVT2 0x1
  170. #define DC_SRC_DCBEVT1 0x2
  171. #define DC_SRC_DCBEVT2 0x3
  172. #define DC_PULSESEL_PRD 0x0
  173. #define DC_PULSESEL_ZERO 0x1
  174. #define DC_BLANK_DISABLE 0x0
  175. #define DC_BLANK_ENABLE 0x1
  176. #define DC_BLANK_NOTINV 0x0
  177. #define DC_BLANK_INV 0x1
  178. //DCACTL/DCBCTL
  179. #define DC_EVT1 0x0
  180. #define DC_EVT2 0x0
  181. #define DC_EVT_FLT 0x1
  182. #define DC_EVT_SYNC 0x0
  183. #define DC_EVT_ASYNC 0x1
  184. #define DC_SOC_DISABLE 0x0
  185. #define DC_SOC_ENABLE 0x1
  186. #ifdef __cplusplus
  187. }
  188. #endif /* extern "C" */
  189. #endif // - end of DSP2803x_EPWM_DEFINES_H
  190. //===========================================================================
  191. // End of file.
  192. //===========================================================================