14 #include "dev_boost_pconfig.h" 15 #include "dev_boost_typedef.h" 18 volatile uint16_t __attribute__((always_inline)) SubState_PowerOnDelay(
volatile struct BOOST_CONVERTER_s *boostInstance);
19 volatile uint16_t __attribute__((always_inline)) Substate_VCapMonitor(
volatile struct BOOST_CONVERTER_s *boostInstance);
20 volatile uint16_t __attribute__((always_inline)) SubState_PrepareVRampUp(
volatile struct BOOST_CONVERTER_s *boostInstance);
21 volatile uint16_t __attribute__((always_inline)) SubState_VRampUp(
volatile struct BOOST_CONVERTER_s *boostInstance);
22 volatile uint16_t __attribute__((always_inline)) SubState_IRampUp(
volatile struct BOOST_CONVERTER_s *boostInstance);
23 volatile uint16_t __attribute__((always_inline)) SubState_PowerGoodDelay(
volatile struct BOOST_CONVERTER_s *boostInstance);
27 volatile uint16_t (*BoostConverterRampUpSubStateMachine[])(
volatile struct BOOST_CONVERTER_s *boostInstance) =
29 SubState_PowerOnDelay,
31 SubState_PrepareVRampUp,
34 SubState_PowerGoodDelay
38 volatile uint16_t BoostRampUpSubStateList_size = (
sizeof(BoostConverterRampUpSubStateMachine)/
sizeof(BoostConverterRampUpSubStateMachine[0]));
55 volatile uint16_t Substate_VCapMonitor(
volatile struct BOOST_CONVERTER_s *boostInstance)
57 volatile uint16_t _source=0;
80 return(BOOST_OPSRET_COMPLETE);
95 return (BOOST_OPSRET_ERROR);
100 return(BOOST_OPSRET_REPEAT);
117 volatile uint16_t SubState_PowerOnDelay(
volatile struct BOOST_CONVERTER_s *boostInstance)
119 volatile uint16_t retval=0;
131 retval = BOOST_OPSRET_COMPLETE;
136 retval = BOOST_OPSRET_REPEAT;
162 volatile uint16_t SubState_PrepareVRampUp(
volatile struct BOOST_CONVERTER_s *boostInstance)
164 volatile uint16_t _i=0;
165 volatile uint32_t _vout=0;
166 volatile uint32_t _vin=0;
167 volatile uint32_t _start_dc=0;
197 _vout = __builtin_muluu(
202 _vin = __builtin_muluu(
208 if (_vout < _vin) _vout = _vin;
215 _start_dc = __builtin_muluu((_vout-_vin), boostInstance->
sw_node[0].
period);
216 _start_dc = __builtin_divud(_start_dc, (uint16_t)_vout);
250 if(_start_dc < boostInstance->
i_loop[_i].minimum)
274 return(BOOST_OPSRET_ERROR);
277 return(BOOST_OPSRET_COMPLETE);
297 volatile uint16_t SubState_VRampUp(
volatile struct BOOST_CONVERTER_s *boostInstance)
299 volatile uint16_t retval=1;
300 volatile uint16_t _i=0;
309 retval &= boostPWM_Resume(boostInstance);
330 return(BOOST_OPSRET_ERROR);
347 retval = BOOST_OPSRET_COMPLETE;
353 retval = BOOST_OPSRET_REPEAT;
380 volatile uint16_t SubState_IRampUp(
volatile struct BOOST_CONVERTER_s *boostInstance)
382 volatile uint16_t retval=0;
399 retval = BOOST_OPSRET_COMPLETE;
404 retval = BOOST_OPSRET_REPEAT;
410 retval = BOOST_OPSRET_COMPLETE;
430 volatile uint16_t SubState_PowerGoodDelay(
volatile struct BOOST_CONVERTER_s *boostInstance)
432 volatile uint16_t retval=0;
449 { retval = BOOST_OPSTATE_ERROR; }
452 retval = BOOST_OPSRET_COMPLETE;
458 retval = BOOST_OPSRET_REPEAT;
enum BOOST_CONTROL_MODE_e control_mode
Fundamental control mode.
volatile struct NPNZ_PORTS_s Ports
Controller input and output ports.
volatile struct NPNZ16b_s * controller
pointer to control loop object data structure
volatile int16_t factor
Fractional scaling factor (range -1 ... 0.99969)
volatile uint16_t timeout
Soft-Start VCAP Charge-Up Monitor Period Counter Timeout (state machine fault state trigger)
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s v_ramp
Voltage Ramp-Up period deinitions.
volatile uint16_t period
Soft-Start Period (POD, RAMP PERIOD, PGD, etc.)
volatile uint16_t i_ref_startup
User setting of the initial current reference at startup (used to limit startup currents)
volatile struct BOOST_SWITCH_NODE_SETTINGS_s sw_node[BOOST_MPHASE_COUNT]
BOOST converter switch node settings.
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_vout
ADC input sampling output voltage.
volatile uint16_t v_ref
User reference setting used to control the power converter controller.
volatile struct NPNZ_PORT_s Target
Primary data output port declaration.
volatile struct BOOST_LOOP_SETTINGS_s v_loop
BOOST voltage control loop object.
volatile uint16_t period
Soft-Start VCAP Charge-Up Period (minimum time to wait when voltage has settled)
volatile struct NPNZ_LIMITS_s Limits
Input and output clamping values.
volatile uint16_t counter
Soft-Start VCAP Charge-Up Period Counter.
volatile uint16_t ref_inc_step
Size/value of one reference increment/decrement or this period.
volatile uint16_t no_of_phases
number of converter phases
volatile uint16_t period
Switching period.
volatile uint16_t minimum
output clamping value (minimum)
volatile uint16_t v_in
BOOST input voltage.
volatile struct BOOST_CONVERTER_STARTUP_s startup
BOOST startup timing settings.
volatile bool busy
Bit #7: Flag bit indicating that the state machine is executing a process (e.g. startup-ramp)
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s power_good_delay
Power-Good Delay period deinitions.
volatile bool enabled
Specifies, if this IO is used or not.
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_vin
ADC input sampling input voltage.
void(* ctrl_Precharge)(volatile struct NPNZ16b_s *, volatile fractional, volatile fractional)
Function pointer to PRECHARGE routine.
volatile struct BOOST_GPIO_INSTANCE_s PowerGood
Power Good Output.
volatile uint16_t reference
Control loop reference variable.
volatile uint16_t counter
Soft-Start Execution Counter (read only)
volatile struct BOOST_STARTUP_VCAP_PRECHARGE_s vcap_monitor
Output Capacitor Charging Time period deinitions.
volatile struct BOOST_CONVERTER_DATA_s data
BOOST runtime data.
volatile uint16_t v_drop
Acceptable voltage drop between input and output voltage when output capacitor is charging up.
volatile struct BOOST_LOOP_SETTINGS_s i_loop[BOOST_MPHASE_COUNT]
BOOST Current control loop objects.
volatile struct NPNZ_STATUS_s status
Control Loop Status and Control flags.
volatile uint16_t timeout_counter
Soft-Start VCAP Charge-Up Timeout Counter.
volatile int16_t MaxOutput
Maximum output value used for clamping (R/W)
volatile struct BOOST_ADC_INPUT_SCALING_s scaling
normalization scaling settings
volatile struct NPNZ_PORT_s AltTarget
Secondary data output port declaration.
volatile uint16_t * ptrAddress
Pointer to register or variable where the value is read from (e.g. ADCBUFx) or written to (e....
volatile uint16_t maximum
output clamping value (maximum)
volatile uint16_t v_out
BOOST output voltage.
volatile struct BOOST_FEEDBACK_SETTINGS_s feedback
BOOST converter feedback settings.
volatile struct BOOST_CONVERTER_STATUS_s status
BOOST operation status bits.
volatile uint16_t reference
Internal dummy reference used to increment/decrement controller reference.
volatile int16_t offset
Signal offset as signed integer to be subtracted from ADC input.
volatile uint16_t duty_ratio_min
Absolute duty cycle minimum during normal operation.
volatile struct BOOST_GPIO_SETTINGS_s gpio
BOOST converter additional GPIO specification.
volatile uint16_t * ptrControlReference
Pointer to global variable of input register holding the controller reference value (e....
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s power_on_delay
Power-On Delay period deinitions.
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s i_ramp
Current Ramp-Up period deinitions.
BOOST control & monitoring data structure.
volatile struct BOOST_CONVERTER_SETTINGS_s set_values
Control field for global access to references.
volatile bool enabled
Bit 15: enables/disables control loop execution.
volatile int16_t scaler
Feedback bit-shift scaler used for number normalization.