45 #ifndef BOOST_CONVERTER_TYPE_DEF_H 46 #define BOOST_CONVERTER_TYPE_DEF_H 53 #include "power_control/drivers/npnz16b.h" 54 #include "config/hal.h" 62 #define BOOST_MPHASE_COUNT BOOST_NO_OF_PHASES 71 enum BOOST_STATUS_FLAGS_e
73 BOOST_STAT_READY = 0b0000000000000001,
74 BOOST_STAT_ADC_ACTIVE = 0b0000000000000010,
75 BOOST_STAT_PWM_ACTIVE = 0b0000000000000100,
76 BOOST_STAT_POWERSOURCE_DETECTED = 0b0000000000001000,
77 BOOST_STAT_CS_SENSE_READY = 0b0000000000010000,
79 BOOST_STAT_FORCED_SHUT_DOWN = 0b0000000010000000,
80 BOOST_STAT_BUSY = 0b0000000100000000,
83 BOOST_STAT_GO = 0b0010000000000000,
84 BOOST_STAT_AUTORUN = 0b0100000000000000,
85 BOOST_STAT_NO_AUTORUN = 0b0000000000000000,
87 BOOST_STAT_ENABLED = 0b1000000000000000,
88 BOOST_STAT_DISABLED = 0b0000000000000000
90 typedef enum BOOST_STATUS_FLAGS_e BOOST_STATUS_FLAGS_t;
99 enum BOOST_OPSTATES_e {
101 BOOST_OPSTATE_ERROR = 0x00,
102 BOOST_OPSTATE_INITIALIZE = 0x01,
103 BOOST_OPSTATE_RESET = 0x02,
104 BOOST_OPSTATE_STANDBY = 0x03,
105 BOOST_OPSTATE_RAMPUP = 0x04,
106 BOOST_OPSTATE_ONLINE = 0x05
109 typedef enum BOOST_OPSTATES_e BOOST_OPSTATE_t;
118 enum BOOST_SUBSTATES_e {
120 BOOST_OPSTATE_POWER_ON_DELAY = 0x00,
121 BOOST_OPSTATE_VCAP_MONITOR = 0x01,
122 BOOST_OPSTATE_PREPARE_V_RAMP = 0x02,
123 BOOST_OPSTATE_V_RAMP_UP = 0x03,
124 BOOST_OPSTATE_I_RAMP_UP = 0x04,
125 BOOST_OPSTATE_PWRGOOD_DELAY = 0x05
128 typedef enum BOOST_SUBSTATES_e BOOST_SUBSTATES_t;
136 enum BOOST_OPSTATE_RETURNS_e {
138 BOOST_OPSRET_ERROR = 0x0000,
139 BOOST_OPSRET_COMPLETE = 0x0001,
140 BOOST_OPSRET_REPEAT = 0x0002
143 typedef enum BOOST_OPSTATE_RETURNS_e BOOST_OPSTATE_RETURNS_t;
152 enum BOOST_CONTROL_MODE_e{
154 BOOST_CONTROL_MODE_VMC = 0,
156 BOOST_CONTROL_MODE_ACMC = 2
159 typedef enum BOOST_CONTROL_MODE_e BOOST_CONTROL_MODE_t;
226 } __attribute__((packed)) bits;
324 volatile uint16_t
i_sns[BOOST_MPHASE_COUNT];
enum BOOST_CONTROL_MODE_e control_mode
Fundamental control mode.
volatile uint8_t trigger_source
input channel trigger source
volatile uint16_t pwm_instance
number of the PWM channel used
enum BOOST_OPSTATES_e OpStateOpCodes
List of State Machine Operating State IDs.
volatile struct NPNZ16b_s * controller
pointer to control loop object data structure
volatile int16_t factor
Fractional scaling factor (range -1 ... 0.99969)
void(* ctrl_Update)(volatile struct NPNZ16b_s *)
Function pointer to UPDATE routine.
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 dead_time_falling
Dead time setting at falling edge of a half-bridge drive.
volatile uint16_t leb_period
Leading-Edge Blanking period.
volatile bool adc_active
Bit #1: indicating that ADC has been started and samples are taken.
volatile bool swap_outputs
Selecting if PWMxH (default) or PWMxL should be the leading PWM output.
volatile bool fault_active
Bit #5: Flag bit indicating system is in enforced shut down mode (usually due to a fault condition)
volatile uint16_t trigger_scaler
PWM triggers for ADC will be generated every n-th cycle.
volatile bool high_resolution_enable
Selecting if PWM module should use high-resolution mode.
volatile uint16_t control_output
BOOST most recent control output value.
volatile unsigned
Bit #3: (reserved)
volatile uint8_t adc_input
number of the ADC input channel used
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 dead_time_rising
Dead time setting at rising edge of a half-bridge drive.
volatile bool enabled
input channel enable bit
volatile uint16_t v_ref
User reference setting used to control the power converter controller.
volatile uint16_t gpio_instance
GPIO instance of the selected PWM generator.
enum BOOST_CONTROL_MODE_e ControlModes
List of Supported Control Modes.
volatile uint16_t control_error
BOOST most recent control error value.
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 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 duty_ratio_init
Initial duty cycle when the PWM module is being turned on.
volatile uint16_t no_of_phases
number of converter phases
volatile uint16_t i_ref
User reference setting used to control the power converter controller.
enum BOOST_SUBSTATES_e SubStateOpCodes
List of State Machine Sub-State IDs.
volatile uint16_t io_type
Input/Output definition (0=push-pull output, 1=input, 2=open-drain output)
enum BOOST_OPSTATE_RETURNS_e OpStateReturnValues
List of State Machine Operating State Return Values.
volatile uint16_t gpio_low
GPIO port pin-number of PWMxL of the selected PWM generator.
volatile uint16_t period
Switching period.
volatile bool sync_drive
Selecting if switch node is driven in synchronous or asnchronous mode.
volatile uint16_t phase
Switching signal phase-shift.
volatile uint16_t gpio_high
GPIO port pin-number of PWMxH of the selected PWM generator.
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_temp
ADC input sampling temperature.
volatile uint16_t minimum
output clamping value (minimum)
volatile uint16_t feedback_offset
Feedback offset value for calibration or bi-direction feedback signals.
Switching signal timing settings.
volatile uint16_t temp
BOOST board temperature.
volatile uint16_t * adc_buffer
pointer to ADC result buffer
volatile uint16_t v_in
BOOST input voltage.
volatile uint16_t pin
GPIO port pin number.
volatile bool suspend
Bit #6: Control bit to put the converter in suspend mode (turned off while ENABLE bit is still on)
volatile uint16_t(* ctrl_Initialize)(volatile struct NPNZ16b_s *)
Function pointer to INIT routine.
volatile bool enabled
Bit #15: Control bit enabling/disabling the charger port.
volatile struct BOOST_CONVERTER_STARTUP_s startup
BOOST startup timing settings.
void(* ctrl_Reset)(volatile struct NPNZ16b_s *)
Function pointer to RESET routine.
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 uint16_t gpio_instance
GPIO instance of the selected PWM generator.
volatile uint16_t i_out
BOOST common output current.
GPIO instance of the converter control GPIO.
volatile bool enabled
Specifies, if this IO is used or not.
volatile uint8_t adc_core
number of the ADC core connected to the selected channel
volatile bool ready
Bit #0: status bit, indicating boost converter is initialized and ready to run.
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 bool pwm_active
Bit #2: indicating that PWM has been started and ADC triggers are generated.
volatile struct BOOST_GPIO_INSTANCE_s PowerGood
Power Good Output.
struct BOOST_STATE_ID_s::@372::@373 bits
volatile uint16_t duty_ratio_max
Absolute duty cycle maximum during normal operation.
volatile uint16_t reference
Control loop reference variable.
volatile uint16_t control_input
BOOST most recent control input value (raw input)
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.
enum BOOST_STATUS_FLAGS_e StatusFlags
List of all status and control flags of the Boost Converter status word.
volatile struct BOOST_CONVERTER_DATA_s data
BOOST runtime data.
volatile bool async_mode
Bit #9: Control bit suspending the synchronous rectifier switch PWM channel.
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 bool differential_input
input channel differential mode enable bit
ADC input channel configuration.
volatile uint16_t polarity
Output polarity, where 0=ACTIVE HIGH, 1=ACTIVE_LOW.
Boost converter main settingsUser defined settings for control loops;
volatile bool early_interrupt_enable
input channel early interrupt enable bit
volatile bool cs_calib_complete
Bit #4: indicating that current sensor calibration has completed.
enum BOOST_SUBSTATES_e substate_id
Most recent operating state of active sub state machine.
volatile uint16_t timeout_counter
Soft-Start VCAP Charge-Up Timeout Counter.
volatile struct BOOST_ADC_INPUT_SCALING_s scaling
normalization scaling settings
volatile uint16_t i_sns[BOOST_MPHASE_COUNT]
BOOST output current.
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 bool interrupt_enable
input channel interrupt enable bit
GPIO instance of the converter control GPIO.
volatile struct BOOST_CONVERTER_STATUS_s status
BOOST operation status bits.
ADC input signal scaling = (ADCBUF - <offset>) * <factor> >> 2^<scaler>
volatile uint16_t trigger_offset
PWM triggers for ADC will be offset by n cycles.
volatile uint16_t reference
Internal dummy reference used to increment/decrement controller reference.
volatile bool signed_result
input channel singed result mode enable bit
volatile uint16_t port
GPIO port instance number (0=Port RA, 0=Port RB, 0=Port RC, etc.)
volatile int16_t offset
Signal offset as signed integer to be subtracted from ADC input.
volatile bool GO
Bit #13: When set, the GO-bit fires up the power supply.
volatile bool cs_calib_enable
Bit #8: Flag bit indicating that current sensors need to calibrated.
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 struct BOOST_STARTUP_PERIOD_HANDLER_s power_on_delay
Power-On Delay period deinitions.
volatile struct BOOST_STATE_ID_s state_id
BOOST state machine operating state ID.
volatile bool master_period_enable
Selecting MASTER or Individual period register.
volatile struct BOOST_GPIO_INSTANCE_s EnableInput
External ENABLE input.
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s i_ramp
Current Ramp-Up period deinitions.
BOOST control & monitoring data structure.
volatile bool autorun
Bit #14: Control bit determining if charger is starting automatically or on command (using the GO bit...
Boost converter feedback declarations.
volatile uint16_t trigger_offset
ADC trigger offset value for trigger fine-tuning.
enum BOOST_OPSTATES_e opstate_id
Most recent operating state of main state machine.
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_isns[BOOST_MPHASE_COUNT]
ADC input sampling phase current.
volatile bool level_trigger
input channel level trigger mode enable bit
volatile struct BOOST_CONVERTER_SETTINGS_s set_values
Control field for global access to references.
volatile int16_t scaler
Feedback bit-shift scaler used for number normalization.