21#include "system/system.h"
23#include "os/os_scheduler.h"
24#include "device/dev_led.h"
26#include "config/comms_config.h"
30#include "pwrctrl/pwrctrl.h"
31#include "system/pins.h"
33#include "sources/config/macros.h"
37uint16_t counter = 65500;
79 while (counter--> 0) Nop();
84 OS_Scheduler_RunForever();
101void __attribute__ ( ( __interrupt__ , auto_psv ) ) _ADCAN0Interrupt (
void )
128 IFS5bits.ADCAN0IF = 0;
This is the generated driver header file for the ADC1 driver.
This is the generated driver header file for the PWM driver.
This is the generated driver header file for the TMR1 driver.
app PBV psfb Frame map file Example
Contain the MCC Custom peripheral configuration that is not supported by MCC Melody tool.
Contains public fault functions.
POWER_CONTROL_t * psfb_ptr
Contains public function relevant for power control interrupt.
void App_PBV_psfb_Init()
This function initializes the local pbv objects. these objects are then passed on to the app_PBV_init...
void dev_MeasureOffsets_Initialize(void)
void MCC_Custom_User_Config(void)
Contains custom peripheral initialization.
void PwrCtrl_Initialize(void)
Initialize the power control parameters.
void PwrCtrl_OffsetDatatypesInitalize(void)
reset offset data types
void __attribute__((__interrupt__, auto_psv))
Executes the power converter control loop.
void PwrCtrl_UpdateADConverterData(void)
This function updates the PSFB data members with ADC raw values.
void ControlLoop_Interrupt_CallBack(void)
Executes the power converter control loop.
void PwrCtrl_PWM_UpdateSecondaryRectifiers(void)
set the PWM output to particular duty cycle.
uint16_t PwrCtrl_UpdateAverageRolling(AVERAGING_ROLLING_t *data, uint16_t sample)
Rolling Average the raw data over number of samples.
void Fault_Initialize(void)
Initialize the fault objects.
void Fault_Execute(void)
Executes the fault handlers.
static void ADC1_SoftwareTriggerEnable(void)
This inline function sets software common trigger.
#define GPIO_debug_SetLow()
Sets the RD14 GPIO Pin which has a custom name of GPIO_debug to Low.
#define GPIO_debug_SetHigh()
Sets the RD14 GPIO Pin which has a custom name of GPIO_debug to High.
void SYSTEM_Initialize(void)
Initializes the System module.
void TMR1_TimeoutCallbackRegister(void(*handler)(void))
This function can be used to override default callback and to define custom callback for TMR1 Timeout...
uint16_t ISensePrimary
Data value for primary current as measured with CT.
uint16_t ISenseSecondary
Data value for secondary current as measured with shunt.
SEC_REC_t SecRec
structure for secondary rectification data
PWR_CTRL_STATE_t State
Power Control State ID.
FEEDBACK_SETTINGS_t Data
Feedback channel settings.
AVERAGING_t ISecAveraging
secondary current average
uint16_t Secondary_Rolling_val
Secondary Current Rolling Average Value.
AVERAGING_ROLLING_t Secondary_Rolling
structure for Secondary current rolling average