MotorWare f2806x Driver API Documentation
pwm.h
Go to the documentation of this file.
1 /* --COPYRIGHT--,BSD
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  * --/COPYRIGHT--*/
32 #ifndef _PWM_H_
33 #define _PWM_H_
34 
41 
42 
43 // **************************************************************************
44 // the includes
45 
46 #include "sw/modules/types/src/types.h"
47 
49 
50 
55 
56 
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 
63 // **************************************************************************
64 // the defines
65 
66 
69 #define PWM_ePWM1_BASE_ADDR (0x00006800)
70 
73 #define PWM_ePWM2_BASE_ADDR (0x00006840)
74 
77 #define PWM_ePWM3_BASE_ADDR (0x00006880)
78 
81 #define PWM_ePWM4_BASE_ADDR (0x000068C0)
82 
85 #define PWM_ePWM5_BASE_ADDR (0x00006900)
86 
89 #define PWM_ePWM6_BASE_ADDR (0x00006940)
90 
93 #define PWM_ePWM7_BASE_ADDR (0x00006980)
94 
97 #define PWM_ePWM8_BASE_ADDR (0x000069C0)
98 
101 #define PWM_AQCTL_ZRO_BITS (3 << 0)
102 
105 #define PWM_AQCTL_PRD_BITS (3 << 2)
106 
109 #define PWM_AQCTL_CAU_BITS (3 << 4)
110 
113 #define PWM_AQCTL_CAD_BITS (3 << 6)
114 
117 #define PWM_AQCTL_CBU_BITS (3 << 8)
118 
121 #define PWM_AQCTL_CBD_BITS (3 << 10)
122 
125 #define PWM_AQCSFRC_CSFA_BITS (3 << 0)
126 
129 #define PWM_AQCSFRC_CSFB_BITS (3 << 2)
130 
133 #define PWM_CMPCTL_LOADAMODE_BITS (3 << 0)
134 
137 #define PWM_CMPCTL_LOADBMODE_BITS (3 << 2)
138 
141 #define PWM_CMPCTL_SHDWAMODE_BITS (1 << 4)
142 
145 #define PWM_CMPCTL_SHDWBMODE_BITS (1 << 6)
146 
149 #define PWM_CMPCTL_SHDWAFULL_BITS (1 << 8)
150 
153 #define PWM_CMPCTL_SHDWBFULL_BITS (1 << 9)
154 
155 
158 #define PWM_DBCTL_OUTMODE_BITS (3 << 0)
159 
162 #define PWM_DBCTL_POLSEL_BITS (3 << 2)
163 
166 #define PWM_DBCTL_INMODE_BITS (3 << 4)
167 
170 #define PWM_DBCTL_HALFCYCLE_BITS (1 << 15)
171 
172 
175 #define PWM_ETCLR_INT_BITS (1 << 0)
176 
179 #define PWM_ETCLR_SOCA_BITS (1 << 2)
180 
183 #define PWM_ETCLR_SOCB_BITS (1 << 3)
184 
185 
188 #define PWM_ETPS_INTPRD_BITS (3 << 0)
189 
192 #define PWM_ETPS_INTCNT_BITS (3 << 2)
193 
196 #define PWM_ETPS_SOCAPRD_BITS (3 << 8)
197 
200 #define PWM_ETPS_SOCACNT_BITS (3 << 10)
201 
204 #define PWM_ETPS_SOCBPRD_BITS (3 << 12)
205 
208 #define PWM_ETPS_SOCBCNT_BITS (3 << 14)
209 
210 
213 #define PWM_ETSEL_INTSEL_BITS (7 << 0)
214 
217 #define PWM_ETSEL_INTEN_BITS (1 << 3)
218 
221 #define PWM_ETSEL_SOCASEL_BITS (7 << 8)
222 
225 #define PWM_ETSEL_SOCAEN_BITS (1 << 11)
226 
229 #define PWM_ETSEL_SOCBSEL_BITS (7 << 12)
230 
233 #define PWM_ETSEL_SOCBEN_BITS (1 << 15)
234 
235 
238 #define PWM_PCCTL_CHPEN_BITS (1 << 0)
239 
242 #define PWM_PCCTL_OSHTWTH_BITS (15 << 1)
243 
246 #define PWM_PCCTL_CHPFREQ_BITS (7 << 5)
247 
250 #define PWM_PCCTL_CHPDUTY_BITS (7 << 8)
251 
254 #define PWM_HRCNFG_EDGMODE_BITS (3 << 0)
255 
258 #define PWM_HRCNFG_CTLMODE_BITS (1 << 2)
259 
262 #define PWM_HRCNFG_HRLOAD_BITS (3 << 3)
263 
266 #define PWM_HRCNFG_SELOUTB_BITS (1 << 5)
267 
270 #define PWM_HRCNFG_AUTOCONV_BITS (1 << 6)
271 
274 #define PWM_HRCNFG_SWAPAB_BITS (1 << 7)
275 
278 #define PWM_HRPCTL_HRPE_BITS (1 << 0)
279 
282 #define PWM_HRPCTL_PWMSYNCSEL_BITS (1 << 1)
283 
286 #define PWM_HRPCTL_TBPHSHRLOADE_BITS (1 << 2)
287 
290 #define PWM_TBCTL_CTRMODE_BITS (3 << 0)
291 
294 #define PWM_TBCTL_PHSEN_BITS (1 << 2)
295 
298 #define PWM_TBCTL_PRDLD_BITS (1 << 3)
299 
302 #define PWM_TBCTL_SYNCOSEL_BITS (3 << 4)
303 
306 #define PWM_TBCTL_SWFSYNC_BITS (1 << 6)
307 
310 #define PWM_TBCTL_HSPCLKDIV_BITS (7 << 7)
311 
314 #define PWM_TBCTL_CLKDIV_BITS (7 << 10)
315 
318 #define PWM_TBCTL_PHSDIR_BITS (1 << 13)
319 
322 #define PWM_TBCTL_FREESOFT_BITS (3 << 14)
323 
324 
327 #define PWM_TZCLR_INT_BITS (1 << 0)
328 
331 #define PWM_TZCLR_CBC_BITS (1 << 1)
332 
335 #define PWM_TZCLR_OST_BITS (1 << 2)
336 
339 #define PWM_TZCLR_DCAEVT1_BITS (1 << 3)
340 
343 #define PWM_TZCLR_DCAEVT2_BITS (1 << 4)
344 
347 #define PWM_TZCLR_DCBEVT1_BITS (1 << 5)
348 
351 #define PWM_TZCLR_DCBEVT2_BITS (1 << 6)
352 
353 
356 #define PWM_TZCTL_TZA_BITS (3 << 0)
357 
360 #define PWM_TZCTL_TZB_BITS (3 << 2)
361 
364 #define PWM_TZCTL_DCAEVT1_BITS (3 << 4)
365 
368 #define PWM_TZCTL_DCAEVT2_BITS (3 << 6)
369 
372 #define PWM_TZCTL_DCBEVT1_BITS (3 << 8)
373 
376 #define PWM_TZCTL_DCBEVT2_BITS (3 << 10)
377 
378 
381 #define PWM_TZFRC_CBC_BITS (1 << 1)
382 
385 #define PWM_TZFRC_OST_BITS (1 << 2)
386 
389 #define PWM_TZFRC_DCAEVT1_BITS (1 << 3)
390 
393 #define PWM_TZFRC_DCAEVT2_BITS (1 << 4)
394 
397 #define PWM_TZFRC_DCBEVT1_BITS (1 << 5)
398 
401 #define PWM_TZFRC_DCBEVT2_BITS (1 << 6)
402 
403 
406 #define PWM_TZDCSEL_DCAEVT1_BITS (7 << 0)
407 
410 #define PWM_TZDCSEL_DCAEVT2_BITS (7 << 3)
411 
414 #define PWM_TZDCSEL_DCBEVT1_BITS (7 << 6)
415 
418 #define PWM_TZDCSEL_DCBEVT2_BITS (7 << 9)
419 
420 
423 #define PWM_DCTRIPSEL_DCAHCOMPSEL_BITS (15 << 0)
424 
427 #define PWM_DCTRIPSEL_DCALCOMPSEL_BITS (15 << 4)
428 
431 #define PWM_DCTRIPSEL_DCBHCOMPSEL_BITS (15 << 8)
432 
435 #define PWM_DCTRIPSEL_DCBLCOMPSEL_BITS (15 << 12)
436 
437 
440 #define PWM_DCFCTL_SRCSEL_BITS (3 << 0)
441 
444 #define PWM_DCFCTL_BLANKE_BITS (1 << 2)
445 
448 #define PWM_DCFCTL_BLANKINV_BITS (1 << 3)
449 
452 #define PWM_DCFCTL_PULSESEL_BITS (3 << 4)
453 
454 
455 // **************************************************************************
456 // the typedefs
457 
460 typedef enum
461 {
467 
468 
471 typedef enum
472 {
477 
478 
481 typedef enum
482 {
483  PWM_ClkDiv_by_1=(0 << 10),
484  PWM_ClkDiv_by_2=(1 << 10),
485  PWM_ClkDiv_by_4=(2 << 10),
486  PWM_ClkDiv_by_8=(3 << 10),
487  PWM_ClkDiv_by_16=(4 << 10),
488  PWM_ClkDiv_by_32=(5 << 10),
489  PWM_ClkDiv_by_64=(6 << 10),
491 } PWM_ClkDiv_e;
492 
493 
496 typedef enum
497 {
507 
508 
511 typedef enum
512 {
521 
522 
525 typedef enum
526 {
544 
545 
548 typedef enum
549 {
555 
556 
559 typedef enum
560 {
566 
567 
570 typedef enum
571 {
577 
578 
581 typedef enum
582 {
588 
589 
592 typedef enum
593 {
599 
600 
603 typedef enum
604 {
612 
613 
616 typedef enum
617 {
623 
624 
627 typedef enum
628 {
632 
633 
636 typedef enum
637 {
647 
650 typedef enum
651 {
655 
656 
659 typedef enum
660 {
666 
667 
670 typedef enum
671 {
676 
679 typedef enum
680 {
688 } PWM_IntMode_e;
689 
690 
693 typedef enum
694 {
700 
701 
704 typedef enum
705 {
711 
712 
715 typedef enum
716 {
725 } PWM_Number_e;
726 
727 
730 typedef enum
731 {
735 
736 
739 typedef enum
740 {
744 
745 
748 typedef enum
749 {
754 } PWM_RunMode_e;
755 
756 
759 typedef enum
760 {
764 
765 
768 typedef enum
769 {
773 
774 
777 typedef enum
778 {
784 
785 
788 typedef enum
789 {
799 
800 
803 typedef enum
804 {
810 
811 
814 typedef enum
815 {
833 
834 
837 typedef enum
838 {
844 
847 typedef enum
848 {
850  PWM_TripZoneFlag_CBC = (1 << 1),
851  PWM_TripZoneFlag_OST = (1 << 2),
857 
860 typedef enum
861 {
869 
870 
873 typedef struct _PWM_Obj_
874 {
875  volatile uint16_t TBCTL;
876  volatile uint16_t TBSTS;
877  volatile uint16_t TBPHSHR;
878  volatile uint16_t TBPHS;
879  volatile uint16_t TBCTR;
880  volatile uint16_t TBPRD;
881  volatile uint16_t TBPRDHR;
882  volatile uint16_t CMPCTL;
883  volatile uint16_t CMPAHR;
884  volatile uint16_t CMPA;
885  volatile uint16_t CMPB;
886  volatile uint16_t AQCTLA;
887  volatile uint16_t AQCTLB;
888  volatile uint16_t AQSFRC;
889  volatile uint16_t AQCSFRC;
890  volatile uint16_t DBCTL;
891  volatile uint16_t DBRED;
892  volatile uint16_t DBFED;
893  volatile uint16_t TZSEL;
894  volatile uint16_t TZDCSEL;
895  volatile uint16_t TZCTL;
896  volatile uint16_t TZEINT;
897  volatile uint16_t TZFLG;
898  volatile uint16_t TZCLR;
899  volatile uint16_t TZFRC;
900  volatile uint16_t ETSEL;
901  volatile uint16_t ETPS;
902  volatile uint16_t ETFLG;
903  volatile uint16_t ETCLR;
904  volatile uint16_t ETFRC;
905  volatile uint16_t PCCTL;
906  volatile uint16_t rsvd_1;
907  volatile uint16_t HRCNFG;
908  volatile uint16_t HRPWR;
909  volatile uint16_t rsvd_2[4];
910  volatile uint16_t HRMSTEP;
911  volatile uint16_t rsvd_3;
912  volatile uint16_t HRPCTL;
913  volatile uint16_t rsvd_4;
914  volatile uint16_t TBPRDHRM;
915  volatile uint16_t TBPRDM;
916  volatile uint16_t CMPAHRM;
917  volatile uint16_t CMPAM;
918  volatile uint16_t rsvd_5[2];
919  volatile uint16_t DCTRIPSEL;
920  volatile uint16_t DCACTL;
921  volatile uint16_t DCBCTL;
922  volatile uint16_t DCFCTL;
923  volatile uint16_t DCCAPCTL;
924  volatile uint16_t DCFOFFSET;
925  volatile uint16_t DCFOFFSETCNT;
926  volatile uint16_t DCFWINDOW;
927  volatile uint16_t DCFWINDOWCNT;
928  volatile uint16_t DCCAP;
929 
930 } PWM_Obj;
931 
932 
935 typedef struct _PWM_Obj_ *PWM_Handle;
936 
937 
938 // **************************************************************************
939 // the globals
940 
941 
942 // **************************************************************************
943 // the function prototypes
944 
947 static inline void PWM_clearIntFlag(PWM_Handle pwmHandle)
948 {
949  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
950 
951 
952  // set the bits
953  pwm->ETCLR = PWM_ETCLR_INT_BITS;
954 
955  return;
956 } // end of PWM_clearIntFlag() function
957 
958 
961 static inline void PWM_clearOneShotTrip(PWM_Handle pwmHandle)
962 {
963  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
964 
965 
967 
968  // set the bits
969  pwm->TZCLR = PWM_TZCLR_OST_BITS;
970 
972 
973  return;
974 } // end of PWM_clearOneShotTrip() function
975 
976 
979 static inline void PWM_clearSocAFlag(PWM_Handle pwmHandle)
980 {
981  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
982 
983 
984  // set the bits
985  pwm->ETCLR = PWM_ETCLR_SOCA_BITS;
986 
987  return;
988 } // end of PWM_clearSocAFlag() function
989 
990 
993 static inline void PWM_clearSocBFlag(PWM_Handle pwmHandle)
994 {
995  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
996 
997 
998  // set the bits
999  pwm->ETCLR = PWM_ETCLR_SOCB_BITS;
1000 
1001  return;
1002 } // end of PWM_clearSocBFlag() function
1003 
1007 extern void PWM_clearTripZone(PWM_Handle pwmHandle, const PWM_TripZoneFlag_e tripZoneFlag);
1008 
1009 
1012 extern void PWM_decrementDeadBandFallingEdgeDelay(PWM_Handle pwmHandle);
1013 
1014 
1017 extern void PWM_decrementDeadBandRisingEdgeDelay(PWM_Handle pwmHandle);
1018 
1021 extern void PWM_disableAutoConvert(PWM_Handle pwmHandle);
1022 
1025 extern void PWM_disableChopping(PWM_Handle pwmHandle);
1026 
1027 
1030 extern void PWM_disableCounterLoad(PWM_Handle pwmHandle);
1031 
1032 
1035 extern void PWM_disableDeadBand(PWM_Handle pwmHandle);
1036 
1037 
1040 extern void PWM_disableDeadBandHalfCycle(PWM_Handle pwmHandle);
1041 
1042 
1045 extern void PWM_disableDigitalCompareBlankingWindow(PWM_Handle pwmHandle);
1046 
1047 
1050 extern void PWM_disableDigitalCompareBlankingWindowInversion(PWM_Handle pwmHandle);
1051 
1054 extern void PWM_disableHrPeriod(PWM_Handle pwmHandle);
1055 
1056 
1059 extern void PWM_disableHrPhaseSync(PWM_Handle pwmHandle);
1060 
1063 extern void PWM_disableInt(PWM_Handle pwmHandle);
1064 
1065 
1068 extern void PWM_disableSocAPulse(PWM_Handle pwmHandle);
1069 
1070 
1073 extern void PWM_disableSocBPulse(PWM_Handle pwmHandle);
1074 
1075 
1078 extern void PWM_disableTripZones(PWM_Handle pwmHandle);
1079 
1080 
1084 extern void PWM_disableTripZoneInt(PWM_Handle pwmHandle, const PWM_TripZoneFlag_e interruptSource);
1085 
1086 
1090 extern void PWM_disableTripZoneSrc(PWM_Handle pwmHandle,const PWM_TripZoneSrc_e src);
1091 
1094 extern void PWM_enableAutoConvert(PWM_Handle pwmHandle);
1095 
1098 extern void PWM_enableChopping(PWM_Handle pwmHandle);
1099 
1100 
1103 extern void PWM_enableCounterLoad(PWM_Handle pwmHandle);
1104 
1105 
1108 extern void PWM_enableDeadBandHalfCycle(PWM_Handle pwmHandle);
1109 
1110 
1113 extern void PWM_enableDigitalCompareBlankingWindow(PWM_Handle pwmHandle);
1114 
1115 
1118 extern void PWM_enableDigitalCompareBlankingWindowInversion(PWM_Handle pwmHandle);
1119 
1122 extern void PWM_enableHrPeriod(PWM_Handle pwmHandle);
1123 
1124 
1127 extern void PWM_enableHrPhaseSync(PWM_Handle pwmHandle);
1128 
1131 extern void PWM_enableInt(PWM_Handle pwmHandle);
1132 
1133 
1136 extern void PWM_enableSocAPulse(PWM_Handle pwmHandle);
1137 
1138 
1141 extern void PWM_enableSocBPulse(PWM_Handle pwmHandle);
1142 
1143 
1147 extern void PWM_enableTripZoneInt(PWM_Handle pwmHandle, const PWM_TripZoneFlag_e interruptSource);
1148 
1149 
1153 extern void PWM_enableTripZoneSrc(PWM_Handle pwmHandle,const PWM_TripZoneSrc_e src);
1154 
1155 
1159 static inline uint16_t PWM_get_CmpA(PWM_Handle pwmHandle)
1160 {
1161  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1162 
1163  return pwm->CMPA;
1164 } // end of PWM_get_CmpA() function
1165 
1166 
1170 static inline uint16_t PWM_get_CmpAM(PWM_Handle pwmHandle)
1171 {
1172  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1173 
1174  return pwm->CMPAM;
1175 } // end of PWM_get_CmpAM() function
1176 
1177 
1181 static inline uint16_t PWM_get_CmpB(PWM_Handle pwmHandle)
1182 {
1183  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1184 
1185  return pwm->CMPB;
1186 } // end of PWM_get_CmpB() function
1187 
1188 
1191 static inline void PWM_forceSync(PWM_Handle pwmHandle)
1192 {
1193  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1194 
1195  pwm->TBCTL |= PWM_TBCTL_SWFSYNC_BITS;
1196 
1197  return;
1198 } // end of PWM_forceSync() function
1199 
1200 
1204 extern uint16_t PWM_getDeadBandFallingEdgeDelay(PWM_Handle pwmHandle);
1205 
1206 
1210 extern uint16_t PWM_getDeadBandRisingEdgeDelay(PWM_Handle pwmHandle);
1211 
1212 
1216 extern uint16_t PWM_getIntCount(PWM_Handle pwmHandle);
1217 
1218 
1222 static inline uint16_t PWM_getPeriod(PWM_Handle pwmHandle)
1223 {
1224  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1225 
1226  return (pwm->TBPRD);
1227 } // end of PWM_getPeriod() function
1228 
1229 
1233 static inline uint16_t PWM_getCmpA(PWM_Handle pwmHandle)
1234 {
1235  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1236 
1237  return (pwm->CMPA);
1238 } // end of PWM_getCmpA() function
1239 
1243 static inline uint16_t PWM_getCmpAHr(PWM_Handle pwmHandle)
1244 {
1245  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1246 
1247  return (pwm->CMPAHR);
1248 } // end of PWM_getCmpAHr() function
1249 
1253 static inline uint16_t PWM_getCmpB(PWM_Handle pwmHandle)
1254 {
1255  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1256 
1257  return (pwm->CMPB);
1258 } // end of PWM_getCmpB() function
1259 
1260 
1264 extern uint16_t PWM_getSocACount(PWM_Handle pwmHandle);
1265 
1266 
1270 extern uint16_t PWM_getSocBCount(PWM_Handle pwmHandle);
1271 
1275 extern void PWM_setHrControlMode(PWM_Handle pwmHandle, const PWM_HrControlMode_e controlMode);
1276 
1277 
1281 extern void PWM_setHrEdgeMode(PWM_Handle pwmHandle, const PWM_HrEdgeMode_e edgeMode);
1282 
1283 
1287 extern void PWM_setHrShadowMode(PWM_Handle pwmHandle, const PWM_HrShadowMode_e shadowMode);
1288 
1291 extern void PWM_incrementDeadBandFallingEdgeDelay(PWM_Handle pwmHandle);
1292 
1293 
1296 extern void PWM_incrementDeadBandRisingEdgeDelay(PWM_Handle pwmHandle);
1297 
1298 
1303 extern PWM_Handle PWM_init(void *pMemory,const size_t numBytes);
1304 
1305 
1309 extern void PWM_setActionQual_CntDown_CmpA_PwmA(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1310 
1311 
1315 extern void PWM_setActionQual_CntDown_CmpA_PwmB(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1316 
1317 
1321 extern void PWM_setActionQual_CntDown_CmpB_PwmA(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1322 
1323 
1327 extern void PWM_setActionQual_CntDown_CmpB_PwmB(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1328 
1329 
1333 extern void PWM_setActionQual_CntUp_CmpA_PwmA(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1334 
1335 
1339 extern void PWM_setActionQual_CntUp_CmpA_PwmB(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1340 
1341 
1345 extern void PWM_setActionQual_CntUp_CmpB_PwmA(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1346 
1347 
1351 extern void PWM_setActionQual_CntUp_CmpB_PwmB(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1352 
1353 
1357 extern void PWM_setActionQualContSWForce_PwmA(PWM_Handle pwmHandle,
1358  const PWM_ActionQualContSWForce_e actionQualContSWForce);
1359 
1360 
1364 extern void PWM_setActionQualContSWForce_PwmB(PWM_Handle pwmHandle,
1365  const PWM_ActionQualContSWForce_e actionQualContSWForce);
1366 
1367 
1371 extern void PWM_setActionQual_Period_PwmA(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1372 
1373 
1377 extern void PWM_setActionQual_Period_PwmB(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1378 
1379 
1383 extern void PWM_setActionQual_Zero_PwmA(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1384 
1385 
1389 extern void PWM_setActionQual_Zero_PwmB(PWM_Handle pwmHandle,const PWM_ActionQual_e actionQual);
1390 
1391 
1395 extern void PWM_setChoppingClkFreq(PWM_Handle pwmHandle,const PWM_ChoppingClkFreq_e clkFreq);
1396 
1397 
1401 extern void PWM_setChoppingDutyCycle(PWM_Handle pwmHandle,const PWM_ChoppingDutyCycle_e dutyCycle);
1402 
1403 
1407 extern void PWM_setChoppingPulseWidth(PWM_Handle pwmHandle,const PWM_ChoppingPulseWidth_e pulseWidth);
1408 
1409 
1413 extern void PWM_setClkDiv(PWM_Handle pwmHandle,const PWM_ClkDiv_e clkDiv);
1414 
1415 
1419 extern void PWM_setCount(PWM_Handle pwmHandle,const uint16_t count);
1420 
1421 
1425 extern void PWM_setCounterMode(PWM_Handle pwmHandle,const PWM_CounterMode_e counterMode);
1426 
1427 
1431 extern void PWM_setDeadBandFallingEdgeDelay(PWM_Handle pwmHandle,const uint16_t delay);
1432 
1433 
1437 extern void PWM_setDeadBandInputMode(PWM_Handle pwmHandle,const PWM_DeadBandInputMode_e inputMode);
1438 
1439 
1443 extern void PWM_setDeadBandOutputMode(PWM_Handle pwmHandle,const PWM_DeadBandOutputMode_e outputMode);
1444 
1445 
1449 extern void PWM_setDeadBandPolarity(PWM_Handle pwmHandle,const PWM_DeadBandPolarity_e polarity);
1450 
1451 
1455 extern void PWM_setDeadBandRisingEdgeDelay(PWM_Handle pwmHandle,const uint16_t delay);
1456 
1457 
1461 extern void PWM_setDigitalCompareFilterSource(PWM_Handle pwmHandle,
1462  const PWM_DigitalCompare_FilterSrc_e input);
1463 
1464 
1468 extern void PWM_setDigitalCompareBlankingPulse(PWM_Handle pwmHandle,
1469  const PWM_DigitalCompare_PulseSel_e pulseSelect);
1470 
1471 
1475 extern void PWM_setDigitalCompareFilterOffset(PWM_Handle pwmHandle,
1476  const uint16_t offset);
1477 
1478 
1482 extern void PWM_setDigitalCompareFilterWindow(PWM_Handle pwmHandle,
1483  const uint16_t window);
1484 
1485 
1490 extern void PWM_setDigitalCompareInput(PWM_Handle pwmHandle,
1491  const PWM_DigitalCompare_Input_e input,
1492  const PWM_DigitalCompare_InputSel_e inputSel);
1493 
1494 
1501 extern void PWM_setDigitalCompareAEvent1(PWM_Handle pwmHandle,
1502  const bool selectFilter,
1503  const bool disableSync,
1504  const bool enableSoc,
1505  const bool generateSync);
1506 
1507 
1512 extern void PWM_setDigitalCompareAEvent2(PWM_Handle pwmHandle,
1513  const bool selectFilter,
1514  const bool disableSync);
1515 
1516 
1523 extern void PWM_setDigitalCompareBEvent1(PWM_Handle pwmHandle,
1524  const bool selectFilter,
1525  const bool disableSync,
1526  const bool enableSoc,
1527  const bool generateSync);
1528 
1529 
1534 extern void PWM_setDigitalCompareBEvent2(PWM_Handle pwmHandle,
1535  const bool selectFilter,
1536  const bool disableSync);
1537 
1538 
1542 extern void PWM_setHighSpeedClkDiv(PWM_Handle pwmHandle,const PWM_HspClkDiv_e clkDiv);
1543 
1544 
1548 extern void PWM_setIntMode(PWM_Handle pwmHandle,const PWM_IntMode_e intMode);
1549 
1550 
1554 extern void PWM_setIntPeriod(PWM_Handle pwmHandle,const PWM_IntPeriod_e intPeriod);
1555 
1556 
1560 extern void PWM_setLoadMode_CmpA(PWM_Handle pwmHandle,const PWM_LoadMode_e loadMode);
1561 
1562 
1566 extern void PWM_setLoadMode_CmpB(PWM_Handle pwmHandle,const PWM_LoadMode_e loadMode);
1567 
1568 
1572 extern void PWM_setPeriodLoad(PWM_Handle pwmHandle,const PWM_PeriodLoad_e periodLoad);
1573 
1574 
1577 static inline void PWM_setOneShotTrip(PWM_Handle pwmHandle)
1578 {
1579  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1580 
1581 
1583 
1584  // set the bits
1585  pwm->TZFRC |= PWM_TZFRC_OST_BITS;
1586 
1588 
1589  return;
1590 } // end of PWM_setOneShotTrip() function
1591 
1592 
1596 extern void PWM_setPeriod(PWM_Handle pwmHandle,const uint16_t period);
1597 
1601 extern void PWM_setPeriodHr(PWM_Handle pwmHandle,const uint16_t period);
1602 
1606 extern void PWM_setPhase(PWM_Handle pwmHandle,const uint16_t phase);
1607 
1608 
1612 extern void PWM_setPhaseDir(PWM_Handle pwmHandle,const PWM_PhaseDir_e phaseDir);
1613 
1614 
1618 extern void PWM_setRunMode(PWM_Handle pwmHandle,const PWM_RunMode_e runMode);
1619 
1620 
1624 extern void PWM_setSocAPeriod(PWM_Handle pwmHandle,const PWM_SocPeriod_e intPeriod);
1625 
1626 
1630 extern void PWM_setSocAPulseSrc(PWM_Handle pwmHandle,const PWM_SocPulseSrc_e pulseSrc);
1631 
1632 
1636 extern void PWM_setSocBPeriod(PWM_Handle pwmHandle,const PWM_SocPeriod_e intPeriod);
1637 
1638 
1642 extern void PWM_setSocBPulseSrc(PWM_Handle pwmHandle,const PWM_SocPulseSrc_e pulseSrc);
1643 
1644 
1648 extern void PWM_setShadowMode_CmpA(PWM_Handle pwmHandle,const PWM_ShadowMode_e shadowMode);
1649 
1650 
1654 extern void PWM_setShadowMode_CmpB(PWM_Handle pwmHandle,const PWM_ShadowMode_e shadowMode);
1655 
1656 
1659 extern void PWM_setSwSync(PWM_Handle pwmHandle);
1660 
1661 
1665 extern void PWM_setSyncMode(PWM_Handle pwmHandle,const PWM_SyncMode_e syncMode);
1666 
1667 
1671 extern void PWM_setTripZoneDCEventSelect_DCAEVT1(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent);
1672 
1673 
1677 extern void PWM_setTripZoneDCEventSelect_DCAEVT2(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent);
1678 
1679 
1683 extern void PWM_setTripZoneDCEventSelect_DCBEVT1(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent);
1684 
1685 
1689 extern void PWM_setTripZoneDCEventSelect_DCBEVT2(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent);
1690 
1691 
1695 extern void PWM_setTripZoneState_DCAEVT1(PWM_Handle pwmHandle,const PWM_TripZoneState_e tripZoneState);
1696 
1697 
1701 extern void PWM_setTripZoneState_DCAEVT2(PWM_Handle pwmHandle,const PWM_TripZoneState_e tripZoneState);
1702 
1703 
1707 extern void PWM_setTripZoneState_DCBEVT1(PWM_Handle pwmHandle,const PWM_TripZoneState_e tripZoneState);
1708 
1709 
1713 extern void PWM_setTripZoneState_DCBEVT2(PWM_Handle pwmHandle,const PWM_TripZoneState_e tripZoneState);
1714 
1715 
1719 extern void PWM_setTripZoneState_TZA(PWM_Handle pwmHandle,const PWM_TripZoneState_e tripZoneState);
1720 
1721 
1725 extern void PWM_setTripZoneState_TZB(PWM_Handle pwmHandle,const PWM_TripZoneState_e tripZoneState);
1726 
1727 
1731 static inline void PWM_write_CmpA(PWM_Handle pwmHandle,const uint16_t pwmData)
1732 {
1733  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1734 
1735  pwm->CMPA = pwmData;
1736 
1737  return;
1738 } // end of PWM_write_CmpA() function
1739 
1740 
1744 static inline void PWM_setCmpA(PWM_Handle pwmHandle,const uint16_t pwmData)
1745 {
1746  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1747 
1748  pwm->CMPA = pwmData;
1749 
1750  return;
1751 } // end of PWM_setCmpA() function
1752 
1756 static inline void PWM_setCmpAHr(PWM_Handle pwmHandle,const uint16_t pwmData)
1757 {
1758  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1759 
1760  pwm->CMPAHR = pwmData;
1761 
1762  return;
1763 } // end of PWM_setCmpAHr() function
1764 
1768 static inline void PWM_write_CmpB(PWM_Handle pwmHandle,const uint16_t pwmData)
1769 {
1770  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1771 
1772  pwm->CMPB = pwmData;
1773 
1774  return;
1775 } // end of PWM_write_CmpB() function
1776 
1777 
1781 static inline void PWM_setCmpB(PWM_Handle pwmHandle,const uint16_t pwmData)
1782 {
1783  PWM_Obj *pwm = (PWM_Obj *)pwmHandle;
1784 
1785  pwm->CMPB = pwmData;
1786 
1787  return;
1788 } // end of PWM_setCmpB() function
1789 
1790 
1791 #ifdef __cplusplus
1792 }
1793 #endif // extern "C"
1794 
1796 #endif // end of _PWM_H_ definition
1797 
volatile uint16_t TBCTL
Time-Base Control Register.
Definition: pwm.h:875
PWM_ClkDiv_e
Enumeration to define the pulse width modulation (PWM) clock dividers.
Definition: pwm.h:481
uint16_t PWM_getDeadBandFallingEdgeDelay(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) deadband falling edge delay.
Definition: pwm.c:476
PWM_ActionQual_e
Enumeration to define the pulse width modulation (PWM) action qualifiers.
Definition: pwm.h:460
volatile uint16_t DCCAPCTL
Digital Compare Capture Control.
Definition: pwm.h:923
uint16_t PWM_getDeadBandRisingEdgeDelay(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) deadband rising edge delay.
Definition: pwm.c:484
volatile uint16_t ETFLG
Event trigger flags.
Definition: pwm.h:902
void PWM_setIntMode(PWM_Handle pwmHandle, const PWM_IntMode_e intMode)
Sets the pulse width modulation (PWM) interrupt mode.
Definition: pwm.c:1190
void PWM_setClkDiv(PWM_Handle pwmHandle, const PWM_ClkDiv_e clkDiv)
Sets the pulse width modulation (PWM) clock divisor.
Definition: pwm.c:899
static uint16_t PWM_getCmpA(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) data value from the Counter Compare A hardware.
Definition: pwm.h:1233
volatile uint16_t DCFWINDOWCNT
Digital Compare Filter Window Counter.
Definition: pwm.h:927
void PWM_decrementDeadBandFallingEdgeDelay(PWM_Handle pwmHandle)
Decrement the dead band falling edge delay.
Definition: pwm.c:71
void PWM_disableTripZones(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) trip zones.
Definition: pwm.c:251
volatile uint16_t rsvd_4
Reserved.
Definition: pwm.h:913
volatile uint16_t rsvd_1
Reserved.
Definition: pwm.h:906
void PWM_setDigitalCompareBEvent2(PWM_Handle pwmHandle, const bool selectFilter, const bool disableSync)
Sets the pulse width modulation (PWM) digital compare B event 2 source parameters.
Definition: pwm.c:1155
#define DISABLE_PROTECTED_REGISTER_WRITE_MODE
Define to disable protected register writes.
Definition: cpu.h:101
void PWM_disableDigitalCompareBlankingWindow(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) digital compare blanking window.
Definition: pwm.c:155
volatile uint16_t AQCTLA
Action-Qualifier Control Register for Output A (EPWMxA)
Definition: pwm.h:886
struct _PWM_Obj_ PWM_Obj
Defines the pulse width modulation (PWM) object.
PWM_DeadBandOutputMode_e
Enumeration to define the pulse width modulation (PWM) deadband output modes.
Definition: pwm.h:570
void PWM_setTripZoneState_DCBEVT1(PWM_Handle pwmHandle, const PWM_TripZoneState_e tripZoneState)
Sets the pulse width modulation (PWM) trip zone state for Digital Compare Output B Event 1 (DCBEVT1) ...
Definition: pwm.c:1563
Digital Compare A Event 2 Trip Zone flag.
Definition: pwm.h:853
void PWM_decrementDeadBandRisingEdgeDelay(PWM_Handle pwmHandle)
Decrement the dead band rising edge delay.
Definition: pwm.c:82
static void PWM_write_CmpA(PWM_Handle pwmHandle, const uint16_t pwmData)
Writes the pulse width modulation (PWM) data value to the Counter Compare A hardware.
Definition: pwm.h:1731
void PWM_setDigitalCompareFilterWindow(PWM_Handle pwmHandle, const uint16_t window)
Sets the pulse width modulation (PWM) digital compare filter offset.
Definition: pwm.c:1059
volatile uint16_t TBPHSHR
Extension for the HRPWM Phase Register.
Definition: pwm.h:877
volatile uint16_t ETCLR
Event trigger clear.
Definition: pwm.h:903
void PWM_setLoadMode_CmpA(PWM_Handle pwmHandle, const PWM_LoadMode_e loadMode)
Sets the pulse width modulation (PWM) load mode for CMPA.
Definition: pwm.c:1220
static uint16_t PWM_getPeriod(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) period value.
Definition: pwm.h:1222
PWM_PeriodLoad_e
Enumeration to define the pulse width modulation (PWM) period load options.
Definition: pwm.h:730
void PWM_setRunMode(PWM_Handle pwmHandle, const PWM_RunMode_e runMode)
Sets the pulse width modulation (PWM) run mode.
Definition: pwm.c:1318
void PWM_disableSocAPulse(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) start of conversion (SOC) B pulse generation.
Definition: pwm.c:227
volatile uint16_t TZEINT
Trip zone interrupt enable.
Definition: pwm.h:896
volatile uint16_t DBRED
Dead-band rising edge delay.
Definition: pwm.h:891
uint16_t PWM_getSocBCount(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) start of conversion (SOC) B count.
Definition: pwm.c:515
volatile uint16_t TBPHS
Time-Base Phase Register.
Definition: pwm.h:878
PWM_DigitalCompare_PulseSel_e
Enumeration to define the pulse width modulation (PWM) digital compare blanking pulse select...
Definition: pwm.h:627
void PWM_setPeriodLoad(PWM_Handle pwmHandle, const PWM_PeriodLoad_e periodLoad)
Sets the pulse width modulation (PWM) period load mode.
Definition: pwm.c:1303
void PWM_setTripZoneState_TZA(PWM_Handle pwmHandle, const PWM_TripZoneState_e tripZoneState)
Sets the pulse width modulation (PWM) trip zone state for Output A (TZA)
Definition: pwm.c:1601
PWM_ChoppingDutyCycle_e
Enumeration to define the pulse width modulation (PWM) chopping clock duty cycles.
Definition: pwm.h:511
volatile uint16_t DBFED
Dead-band falling edge delay.
Definition: pwm.h:892
volatile uint16_t CMPAHRM
Extension of HRPWM Counter-Compare A mirror Register.
Definition: pwm.h:916
volatile uint16_t AQCTLB
Action-Qualifier Control Register for Output B (EPWMxB)
Definition: pwm.h:887
PWM_LoadMode_e
Enumeration to define the pulse width modulation (PWM) load modes.
Definition: pwm.h:704
void PWM_setTripZoneDCEventSelect_DCBEVT1(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent)
Sets the pulse width modulation (PWM) trip zone digital compare event select for Digital Compare Outp...
Definition: pwm.c:1487
PWM_ShadowMode_e
Enumeration to define the pulse width modulation (PWM) shadow modes.
Definition: pwm.h:759
volatile uint16_t DCFOFFSETCNT
Digital Compare Filter Offset Counter.
Definition: pwm.h:925
#define PWM_ETCLR_SOCB_BITS
Defines the location of the SOCB bits in the ETCLR register.
Definition: pwm.h:183
PWM_HrControlMode_e
Enumeration to define the pulse width modulation (PWM) high resolution control mode options...
Definition: pwm.h:650
PWM_CounterMode_e
Enumeration to define the pulse width modulation (PWM) counter modes.
Definition: pwm.h:548
void PWM_enableHrPeriod(PWM_Handle pwmHandle)
Enables high resolution period control.
Definition: pwm.c:379
void PWM_setActionQualContSWForce_PwmA(PWM_Handle pwmHandle, const PWM_ActionQualContSWForce_e actionQualContSWForce)
Sets the pulse width modulation (PWM) object Continuous Software Force action for PWM A...
Definition: pwm.c:764
void PWM_setTripZoneState_DCAEVT1(PWM_Handle pwmHandle, const PWM_TripZoneState_e tripZoneState)
Sets the pulse width modulation (PWM) trip zone state for Digital Compare Output A Event 1 (DCAEVT1) ...
Definition: pwm.c:1525
void PWM_setHrShadowMode(PWM_Handle pwmHandle, const PWM_HrShadowMode_e shadowMode)
Set the High Resolution Shadow Load Mode.
Definition: pwm.c:590
void PWM_setDeadBandRisingEdgeDelay(PWM_Handle pwmHandle, const uint16_t delay)
Sets the pulse width modulation (PWM) deadband rising edge delay.
Definition: pwm.c:997
volatile uint16_t AQSFRC
Action qual SW force.
Definition: pwm.h:888
void PWM_setCount(PWM_Handle pwmHandle, const uint16_t count)
Sets the pulse width modulation (PWM) count.
Definition: pwm.c:914
void PWM_setLoadMode_CmpB(PWM_Handle pwmHandle, const PWM_LoadMode_e loadMode)
Sets the pulse width modulation (PWM) load mode for CMPB.
Definition: pwm.c:1235
void PWM_enableDigitalCompareBlankingWindow(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) digital compare blanking window.
Definition: pwm.c:349
volatile uint16_t CMPCTL
Counter-Compare Control Register.
Definition: pwm.h:882
void PWM_setDigitalCompareInput(PWM_Handle pwmHandle, const PWM_DigitalCompare_Input_e input, const PWM_DigitalCompare_InputSel_e inputSel)
Sets the pulse width modulation (PWM) digital compare input.
Definition: pwm.c:1071
PWM_DeadBandPolarity_e
Enumeration to define the pulse width modulation (PWM) deadband polarity.
Definition: pwm.h:581
void PWM_setTripZoneState_TZB(PWM_Handle pwmHandle, const PWM_TripZoneState_e tripZoneState)
Sets the pulse width modulation (PWM) trip zone state for Output B (TZB)
Definition: pwm.c:1620
void PWM_setSyncMode(PWM_Handle pwmHandle, const PWM_SyncMode_e syncMode)
Sets the pulse width modulation (PWM) sync mode.
Definition: pwm.c:1435
PWM_ShadowStatus_e
Enumeration to define the pulse width modulation (PWM) shadow status options.
Definition: pwm.h:768
void PWM_setActionQual_Period_PwmA(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM A when the counter equals the period...
Definition: pwm.c:794
void PWM_disableDigitalCompareBlankingWindowInversion(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) digital compare blanking window inversion.
Definition: pwm.c:170
Compare H = Don't Care, Compare L = High.
Definition: pwm.h:866
void PWM_setDigitalCompareBlankingPulse(PWM_Handle pwmHandle, const PWM_DigitalCompare_PulseSel_e pulseSelect)
Sets the pulse width modulation (PWM) digital compare blanking pulse.
Definition: pwm.c:1028
struct _PWM_Obj_ * PWM_Handle
Defines the pulse width modulation (PWM) handle.
Definition: pwm.h:935
PWM_TripZoneFlag_e
Enumeration to define the pulse width modulation (PWM) trip zone states.
Definition: pwm.h:847
void PWM_enableSocBPulse(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) start of conversion (SOC) B pulse generation.
Definition: pwm.c:433
volatile uint16_t TZCTL
Trip zone control.
Definition: pwm.h:895
static void PWM_clearSocAFlag(PWM_Handle pwmHandle)
Clears the pulse width modulation (PWM) start of conversion (SOC) A flag.
Definition: pwm.h:979
volatile uint16_t PCCTL
PWM chopper control.
Definition: pwm.h:905
void PWM_setHrEdgeMode(PWM_Handle pwmHandle, const PWM_HrEdgeMode_e edgeMode)
Set the High Resolution Edge Mode.
Definition: pwm.c:574
void PWM_setShadowMode_CmpB(PWM_Handle pwmHandle, const PWM_ShadowMode_e shadowMode)
Sets the pulse width modulation (PWM) shadow mode for CMPB.
Definition: pwm.c:1408
static uint16_t PWM_get_CmpB(PWM_Handle pwmHandle)
Gets the value of the Counter Compare B hardware.
Definition: pwm.h:1181
volatile uint16_t rsvd_3
Reserved.
Definition: pwm.h:911
void PWM_setActionQual_CntDown_CmpB_PwmA(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM A when the counter equals CMPB and the co...
Definition: pwm.c:674
void PWM_disableDeadBandHalfCycle(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) deadband half cycle clocking.
Definition: pwm.c:143
uint16_t PWM_getSocACount(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) start of conversion (SOC) A count.
Definition: pwm.c:502
void PWM_clearTripZone(PWM_Handle pwmHandle, const PWM_TripZoneFlag_e tripZoneFlag)
Clears the trip zone (TZ) flag specified.
Definition: pwm.c:56
PWM_HrShadowMode_e
Enumeration to define the pulse width modulation (PWM) high resolution shadow load mode options...
Definition: pwm.h:670
void PWM_disableDeadBand(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) deadband.
Definition: pwm.c:131
volatile uint16_t HRPCTL
High Resolution Period Control.
Definition: pwm.h:912
volatile uint16_t HRMSTEP
HRPWM MEP Step Register.
Definition: pwm.h:910
volatile uint16_t ETFRC
Event trigger force.
Definition: pwm.h:904
void PWM_setDigitalCompareAEvent2(PWM_Handle pwmHandle, const bool selectFilter, const bool disableSync)
Sets the pulse width modulation (PWM) digital compare A event 2 source parameters.
Definition: pwm.c:1113
void PWM_disableSocBPulse(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) start of conversion (SOC) B pulse generation.
Definition: pwm.c:239
void PWM_setChoppingDutyCycle(PWM_Handle pwmHandle, const PWM_ChoppingDutyCycle_e dutyCycle)
Sets the pulse width modulation (PWM) chopping clock duty cycle.
Definition: pwm.c:869
Digital Compare A Event 1 Trip Zone flag.
Definition: pwm.h:852
void PWM_setSocBPulseSrc(PWM_Handle pwmHandle, const PWM_SocPulseSrc_e pulseSrc)
Sets the pulse width modulation (PWM) start of conversion (SOC) B interrupt pulse source...
Definition: pwm.c:1378
volatile uint16_t TBPRDHRM
Time-Base Period High Resolution mirror Register.
Definition: pwm.h:914
static void PWM_clearOneShotTrip(PWM_Handle pwmHandle)
Clears the pulse width modulation (PWM) one shot trip.
Definition: pwm.h:961
volatile uint16_t rsvd_2[4]
Reserved.
Definition: pwm.h:909
void PWM_setDigitalCompareFilterOffset(PWM_Handle pwmHandle, const uint16_t offset)
Sets the pulse width modulation (PWM) digital compare filter offset.
Definition: pwm.c:1047
void PWM_enableHrPhaseSync(PWM_Handle pwmHandle)
Enables high resolution phase synchronization.
Definition: pwm.c:406
void PWM_setActionQual_Period_PwmB(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM B when the counter equals the period...
Definition: pwm.c:809
volatile uint16_t TZCLR
Trip zone clear.
Definition: pwm.h:898
volatile uint16_t DCBCTL
Digital Compare B Control.
Definition: pwm.h:921
void PWM_setDigitalCompareAEvent1(PWM_Handle pwmHandle, const bool selectFilter, const bool disableSync, const bool enableSoc, const bool generateSync)
Sets the pulse width modulation (PWM) digital compare A event 1 source parameters.
Definition: pwm.c:1091
void PWM_disableCounterLoad(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) counter loading from the phase register.
Definition: pwm.c:119
#define ENABLE_PROTECTED_REGISTER_WRITE_MODE
Define to allow protected register writes.
Definition: cpu.h:93
static uint16_t PWM_getCmpAHr(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) data value from the Counter Compare A Hr hardware.
Definition: pwm.h:1243
volatile uint16_t HRCNFG
HRPWM Config Reg.
Definition: pwm.h:907
PWM_SyncMode_e
Enumeration to define the pulse width modulation (PWM) sync modes.
Definition: pwm.h:803
volatile uint16_t DCACTL
Digital Compare A Control.
Definition: pwm.h:920
void PWM_disableChopping(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) chopping.
Definition: pwm.c:108
void PWM_setTripZoneState_DCBEVT2(PWM_Handle pwmHandle, const PWM_TripZoneState_e tripZoneState)
Sets the pulse width modulation (PWM) trip zone state for Digital Compare Output B Event 2 (DCBEVT1) ...
Definition: pwm.c:1582
void PWM_setActionQual_Zero_PwmA(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM A when the counter equals the zero...
Definition: pwm.c:824
PWM_DigitalCompare_InputSel_e
Enumeration to define the pulse width modulation (PWM) digital compare input choices.
Definition: pwm.h:603
volatile uint16_t ETPS
Event trigger pre-scaler.
Definition: pwm.h:901
PWM_ActionQualContSWForce_e
Enumeration to define the pulse width modulation (PWM) Action-qualifier Continuous Software Force...
Definition: pwm.h:471
void PWM_enableTripZoneInt(PWM_Handle pwmHandle, const PWM_TripZoneFlag_e interruptSource)
Enables the pulse width modulation (PWM) trip zones interrupts.
Definition: pwm.c:445
void PWM_setHighSpeedClkDiv(PWM_Handle pwmHandle, const PWM_HspClkDiv_e clkDiv)
Sets the pulse width modulation (PWM) high speed clock divisor.
Definition: pwm.c:1175
void PWM_setDeadBandInputMode(PWM_Handle pwmHandle, const PWM_DeadBandInputMode_e inputMode)
Sets the pulse width modulation (PWM) deadband input mode.
Definition: pwm.c:952
Defines the pulse width modulation (PWM) object.
Definition: pwm.h:873
volatile uint16_t DCTRIPSEL
Digital Compare Trip Select.
Definition: pwm.h:919
void PWM_setTripZoneState_DCAEVT2(PWM_Handle pwmHandle, const PWM_TripZoneState_e tripZoneState)
Sets the pulse width modulation (PWM) trip zone state for Digital Compare Output A Event 2 (DCAEVT1) ...
Definition: pwm.c:1544
volatile uint16_t ETSEL
Event trigger selection.
Definition: pwm.h:900
void PWM_enableCounterLoad(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) counter loading from the phase register. ...
Definition: pwm.c:325
void PWM_setTripZoneDCEventSelect_DCBEVT2(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent)
Sets the pulse width modulation (PWM) trip zone digital compare event select for Digital Compare Outp...
Definition: pwm.c:1506
void PWM_enableAutoConvert(PWM_Handle pwmHandle)
Enables auto conversion of delay line value.
Definition: pwm.c:299
PWM_Handle PWM_init(void *pMemory, const size_t numBytes)
Initializes the pulse width modulation (PWM) object handle.
Definition: pwm.c:628
Compare H = High, Compare L = Don't Care.
Definition: pwm.h:864
void PWM_enableSocAPulse(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) start of conversion (SOC) A pulse generation.
Definition: pwm.c:421
PWM_TripZoneState_e
Enumeration to define the pulse width modulation (PWM) trip zone states.
Definition: pwm.h:837
PWM_IntMode_e
Enumeration to define the pulse width modulation (PWM) interrupt generation modes.
Definition: pwm.h:679
void PWM_setActionQual_CntDown_CmpB_PwmB(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM B when the counter equals CMPB and the co...
Definition: pwm.c:689
#define PWM_TZFRC_OST_BITS
Defines the location of the OST bits in the TZFRC register.
Definition: pwm.h:385
volatile uint16_t TZDCSEL
Trip zone digital comparator select.
Definition: pwm.h:894
void PWM_setChoppingPulseWidth(PWM_Handle pwmHandle, const PWM_ChoppingPulseWidth_e pulseWidth)
Sets the pulse width modulation (PWM) chopping clock pulse width.
Definition: pwm.c:884
void PWM_setHrControlMode(PWM_Handle pwmHandle, const PWM_HrControlMode_e controlMode)
Set the High Resolution Control Mode.
Definition: pwm.c:558
void PWM_setPhase(PWM_Handle pwmHandle, const uint16_t phase)
Sets the pulse width modulation (PWM) phase.
Definition: pwm.c:1277
Compare H = Low, Compare L = Don't Care.
Definition: pwm.h:863
PWM_ChoppingPulseWidth_e
Enumeration to define the pulse width modulation (PWM) chopping clock pulse widths.
Definition: pwm.h:525
void PWM_setDeadBandOutputMode(PWM_Handle pwmHandle, const PWM_DeadBandOutputMode_e outputMode)
Sets the pulse width modulation (PWM) deadband output mode.
Definition: pwm.c:967
#define PWM_TBCTL_SWFSYNC_BITS
Defines the location of the SWFSYNC bits in the TBCTL register.
Definition: pwm.h:306
PWM_DeadBandInputMode_e
Enumeration to define the pulse width modulation (PWM) deadband options.
Definition: pwm.h:559
volatile uint16_t DBCTL
Dead-band control.
Definition: pwm.h:890
void PWM_setTripZoneDCEventSelect_DCAEVT1(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent)
Sets the pulse width modulation (PWM) trip zone digital compare event select for Digital Compare Outp...
Definition: pwm.c:1449
PWM_PhaseDir_e
Enumeration to define the pulse width modulation (PWM) phase direction modes.
Definition: pwm.h:739
PWM_RunMode_e
Enumeration to define the pulse width modulation (PWM) run modes.
Definition: pwm.h:748
void PWM_disableHrPhaseSync(PWM_Handle pwmHandle)
Disables high resolution phase synchronization.
Definition: pwm.c:200
volatile uint16_t DCFCTL
Digital Compare Filter Control.
Definition: pwm.h:922
static void PWM_clearSocBFlag(PWM_Handle pwmHandle)
Clears the pulse width modulation (PWM) start of conversion (SOC) B flag.
Definition: pwm.h:993
void PWM_setChoppingClkFreq(PWM_Handle pwmHandle, const PWM_ChoppingClkFreq_e clkFreq)
Sets the pulse width modulation (PWM) chopping clock frequency.
Definition: pwm.c:854
void PWM_setTripZoneDCEventSelect_DCAEVT2(PWM_Handle pwmHandle, const PWM_TripZoneDCEventSel_e tripZoneEvent)
Sets the pulse width modulation (PWM) trip zone digital compare event select for Digital Compare Outp...
Definition: pwm.c:1468
static uint16_t PWM_getCmpB(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) data value from the Counter Compare B hardware.
Definition: pwm.h:1253
volatile uint16_t TZSEL
Trip zone select.
Definition: pwm.h:893
PWM_IntPeriod_e
Enumeration to define the pulse width modulation (PWM) interrupt period options.
Definition: pwm.h:693
void PWM_enableInt(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) interrupt.
Definition: pwm.c:394
void PWM_disableAutoConvert(PWM_Handle pwmHandle)
Disables auto conversion of delay line value.
Definition: pwm.c:93
static void PWM_setOneShotTrip(PWM_Handle pwmHandle)
Sets the pulse width modulation (PWM) one shot trip.
Definition: pwm.h:1577
volatile uint16_t AQCSFRC
Action qualifier continuous SW force.
Definition: pwm.h:889
PWM_TripZoneDCEventSel_e
Enumeration to define the pulse width modulation (PWM) trip zone event selections.
Definition: pwm.h:860
volatile uint16_t rsvd_5[2]
Reserved.
Definition: pwm.h:918
Contains public interface to various functions related to the central processing unit (CPU) object...
PWM_SocPeriod_e
Enumeration to define the pulse width modulation (PWM) start of conversion (SOC) period options...
Definition: pwm.h:777
volatile uint16_t TBPRD
Time-Base Period register set.
Definition: pwm.h:880
void PWM_setSocAPulseSrc(PWM_Handle pwmHandle, const PWM_SocPulseSrc_e pulseSrc)
Sets the pulse width modulation (PWM) start of conversion (SOC) A interrupt pulse source...
Definition: pwm.c:1348
volatile uint16_t TBPRDM
Time-Base Period mirror register.
Definition: pwm.h:915
static void PWM_forceSync(PWM_Handle pwmHandle)
Force Synchronization.
Definition: pwm.h:1191
volatile uint16_t CMPA
Counter-Compare A Register.
Definition: pwm.h:884
PWM_DigitalCompare_FilterSrc_e
Enumeration to define the pulse width modulation (PWM) digital compare filter sources.
Definition: pwm.h:616
volatile uint16_t TZFRC
Trip zone force interrupt.
Definition: pwm.h:899
void PWM_setSocBPeriod(PWM_Handle pwmHandle, const PWM_SocPeriod_e intPeriod)
Sets the pulse width modulation (PWM) start of conversion (SOC) B interrupt period.
Definition: pwm.c:1363
void PWM_enableDigitalCompareBlankingWindowInversion(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) digital compare blanking window inversion.
Definition: pwm.c:364
void PWM_disableTripZoneInt(PWM_Handle pwmHandle, const PWM_TripZoneFlag_e interruptSource)
Disables the pulse width modulation (PWM) trip zones interrupts.
Definition: pwm.c:267
PWM_SocPulseSrc_e
Enumeration to define the pulse width modulation (PWM) start of conversion (SOC) sources.
Definition: pwm.h:788
void PWM_setCounterMode(PWM_Handle pwmHandle, const PWM_CounterMode_e counterMode)
Sets the pulse width modulation (PWM) counter mode.
Definition: pwm.c:926
volatile uint16_t DCFWINDOW
Digital Compare Filter Window.
Definition: pwm.h:926
void PWM_setPeriodHr(PWM_Handle pwmHandle, const uint16_t period)
Sets the pulse width modulation (PWM) high resolution period.
Definition: pwm.c:1262
#define PWM_ETCLR_INT_BITS
Defines the location of the ETCR bits in the ETCLR register.
Definition: pwm.h:175
void PWM_setActionQualContSWForce_PwmB(PWM_Handle pwmHandle, const PWM_ActionQualContSWForce_e actionQualContSWForce)
Sets the pulse width modulation (PWM) object Continuous Software Force action for PWM B...
Definition: pwm.c:779
void PWM_setDeadBandFallingEdgeDelay(PWM_Handle pwmHandle, const uint16_t delay)
Sets the pulse width modulation (PWM) deadband falling edge delay.
Definition: pwm.c:941
static void PWM_setCmpA(PWM_Handle pwmHandle, const uint16_t pwmData)
Writes the pulse width modulation (PWM) data value to the Counter Compare A hardware.
Definition: pwm.h:1744
Compare H = Don't Care, Compare L = Low.
Definition: pwm.h:865
static uint16_t PWM_get_CmpAM(PWM_Handle pwmHandle)
Gets the value of the Counter Compare A Mirror Register.
Definition: pwm.h:1170
void PWM_disableInt(PWM_Handle pwmHandle)
Disables the pulse width modulation (PWM) interrupt.
Definition: pwm.c:215
static void PWM_setCmpAHr(PWM_Handle pwmHandle, const uint16_t pwmData)
Writes the pulse width modulation (PWM) data value to the Counter Compare A Hr hardware.
Definition: pwm.h:1756
static uint16_t PWM_get_CmpA(PWM_Handle pwmHandle)
Gets the value of the Counter Compare A hardware.
Definition: pwm.h:1159
volatile uint16_t TBSTS
Time-Base Status Register.
Definition: pwm.h:876
void PWM_setDigitalCompareBEvent1(PWM_Handle pwmHandle, const bool selectFilter, const bool disableSync, const bool enableSoc, const bool generateSync)
Sets the pulse width modulation (PWM) digital compare B event 1 source parameters.
Definition: pwm.c:1133
void PWM_setPhaseDir(PWM_Handle pwmHandle, const PWM_PhaseDir_e phaseDir)
Sets the pulse width modulation (PWM) phase direction.
Definition: pwm.c:1288
Digital Compare B Event 1 Trip Zone flag.
Definition: pwm.h:854
void PWM_setActionQual_CntDown_CmpA_PwmB(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM B when the counter equals CMPA and the co...
Definition: pwm.c:659
void PWM_enableChopping(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) chopping.
Definition: pwm.c:314
void PWM_disableHrPeriod(PWM_Handle pwmHandle)
Disables high resolution period control.
Definition: pwm.c:185
void PWM_setSocAPeriod(PWM_Handle pwmHandle, const PWM_SocPeriod_e intPeriod)
Sets the pulse width modulation (PWM) start of conversion (SOC) A interrupt period.
Definition: pwm.c:1333
void PWM_setIntPeriod(PWM_Handle pwmHandle, const PWM_IntPeriod_e intPeriod)
Sets the pulse width modulation (PWM) interrupt period.
Definition: pwm.c:1205
One Shot Trip Zone flag.
Definition: pwm.h:851
void PWM_setActionQual_CntUp_CmpB_PwmA(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM A when the counter equals CMPB and the co...
Definition: pwm.c:734
void PWM_setActionQual_CntUp_CmpB_PwmB(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM B when the counter equals CMPB and the co...
Definition: pwm.c:749
Event Disabled.
Definition: pwm.h:862
void PWM_incrementDeadBandFallingEdgeDelay(PWM_Handle pwmHandle)
Increment the dead band falling edge delay.
Definition: pwm.c:606
volatile uint16_t TBPRDHR
Time-Base Period High Resolution Register.
Definition: pwm.h:881
volatile uint16_t TBCTR
Time-Base Counter.
Definition: pwm.h:879
void PWM_setActionQual_Zero_PwmB(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM B when the counter equals the zero...
Definition: pwm.c:839
void PWM_setActionQual_CntUp_CmpA_PwmA(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM A when the counter equals CMPA and the co...
Definition: pwm.c:704
volatile uint16_t CMPAHR
Extension of HRPWM Counter-Compare A Register.
Definition: pwm.h:883
void PWM_incrementDeadBandRisingEdgeDelay(PWM_Handle pwmHandle)
Increment the dead band rising edge delay.
Definition: pwm.c:617
PWM_ChoppingClkFreq_e
Enumeration to define the pulse width modulation (PWM) chopping clock frequencies.
Definition: pwm.h:496
PWM_HspClkDiv_e
Enumeration to define the pulse width modulation (PWM) high speed clock divide options.
Definition: pwm.h:636
static void PWM_clearIntFlag(PWM_Handle pwmHandle)
Clears the pulse width modulation (PWM) interrupt flag.
Definition: pwm.h:947
void PWM_setActionQual_CntUp_CmpA_PwmB(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM B when the counter equals CMPA and the co...
Definition: pwm.c:719
PWM_DigitalCompare_Input_e
Enumeration to define the pulse width modulation (PWM) digital compare inputs.
Definition: pwm.h:592
void PWM_setDigitalCompareFilterSource(PWM_Handle pwmHandle, const PWM_DigitalCompare_FilterSrc_e input)
Sets the pulse width modulation (PWM) digital compare filter source.
Definition: pwm.c:1009
void PWM_setSwSync(PWM_Handle pwmHandle)
Sets the pulse width modulation (PWM) software sync.
Definition: pwm.c:1423
void PWM_setShadowMode_CmpA(PWM_Handle pwmHandle, const PWM_ShadowMode_e shadowMode)
Sets the pulse width modulation (PWM) shadow mode for CMPA.
Definition: pwm.c:1393
Digital Compare B Event 2 Trip Zone flag.
Definition: pwm.h:855
volatile uint16_t TZFLG
Trip zone interrupt flags.
Definition: pwm.h:897
Compare H = Low, Compare L = High.
Definition: pwm.h:867
volatile uint16_t DCFOFFSET
Digital Compare Filter Offset.
Definition: pwm.h:924
#define PWM_TZCLR_OST_BITS
Defines the location of the OST bits in the TXCLR register.
Definition: pwm.h:335
void PWM_setPeriod(PWM_Handle pwmHandle, const uint16_t period)
Sets the pulse width modulation (PWM) period.
Definition: pwm.c:1250
void PWM_enableTripZoneSrc(PWM_Handle pwmHandle, const PWM_TripZoneSrc_e src)
Enable the pulse width modulation (PWM) trip zone source.
Definition: pwm.c:460
void PWM_enableDeadBandHalfCycle(PWM_Handle pwmHandle)
Enables the pulse width modulation (PWM) deadband half cycle clocking.
Definition: pwm.c:337
volatile uint16_t HRPWR
HRPWM Power Register.
Definition: pwm.h:908
PWM_Number_e
Enumeration to define the pulse width modulation (PWM) numbers.
Definition: pwm.h:715
void PWM_disableTripZoneSrc(PWM_Handle pwmHandle, const PWM_TripZoneSrc_e src)
Disable the pulse width modulation (PWM) trip zone source.
Definition: pwm.c:283
PWM_HrEdgeMode_e
Enumeration to define the pulse width modulation (PWM) high resolution edge mode options.
Definition: pwm.h:659
volatile uint16_t DCCAP
Digital Compare Filter Counter Capture.
Definition: pwm.h:928
Global Trip Zone flag.
Definition: pwm.h:849
static void PWM_setCmpB(PWM_Handle pwmHandle, const uint16_t pwmData)
Writes the pulse width modulation (PWM) data value to the Counter Compare B hardware.
Definition: pwm.h:1781
volatile uint16_t CMPAM
Counter-Compare A mirror Register.
Definition: pwm.h:917
volatile uint16_t CMPB
Counter-Compare B Register.
Definition: pwm.h:885
void PWM_setActionQual_CntDown_CmpA_PwmA(PWM_Handle pwmHandle, const PWM_ActionQual_e actionQual)
Sets the pulse width modulation (PWM) object action for PWM A when the counter equals CMPA and the co...
Definition: pwm.c:644
Cycle by cycle Trip Zone flag.
Definition: pwm.h:850
uint16_t PWM_getIntCount(PWM_Handle pwmHandle)
Gets the pulse width modulation (PWM) interrupt event count.
Definition: pwm.c:492
#define PWM_ETCLR_SOCA_BITS
Defines the location of the SOCA bits in the ETCLR register.
Definition: pwm.h:179
PWM_TripZoneSrc_e
Enumeration to define the pulse width modulation (PWM) trip zone sources.
Definition: pwm.h:814
static void PWM_write_CmpB(PWM_Handle pwmHandle, const uint16_t pwmData)
Writes the pulse width modulation (PWM) data value to the Counter Compare B hardware.
Definition: pwm.h:1768
void PWM_setDeadBandPolarity(PWM_Handle pwmHandle, const PWM_DeadBandPolarity_e polarity)
Sets the pulse width modulation (PWM) deadband polarity.
Definition: pwm.c:982