12#include "pwrctrl_typedef.h"
15#define DEAD_TIME_ADJ 240
63 PCLKCONbits.MCLKSEL = 1;
64 PCLKCONbits.DIVSEL = 0;
68 while ((0 == PCLKCONbits.HRRDY) && (++timeout < 5000));
71 PG1STATbits.UPDREQ = 1;
74 PG1IOCONHbits.PENH = 1;
75 PG1IOCONHbits.PENL = 1;
76 PG2IOCONHbits.PENH = 0;
77 PG2IOCONHbits.PENL = 1;
78 PG3IOCONHbits.PENH = 1;
79 PG3IOCONHbits.PENL = 1;
80 PG4IOCONHbits.PENH = 0;
81 PG4IOCONHbits.PENL = 1;
83 for (
int i=1000; i>0; i--);
86 PG1IOCONLbits.OVRENH = 0;
87 PG1IOCONLbits.OVRENL = 0;
89 PG2IOCONLbits.OVRENH = 1;
91 PG2IOCONLbits.OVRENL = 1;
93 PG3IOCONLbits.OVRENH = 0;
94 PG3IOCONLbits.OVRENL = 0;
96 PG4IOCONLbits.OVRENH = 1;
98 PG4IOCONLbits.OVRENL = 1;
128 PG1IOCONLbits.OVRENH = 1;
129 PG1IOCONLbits.OVRENL = 1;
130 PG2IOCONLbits.OVRENH = 1;
131 PG2IOCONLbits.OVRENL = 1;
132 PG3IOCONLbits.OVRENH = 1;
133 PG3IOCONLbits.OVRENL = 1;
134 PG4IOCONLbits.OVRENH = 1;
135 PG4IOCONLbits.OVRENL = 1;
188 PG1EVTLbits.PGTRGSEL = 0b011;
189 PG1EVTLbits.UPDTRG = 0;
190 PG1EVTLbits.ADTR1EN1 = 1;
192 PG1EVTHbits.ADTR2EN2 = 1;
196 PG3EVTLbits.PGTRGSEL = 0b011;
197 PG3EVTLbits.UPDTRG = 0;
225 PG2DC = (PG1PER - PG1TRIGC - PG2DTL);
226 PG4DC = (PG1PER - PG1TRIGC - PG4DTL);
241 PG1IOCONLbits.OVRENH = 1;
242 PG1IOCONLbits.OVRENL = 1;
243 PG3IOCONLbits.OVRENH = 1;
244 PG3IOCONLbits.OVRENL = 1;
261 uint16_t phaseValue = dutycycle * 200;
291 PG4IOCONLbits.OVRENL = 0;
292 PG2IOCONLbits.OVRENL = 0;
300 PG4IOCONLbits.OVRENL = 1;
301 PG2IOCONLbits.OVRENL = 1;
This is the generated driver header file for the PWM driver.
POWER_CONTROL_t * psfb_ptr
Contains public functions for PWM.
void PwrCtrl_PWM_Update()
PWM distribution for PSFB converter.
void PwrCtrl_PWM_Disable(void)
Disable the PWM output.
void PwrCtrl_PWM_Initialize(void)
Initialize the PWM peripheral.
void PwrCtrl_PWM_SetDutyCyclePrimary(uint16_t dutycycle)
set the PWM output to particular duty cycle.
void PwrCtrl_PWM_Stop_Switching(void)
Disable the PWM output.
void PwrCtrl_PWM_Enable(void)
Enable the PWM output.
void PwrCtrl_PWM_UpdateSecondaryRectifiers(void)
set the PWM output to particular duty cycle.
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 ...
static void PWM_DutyCycleSet(enum PWM_GENERATOR genNum, uint16_t dutyCycle)
This inline function sets the PWM generator specific duty cycle register.
static void PWM_SoftwareUpdateRequest(enum PWM_GENERATOR genNum)
This inline function requests to update the data registers for specific PWM generator selected by the...
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 ...
uint16_t ControlPhase
Control phase value from control loop.
uint16_t PBVControlPhaseTarget
Power Board Visualizer Set Control phase.
bool Enable
Enable control loop.
CONTROLLER_t ILoop
structure for current controller data
SWITCH_NODE_t Pwm
Switch node settings.
SEC_REC_t SecRec
structure for secondary rectification data
uint16_t Secondary_Rolling_val
Secondary Current Rolling Average Value.