Digital Power Starter Kit 3 Firmware
dsPIC33C Boost Converter Voltage Mode Control Example
dev_boost_typedef.h
1 
33 /*
34  * File: dev_boost_typedef.h
35  * Author: M91406
36  * Comments: Type definitions of single- and multiphase Boost Converter data object
37  * Revision history:
38  * 1.0 initial release
39  * 1.1 restructured phase arrays in data object to optimize code execution and stay with unified API
40  * with regards to other power converter object libraries
41  */
42 
43 // This is a guard condition so that contents of this file are not included
44 // more than once.
45 #ifndef BOOST_CONVERTER_TYPE_DEF_H
46 #define BOOST_CONVERTER_TYPE_DEF_H
47 
48 #include <xc.h> // include processor files - each processor file is guarded.
49 #include <stdint.h> // include standard integer number data types
50 #include <stdbool.h> // include standard boolean data types (true/false)
51 #include <stddef.h> // include standard definition data types
52 
53 #include "power_control/drivers/npnz16b.h"
54 #include "config/hal.h"
55 
56 
57 /****************************************************************************************************
58  * @ingroup lib-layer-boost-converter-properties-public-defines
59  * @def BOOST_MPHASE_COUNT
60  * @brief Declaration of the number of power train phases of the Boost Converter
61  **************************************************************************************************** */
62 #define BOOST_MPHASE_COUNT BOOST_NO_OF_PHASES
63 
64 // Controller Status Bits
65 /****************************************************************************************************
66  * @ingroup lib-layer-boost-converter-properties-private-data-types
67  * @enum BOOST_STATUS_FLAGS_e
68  * @brief Enumeration of status and control flags
69  * @extends BOOST_CONVERTER_CONSTANTS_s
70  **************************************************************************************************** */
71 enum BOOST_STATUS_FLAGS_e
72 {
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,
78 
79  BOOST_STAT_FORCED_SHUT_DOWN = 0b0000000010000000,
80  BOOST_STAT_BUSY = 0b0000000100000000,
81 
82 // Controller Control Bits
83  BOOST_STAT_GO = 0b0010000000000000,
84  BOOST_STAT_AUTORUN = 0b0100000000000000,
85  BOOST_STAT_NO_AUTORUN = 0b0000000000000000,
86 
87  BOOST_STAT_ENABLED = 0b1000000000000000,
88  BOOST_STAT_DISABLED = 0b0000000000000000
89 };
90 typedef enum BOOST_STATUS_FLAGS_e BOOST_STATUS_FLAGS_t;
91 
92 /****************************************************************************************************
93  * @ingroup lib-layer-boost-converter-properties-private-data-types
94  * @enum BOOST_OPSTATES_e
95  * @brief Enumeration of state machine operating states
96  * @extends BOOST_STATE_ID_s
97  * @extends BOOST_CONVERTER_CONSTANTS_s
98  **************************************************************************************************** */
99 enum BOOST_OPSTATES_e {
100 
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
107 
108 };
109 typedef enum BOOST_OPSTATES_e BOOST_OPSTATE_t;
110 
111 /****************************************************************************************************
112  * @ingroup lib-layer-boost-converter-properties-private-data-types
113  * @enum BOOST_SUBSTATES_e
114  * @brief Enumeration of state machine operating sub-states
115  * @extends BOOST_STATE_ID_s
116  * @extends BOOST_CONVERTER_CONSTANTS_s
117  **************************************************************************************************** */
118 enum BOOST_SUBSTATES_e { // Enumeration of state machine operating sub-states
119 
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
126 
127 };
128 typedef enum BOOST_SUBSTATES_e BOOST_SUBSTATES_t;
129 
130 /****************************************************************************************************
131  * @ingroup lib-layer-boost-converter-properties-private-data-types
132  * @enum BOOST_OPSTATE_RETURNS_e
133  * @brief Enumeration of state machine operating state return values
134  * @extends BOOST_CONVERTER_CONSTANTS_s
135  **************************************************************************************************** */
136 enum BOOST_OPSTATE_RETURNS_e { // Enumeration of state machine operating state return values
137 
138  BOOST_OPSRET_ERROR = 0x0000,
139  BOOST_OPSRET_COMPLETE = 0x0001,
140  BOOST_OPSRET_REPEAT = 0x0002
141 
142 }; // Enumeration of state machine operating state return values
143 typedef enum BOOST_OPSTATE_RETURNS_e BOOST_OPSTATE_RETURNS_t; // State Machine Operating State Return Values
144 
145 /****************************************************************************************************
146  * @ingroup lib-layer-boost-converter-properties-private-data-types
147  * @enum BOOST_CONTROL_MODE_e
148  * @brief Enumeration of the power supply mode control
149  * @extends BOOST_CONVERTER_SETTINGS_s
150  * @extends BOOST_CONVERTER_CONSTANTS_s
151  **************************************************************************************************** */
152 enum BOOST_CONTROL_MODE_e{
153 
154  BOOST_CONTROL_MODE_VMC = 0,
155 // BOOST_CONTROL_MODE_PCMC = 1, // Peak Current Mode Control (not supported yet)
156  BOOST_CONTROL_MODE_ACMC = 2
157 
158 };
159 typedef enum BOOST_CONTROL_MODE_e BOOST_CONTROL_MODE_t;
160 
161 /****************************************************************************************************
162  * @ingroup lib-layer-boost-converter-properties-public-data-types
163  * @struct BOOST_CONVERTER_CONSTANTS_s
164  * @brief Structure providing all public enumerated lists of constants
165  **************************************************************************************************** */
167 {
168  volatile enum BOOST_STATUS_FLAGS_e StatusFlags;
169  volatile enum BOOST_OPSTATES_e OpStateOpCodes;
170  volatile enum BOOST_SUBSTATES_e SubStateOpCodes;
171  volatile enum BOOST_OPSTATE_RETURNS_e OpStateReturnValues;
172  volatile enum BOOST_CONTROL_MODE_e ControlModes;
173 };
175 
176 /****************************************************************************************************
177  * @ingroup lib-layer-boost-converter-properties-public-variables
178  * @var BoostConverterConstants
179  * @brief Structure providing all public enumerated lists of constants
180  **************************************************************************************************** */
181 extern volatile struct BOOST_CONVERTER_CONSTANTS_s BoostConverterConstants;
182 
183 /*****************************************************************************************************
184  * @ingroup lib-layer-boost-converter-properties-private-data-types
185  * @struct BOOST_CONVERTER_STATUS_s
186  * @brief Generic power controller status word
187  * @extends BOOST_CONVERTER_s
188  *
189  * @details
190  * The power controller status/control word contains status (low-byte) and control bits (high-byte).
191  * -# Status Bits:
192  * - ADC_ACTIVE: ADC is active and running (read only)
193  * - PWM_STARTED: PWM is active and running generating ADC triggers (read only)
194  * - POWERSOURCE_DETECTED: A valid power source has been detected allowing the converter to run (read only)
195  * - CS_READ: Current sense feedback ready (read only)
196  * - FORCED_SHUT_DOWN: Control(Status bit for external software components forcing the converter to stay off
197  * - BUSY: Converter is currently going through an internal process (e.g. ramp up/down) (read only)
198  *
199  * -# Control Bits
200  * - ENABLE: Enables/Disables the power converter
201  * - AUTORUN: When set, the power converter will automatically start up once all status bits are set accordingly
202  * - GO: Control bit to manually start the power converter if (AUTOSTART=0)
203  *
204  **************************************************************************************************** */
206 {
207  union {
208  struct{
209  volatile bool ready:1;
210  volatile bool adc_active:1;
211  volatile bool pwm_active:1;
212  volatile unsigned :1;
213  volatile bool cs_calib_complete :1;
214  volatile bool fault_active :1;
215  volatile bool suspend :1;
216  volatile bool busy :1;
217 
218  volatile bool cs_calib_enable :1;
219  volatile bool async_mode :1;
220  volatile unsigned :1;
221  volatile unsigned :1;
222  volatile unsigned :1;
223  volatile bool GO :1;
224  volatile bool autorun :1;
225  volatile bool enabled :1;
226  } __attribute__((packed)) bits;
227 
228  volatile uint16_t value; // buffer for 16-bit word read/write operations
229  };
230 }; // Boost Converter Status & Control word
231 typedef struct BOOST_CONVERTER_STATUS_s BOOST_CONVERTER_STATUS_t; // Boost Converter Status & Control word data type
232 
233 /****************************************************************************************************
234  * @ingroup lib-layer-boost-converter-properties-private-data-types
235  * @struct BOOST_STATE_ID_s
236  * @brief data structure for the boost statement ID for sub-operating and operating states
237  * @extends BOOST_CONVERTER_s
238  **************************************************************************************************** */
240 {
241  union {
242  struct {
243  volatile enum BOOST_OPSTATES_e opstate_id;
244  volatile enum BOOST_SUBSTATES_e substate_id;
245  } bits;
246  volatile uint32_t value; // full state ID value access to main and sub-state machine state
247  };
248 }; // Boost Converter State Machine operating state ID
249 typedef struct BOOST_STATE_ID_s BOOST_STATE_ID_t; // Boost Converter State Machine operating state ID data type
250 
251 /****************************************************************************************************
252  * @ingroup lib-layer-boost-converter-properties-private-data-types
253  * @struct BOOST_STARTUP_PERIOD_HANDLER_s
254  * @brief Generic power controller startup period settings
255  * @extends BOOST_CONVERTER_STARTUP_s
256  *
257  * @details
258  * This data structure is used to set the startup settings such as power on delay, power good delay
259  * and ramp up time. It further covers private values like startup counters and reference values
260  * for voltage and current, which are used internally by the controller (read only) but are still
261  * accessible for external code modules for monitoring, diagnostics and fault handling purposes.
262  *
263  **************************************************************************************************** */
265 
266  volatile uint16_t counter;
267  volatile uint16_t period;
268  volatile uint16_t reference;
269  volatile uint16_t ref_inc_step;
270 
271 }; // Power converter soft-start auxiliary variables
272 typedef struct BOOST_STARTUP_PERIOD_HANDLER_s BOOST_STARTUP_PERIOD_HANDLER_t; // Power converter soft-start auxiliary variables data types
273 
274 /****************************************************************************************************
275  * @ingroup lib-layer-boost-converter-properties-private-data-types
276  * @struct BOOST_STARTUP_VCAP_PRECHARGE_s
277  * @brief Boost converter output capacitor voltage charge-up monitor settings
278  * @extends BOOST_CONVERTER_STARTUP_s
279  *
280  * @details
281  * This data structure is used to set the startup settings such as power on delay, power good delay
282  * and ramp up time. It further covers private values like startup counters and reference values
283  * for voltage and current, which are used internally by the controller (read only) but are still
284  * accessible for external code modules for monitoring, diagnostics and fault handling purposes.
285  *
286  **************************************************************************************************** */
288 
289  volatile uint16_t counter;
290  volatile uint16_t period;
291  volatile uint16_t timeout_counter;
292  volatile uint16_t timeout;
293  volatile uint16_t v_drop;
294 
295 }; // Power converter soft-start Vcap auxiliary variables
296 typedef struct BOOST_STARTUP_VCAP_PRECHARGE_s BOOST_STARTUP_VCAP_PRECHARGE_t; // Power converter Vcap pre-charge auxiliary variables data types
297 
298 /****************************************************************************************************
299  * @ingroup lib-layer-boost-converter-properties-private-data-types
300  * @struct BOOST_CONVERTER_STARTUP_s
301  * @brief Power Converter Startup Timing Settings
302  * @extends BOOST_CONVERTER_s
303  * *************************************************************************************************** */
305 
311 
312 }; // Power converter start-up settings and variables
313 typedef struct BOOST_CONVERTER_STARTUP_s BOOST_CONVERTER_STARTUP_t; // Power converter start-up settings and variables data type
314 
315 /****************************************************************************************************
316  * @ingroup lib-layer-boost-converter-properties-private-data-types
317  * @struct BOOST_CONVERTER_DATA_s
318  * @brief Publicly accessible data buffer of most recent runtime data values
319  * @extends BOOST_CONVERTER_s
320  *
321  **************************************************************************************************** */
323 
324  volatile uint16_t i_sns[BOOST_MPHASE_COUNT];
325  volatile uint16_t i_out;
326  volatile uint16_t v_in;
327  volatile uint16_t v_out;
328  volatile uint16_t temp;
329 
330  volatile uint16_t control_input;
331  volatile uint16_t control_error;
332  volatile uint16_t control_output;
333 
334 }; // BOOST runtime data buffer
335 typedef struct BOOST_CONVERTER_DATA_s BOOST_CONVERTER_DATA_t; // BOOST runtime data buffer data type
336 
337 /****************************************************************************************************
338  * @ingroup lib-layer-boost-converter-properties-private-data-types
339  * @struct BOOST_CONVERTER_SETTINGS_s
340  * @brief Generic power controller control settings
341  * @extends BOOST_CONVERTER_s
342  *
343  * @details
344  * This data structure is used to set the overall settings to allow external software instances
345  * to control the power control object, such as voltage and current references.
346  *
347  **************************************************************************************************** */
349 
350  volatile enum BOOST_CONTROL_MODE_e control_mode;
351  volatile uint16_t no_of_phases;
352  volatile uint16_t v_ref;
353  volatile uint16_t i_ref;
354  volatile uint16_t i_ref_startup;
355 
356 };
358 
359 /****************************************************************************************************
360  * @ingroup lib-layer-boost-converter-properties-private-data-types
361  * @struct BOOST_LOOP_SETTINGS_s
362  * @brief Generic power control loop settings
363  * @extends BOOST_CONVERTER_s
364  *
365  * @details
366  * This data structure is used to set the control loop settings such as pointers to controller
367  * objects and its function calls as well as basic user settings such as reference, feedback
368  * signal offsets, trigger delays and minimum/maximum output clamping values.
369  *
370  * *************************************************************************************************** */
372 
373  // Properties (user settings)
374  volatile uint16_t reference;
375  volatile uint16_t feedback_offset;
376  volatile uint16_t trigger_offset;
377  volatile uint16_t minimum;
378  volatile uint16_t maximum;
379  // Control Loop Object
380  volatile struct NPNZ16b_s* controller;
381  // Function pointers
382  volatile uint16_t (*ctrl_Initialize)(volatile struct NPNZ16b_s*);
383  void (*ctrl_Reset)(volatile struct NPNZ16b_s*);
384  void (*ctrl_Update)(volatile struct NPNZ16b_s*);
385  void (*ctrl_Precharge)(volatile struct NPNZ16b_s*, volatile fractional, volatile fractional);
386 
387 };
389 
390 /****************************************************************************************************
391  * @ingroup lib-layer-boost-converter-properties-private-data-types
392  * @struct BOOST_SWITCH_NODE_SETTINGS_s
393  * @brief Generic power converter switch-node specifications
394  * @extends BOOST_CONVERTER_s
395  *
396  * @details
397  * This data structure is used to set the converter switch-node specifications declaring which
398  * PWM channel is used as well as its switching frequency, phase-shift, dead times and duty ratio
399  * limits.
400  *
401  * *************************************************************************************************** */
403 
404  volatile uint16_t pwm_instance;
405  volatile uint16_t gpio_instance;
406  volatile uint16_t gpio_high;
407  volatile uint16_t gpio_low;
408  volatile bool swap_outputs;
409  volatile bool master_period_enable;
410  volatile bool high_resolution_enable;
411  volatile bool sync_drive;
412  volatile uint16_t period;
413  volatile uint16_t phase;
414  volatile uint16_t duty_ratio_init;
415  volatile uint16_t duty_ratio_min;
416  volatile uint16_t duty_ratio_max;
417  volatile uint16_t dead_time_rising;
418  volatile uint16_t dead_time_falling;
419  volatile uint16_t leb_period;
420  volatile uint16_t trigger_scaler;
421  volatile uint16_t trigger_offset;
422 
423 };
425 
426 /****************************************************************************************************
427  * @ingroup lib-layer-boost-converter-properties-private-data-types
428  * @struct BOOST_ADC_INPUT_SCALING_s
429  * @brief Generic power converter feedback specifications
430  * @extends BOOST_ADC_INPUT_SETTINGS_s
431  * @details
432  * This data structure is used to set the converter feedback specifications declaring which
433  * ADC channels are used including the individual AD input configuration such as trigger mode,
434  * input mode, result format and value normalization.
435  *
436  * *************************************************************************************************** */
438 
439  volatile int16_t factor;
440  volatile int16_t scaler;
441  volatile int16_t offset;
442 
443 };
445 
446 /****************************************************************************************************
447  * @ingroup lib-layer-boost-converter-properties-private-data-types
448  * @struct BOOST_ADC_INPUT_SETTINGS_s
449  * @brief Generic power converter ADC input channel configuration
450  * @extends BOOST_FEEDBACK_SETTINGS_s
451  * *************************************************************************************************** */
453 
454  volatile bool enabled;
455  volatile uint16_t* adc_buffer;
456  volatile uint16_t gpio_instance;
457  volatile uint8_t adc_input;
458  volatile uint8_t adc_core;
459  volatile uint8_t trigger_source;
460  volatile bool interrupt_enable;
461  volatile bool early_interrupt_enable;
462  volatile bool differential_input;
463  volatile bool signed_result;
464  volatile bool level_trigger;
466 
467 };
469 
470 /****************************************************************************************************
471  * @ingroup lib-layer-boost-converter-properties-private-data-types
472  * @struct BOOST_FEEDBACK_SETTINGS_s
473  * @brief Power converter feedback input channel declarations
474  * @extends BOOST_CONVERTER_s
475  * *************************************************************************************************** */
477 
480  volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_isns[BOOST_MPHASE_COUNT];
482 
483 };
485 
486 /****************************************************************************************************
487  * @ingroup lib-layer-boost-converter-properties-private-data-types
488  * @struct BOOST_GPIO_INSTANCE_s
489  * @brief Generic power converter GPIO specifications
490  * @extends BOOST_GPIO_SETTINGS_s
491  *
492  * @details
493  * This data structure is used to set the converter GPIO specifications declaring which
494  * if and which additional GPIOs are used by the converter controller, such as POWER_GOOD.
495  *
496  * *************************************************************************************************** */
498 
499  volatile bool enabled;
500  volatile uint16_t port;
501  volatile uint16_t pin;
502  volatile uint16_t polarity;
503  volatile uint16_t io_type;
504 
505 };
507 
508 /****************************************************************************************************
509  * @ingroup lib-layer-boost-converter-properties-private-data-types
510  * @struct BOOST_GPIO_SETTINGS_s
511  * @brief Generic power converter GPIO specifications
512  * @extends BOOST_CONVERTER_s
513  * *************************************************************************************************** */
515 
518 
519 };
521 
522 /****************************************************************************************************
523  * @ingroup lib-layer-boost-converter-properties-public-data-types
524  * @struct BOOST_CONVERTER_s
525  * @brief Boost Converter data object
526  *****************************************************************************************************/
528 {
530  volatile struct BOOST_STATE_ID_s state_id;
533  volatile struct BOOST_CONVERTER_DATA_s data;
535 
536  volatile struct BOOST_SWITCH_NODE_SETTINGS_s sw_node[BOOST_MPHASE_COUNT];
537  volatile struct BOOST_GPIO_SETTINGS_s gpio;
538 
539  volatile struct BOOST_LOOP_SETTINGS_s v_loop;
540  volatile struct BOOST_LOOP_SETTINGS_s i_loop[BOOST_MPHASE_COUNT];
541 
542 };
544 
545 
546 //#else
547 // #pragma message "Warning: dev_boost_typedef.h inclusion bypassed"
548 #endif /* BOOST_CONVERTER_TYPE_DEF_H */
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 uint32_t value
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.