52 volatile uint16_t retval=1;
106 volatile uint16_t retval=1;
133 ((
volatile uint8_t*) &PCLKCON);
160 volatile uint16_t retval=1;
165 ((
volatile uint8_t*) &PCLKCON);
194 ((
volatile uint8_t*) &PG1CONL + ((pgInstance - 1) * P33C_PWMGEN_SFR_OFFSET));
218 volatile uint16_t pgInstance,
222 volatile uint16_t retval=1;
227 ((
volatile uint8_t*) &PG1CONL + ((pgInstance - 1) * P33C_PWMGEN_SFR_OFFSET));
252 volatile uint16_t retval=1;
292 volatile uint16_t retval=1;
318 volatile uint16_t retval=1;
319 volatile uint16_t timeout=0;
338 while((!PCLKCONbits.HRRDY) && (timeout++<5000));
339 if ((timeout >= 5000) || (PCLKCONbits.HRERR))
368 volatile uint16_t retval=1;
402 volatile uint16_t retval=1;
430 volatile uint16_t retval=1;
459 volatile uint16_t period
462 volatile uint16_t retval=1;
492 volatile uint16_t duty
495 volatile uint16_t retval=1;
526 volatile uint16_t dead_time_rising,
527 volatile uint16_t dead_time_falling
530 volatile uint16_t retval=1;
561 ((
volatile uint8_t*)&PG1CONL + ((pgInstance - 1) * P33C_PWMGEN_SFR_OFFSET));
582 volatile uint16_t retval=1;
589 retval = (
volatile uint16_t)
590 (((
volatile uint16_t)&pg->
PGxCONL - (
volatile uint16_t)&PG1CONL) / P33C_PWMGEN_SFR_OFFSET) + 1;
592 if (retval > P33C_PG_COUNT)
614 volatile uint16_t retval=1;
615 volatile uint16_t pgInstance;
622 pgInstance = (
volatile uint16_t)
623 (((
volatile uint16_t)&pg->
PGxCONL - (
volatile uint16_t)&PG1CONL) / P33C_PWMGEN_SFR_OFFSET + 1);
626 if (pgInstance > P33C_PG_COUNT)
628 else if (pgInstance > 4)
672 volatile uint16_t pgMotherTriggerOutput,
674 volatile bool ChildImmediateUpdate
677 volatile uint16_t retval=1;
678 volatile uint16_t pgMotherInstance=0;
679 volatile uint16_t pgChildInstance=0;
680 volatile uint16_t pgMotherGroup=0;
681 volatile uint16_t pgChildGroup=0;
682 volatile uint16_t pgInstance;
685 if ((pgHandleMother == NULL) || (pgHandleChild == NULL))
704 pgHandleMother->
PGxEVTL.
bits.PGTRGSEL = (pgMotherTriggerOutput & 0x0003);
707 pgHandleChild->
PGxCONH.
bits.UPDMOD = (0b010 | ChildImmediateUpdate);
725 if (pgMotherGroup == pgChildGroup)
730 if (pgMotherGroup == 1)
731 pgHandleChild->
PGxCONH.
bits.SOCS = pgMotherInstance;
732 else if (pgMotherGroup == 2)
733 pgHandleChild->
PGxCONH.
bits.SOCS = (pgMotherInstance - 4);
776 .vFSCL.value = 0x0000,
777 .vFSMINPER.value = 0x0000,
778 .vMPHASE.value = 0x0000,
779 .vMDC.value = 0x0000,
780 .vMPER.value = 0x0000,
781 .vLFSR.value = 0x0000,
782 .vCMBTRIGL.value = 0x0000,
783 .vCMBTRIGH.value = 0x0000,
784 .LOGCON_A.value = 0x0000,
785 .LOGCON_B.value = 0x0000,
786 .LOGCON_C.value = 0x0000,
787 .LOGCON_D.value = 0x0000,
788 .LOGCON_E.value = 0x0000,
789 .LOGCON_F.value = 0x0000,
790 .PWMEVT_A.value = 0x0000,
791 .PWMEVT_B.value = 0x0000,
792 .PWMEVT_C.value = 0x0000,
793 .PWMEVT_D.value = 0x0000,
794 .PWMEVT_E.value = 0x0000,
795 .PWMEVT_F.value = 0x0000
816 .vFSCL.value = 0x0000,
817 .vFSMINPER.value = 0x0000,
818 .vMPHASE.value = 0x0000,
819 .vMDC.value = 0x0000,
820 .vMPER.value = 0x0000,
821 .vLFSR.value = 0x0000,
822 .vCMBTRIGL.value = 0x0000,
823 .vCMBTRIGH.value = 0x0000,
824 .LOGCON_A.value = 0x0000,
825 .LOGCON_B.value = 0x0000,
826 .LOGCON_C.value = 0x0000,
827 .LOGCON_D.value = 0x0000,
828 .LOGCON_E.value = 0x0000,
829 .LOGCON_F.value = 0x0000,
830 .PWMEVT_A.value = 0x0000,
831 .PWMEVT_B.value = 0x0000,
832 .PWMEVT_C.value = 0x0000,
833 .PWMEVT_D.value = 0x0000,
834 .PWMEVT_E.value = 0x0000,
835 .PWMEVT_F.value = 0x0000
859 .PGxCONH.value = 0x0000,
860 .PGxSTAT.value = 0x0000,
861 .PGxIOCONL.value = 0x0000,
862 .PGxIOCONH.value = 0x0000,
863 .PGxEVTL.value = 0x0000,
864 .PGxEVTH.value = 0x0000,
865 .PGxFPCIL.value = 0x0000,
866 .PGxFPCIH.value = 0x0000,
867 .PGxCLPCIL.value = 0x0000,
868 .PGxCLPCIH.value = 0x0000,
869 .PGxFFPCIL.value = 0x0000,
870 .PGxFFPCIH.value = 0x0000,
871 .PGxSPCIL.value = 0x0000,
872 .PGxSPCIH.value = 0x0000,
873 .PGxLEBL.value = 0x0000,
874 .PGxLEBH.value = 0x0000,
875 .PGxPHASE.value = 0x0000,
876 .PGxDC.value = 0x0000,
877 .PGxDCA.value = 0x0000,
878 .PGxPER.value = 0x0000,
879 .PGxTRIGA.value = 0x0000,
880 .PGxTRIGB.value = 0x0000,
881 .PGxTRIGC.value = 0x0000,
882 .PGxDTL.value = 0x0000,
883 .PGxDTH.value = 0x0000,
884 .PGxCAP.value = 0x0000
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::@49 vPCLKCON
union P33C_PWM_GENERATOR_s::@96 PGxPER
union P33C_PWM_GENERATOR_s::@77 PGxCONH
union P33C_PWM_GENERATOR_s::@79 PGxIOCONL
union P33C_PWM_GENERATOR_s::@78 PGxSTAT
union P33C_PWM_GENERATOR_s::@80 PGxIOCONH
struct tagPG1CONLBITS bits
union P33C_PWM_GENERATOR_s::@92 PGxLEBH
union P33C_PWM_GENERATOR_s::@81 PGxEVTL
union P33C_PWM_GENERATOR_s::@101 PGxDTH
union P33C_PWM_GENERATOR_s::@76 PGxCONL
union P33C_PWM_GENERATOR_s::@100 PGxDTL
union P33C_PWM_GENERATOR_s::@89 PGxSPCIL
union P33C_PWM_GENERATOR_s::@94 PGxDC