44 #ifndef P33C_PWM_SFR_ABSTRACTION_H
45 #define P33C_PWM_SFR_ABSTRACTION_H
84 #ifndef P33C_PWM_MODULE_s
89 struct tagPCLKCONBITS
bits;
130 struct tagCMBTRIGLBITS
bits;
134 struct tagCMBTRIGHBITS
bits;
138 struct tagLOGCONABITS
bits;
142 struct tagLOGCONABITS
bits;
146 struct tagLOGCONABITS
bits;
150 struct tagLOGCONABITS
bits;
154 struct tagLOGCONABITS
bits;
158 struct tagLOGCONABITS
bits;
162 struct tagPWMEVTABITS
bits;
166 struct tagPWMEVTABITS
bits;
170 struct tagPWMEVTABITS
bits;
174 struct tagPWMEVTABITS
bits;
178 struct tagPWMEVTABITS
bits;
182 struct tagPWMEVTABITS
bits;
186 } __attribute__((packed)) P33C_PWM_MODULE_t;
193 #ifndef P33C_PWM_GENERATOR_s
197 struct tagPG1CONLBITS
bits;
201 struct tagPG1CONHBITS
bits;
205 struct tagPG1STATBITS
bits;
209 struct tagPG1IOCONLBITS
bits;
213 struct tagPG1IOCONHBITS
bits;
217 struct tagPG1EVTLBITS
bits;
221 struct tagPG1EVTHBITS
bits;
225 struct tagPG1FPCILBITS
bits;
229 struct tagPG1FPCIHBITS
bits;
233 struct tagPG1CLPCILBITS
bits;
237 struct tagPG1CLPCIHBITS
bits;
241 struct tagPG1FFPCILBITS
bits;
245 struct tagPG1FFPCIHBITS
bits;
249 struct tagPG1SPCILBITS
bits;
253 struct tagPG1SPCIHBITS
bits;
263 struct tagPG1LEBHBITS
bits;
279 struct tagPG1DCABITS
bits;
307 struct tagPG1DTLBITS
bits;
311 struct tagPG1DTHBITS
bits;
320 } __attribute__((packed)) P33C_PWM_GENERATOR_t;
323 #define P33C_PWMGEN_SFR_OFFSET ((volatile uint16_t)&PG2CONL - (volatile uint16_t)&PG1CONL)
328 #if defined (PG8CONL)
329 #define P33C_PG_COUNT 8
330 #elif defined (PG4CONL)
331 #define P33C_PG_COUNT 4
377 volatile uint16_t period);
379 volatile uint16_t duty);
381 volatile uint16_t dead_time_rising,
volatile uint16_t dead_time_falling);
385 volatile uint16_t pgMotherTriggerOutput,
387 volatile bool ChildImmediateUpdate
volatile uint16_t p33c_PwmGenerator_SetDeadTimes(volatile struct P33C_PWM_GENERATOR_s *pg, volatile uint16_t dead_time_rising, volatile uint16_t dead_time_falling)
Sets the dead-times of a given PWM generator.
volatile uint16_t p33c_PwmGenerator_SetDutyCycle(volatile struct P33C_PWM_GENERATOR_s *pg, volatile uint16_t duty)
Sets the on-time of a given PWM generator.
volatile uint16_t p33c_PwmGenerator_SetPeriod(volatile struct P33C_PWM_GENERATOR_s *pg, volatile uint16_t period)
Sets the period of a given PWM generator.
volatile uint16_t p33c_PwmGenerator_Suspend(volatile struct P33C_PWM_GENERATOR_s *pg)
Disables the PWM generator outputs but keeps the module running.
volatile struct P33C_PWM_MODULE_s * p33c_PwmModule_GetHandle(void)
Gets pointer to PWM module SFR set.
volatile struct P33C_PWM_GENERATOR_s * p33c_PwmGenerator_GetHandle(volatile uint16_t pgInstance)
Returns the PWM generator index.
volatile struct P33C_PWM_MODULE_s p33c_PwmModule_ConfigRead(void)
Read the current configuration from the PWM base module registers.
volatile uint16_t p33c_PwmGenerator_Dispose(volatile uint16_t pgInstance)
Disposes a given PWM generator by resetting all its registers to default.
volatile uint16_t p33c_PwmGenerator_GetInstance(volatile struct P33C_PWM_GENERATOR_s *pg)
Get the PWM generator instance index of a known PWM object pointer address.
volatile uint16_t p33c_PwmModule_Dispose(void)
Resets all PWM base module registers to their RESET default values.
volatile uint16_t p33c_PwmGenerator_Enable(volatile struct P33C_PWM_GENERATOR_s *pg)
Enables a given PWM generator with output pins disabled.
volatile uint16_t p33c_PwmGenerator_Resume(volatile struct P33C_PWM_GENERATOR_s *pg)
Disables a PWM generator IOs.
volatile uint16_t p33c_PwmGenerator_Initialize(volatile uint16_t pgInstance)
Initializes a given PWM generator by resetting all its registers to default.
volatile uint16_t p33c_PwmModule_ConfigWrite(volatile struct P33C_PWM_MODULE_s pwmConfig)
Writes a user-defined configuration to the PWM base module registers.
volatile uint16_t p33c_PwmGenerator_SyncGenerators(volatile struct P33C_PWM_GENERATOR_s *pgHandleMother, volatile uint16_t pgMotherTriggerOutput, volatile struct P33C_PWM_GENERATOR_s *pgHandleChild, volatile bool ChildImmediateUpdate)
Sets the synchronization triggers of two PWM generators, of which the Mother PWM generator is the tri...
volatile uint16_t p33c_PwmGenerator_ConfigWrite(volatile uint16_t pgInstance, volatile struct P33C_PWM_GENERATOR_s pgConfig)
Disposes a given PWM generator by resetting all its registers to default.
volatile uint16_t p33c_PwmModule_Initialize(void)
Initializes the PWM base module by resetting all its registers to default.
volatile uint16_t p33c_PwmGenerator_Disable(volatile struct P33C_PWM_GENERATOR_s *pg)
Disables a given PWM generator.
volatile struct P33C_PWM_GENERATOR_s p33c_PwmGenerator_ConfigRead(volatile uint16_t pgInstance)
Disposes a given PWM generator by resetting all its registers to default.
volatile uint16_t p33c_PwmGenerator_GetGroup(volatile struct P33C_PWM_GENERATOR_s *pg)
Get the PWM generator group.
volatile struct P33C_PWM_GENERATOR_s pgConfigClear
Default RESET configuration of one PWM generator instance SFRs.
volatile struct P33C_PWM_MODULE_s pwmConfigDefault
Default initialization configuration of the PWM module SFRs.
volatile struct P33C_PWM_MODULE_s pwmConfigClear
Default RESET configuration of the PWM module SFRs.
union P33C_PWM_MODULE_s::@103 vCMBTRIGH
union P33C_PWM_MODULE_s::@102 vCMBTRIGL
union P33C_PWM_MODULE_s::@111 PWMEVT_B
struct tagPCLKCONBITS bits
union P33C_PWM_MODULE_s::@101 vLFSR
union P33C_PWM_MODULE_s::@106 LOGCON_C
union P33C_PWM_MODULE_s::@96 vFSCL
union P33C_PWM_MODULE_s::@97 vFSMINPER
union P33C_PWM_MODULE_s::@113 PWMEVT_D
union P33C_PWM_MODULE_s::@98 vMPHASE
union P33C_PWM_MODULE_s::@95 vPCLKCON
union P33C_PWM_MODULE_s::@99 vMDC
union P33C_PWM_MODULE_s::@112 PWMEVT_C
union P33C_PWM_MODULE_s::@108 LOGCON_E
union P33C_PWM_MODULE_s::@107 LOGCON_D
union P33C_PWM_MODULE_s::@114 PWMEVT_E
union P33C_PWM_MODULE_s::@104 LOGCON_A
union P33C_PWM_MODULE_s::@109 LOGCON_F
union P33C_PWM_MODULE_s::@105 LOGCON_B
union P33C_PWM_MODULE_s::@110 PWMEVT_A
union P33C_PWM_MODULE_s::@115 PWMEVT_F
union P33C_PWM_MODULE_s::@100 vMPER
union P33C_PWM_GENERATOR_s::@172 PGxTRIGC
union P33C_PWM_GENERATOR_s::@171 PGxTRIGB
union P33C_PWM_GENERATOR_s::@159 PGxCLPCIH
union P33C_PWM_GENERATOR_s::@153 PGxIOCONH
union P33C_PWM_GENERATOR_s::@155 PGxEVTH
union P33C_PWM_GENERATOR_s::@156 PGxFPCIL
union P33C_PWM_GENERATOR_s::@150 PGxCONH
union P33C_PWM_GENERATOR_s::@149 PGxCONL
union P33C_PWM_GENERATOR_s::@169 PGxPER
union P33C_PWM_GENERATOR_s::@160 PGxFFPCIL
union P33C_PWM_GENERATOR_s::@175 PGxCAP
union P33C_PWM_GENERATOR_s::@154 PGxEVTL
union P33C_PWM_GENERATOR_s::@157 PGxFPCIH
union P33C_PWM_GENERATOR_s::@167 PGxDC
union P33C_PWM_GENERATOR_s::@173 PGxDTL
union P33C_PWM_GENERATOR_s::@166 PGxPHASE
struct tagPG1CONLBITS bits
union P33C_PWM_GENERATOR_s::@163 PGxSPCIH
union P33C_PWM_GENERATOR_s::@162 PGxSPCIL
union P33C_PWM_GENERATOR_s::@152 PGxIOCONL
union P33C_PWM_GENERATOR_s::@164 PGxLEBL
union P33C_PWM_GENERATOR_s::@165 PGxLEBH
union P33C_PWM_GENERATOR_s::@168 PGxDCA
union P33C_PWM_GENERATOR_s::@158 PGxCLPCIL
union P33C_PWM_GENERATOR_s::@161 PGxFFPCIH
union P33C_PWM_GENERATOR_s::@174 PGxDTH
union P33C_PWM_GENERATOR_s::@151 PGxSTAT
union P33C_PWM_GENERATOR_s::@170 PGxTRIGA