Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches
pwm.c
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// Section: Included Files
39
40
41#include "../pwm.h"
42#include "../../system/clock.h"
43
44// Section: File specific functions
45
46static void (*PWM_GeneratorEOCEventHandler)(enum PWM_GENERATOR genNum) = NULL;
47
48
49// Section: Driver Interface
50
51const struct PWM_HS_INTERFACE PWM_HS = {
53 .Deinitialize = &PWM_Deinitialize,
54 .Disable = &PWM_Disable,
55 .Enable = &PWM_Enable,
56 .ModeSet = &PWM_ModeSet,
57 .MasterPeriodSet = &PWM_MasterPeriodSet,
58 .MasterDutyCycleSet = &PWM_MasterDutyCycleSet,
59 .PeriodSet = &PWM_PeriodSet,
60 .DutyCycleSet = &PWM_DutyCycleSet,
61 .PhaseSelect = &PWM_PhaseSelect,
62 .PhaseSet = &PWM_PhaseSet,
63 .OverrideDataSet = &PWM_OverrideDataSet,
64 .OverrideDataHighSet = &PWM_OverrideDataHighSet,
65 .OverrideDataLowSet = &PWM_OverrideDataLowSet,
66 .OverrideDataGet = &PWM_OverrideDataGet,
67 .OverrideHighEnable = &PWM_OverrideHighEnable,
68 .OverrideLowEnable = &PWM_OverrideLowEnable,
69 .OverrideHighDisable = &PWM_OverrideHighDisable,
70 .OverrideLowDisable = &PWM_OverrideLowDisable,
71 .DeadTimeLowSet = &PWM_DeadTimeLowSet,
72 .DeadTimeHighSet = &PWM_DeadTimeHighSet,
73 .DeadTimeSet = &PWM_DeadTimeSet,
74 .TriggerCompareValueSet = &PWM_TriggerCompareValueSet,
75 .GeneratorInterruptEnable = &PWM_GeneratorInterruptEnable,
76 .GeneratorInterruptDisable = &PWM_GeneratorInterruptDisable,
77 .GeneratorEventStatusGet = &PWM_GeneratorEventStatusGet,
78 .GeneratorEventStatusClear = &PWM_GeneratorEventStatusClear,
79
80 .SpecialEventPrimaryCompareValueSet = NULL,
81 .SpecialEventTriggerInterruptFlagClear = NULL,
82 .SpecialEventPrimaryInterruptEnable = NULL,
83 .SpecialEventPrimaryInterruptDisable = NULL,
84 .FaultModeLatchDisable = NULL,
85 .FaultModeLatchEnable = NULL,
86 .MasterPhaseSet = &PWM_MasterPhaseSet,
87 .GeneratorDisable = &PWM_GeneratorDisable,
88 .GeneratorEnable = &PWM_GeneratorEnable,
89 .TriggerACompareValueSet = &PWM_TriggerACompareValueSet,
90 .TriggerBCompareValueSet = &PWM_TriggerBCompareValueSet,
91 .TriggerCCompareValueSet = &PWM_TriggerCCompareValueSet,
92 .SoftwareUpdateRequest = &PWM_SoftwareUpdateRequest,
93 .SoftwareUpdatePending = &PWM_SoftwareUpdatePending,
94 .FaultModeLatchClear = &PWM_FaultModeLatchClear,
95 .Trigger1Enable = &PWM_Trigger1Enable,
96 .Trigger1Disable = &PWM_Trigger1Disable,
97 .Trigger2Enable = &PWM_Trigger2Enable,
98 .Trigger2Disable = &PWM_Trigger2Disable,
99
100 .GeneratorEOCEventCallbackRegister = &PWM_GeneratorEOCEventCallbackRegister,
101
102
103 .GeneratorTasks = &PWM_GeneratorTasks,
104 .CommonEventTasks = NULL,
105};
106
107// Section: PWM Module APIs
108
109void PWM_Initialize (void)
110{
111 // MODSEL Independent Edge; TRGCNT 1; CLKSEL Master clock; ON disabled; HREN enabled;
112 PG1CONL = 0x88;
113 // MODSEL Independent Edge; TRGCNT 1; CLKSEL Master clock; ON disabled; HREN enabled;
114 PG2CONL = 0x88;
115 //
116 PG1CAP = 0x0;
117 // PCIGT disabled; TQPS Not inverted; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
118 PG1CLPCIH = 0x0;
119 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
120 PG1CLPCIL = 0x0;
121 // MSTEN disabled; TRIGMOD Single trigger mode; SOCS Self-trigger; UPDMOD SOC update; MPHSEL disabled; MPERSEL enabled; MDCSEL disabled;
122 PG1CONH = 0x4000;
123 // DC1 0;
124 PG1DC = 0x0;
125 // DCA1 0x0;
126 PG1DCA = 0x0;
127 // DTH1 0;
128 PG1DTH = 0x0;
129 // DTL1 0;
130 PG1DTL = 0x0;
131 // ADTR2EN1 disabled; IEVTSEL EOC; SIEN disabled; FFIEN disabled; ADTR1OFS None; CLIEN disabled; FLTIEN disabled; ADTR2EN2 disabled; ADTR2EN3 disabled;
132 PG1EVTH = 0x0;
133 // UPDTRG Duty Cycle; ADTR1PS 1:1; PGTRGSEL Trigger C compare event; ADTR1EN3 disabled; ADTR1EN1 enabled; ADTR1EN2 disabled;
134 PG1EVTL = 0x10B;
135 // PCIGT disabled; TQPS Not inverted; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
136 PG1FFPCIH = 0x0;
137 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
138 PG1FFPCIL = 0x0;
139 // TQPS Not inverted; LATMOD disabled; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
140 PG1FPCIH = 0x0;
141 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
142 PG1FPCIL = 0x0;
143 // PENL enabled; DTCMPSEL PCI Sync Logic; PMOD Complementary; POLL Active-high; PENH enabled; CAPSRC Software; POLH Active-high;
144 PG1IOCONH = 0xC;
145 // FLTDAT 0; DBDAT 0x0; SWAP disabled; OVRENH enabled; OVRENL enabled; OSYNC User output overrides occur when specified by UPDMOD bits; CLMOD disabled; FFDAT 0x0; CLDAT 0x0; OVRDAT 0;
146 PG1IOCONL = 0x3200;
147 // PWMPCI PWM1; PLR disabled; PLF disabled; PHR disabled; PHF disabled;
148 PG1LEBH = 0x0;
149 // LEB 0x0;
150 PG1LEBL = 0x0;
151 // PER1 39992;
152 PG1PER = 0x9C38;
153 // PHASE1 0;
154 PG1PHASE = 0x0;
155 // PCIGT disabled; TQPS Not inverted; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
156 PG1SPCIH = 0x0;
157 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
158 PG1SPCIL = 0x0;
159 // TRSET disabled; UPDREQ disabled; CLEVT disabled; TRCLR disabled; CAP disabled; SEVT disabled; FFEVT disabled; UPDATE disabled; FLTEVT disabled;
160 PG1STAT = 0x0;
161 // TRIGA1 0;
162 PG1TRIGA = 0x0;
163 // TRIGB1 0;
164 PG1TRIGB = 0x0;
165 // TRIGC1 0;
166 PG1TRIGC = 0x0;
167 //
168 PG2CAP = 0x0;
169 // PCIGT disabled; TQPS Not inverted; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
170 PG2CLPCIH = 0x0;
171 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
172 PG2CLPCIL = 0x0;
173 // MSTEN disabled; TRIGMOD Single trigger mode; SOCS Trigger output selected by PG1 or PG5; UPDMOD SOC update; MPHSEL disabled; MPERSEL enabled; MDCSEL disabled;
174 PG2CONH = 0x4001;
175 // DC2 0;
176 PG2DC = 0x0;
177 // DCA2 0x0;
178 PG2DCA = 0x0;
179 // DTH2 0;
180 PG2DTH = 0x0;
181 // DTL2 0;
182 PG2DTL = 0x0;
183 // ADTR2EN1 disabled; IEVTSEL EOC; SIEN disabled; FFIEN disabled; ADTR1OFS None; CLIEN disabled; FLTIEN disabled; ADTR2EN2 disabled; ADTR2EN3 disabled;
184 PG2EVTH = 0x0;
185 // UPDTRG Duty Cycle; ADTR1PS 1:1; PGTRGSEL EOC event; ADTR1EN3 disabled; ADTR1EN1 enabled; ADTR1EN2 disabled;
186 PG2EVTL = 0x108;
187 // PCIGT disabled; TQPS Not inverted; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
188 PG2FFPCIH = 0x0;
189 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
190 PG2FFPCIL = 0x0;
191 // TQPS Not inverted; LATMOD disabled; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
192 PG2FPCIH = 0x0;
193 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
194 PG2FPCIL = 0x0;
195 // PENL enabled; DTCMPSEL PCI Sync Logic; PMOD Complementary; POLL Active-high; PENH enabled; CAPSRC Software; POLH Active-high;
196 PG2IOCONH = 0xC;
197 // FLTDAT 0; DBDAT 0x0; SWAP disabled; OVRENH enabled; OVRENL enabled; OSYNC User output overrides occur when specified by UPDMOD bits; CLMOD disabled; FFDAT 0x0; CLDAT 0x0; OVRDAT 0;
198 PG2IOCONL = 0x3200;
199 // PWMPCI PWM1; PLR disabled; PLF disabled; PHR disabled; PHF disabled;
200 PG2LEBH = 0x0;
201 // LEB 0x0;
202 PG2LEBL = 0x0;
203 // PER2 39992;
204 PG2PER = 0x9C38;
205 // PHASE2 0;
206 PG2PHASE = 0x0;
207 // PCIGT disabled; TQPS Not inverted; SWPCI Drives '0'; BPEN disabled; TQSS None; SWPCIM PCI acceptance logic; BPSEL PWM Generator 1; ACP Level-sensitive;
208 PG2SPCIH = 0x0;
209 // PSS Internally connected to '1'b0; PPS Not inverted; SWTERM disabled; PSYNC disabled; TERM Manual Terminate; AQPS Not inverted; AQSS None; TSYNCDIS PWM EOC;
210 PG2SPCIL = 0x0;
211 // TRSET disabled; UPDREQ disabled; CLEVT disabled; TRCLR disabled; CAP disabled; SEVT disabled; FFEVT disabled; UPDATE disabled; FLTEVT disabled;
212 PG2STAT = 0x0;
213 // TRIGA2 0;
214 PG2TRIGA = 0x0;
215 // TRIGB2 0;
216 PG2TRIGB = 0x0;
217 // TRIGC2 0;
218 PG2TRIGC = 0x0;
219 // CTB3EN disabled; CTB2EN disabled; CTB1EN disabled; CTB4EN disabled; CTB8EN disabled; CTB7EN disabled; CTB6EN disabled; CTB5EN disabled;
220 CMBTRIGH = 0x0;
221 // CTA1EN disabled; CTA2EN disabled; CTA3EN disabled; CTA4EN disabled; CTA7EN disabled; CTA8EN disabled; CTA5EN disabled; CTA6EN disabled;
222 CMBTRIGL = 0x0;
223 // FSCL 0x0;
224 FSCL = 0x0;
225 // FSMINPER 0x0;
226 FSMINPER = 0x0;
227 // LFSR 0x0;
228 LFSR = 0x0;
229 // PWMLFA PWMS1 or PWMS2;; S1APOL Positive logic; S2APOL Positive logic; PWMLFAD No Assignment; PWMS1A PWM1H; PWMS2A PWM1H;
230 LOGCONA = 0x0;
231 // PWMLFB PWMS1 | PWMS2; S2BPOL Positive logic; PWMLFBD No Assignment; S1BPOL Positive logic; PWMS2B PWM1H; PWMS1B PWM1H;
232 LOGCONB = 0x0;
233 // PWMLFC PWMS1 | PWMS2; PWMLFCD No Assignment; S2CPOL Positive logic; S1CPOL Positive logic; PWMS1C PWM1H; PWMS2C PWM1H;
234 LOGCONC = 0x0;
235 // PWMS1D PWM1H; S1DPOL Positive logic; PWMLFD PWMS1 | PWMS2; PWMLFDD No Assignment; S2DPOL Positive logic; PWMS2D PWM1H;
236 LOGCOND = 0x0;
237 // PWMS1E PWM1H; PWMS2E PWM1H; S1EPOL Positive logic; PWMLFE PWMS1 | PWMS2; S2EPOL Positive logic; PWMLFED No Assignment;
238 LOGCONE = 0x0;
239 // S1FPOL Positive logic; PWMS2F PWM1H; PWMS1F PWM1H; S2FPOL Positive logic; PWMLFFD No Assignment; PWMLFF PWMS1 | PWMS2;
240 LOGCONF = 0x0;
241 // MDC 0;
242 MDC = 0x0;
243 // MPER 39992;
244 MPER = 0x9C38;
245 // MPHASE 0x0;
246 MPHASE = 0x0;
247 // MCLKSEL AFPLLO; LOCK disabled; DIVSEL 1:2; HRERR disabled;
248 PCLKCON = 0x3;
249 // EVTASEL PGTRGSEL bits; EVTASYNC Not synchronized; EVTAPOL Active-high; EVTAPGS PG1; EVTASTRD Stretched to 8 PWM clock cycles minimum; EVT1OEN disabled;
250 PWMEVTA = 0x0;
251 // EVTBPGS PG1; EVTBSYNC Not synchronized; EVTBPOL Active-high; EVTBSEL PGTRGSEL bits; EVTBSTRD Stretched to 8 PWM clock cycles minimum; EVT2OEN disabled;
252 PWMEVTB = 0x0;
253 // EVTCPGS PG1; EVTCPOL Active-high; EVTCSEL PGTRGSEL bits; EVTCSTRD Stretched to 8 PWM clock cycles minimum; EVTCSYNC Not synchronized; EVT3OEN disabled;
254 PWMEVTC = 0x0;
255 // EVT4OEN disabled; EVTDSTRD Stretched to 8 PWM clock cycles minimum; EVTDPOL Active-high; EVTDPGS PG1; EVTDSEL PGTRGSEL bits; EVTDSYNC Not synchronized;
256 PWMEVTD = 0x0;
257 // EVT5OEN disabled; EVTEPOL Active-high; EVTEPGS PG1; EVTESTRD Stretched to 8 PWM clock cycles minimum; EVTESEL PGTRGSEL bits; EVTESYNC Not synchronized;
258 PWMEVTE = 0x0;
259 // EVTFPOL Active-high; EVTFPGS PG1; EVTFSTRD Stretched to 8 PWM clock cycles minimum; EVTFSEL PGTRGSEL bits; EVT6OEN disabled; EVTFSYNC Not synchronized;
260 PWMEVTF = 0x0;
261
263
264
265
266 //Wait until AUX PLL clock is locked
268
269}
270
272{
273 PWM_Disable();
274
275 PG1CONL = 0x0;
276 PG2CONL = 0x0;
277
278 PG1CAP = 0x0;
279 PG1CLPCIH = 0x0;
280 PG1CLPCIL = 0x0;
281 PG1CONH = 0x0;
282 PG1DC = 0x0;
283 PG1DCA = 0x0;
284 PG1DTH = 0x0;
285 PG1DTL = 0x0;
286 PG1EVTH = 0x0;
287 PG1EVTL = 0x0;
288 PG1FFPCIH = 0x0;
289 PG1FFPCIL = 0x0;
290 PG1FPCIH = 0x0;
291 PG1FPCIL = 0x0;
292 PG1IOCONH = 0x0;
293 PG1IOCONL = 0x0;
294 PG1LEBH = 0x0;
295 PG1LEBL = 0x0;
296 PG1PER = 0x0;
297 PG1PHASE = 0x0;
298 PG1SPCIH = 0x0;
299 PG1SPCIL = 0x0;
300 PG1STAT = 0x0;
301 PG1TRIGA = 0x0;
302 PG1TRIGB = 0x0;
303 PG1TRIGC = 0x0;
304 PG2CAP = 0x0;
305 PG2CLPCIH = 0x0;
306 PG2CLPCIL = 0x0;
307 PG2CONH = 0x0;
308 PG2DC = 0x0;
309 PG2DCA = 0x0;
310 PG2DTH = 0x0;
311 PG2DTL = 0x0;
312 PG2EVTH = 0x0;
313 PG2EVTL = 0x0;
314 PG2FFPCIH = 0x0;
315 PG2FFPCIL = 0x0;
316 PG2FPCIH = 0x0;
317 PG2FPCIL = 0x0;
318 PG2IOCONH = 0x0;
319 PG2IOCONL = 0x0;
320 PG2LEBH = 0x0;
321 PG2LEBL = 0x0;
322 PG2PER = 0x0;
323 PG2PHASE = 0x0;
324 PG2SPCIH = 0x0;
325 PG2SPCIL = 0x0;
326 PG2STAT = 0x0;
327 PG2TRIGA = 0x0;
328 PG2TRIGB = 0x0;
329 PG2TRIGC = 0x0;
330 CMBTRIGH = 0x0;
331 CMBTRIGL = 0x0;
332 FSCL = 0x0;
333 FSMINPER = 0x0;
334 LFSR = 0x0;
335 LOGCONA = 0x0;
336 LOGCONB = 0x0;
337 LOGCONC = 0x0;
338 LOGCOND = 0x0;
339 LOGCONE = 0x0;
340 LOGCONF = 0x0;
341 MDC = 0x0;
342 MPER = 0x0;
343 MPHASE = 0x0;
344 PCLKCON = 0x0;
345 PWMEVTA = 0x0;
346 PWMEVTB = 0x0;
347 PWMEVTC = 0x0;
348 PWMEVTD = 0x0;
349 PWMEVTE = 0x0;
350 PWMEVTF = 0x0;
351}
352
353void PWM_GeneratorEOCEventCallbackRegister(void (*callback)(enum PWM_GENERATOR genNum))
354{
355 if(NULL != callback)
356 {
358 }
359}
360
361void __attribute__ ((weak)) PWM_GeneratorEOCEventCallback ( enum PWM_GENERATOR genNum )
362{
363
364}
365
366
368{
369 switch(intGen)
370 {
371 case PWM_GENERATOR_1:
372 if(IFS4bits.PWM1IF == 1)
373 {
375 {
376 (*PWM_GeneratorEOCEventHandler)(intGen);
377 }
378 IFS4bits.PWM1IF = 0;
379 }
380 break;
381 case PWM_GENERATOR_2:
382 if(IFS4bits.PWM2IF == 1)
383 {
385 {
386 (*PWM_GeneratorEOCEventHandler)(intGen);
387 }
388 IFS4bits.PWM2IF = 0;
389 }
390 break;
391 default:
392 break;
393 }
394}
395
This is the generated driver header file for the PWM driver.
@ PWM_GENERATOR_1
@ PWM_GENERATOR_2
static void(* PWM_GeneratorEOCEventHandler)(enum PWM_GENERATOR genNum)
Definition pwm.c:46
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
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
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
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
bool CLOCK_AuxPllLockStatusGet(void)
Returns Auxiliary PLL status.
Definition clock.c:104
Structure containing the function pointers of PWM driver.
void(* Initialize)(void)
Pointer to PWM_Initialize.