13 #include "xc16_pral.h"
14 #include "dev_buck_typedef.h"
15 #include "dev_buck_special_functions.h"
22 struct CS_CALIBRATION_s
26 volatile uint16_t counter;
27 volatile uint32_t buffer;
29 typedef struct CS_CALIBRATION_s CS_CALIBRATION_t;
53 #define CS_CALIB_STEPS 8
138 volatile uint16_t retval=0;
144 if(buckInstance == NULL)
180 volatile uint16_t _i=0;
181 volatile bool _complete=
true;
185 if(!buckInstance->
status.
bits.cs_calib_enable)
187 return((uint16_t)BUCK_OPSRET_COMPLETE);
191 if ((!buckInstance->
status.
bits.adc_active) ||
194 {
return((uint16_t)BUCK_OPSRET_REPEAT); }
235 retval = (uint16_t)BUCK_OPSRET_COMPLETE;
237 retval = (uint16_t)BUCK_OPSRET_REPEAT;
#define BUCK_MPHASE_COUNT
Declaration of the number of power train phases of the Buck Converter.
BUCK_OPSTATE_RETURNS_e
Enumeration of state machine operating state return values.
volatile uint16_t CurrentSenseOffsetCalibration(volatile struct BUCK_CONVERTER_s *buckInstance)
Performs an offset calibration of the current sense feedback signal(s)
volatile uint16_t drv_BuckConverter_SpecialFunctionExecute(volatile struct BUCK_CONVERTER_s *buckInstance, volatile enum BUCK_SPECIAL_FUNCTIONS_e specialFunction)
This is the public function call access point to call dedicated special sub-functions.
volatile uint16_t(* BuckConverterSpecialFunctions[])(volatile struct BUCK_CONVERTER_s *buckInstance)
Function pointer list of all special function sub-state functions.
volatile struct CS_CALIBRATION_s calib_cs[BUCK_NO_OF_PHASES]
Array of current sense calibration data objects of type CS_CALIBRATION_t.
BUCK_SPECIAL_FUNCTIONS_e
Enumeration of special function sub-states.
#define CS_CALIB_STEPS
Number of signal oversampling steps used to determine the calibration value.
struct BUCK_CONVERTER_STATUS_s::@126::@128 bits
data structure for single bit addressing operations
volatile uint16_t i_sns[BUCK_NO_OF_PHASES]
BUCK output current.
volatile uint16_t no_of_phases
number of converter phases
volatile uint16_t feedback_offset
Feedback offset value for calibration or bi-direction feedback signals.
BUCK control & monitoring data structure.
volatile struct BUCK_LOOP_SETTINGS_s i_loop[BUCK_NO_OF_PHASES]
BUCK Current control loop objects.
volatile struct BUCK_CONVERTER_STATUS_s status
BUCK operation status bits.
volatile struct BUCK_CONVERTER_DATA_s data
BUCK runtime data.
volatile struct BUCK_CONVERTER_SETTINGS_s set_values
Control field for global access to references.