Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
pwm.h
Go to the documentation of this file.
1
17/*
18� [2024] Microchip Technology Inc. and its subsidiaries.
19
20 Subject to your compliance with these terms, you may use Microchip
21 software and any derivatives exclusively with Microchip products.
22 You are responsible for complying with 3rd party license terms
23 applicable to your use of 3rd party software (including open source
24 software) that may accompany Microchip software. SOFTWARE IS ?AS IS.?
25 NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS
26 SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT,
27 MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
28 WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
29 INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY
30 KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
31 MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE
32 FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP?S
33 TOTAL LIABILITY ON ALL CLAIMS RELATED TO THE SOFTWARE WILL NOT
34 EXCEED AMOUNT OF FEES, IF ANY, YOU PAID DIRECTLY TO MICROCHIP FOR
35 THIS SOFTWARE.
36*/
37
38#ifndef PWM_H
39#define PWM_H
40
41// Section: Included Files
42
43#include <xc.h>
44#include <stdint.h>
45#include <stdbool.h>
46#include <stdlib.h>
47#include "pwm_hs_types.h"
48#include "pwm_hs_interface.h"
49
50// Section: Data Type Definitions
51
52
63extern const struct PWM_HS_INTERFACE PWM_HS;
64
69#define PWM_HS_Initialize PWM_Initialize
74#define PWM_HS_Deinitialize PWM_Deinitialize
79#define PWM_HS_Disable PWM_Disable
84#define PWM_HS_Enable PWM_Enable
89#define PWM_HS_MasterPeriodSet PWM_MasterPeriodSet
94#define PWM_HS_MasterDutyCycleSet PWM_MasterDutyCycleSet
99#define PWM_HS_MasterPhaseSet PWM_MasterPhaseSet
104#define PWM_HS_PeriodSet PWM_PeriodSet
109#define PWM_HS_ModeSet PWM_ModeSet
114#define PWM_HS_DutyCycleSet PWM_DutyCycleSet
119#define PWM_HS_PhaseSelect PWM_PhaseSelect
124#define PWM_HS_PhaseSet PWM_PhaseSet
129#define PWM_HS_OverrideDataSet PWM_OverrideDataSet
134#define PWM_HS_OverrideDataHighSet PWM_OverrideDataHighSet
139#define PWM_HS_OverrideDataLowSet PWM_OverrideDataLowSet
144#define PWM_HS_OverrideDataGet PWM_OverrideDataGet
149#define PWM_HS_OverrideHighEnable PWM_OverrideHighEnable
154#define PWM_HS_OverrideLowEnable PWM_OverrideLowEnable
159#define PWM_HS_OverrideHighDisable PWM_OverrideHighDisable
164#define PWM_HS_OverrideLowDisable PWM_OverrideLowDisable
169#define PWM_HS_DeadTimeLowSet PWM_DeadTimeLowSet
174#define PWM_HS_DeadTimeHighSet PWM_DeadTimeHighSet
179#define PWM_HS_DeadTimeSet PWM_DeadTimeSet
184#define PWM_HS_TriggerCompareValueSet PWM_TriggerCompareValueSet
189#define PWM_HS_GeneratorInterruptEnable PWM_GeneratorInterruptEnable
194#define PWM_HS_GeneratorInterruptDisable PWM_GeneratorInterruptDisable
199#define PWM_HS_GeneratorEventStatusGet PWM_GeneratorEventStatusGet
204#define PWM_HS_GeneratorEventStatusClear PWM_GeneratorEventStatusClear
209#define PWM_HS_GeneratorDisable PWM_GeneratorDisable
214#define PWM_HS_GeneratorEnable PWM_GeneratorEnable
219#define PWM_HS_TriggerACompareValueSet PWM_TriggerACompareValueSet
224#define PWM_HS_TriggerBCompareValueSet PWM_TriggerBCompareValueSet
229#define PWM_HS_TriggerCCompareValueSet PWM_TriggerCCompareValueSet
234#define PWM_HS_SoftwareUpdateRequest PWM_SoftwareUpdateRequest
239#define PWM_HS_SoftwareUpdatePending PWM_SoftwareUpdatePending
244#define PWM_HS_FaultModeLatchClear PWM_FaultModeLatchClear
249 #define PWM_HS_Trigger1Enable PWM_Trigger1Enable
254#define PWM_HS_Trigger1Disable PWM_Trigger1Disable
259 #define PWM_HS_Trigger2Enable PWM_Trigger2Enable
264#define PWM_HS_Trigger2Disable PWM_Trigger2Disable
269#define PWM_HS_GeneratorEOCEventCallbackRegister PWM_GeneratorEOCEventCallbackRegister
270
275#define PWM_HS_GeneratorTasks PWM_GeneratorTasks
276
277// Section: PWM Module APIs
278
285void PWM_Initialize(void);
286
293void PWM_Deinitialize(void);
294
302inline static void PWM_GeneratorEnable(enum PWM_GENERATOR genNum)
303{
304 switch(genNum) {
305 case PWM_GENERATOR_1:
306 PG1CONLbits.ON = 1;
307 break;
308 case PWM_GENERATOR_2:
309 PG2CONLbits.ON = 1;
310 break;
311 default:break;
312 }
313}
314
322inline static void PWM_GeneratorDisable(enum PWM_GENERATOR genNum)
323{
324 switch(genNum) {
325 case PWM_GENERATOR_1:
326 PG1CONLbits.ON = 0;
327 break;
328 case PWM_GENERATOR_2:
329 PG2CONLbits.ON = 0;
330 break;
331 default:break;
332 }
333}
334
343inline static void PWM_ModeSet(enum PWM_GENERATOR genNum, enum PWM_MODES mode)
344{
345 switch(genNum) {
346 case PWM_GENERATOR_1:
347 PG1CONLbits.MODSEL = mode;
349 {
350 PG1IOCONHbits.PMOD = 0x1;
351 }
352 else
353 {
354 PG1IOCONHbits.PMOD = 0x0;
355 }
356 break;
357 case PWM_GENERATOR_2:
358 PG2CONLbits.MODSEL = mode;
360 {
361 PG2IOCONHbits.PMOD = 0x1;
362 }
363 else
364 {
365 PG2IOCONHbits.PMOD = 0x0;
366 }
367 break;
368 default:break;
369 }
370}
371
378inline static void PWM_Enable(void)
379{
380 PG1CONLbits.ON = 1;
381 PG2CONLbits.ON = 1;
382}
383
390inline static void PWM_Disable(void)
391{
392 PG1CONLbits.ON = 0;
393 PG2CONLbits.ON = 0;
394}
395
402inline static void PWM_MasterPeriodSet(uint16_t masterPeriod)
403{
404 MPER = masterPeriod;
405}
406
413inline static void PWM_MasterDutyCycleSet(uint16_t masterDutyCycle)
414{
415 MDC = masterDutyCycle;
416}
417
424inline static void PWM_MasterPhaseSet(uint16_t masterPhase)
425{
426 MPHASE = masterPhase;
427}
428
436inline static void PWM_PeriodSet(enum PWM_GENERATOR genNum,uint16_t period)
437{
438 switch(genNum) {
439 case PWM_GENERATOR_1:
440 PG1PER = period;
441 break;
442 case PWM_GENERATOR_2:
443 PG2PER = period;
444 break;
445 default:break;
446 }
447}
448
456inline static void PWM_DutyCycleSet(enum PWM_GENERATOR genNum,uint16_t dutyCycle)
457{
458 switch(genNum) {
459 case PWM_GENERATOR_1:
460 PG1DC = dutyCycle;
461 break;
462 case PWM_GENERATOR_2:
463 PG2DC = dutyCycle;
464 break;
465 default:break;
466 }
467}
468
476inline static void PWM_PhaseSelect(enum PWM_GENERATOR genNum,enum PWM_SOURCE_SELECT source)
477{
478 switch(genNum) {
479 case PWM_GENERATOR_1:
480 PG1CONHbits.MPHSEL = source;
481 break;
482 case PWM_GENERATOR_2:
483 PG2CONHbits.MPHSEL = source;
484 break;
485 default:break;
486 }
487}
488
496inline static void PWM_PhaseSet(enum PWM_GENERATOR genNum,uint16_t phase)
497{
498 switch(genNum) {
499 case PWM_GENERATOR_1:
500 PG1PHASE = phase;
501 break;
502 case PWM_GENERATOR_2:
503 PG2PHASE = phase;
504 break;
505 default:break;
506 }
507}
508
517inline static void PWM_OverrideDataSet(enum PWM_GENERATOR genNum,uint16_t overrideData)
518{
519 switch(genNum) {
520 case PWM_GENERATOR_1:
521 PG1IOCONLbits.OVRDAT = overrideData;
522 break;
523 case PWM_GENERATOR_2:
524 PG2IOCONLbits.OVRDAT = overrideData;
525 break;
526 default:break;
527 }
528}
529
538inline static void PWM_OverrideDataHighSet(enum PWM_GENERATOR genNum,bool overrideDataHigh)
539{
540 switch(genNum) {
541 case PWM_GENERATOR_1:
542 PG1IOCONLbits.OVRDAT = (PG1IOCONLbits.OVRDAT & 0x1) | ((uint8_t)overrideDataHigh << 0x1);
543 break;
544 case PWM_GENERATOR_2:
545 PG2IOCONLbits.OVRDAT = (PG2IOCONLbits.OVRDAT & 0x1) | ((uint8_t)overrideDataHigh << 0x1);
546 break;
547 default:break;
548 }
549}
550
559inline static void PWM_OverrideDataLowSet(enum PWM_GENERATOR genNum,bool overrideDataLow)
560{
561 switch(genNum) {
562 case PWM_GENERATOR_1:
563 PG1IOCONLbits.OVRDAT = (PG1IOCONLbits.OVRDAT & 0x2) | overrideDataLow;
564 break;
565 case PWM_GENERATOR_2:
566 PG2IOCONLbits.OVRDAT = (PG2IOCONLbits.OVRDAT & 0x2) | overrideDataLow;
567 break;
568 default:break;
569 }
570}
571
580inline static uint16_t PWM_OverrideDataGet(enum PWM_GENERATOR genNum)
581{
582 uint16_t overrideData = 0x0U;
583 switch(genNum) {
584 case PWM_GENERATOR_1:
585 overrideData = PG1IOCONLbits.OVRDAT;
586 break;
587 case PWM_GENERATOR_2:
588 overrideData = PG2IOCONLbits.OVRDAT;
589 break;
590 default:break;
591 }
592 return overrideData;
593}
594
602inline static void PWM_OverrideHighEnable(enum PWM_GENERATOR genNum)
603{
604 switch(genNum) {
605 case PWM_GENERATOR_1:
606 PG1IOCONLbits.OVRENH = 1;
607 break;
608 case PWM_GENERATOR_2:
609 PG2IOCONLbits.OVRENH = 1;
610 break;
611 default:break;
612 }
613}
614
622inline static void PWM_OverrideLowEnable(enum PWM_GENERATOR genNum)
623{
624 switch(genNum) {
625 case PWM_GENERATOR_1:
626 PG1IOCONLbits.OVRENL = 1;
627 break;
628 case PWM_GENERATOR_2:
629 PG2IOCONLbits.OVRENL = 1;
630 break;
631 default:break;
632 }
633}
634
642inline static void PWM_OverrideHighDisable(enum PWM_GENERATOR genNum)
643{
644 switch(genNum) {
645 case PWM_GENERATOR_1:
646 PG1IOCONLbits.OVRENH = 0;
647 break;
648 case PWM_GENERATOR_2:
649 PG2IOCONLbits.OVRENH = 0;
650 break;
651 default:break;
652 }
653}
654
662inline static void PWM_OverrideLowDisable(enum PWM_GENERATOR genNum)
663{
664 switch(genNum) {
665 case PWM_GENERATOR_1:
666 PG1IOCONLbits.OVRENL = 0;
667 break;
668 case PWM_GENERATOR_2:
669 PG2IOCONLbits.OVRENL = 0;
670 break;
671 default:break;
672 }
673}
674
683inline static void PWM_DeadTimeLowSet(enum PWM_GENERATOR genNum,uint16_t deadtimeLow)
684{
685 switch(genNum) {
686 case PWM_GENERATOR_1:
687 PG1DTL = deadtimeLow;
688 break;
689 case PWM_GENERATOR_2:
690 PG2DTL = deadtimeLow;
691 break;
692 default:break;
693 }
694}
695
704inline static void PWM_DeadTimeHighSet(enum PWM_GENERATOR genNum,uint16_t deadtimeHigh)
705{
706 switch(genNum) {
707 case PWM_GENERATOR_1:
708 PG1DTH = deadtimeHigh;
709 break;
710 case PWM_GENERATOR_2:
711 PG2DTH = deadtimeHigh;
712 break;
713 default:break;
714 }
715}
716
725inline static void PWM_DeadTimeSet(enum PWM_GENERATOR genNum,uint16_t deadtime)
726{
727 switch(genNum) {
728 case PWM_GENERATOR_1:
729 PG1DTL = deadtime;
730 PG1DTH = deadtime;
731 break;
732 case PWM_GENERATOR_2:
733 PG2DTL = deadtime;
734 PG2DTH = deadtime;
735 break;
736 default:break;
737 }
738}
739
748inline static void PWM_TriggerCompareValueSet(enum PWM_GENERATOR genNum,uint16_t trigCompValue)
749{
750 switch(genNum) {
751 case PWM_GENERATOR_1:
752 PG1TRIGA = trigCompValue;
753 break;
754 case PWM_GENERATOR_2:
755 PG2TRIGA = trigCompValue;
756 break;
757 default:break;
758 }
759}
760
769inline static void PWM_GeneratorInterruptEnable(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
770{
771 switch(genNum) {
772 case PWM_GENERATOR_1:
773 switch(interrupt) {
775 PG1EVTHbits.FLTIEN = true;
776 break;
778 PG1EVTHbits.CLIEN = true;
779 break;
781 PG1EVTHbits.FFIEN = true;
782 break;
784 PG1EVTHbits.SIEN = true;
785 break;
786 default:break;
787 }
788 break;
789 case PWM_GENERATOR_2:
790 switch(interrupt) {
792 PG2EVTHbits.FLTIEN = true;
793 break;
795 PG2EVTHbits.CLIEN = true;
796 break;
798 PG2EVTHbits.FFIEN = true;
799 break;
801 PG2EVTHbits.SIEN = true;
802 break;
803 default:break;
804 }
805 break;
806 default:break;
807 }
808}
809
818inline static void PWM_GeneratorInterruptDisable(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
819{
820 switch(genNum) {
821 case PWM_GENERATOR_1:
822 switch(interrupt) {
824 PG1EVTHbits.FLTIEN = false;
825 break;
827 PG1EVTHbits.CLIEN = false;
828 break;
830 PG1EVTHbits.FFIEN = false;
831 break;
833 PG1EVTHbits.SIEN = false;
834 break;
835 default:break;
836 }
837 break;
838 case PWM_GENERATOR_2:
839 switch(interrupt) {
841 PG2EVTHbits.FLTIEN = false;
842 break;
844 PG2EVTHbits.CLIEN = false;
845 break;
847 PG2EVTHbits.FFIEN = false;
848 break;
850 PG2EVTHbits.SIEN = false;
851 break;
852 default:break;
853 }
854 break;
855 default:break;
856 }
857}
858
867inline static void PWM_GeneratorEventStatusClear(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
868{
869 switch(genNum) {
870 case PWM_GENERATOR_1:
871 switch(interrupt) {
873 PG1STATbits.FLTEVT = 0;
874 break;
876 PG1STATbits.CLEVT = 0;
877 break;
879 PG1STATbits.FFEVT = 0;
880 break;
882 PG1STATbits.SEVT = 0;
883 break;
884 default:break;
885 }
886 break;
887 case PWM_GENERATOR_2:
888 switch(interrupt) {
890 PG2STATbits.FLTEVT = 0;
891 break;
893 PG2STATbits.CLEVT = 0;
894 break;
896 PG2STATbits.FFEVT = 0;
897 break;
899 PG2STATbits.SEVT = 0;
900 break;
901 default:break;
902 }
903 break;
904 default:break;
905 }
906}
907
917inline static bool PWM_GeneratorEventStatusGet(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
918{
919 bool status = false;
920 switch(genNum) {
921 case PWM_GENERATOR_1:
922 switch(interrupt) {
924 status = PG1STATbits.FLTEVT;
925 break;
927 status = PG1STATbits.CLEVT;
928 break;
930 status = PG1STATbits.FFEVT;
931 break;
933 status = PG1STATbits.SEVT;
934 break;
935 default:break;
936 }
937 break;
938 case PWM_GENERATOR_2:
939 switch(interrupt) {
941 status = PG2STATbits.FLTEVT;
942 break;
944 status = PG2STATbits.CLEVT;
945 break;
947 status = PG2STATbits.FFEVT;
948 break;
950 status = PG2STATbits.SEVT;
951 break;
952 default:break;
953 }
954 break;
955 default:break;
956 }
957 return status;
958}
959
967inline static void PWM_SoftwareUpdateRequest(enum PWM_GENERATOR genNum)
968{
969 switch(genNum) {
970 case PWM_GENERATOR_1:
971 PG1STATbits.UPDREQ = 1;
972 break;
973 case PWM_GENERATOR_2:
974 PG2STATbits.UPDREQ = 1;
975 break;
976 default:break;
977 }
978
979}
980
989inline static bool PWM_SoftwareUpdatePending(enum PWM_GENERATOR genNum)
990{
991 bool status = false;
992 switch(genNum) {
993 case PWM_GENERATOR_1:
994 status = PG1STATbits.UPDATE;
995 break;
996 case PWM_GENERATOR_2:
997 status = PG2STATbits.UPDATE;
998 break;
999 default:break;
1000 }
1001 return status;
1002}
1003
1012inline static void PWM_TriggerACompareValueSet(enum PWM_GENERATOR genNum,uint16_t trigA)
1013{
1014 switch(genNum) {
1015 case PWM_GENERATOR_1:
1016 PG1TRIGA = trigA;
1017 break;
1018 case PWM_GENERATOR_2:
1019 PG2TRIGA = trigA;
1020 break;
1021 default:break;
1022 }
1023}
1024
1033inline static void PWM_TriggerBCompareValueSet(enum PWM_GENERATOR genNum,uint16_t trigB)
1034{
1035 switch(genNum) {
1036 case PWM_GENERATOR_1:
1037 PG1TRIGB = trigB;
1038 break;
1039 case PWM_GENERATOR_2:
1040 PG2TRIGB = trigB;
1041 break;
1042 default:break;
1043 }
1044}
1045
1054inline static void PWM_TriggerCCompareValueSet(enum PWM_GENERATOR genNum,uint16_t trigC)
1055{
1056 switch(genNum) {
1057 case PWM_GENERATOR_1:
1058 PG1TRIGC = trigC;
1059 break;
1060 case PWM_GENERATOR_2:
1061 PG2TRIGC = trigC;
1062 break;
1063 default:break;
1064 }
1065}
1066
1078inline static void PWM_Trigger1Enable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
1079{
1080 switch(genNum) {
1081 case PWM_GENERATOR_1:
1082 switch(compareRegister) {
1084 PG1EVTLbits.ADTR1EN1 = 1;
1085 break;
1087 PG1EVTLbits.ADTR1EN2 = 1;
1088 break;
1090 PG1EVTLbits.ADTR1EN3 = 1;
1091 break;
1092 default:break;
1093 }
1094 break;
1095 case PWM_GENERATOR_2:
1096 switch(compareRegister) {
1098 PG2EVTLbits.ADTR1EN1 = 1;
1099 break;
1101 PG2EVTLbits.ADTR1EN2 = 1;
1102 break;
1104 PG2EVTLbits.ADTR1EN3 = 1;
1105 break;
1106 default:break;
1107 }
1108 break;
1109 default:break;
1110 }
1111
1112}
1113
1122inline static void PWM_Trigger1Disable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
1123{
1124 switch(genNum) {
1125 case PWM_GENERATOR_1:
1126 switch(compareRegister) {
1128 PG1EVTLbits.ADTR1EN1 = 0;
1129 break;
1131 PG1EVTLbits.ADTR1EN2 = 0;
1132 break;
1134 PG1EVTLbits.ADTR1EN3 = 0;
1135 break;
1136 default:break;
1137 }
1138 break;
1139 case PWM_GENERATOR_2:
1140 switch(compareRegister) {
1142 PG2EVTLbits.ADTR1EN1 = 0;
1143 break;
1145 PG2EVTLbits.ADTR1EN2 = 0;
1146 break;
1148 PG2EVTLbits.ADTR1EN3 = 0;
1149 break;
1150 default:break;
1151 }
1152 break;
1153 default:break;
1154 }
1155
1156}
1157
1169inline static void PWM_Trigger2Enable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
1170{
1171 switch(genNum) {
1172 case PWM_GENERATOR_1:
1173 switch(compareRegister) {
1175 PG1EVTHbits.ADTR2EN1 = 1;
1176 break;
1178 PG1EVTHbits.ADTR2EN2 = 1;
1179 break;
1181 PG1EVTHbits.ADTR2EN3 = 1;
1182 break;
1183 default:break;
1184 }
1185 break;
1186 case PWM_GENERATOR_2:
1187 switch(compareRegister) {
1189 PG2EVTHbits.ADTR2EN1 = 1;
1190 break;
1192 PG2EVTHbits.ADTR2EN2 = 1;
1193 break;
1195 PG2EVTHbits.ADTR2EN3 = 1;
1196 break;
1197 default:break;
1198 }
1199 break;
1200 default:break;
1201 }
1202
1203}
1204
1213inline static void PWM_Trigger2Disable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
1214{
1215 switch(genNum) {
1216 case PWM_GENERATOR_1:
1217 switch(compareRegister) {
1219 PG1EVTHbits.ADTR2EN1 = 0;
1220 break;
1222 PG1EVTHbits.ADTR2EN2 = 0;
1223 break;
1225 PG1EVTHbits.ADTR2EN3 = 0;
1226 break;
1227 default:break;
1228 }
1229 break;
1230 case PWM_GENERATOR_2:
1231 switch(compareRegister) {
1233 PG2EVTHbits.ADTR2EN1 = 0;
1234 break;
1236 PG2EVTHbits.ADTR2EN2 = 0;
1237 break;
1239 PG2EVTHbits.ADTR2EN3 = 0;
1240 break;
1241 default:break;
1242 }
1243 break;
1244 default:break;
1245 }
1246
1247}
1248
1256inline static void PWM_FaultModeLatchClear(enum PWM_GENERATOR genNum)
1257{
1258 switch(genNum) {
1259 case PWM_GENERATOR_1:
1260 PG1FPCILbits.SWTERM = 1;
1261 break;
1262 case PWM_GENERATOR_2:
1263 PG2FPCILbits.SWTERM = 1;
1264 break;
1265 default:break;
1266 }
1267}
1268
1277void PWM_GeneratorEOCEventCallbackRegister(void (*callback)(enum PWM_GENERATOR genNum));
1278
1288
1289
1296void PWM_GeneratorTasks(enum PWM_GENERATOR intGen);
1297
1298
1299#endif //PWM_H
1300
This is the generated driver types header file for the PWM driver.
PWM_SOURCE_SELECT
@ PWM_GENERATOR_INTERRUPT_FEED_FORWARD
@ PWM_GENERATOR_INTERRUPT_SYNC
@ PWM_GENERATOR_INTERRUPT_CURRENT_LIMIT
@ PWM_GENERATOR_INTERRUPT_FAULT
@ PWM_TRIGGER_COMPARE_A
@ PWM_TRIGGER_COMPARE_B
@ PWM_TRIGGER_COMPARE_C
@ PWM_MODE_INDEPENDENT_EDGE_DUAL_OUTPUT
@ PWM_GENERATOR_1
@ PWM_GENERATOR_2
size_t status
Definition uart1.c:99
static void PWM_Trigger2Enable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
This inline function enables ADC trigger 2 for the specific compare register selected by the argument...
Definition pwm.h:1169
static void PWM_MasterPhaseSet(uint16_t masterPhase)
This inline function sets the phase value in count for the Master Time Base generator.
Definition pwm.h:424
static void PWM_GeneratorInterruptDisable(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
This inline function disables interrupt requests for the PWM Generator selected by the argument PWM_G...
Definition pwm.h:818
static void PWM_DeadTimeLowSet(enum PWM_GENERATOR genNum, uint16_t deadtimeLow)
This inline function updates PWM Deadtime low register with the requested value for a specific PWM ge...
Definition pwm.h:683
static void PWM_OverrideDataHighSet(enum PWM_GENERATOR genNum, bool overrideDataHigh)
This inline function updates PWM override high data bit with the requested value for a specific PWM g...
Definition pwm.h:538
static void PWM_Trigger1Disable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
This inline function disables ADC trigger 1 for the specific compare register selected by the argumen...
Definition pwm.h:1122
static uint16_t PWM_OverrideDataGet(enum PWM_GENERATOR genNum)
This inline function gets PWM override value for the PWM Generator selected by the argument PWM_GENER...
Definition pwm.h:580
static void PWM_OverrideLowEnable(enum PWM_GENERATOR genNum)
This inline function enables PWM override on PWML output for specific PWM generator selected by the a...
Definition pwm.h:622
PWM_GENERATOR_INTERRUPT
Defines the PWM generator interrupts that are available for the module to use.
const struct PWM_HS_INTERFACE PWM_HS
Structure object of type PWM_HS_INTERFACE with the custom name given by the user in the Melody Driver...
Definition pwm.c:51
void PWM_Initialize(void)
Initializes PWM module, using the given initialization data.
Definition pwm.c:109
static void PWM_MasterPeriodSet(uint16_t masterPeriod)
This inline function sets the period value in count for the Master Time Base generator.
Definition pwm.h:402
static void PWM_TriggerACompareValueSet(enum PWM_GENERATOR genNum, uint16_t trigA)
This inline function sets the Trigger A compare value in count for a specific PWM generator selected ...
Definition pwm.h:1012
static void PWM_TriggerBCompareValueSet(enum PWM_GENERATOR genNum, uint16_t trigB)
This inline function sets the Trigger B compare value in count for a specific PWM generator selected ...
Definition pwm.h:1033
static void PWM_DutyCycleSet(enum PWM_GENERATOR genNum, uint16_t dutyCycle)
This inline function sets the PWM generator specific duty cycle register.
Definition pwm.h:456
void PWM_GeneratorEOCEventCallback(enum PWM_GENERATOR genNum)
This is the default callback with weak attribute. The user can override and implement the default cal...
Definition pwm.c:361
void PWM_Deinitialize(void)
Deinitializes the PWM to POR values.
Definition pwm.c:271
static void PWM_TriggerCompareValueSet(enum PWM_GENERATOR genNum, uint16_t trigCompValue)
This inline function sets the PWM trigger compare value in count for the PWM Generator selected by th...
Definition pwm.h:748
PWM_TRIGGER_COMPARE
Defines the PWM generator Trigger Compare registers that are available for the module to use.
static void PWM_OverrideHighEnable(enum PWM_GENERATOR genNum)
This inline function enables PWM override on PWMH output for specific PWM generator selected by the a...
Definition pwm.h:602
static void PWM_GeneratorDisable(enum PWM_GENERATOR genNum)
This inline function disables the specific PWM generator selected by the argument PWM_GENERATOR.
Definition pwm.h:322
static void PWM_Disable(void)
This inline function will disable all the generators of PWM module.
Definition pwm.h:390
static void PWM_PhaseSet(enum PWM_GENERATOR genNum, uint16_t phase)
This inline function sets the phase value in count for the PWM generator specific Time Base.
Definition pwm.h:496
static bool PWM_GeneratorEventStatusGet(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
This inline function gets the PWM interrupt status for the PWM Generator selected by the argument PWM...
Definition pwm.h:917
static void PWM_FaultModeLatchClear(enum PWM_GENERATOR genNum)
This inline function clears the status of PWM latched fault mode for the PWM Generator selected by th...
Definition pwm.h:1256
static void PWM_ModeSet(enum PWM_GENERATOR genNum, enum PWM_MODES mode)
This inline function sets the operating mode of specific PWM generator selected by the argument PWM...
Definition pwm.h:343
static void PWM_SoftwareUpdateRequest(enum PWM_GENERATOR genNum)
This inline function requests to update the data registers for specific PWM generator selected by the...
Definition pwm.h:967
PWM_MODES
Defines the PWM generator operating modes that are available.
static void PWM_MasterDutyCycleSet(uint16_t masterDutyCycle)
This inline function sets the PWM master duty cycle register.
Definition pwm.h:413
static void PWM_OverrideDataLowSet(enum PWM_GENERATOR genNum, bool overrideDataLow)
This inline function updates PWM override low data bit with the requested value for a specific PWM ge...
Definition pwm.h:559
static void PWM_OverrideHighDisable(enum PWM_GENERATOR genNum)
This inline function disables PWM override on PWMH output for specific PWM generator selected by the ...
Definition pwm.h:642
static void PWM_OverrideDataSet(enum PWM_GENERATOR genNum, uint16_t overrideData)
This inline function updates PWM override data bits with the requested value for a specific PWM gener...
Definition pwm.h:517
static void PWM_DeadTimeSet(enum PWM_GENERATOR genNum, uint16_t deadtime)
This inline function updates PWM Deadtime low and high register with the requested value for a specif...
Definition pwm.h:725
PWM_GENERATOR
Defines the PWM generators that are selected from the MCC Melody User Interface for the PWM output co...
static bool PWM_SoftwareUpdatePending(enum PWM_GENERATOR genNum)
This inline function gets the status of the update request for specific PWM generator selected by the...
Definition pwm.h:989
void PWM_GeneratorTasks(enum PWM_GENERATOR intGen)
This is a tasks function for PWM1.
Definition pwm.c:367
static void PWM_Trigger2Disable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
This inline function disables ADC trigger 2 for the specific compare register selected by the argumen...
Definition pwm.h:1213
static void PWM_GeneratorEventStatusClear(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
This inline function clears the PWM interrupt status for the PWM Generator selected by the argument P...
Definition pwm.h:867
static void PWM_OverrideLowDisable(enum PWM_GENERATOR genNum)
This inline function disables PWM override on PWML output for specific PWM generator selected by the ...
Definition pwm.h:662
static void PWM_GeneratorInterruptEnable(enum PWM_GENERATOR genNum, enum PWM_GENERATOR_INTERRUPT interrupt)
This inline function enables interrupt requests for the PWM Generator selected by the argument PWM_GE...
Definition pwm.h:769
static void PWM_TriggerCCompareValueSet(enum PWM_GENERATOR genNum, uint16_t trigC)
This inline function sets the Trigger C compare value in count for a specific PWM generator selected ...
Definition pwm.h:1054
static void PWM_PhaseSelect(enum PWM_GENERATOR genNum, enum PWM_SOURCE_SELECT source)
This inline function selects the PWM generator source for Phase.
Definition pwm.h:476
static void PWM_Trigger1Enable(enum PWM_GENERATOR genNum, enum PWM_TRIGGER_COMPARE compareRegister)
This inline function enables ADC trigger 1 for the specific compare register selected by the argument...
Definition pwm.h:1078
static void PWM_PeriodSet(enum PWM_GENERATOR genNum, uint16_t period)
This inline function sets the period value in count for the PWM generator specific Time Base.
Definition pwm.h:436
static void PWM_GeneratorEnable(enum PWM_GENERATOR genNum)
This inline function enables the specific PWM generator selected by the argument PWM_GENERATOR.
Definition pwm.h:302
static void PWM_DeadTimeHighSet(enum PWM_GENERATOR genNum, uint16_t deadtimeHigh)
This inline function updates PWM Deadtime high register with the requested value for a specific PWM g...
Definition pwm.h:704
static void PWM_Enable(void)
This inline function will enable all the generators of PWM module.
Definition pwm.h:378
void PWM_GeneratorEOCEventCallbackRegister(void(*callback)(enum PWM_GENERATOR genNum))
This function can be used to override default callback PWM_GeneratorEOCEventCallback and to define cu...
Definition pwm.c:353
Structure containing the function pointers of PWM driver.