| 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 **************************************************************************************************** */
166 struct BOOST_CONVERTER_CONSTANTS_s
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 };
174 typedef struct BOOST_CONVERTER_CONSTANTS_s BOOST_CONVERTER_CONSTANTS_t;
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 **************************************************************************************************** */
205 struct BOOST_CONVERTER_STATUS_s
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 **************************************************************************************************** */
239 struct BOOST_STATE_ID_s
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 **************************************************************************************************** */
264 struct BOOST_STARTUP_PERIOD_HANDLER_s {
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 **************************************************************************************************** */
287 struct BOOST_STARTUP_VCAP_PRECHARGE_s {
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 * *************************************************************************************************** */
304 struct BOOST_CONVERTER_STARTUP_s {
305
306 volatile struct BOOST_STARTUP_PERIOD_HANDLER_s power_on_delay;
307 volatile struct BOOST_STARTUP_PERIOD_HANDLER_s power_good_delay;
308 volatile struct BOOST_STARTUP_PERIOD_HANDLER_s i_ramp;
309 volatile struct BOOST_STARTUP_PERIOD_HANDLER_s v_ramp;
310 volatile struct BOOST_STARTUP_VCAP_PRECHARGE_s vcap_monitor;
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 **************************************************************************************************** */
322 struct BOOST_CONVERTER_DATA_s {
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 **************************************************************************************************** */
348 struct BOOST_CONVERTER_SETTINGS_s {
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 };
357 typedef struct BOOST_CONVERTER_SETTINGS_s BOOST_CONVERTER_SETTINGS_t;
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 * *************************************************************************************************** */
371 struct BOOST_LOOP_SETTINGS_s {
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 };
388 typedef struct BOOST_LOOP_SETTINGS_s BOOST_LOOP_SETTINGS_t;
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 * *************************************************************************************************** */
402 struct BOOST_SWITCH_NODE_SETTINGS_s {
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 };
424 typedef struct BOOST_SWITCH_NODE_SETTINGS_s BOOST_SWITCH_NODE_SETTINGS_t;
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 * *************************************************************************************************** */
437 struct BOOST_ADC_INPUT_SCALING_s {
438
439 volatile int16_t factor;
440 volatile int16_t scaler;
441 volatile int16_t offset;
442
443 };
444 typedef struct BOOST_ADC_INPUT_SCALING_s BOOST_ADC_INPUT_SCALING_t;
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 * *************************************************************************************************** */
452 struct BOOST_ADC_INPUT_SETTINGS_s {
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;
465 volatile struct BOOST_ADC_INPUT_SCALING_s scaling;
466
467 };
468 typedef struct BOOST_ADC_INPUT_SETTINGS_s BOOST_ADC_INPUT_SETTINGS_t;
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 * *************************************************************************************************** */
476 struct BOOST_FEEDBACK_SETTINGS_s {
477
478 volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_vin;
479 volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_vout;
480 volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_isns[BOOST_MPHASE_COUNT];
481 volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_temp;
482
483 };
484 typedef struct BOOST_FEEDBACK_SETTINGS_s BOOST_FEEDBACK_SETTINGS_t;
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 * *************************************************************************************************** */
497 struct BOOST_GPIO_INSTANCE_s {
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 };
506 typedef struct BOOST_GPIO_INSTANCE_s BOOST_GPIO_INSTANCE_t;
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 * *************************************************************************************************** */
514 struct BOOST_GPIO_SETTINGS_s {
515
516 volatile struct BOOST_GPIO_INSTANCE_s EnableInput;
517 volatile struct BOOST_GPIO_INSTANCE_s PowerGood;
518
519 };
520 typedef struct BOOST_GPIO_SETTINGS_s BOOST_GPIO_SETTINGS_t;
521
522 /****************************************************************************************************
523 * @ingroup lib-layer-boost-converter-properties-public-data-types
524 * @struct BOOST_CONVERTER_s
525 * @brief Boost Converter data object
526 *****************************************************************************************************/
527 struct BOOST_CONVERTER_s
528 {
529 volatile struct BOOST_CONVERTER_STATUS_s status;
530 volatile struct BOOST_STATE_ID_s state_id;
531 volatile struct BOOST_CONVERTER_STARTUP_s startup;
532 volatile struct BOOST_CONVERTER_SETTINGS_s set_values;
533 volatile struct BOOST_CONVERTER_DATA_s data;
534 volatile struct BOOST_FEEDBACK_SETTINGS_s feedback;
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 };
543 typedef struct BOOST_CONVERTER_s BOOST_POWER_CONTROLLER_t;
544
545
546 //#else
547 // #pragma message "Warning: dev_boost_typedef.h inclusion bypassed"
548 #endif /* BOOST_CONVERTER_TYPE_DEF_H */
BOOST_CONVERTER_SETTINGS_s::control_mode
enum BOOST_CONTROL_MODE_e control_mode
Fundamental control mode.
Definition: dev_boost_typedef.h:350
BOOST_ADC_INPUT_SETTINGS_s::trigger_source
volatile uint8_t trigger_source
input channel trigger source
Definition: dev_boost_typedef.h:459
BOOST_SWITCH_NODE_SETTINGS_s::pwm_instance
volatile uint16_t pwm_instance
number of the PWM channel used
Definition: dev_boost_typedef.h:404
BOOST_CONVERTER_CONSTANTS_s::OpStateOpCodes
enum BOOST_OPSTATES_e OpStateOpCodes
List of State Machine Operating State IDs.
Definition: dev_boost_typedef.h:169
BOOST_LOOP_SETTINGS_s::controller
volatile struct NPNZ16b_s * controller
pointer to control loop object data structure
Definition: dev_boost_typedef.h:380
BOOST_STARTUP_PERIOD_HANDLER_s
Definition: dev_boost_typedef.h:264
BOOST_ADC_INPUT_SCALING_s::factor
volatile int16_t factor
Fractional scaling factor (range -1 ... 0.99969)
Definition: dev_boost_typedef.h:439
BOOST_LOOP_SETTINGS_s::ctrl_Update
void(* ctrl_Update)(volatile struct NPNZ16b_s *)
Function pointer to UPDATE routine.
Definition: dev_boost_typedef.h:384
BOOST_STARTUP_VCAP_PRECHARGE_s::timeout
volatile uint16_t timeout
Soft-Start VCAP Charge-Up Monitor Period Counter Timeout (state machine fault state trigger)
Definition: dev_boost_typedef.h:292
BOOST_CONVERTER_STARTUP_s::v_ramp
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s v_ramp
Voltage Ramp-Up period deinitions.
Definition: dev_boost_typedef.h:309
BOOST_SWITCH_NODE_SETTINGS_s::dead_time_falling
volatile uint16_t dead_time_falling
Dead time setting at falling edge of a half-bridge drive.
Definition: dev_boost_typedef.h:418
BOOST_SWITCH_NODE_SETTINGS_s::leb_period
volatile uint16_t leb_period
Leading-Edge Blanking period.
Definition: dev_boost_typedef.h:419
BOOST_STATE_ID_s
Definition: dev_boost_typedef.h:239
BOOST_CONVERTER_STATUS_s::adc_active
volatile bool adc_active
Bit #1: indicating that ADC has been started and samples are taken.
Definition: dev_boost_typedef.h:210
BOOST_SWITCH_NODE_SETTINGS_s::swap_outputs
volatile bool swap_outputs
Selecting if PWMxH (default) or PWMxL should be the leading PWM output.
Definition: dev_boost_typedef.h:408
BOOST_CONVERTER_STATUS_s::fault_active
volatile bool fault_active
Bit #5: Flag bit indicating system is in enforced shut down mode (usually due to a fault condition)
Definition: dev_boost_typedef.h:214
BOOST_SWITCH_NODE_SETTINGS_s::trigger_scaler
volatile uint16_t trigger_scaler
PWM triggers for ADC will be generated every n-th cycle.
Definition: dev_boost_typedef.h:420
BOOST_SWITCH_NODE_SETTINGS_s::high_resolution_enable
volatile bool high_resolution_enable
Selecting if PWM module should use high-resolution mode.
Definition: dev_boost_typedef.h:410
BOOST_CONVERTER_STATUS_s
Definition: dev_boost_typedef.h:205
BOOST_CONVERTER_DATA_s::control_output
volatile uint16_t control_output
BOOST most recent control output value.
Definition: dev_boost_typedef.h:332
BOOST_CONVERTER_STATUS_s::unsigned
volatile unsigned
Bit #3: (reserved)
Definition: dev_boost_typedef.h:212
BOOST_ADC_INPUT_SETTINGS_s::adc_input
volatile uint8_t adc_input
number of the ADC input channel used
Definition: dev_boost_typedef.h:457
BOOST_STARTUP_PERIOD_HANDLER_s::period
volatile uint16_t period
Soft-Start Period (POD, RAMP PERIOD, PGD, etc.)
Definition: dev_boost_typedef.h:267
BOOST_CONVERTER_SETTINGS_s::i_ref_startup
volatile uint16_t i_ref_startup
User setting of the initial current reference at startup (used to limit startup currents)
Definition: dev_boost_typedef.h:354
BOOST_CONVERTER_s::sw_node
volatile struct BOOST_SWITCH_NODE_SETTINGS_s sw_node[BOOST_MPHASE_COUNT]
BOOST converter switch node settings.
Definition: dev_boost_typedef.h:536
BOOST_FEEDBACK_SETTINGS_s::ad_vout
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_vout
ADC input sampling output voltage.
Definition: dev_boost_typedef.h:479
BOOST_SWITCH_NODE_SETTINGS_s::dead_time_rising
volatile uint16_t dead_time_rising
Dead time setting at rising edge of a half-bridge drive.
Definition: dev_boost_typedef.h:417
BOOST_ADC_INPUT_SETTINGS_s::enabled
volatile bool enabled
input channel enable bit
Definition: dev_boost_typedef.h:454
BOOST_CONVERTER_SETTINGS_s::v_ref
volatile uint16_t v_ref
User reference setting used to control the power converter controller.
Definition: dev_boost_typedef.h:352
BOOST_SWITCH_NODE_SETTINGS_s::gpio_instance
volatile uint16_t gpio_instance
GPIO instance of the selected PWM generator.
Definition: dev_boost_typedef.h:405
BOOST_CONVERTER_CONSTANTS_s::ControlModes
enum BOOST_CONTROL_MODE_e ControlModes
List of Supported Control Modes.
Definition: dev_boost_typedef.h:172
BOOST_CONVERTER_DATA_s::control_error
volatile uint16_t control_error
BOOST most recent control error value.
Definition: dev_boost_typedef.h:331
BOOST_CONVERTER_s::v_loop
volatile struct BOOST_LOOP_SETTINGS_s v_loop
BOOST voltage control loop object.
Definition: dev_boost_typedef.h:539
BOOST_STARTUP_VCAP_PRECHARGE_s::period
volatile uint16_t period
Soft-Start VCAP Charge-Up Period (minimum time to wait when voltage has settled)
Definition: dev_boost_typedef.h:290
BOOST_STARTUP_VCAP_PRECHARGE_s::counter
volatile uint16_t counter
Soft-Start VCAP Charge-Up Period Counter.
Definition: dev_boost_typedef.h:289
BOOST_STARTUP_PERIOD_HANDLER_s::ref_inc_step
volatile uint16_t ref_inc_step
Size/value of one reference increment/decrement or this period.
Definition: dev_boost_typedef.h:269
BOOST_SWITCH_NODE_SETTINGS_s::duty_ratio_init
volatile uint16_t duty_ratio_init
Initial duty cycle when the PWM module is being turned on.
Definition: dev_boost_typedef.h:414
BOOST_CONVERTER_SETTINGS_s::no_of_phases
volatile uint16_t no_of_phases
number of converter phases
Definition: dev_boost_typedef.h:351
BOOST_CONVERTER_SETTINGS_s::i_ref
volatile uint16_t i_ref
User reference setting used to control the power converter controller.
Definition: dev_boost_typedef.h:353
BOOST_CONVERTER_CONSTANTS_s::SubStateOpCodes
enum BOOST_SUBSTATES_e SubStateOpCodes
List of State Machine Sub-State IDs.
Definition: dev_boost_typedef.h:170
BOOST_STARTUP_VCAP_PRECHARGE_s
Definition: dev_boost_typedef.h:287
BOOST_GPIO_INSTANCE_s::io_type
volatile uint16_t io_type
Input/Output definition (0=push-pull output, 1=input, 2=open-drain output)
Definition: dev_boost_typedef.h:503
BOOST_CONVERTER_CONSTANTS_s::OpStateReturnValues
enum BOOST_OPSTATE_RETURNS_e OpStateReturnValues
List of State Machine Operating State Return Values.
Definition: dev_boost_typedef.h:171
BOOST_STATE_ID_s::value
volatile uint32_t value
Definition: dev_boost_typedef.h:246
BOOST_SWITCH_NODE_SETTINGS_s::gpio_low
volatile uint16_t gpio_low
GPIO port pin-number of PWMxL of the selected PWM generator.
Definition: dev_boost_typedef.h:407
BOOST_SWITCH_NODE_SETTINGS_s::period
volatile uint16_t period
Switching period.
Definition: dev_boost_typedef.h:412
BOOST_SWITCH_NODE_SETTINGS_s::sync_drive
volatile bool sync_drive
Selecting if switch node is driven in synchronous or asnchronous mode.
Definition: dev_boost_typedef.h:411
BOOST_SWITCH_NODE_SETTINGS_s::phase
volatile uint16_t phase
Switching signal phase-shift.
Definition: dev_boost_typedef.h:413
BOOST_SWITCH_NODE_SETTINGS_s::gpio_high
volatile uint16_t gpio_high
GPIO port pin-number of PWMxH of the selected PWM generator.
Definition: dev_boost_typedef.h:406
BOOST_FEEDBACK_SETTINGS_s::ad_temp
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_temp
ADC input sampling temperature.
Definition: dev_boost_typedef.h:481
BOOST_LOOP_SETTINGS_s::minimum
volatile uint16_t minimum
output clamping value (minimum)
Definition: dev_boost_typedef.h:377
BOOST_LOOP_SETTINGS_s::feedback_offset
volatile uint16_t feedback_offset
Feedback offset value for calibration or bi-direction feedback signals.
Definition: dev_boost_typedef.h:375
BOOST_SWITCH_NODE_SETTINGS_s
Switching signal timing settings.
Definition: dev_boost_typedef.h:402
BOOST_CONVERTER_DATA_s::temp
volatile uint16_t temp
BOOST board temperature.
Definition: dev_boost_typedef.h:328
BOOST_ADC_INPUT_SETTINGS_s::adc_buffer
volatile uint16_t * adc_buffer
pointer to ADC result buffer
Definition: dev_boost_typedef.h:455
BOOST_CONVERTER_DATA_s::v_in
volatile uint16_t v_in
BOOST input voltage.
Definition: dev_boost_typedef.h:326
BOOST_GPIO_INSTANCE_s::pin
volatile uint16_t pin
GPIO port pin number.
Definition: dev_boost_typedef.h:501
BOOST_CONVERTER_STATUS_s::suspend
volatile bool suspend
Bit #6: Control bit to put the converter in suspend mode (turned off while ENABLE bit is still on)
Definition: dev_boost_typedef.h:215
BOOST_LOOP_SETTINGS_s::ctrl_Initialize
volatile uint16_t(* ctrl_Initialize)(volatile struct NPNZ16b_s *)
Function pointer to INIT routine.
Definition: dev_boost_typedef.h:382
BOOST_CONVERTER_STATUS_s::enabled
volatile bool enabled
Bit #15: Control bit enabling/disabling the charger port.
Definition: dev_boost_typedef.h:225
BOOST_CONVERTER_s::startup
volatile struct BOOST_CONVERTER_STARTUP_s startup
BOOST startup timing settings.
Definition: dev_boost_typedef.h:531
BOOST_LOOP_SETTINGS_s::ctrl_Reset
void(* ctrl_Reset)(volatile struct NPNZ16b_s *)
Function pointer to RESET routine.
Definition: dev_boost_typedef.h:383
BOOST_CONVERTER_STATUS_s::busy
volatile bool busy
Bit #7: Flag bit indicating that the state machine is executing a process (e.g. startup-ramp)
Definition: dev_boost_typedef.h:216
BOOST_CONVERTER_STARTUP_s::power_good_delay
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s power_good_delay
Power-Good Delay period deinitions.
Definition: dev_boost_typedef.h:307
BOOST_ADC_INPUT_SETTINGS_s::gpio_instance
volatile uint16_t gpio_instance
GPIO instance of the selected PWM generator.
Definition: dev_boost_typedef.h:456
BOOST_CONVERTER_DATA_s::i_out
volatile uint16_t i_out
BOOST common output current.
Definition: dev_boost_typedef.h:325
BOOST_GPIO_SETTINGS_s
GPIO instance of the converter control GPIO.
Definition: dev_boost_typedef.h:514
BOOST_GPIO_INSTANCE_s::enabled
volatile bool enabled
Specifies, if this IO is used or not.
Definition: dev_boost_typedef.h:499
BOOST_ADC_INPUT_SETTINGS_s::adc_core
volatile uint8_t adc_core
number of the ADC core connected to the selected channel
Definition: dev_boost_typedef.h:458
BOOST_CONVERTER_STATUS_s::ready
volatile bool ready
Bit #0: status bit, indicating boost converter is initialized and ready to run.
Definition: dev_boost_typedef.h:209
BOOST_FEEDBACK_SETTINGS_s::ad_vin
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_vin
ADC input sampling input voltage.
Definition: dev_boost_typedef.h:478
BOOST_LOOP_SETTINGS_s::ctrl_Precharge
void(* ctrl_Precharge)(volatile struct NPNZ16b_s *, volatile fractional, volatile fractional)
Function pointer to PRECHARGE routine.
Definition: dev_boost_typedef.h:385
BOOST_CONVERTER_STATUS_s::pwm_active
volatile bool pwm_active
Bit #2: indicating that PWM has been started and ADC triggers are generated.
Definition: dev_boost_typedef.h:211
BOOST_GPIO_SETTINGS_s::PowerGood
volatile struct BOOST_GPIO_INSTANCE_s PowerGood
Power Good Output.
Definition: dev_boost_typedef.h:517
BOOST_STATE_ID_s::bits
struct BOOST_STATE_ID_s::@372::@373 bits
BOOST_SWITCH_NODE_SETTINGS_s::duty_ratio_max
volatile uint16_t duty_ratio_max
Absolute duty cycle maximum during normal operation.
Definition: dev_boost_typedef.h:416
BOOST_LOOP_SETTINGS_s::reference
volatile uint16_t reference
Control loop reference variable.
Definition: dev_boost_typedef.h:374
BOOST_CONVERTER_DATA_s
Definition: dev_boost_typedef.h:322
BOOST_CONVERTER_DATA_s::control_input
volatile uint16_t control_input
BOOST most recent control input value (raw input)
Definition: dev_boost_typedef.h:330
NPNZ16b_s
Definition: npnz16b.h:502
BOOST_STARTUP_PERIOD_HANDLER_s::counter
volatile uint16_t counter
Soft-Start Execution Counter (read only)
Definition: dev_boost_typedef.h:266
BOOST_CONVERTER_STARTUP_s::vcap_monitor
volatile struct BOOST_STARTUP_VCAP_PRECHARGE_s vcap_monitor
Output Capacitor Charging Time period deinitions.
Definition: dev_boost_typedef.h:310
BOOST_CONVERTER_CONSTANTS_s::StatusFlags
enum BOOST_STATUS_FLAGS_e StatusFlags
List of all status and control flags of the Boost Converter status word.
Definition: dev_boost_typedef.h:168
BOOST_CONVERTER_s::data
volatile struct BOOST_CONVERTER_DATA_s data
BOOST runtime data.
Definition: dev_boost_typedef.h:533
BOOST_CONVERTER_STATUS_s::async_mode
volatile bool async_mode
Bit #9: Control bit suspending the synchronous rectifier switch PWM channel.
Definition: dev_boost_typedef.h:219
BOOST_STARTUP_VCAP_PRECHARGE_s::v_drop
volatile uint16_t v_drop
Acceptable voltage drop between input and output voltage when output capacitor is charging up.
Definition: dev_boost_typedef.h:293
BOOST_CONVERTER_s::i_loop
volatile struct BOOST_LOOP_SETTINGS_s i_loop[BOOST_MPHASE_COUNT]
BOOST Current control loop objects.
Definition: dev_boost_typedef.h:540
BOOST_ADC_INPUT_SETTINGS_s::differential_input
volatile bool differential_input
input channel differential mode enable bit
Definition: dev_boost_typedef.h:462
BOOST_ADC_INPUT_SETTINGS_s
ADC input channel configuration.
Definition: dev_boost_typedef.h:452
BOOST_GPIO_INSTANCE_s::polarity
volatile uint16_t polarity
Output polarity, where 0=ACTIVE HIGH, 1=ACTIVE_LOW.
Definition: dev_boost_typedef.h:502
BOOST_LOOP_SETTINGS_s
Boost converter main settingsUser defined settings for control loops;
Definition: dev_boost_typedef.h:371
BOOST_ADC_INPUT_SETTINGS_s::early_interrupt_enable
volatile bool early_interrupt_enable
input channel early interrupt enable bit
Definition: dev_boost_typedef.h:461
BOOST_CONVERTER_STATUS_s::cs_calib_complete
volatile bool cs_calib_complete
Bit #4: indicating that current sensor calibration has completed.
Definition: dev_boost_typedef.h:213
BOOST_STATE_ID_s::substate_id
enum BOOST_SUBSTATES_e substate_id
Most recent operating state of active sub state machine.
Definition: dev_boost_typedef.h:244
BOOST_STARTUP_VCAP_PRECHARGE_s::timeout_counter
volatile uint16_t timeout_counter
Soft-Start VCAP Charge-Up Timeout Counter.
Definition: dev_boost_typedef.h:291
BOOST_ADC_INPUT_SETTINGS_s::scaling
volatile struct BOOST_ADC_INPUT_SCALING_s scaling
normalization scaling settings
Definition: dev_boost_typedef.h:465
BOOST_CONVERTER_STARTUP_s
Definition: dev_boost_typedef.h:304
BOOST_CONVERTER_DATA_s::i_sns
volatile uint16_t i_sns[BOOST_MPHASE_COUNT]
BOOST output current.
Definition: dev_boost_typedef.h:324
BOOST_CONVERTER_STATUS_s::value
volatile uint16_t value
Definition: dev_boost_typedef.h:228
BOOST_LOOP_SETTINGS_s::maximum
volatile uint16_t maximum
output clamping value (maximum)
Definition: dev_boost_typedef.h:378
BOOST_CONVERTER_DATA_s::v_out
volatile uint16_t v_out
BOOST output voltage.
Definition: dev_boost_typedef.h:327
BOOST_CONVERTER_s::feedback
volatile struct BOOST_FEEDBACK_SETTINGS_s feedback
BOOST converter feedback settings.
Definition: dev_boost_typedef.h:534
BOOST_ADC_INPUT_SETTINGS_s::interrupt_enable
volatile bool interrupt_enable
input channel interrupt enable bit
Definition: dev_boost_typedef.h:460
BOOST_GPIO_INSTANCE_s
GPIO instance of the converter control GPIO.
Definition: dev_boost_typedef.h:497
BOOST_CONVERTER_s::status
volatile struct BOOST_CONVERTER_STATUS_s status
BOOST operation status bits.
Definition: dev_boost_typedef.h:529
BOOST_ADC_INPUT_SCALING_s
ADC input signal scaling = (ADCBUF - <offset>) * <factor> >> 2^<scaler>
Definition: dev_boost_typedef.h:437
BOOST_SWITCH_NODE_SETTINGS_s::trigger_offset
volatile uint16_t trigger_offset
PWM triggers for ADC will be offset by n cycles.
Definition: dev_boost_typedef.h:421
BOOST_STARTUP_PERIOD_HANDLER_s::reference
volatile uint16_t reference
Internal dummy reference used to increment/decrement controller reference.
Definition: dev_boost_typedef.h:268
BOOST_ADC_INPUT_SETTINGS_s::signed_result
volatile bool signed_result
input channel singed result mode enable bit
Definition: dev_boost_typedef.h:463
BOOST_GPIO_INSTANCE_s::port
volatile uint16_t port
GPIO port instance number (0=Port RA, 0=Port RB, 0=Port RC, etc.)
Definition: dev_boost_typedef.h:500
BOOST_ADC_INPUT_SCALING_s::offset
volatile int16_t offset
Signal offset as signed integer to be subtracted from ADC input.
Definition: dev_boost_typedef.h:441
BOOST_CONVERTER_STATUS_s::GO
volatile bool GO
Bit #13: When set, the GO-bit fires up the power supply.
Definition: dev_boost_typedef.h:223
BOOST_CONVERTER_SETTINGS_s
Definition: dev_boost_typedef.h:348
BOOST_CONVERTER_STATUS_s::cs_calib_enable
volatile bool cs_calib_enable
Bit #8: Flag bit indicating that current sensors need to calibrated.
Definition: dev_boost_typedef.h:218
BOOST_SWITCH_NODE_SETTINGS_s::duty_ratio_min
volatile uint16_t duty_ratio_min
Absolute duty cycle minimum during normal operation.
Definition: dev_boost_typedef.h:415
BOOST_CONVERTER_CONSTANTS_s
Definition: dev_boost_typedef.h:166
BOOST_CONVERTER_s::gpio
volatile struct BOOST_GPIO_SETTINGS_s gpio
BOOST converter additional GPIO specification.
Definition: dev_boost_typedef.h:537
BOOST_CONVERTER_STARTUP_s::power_on_delay
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s power_on_delay
Power-On Delay period deinitions.
Definition: dev_boost_typedef.h:306
BOOST_CONVERTER_s::state_id
volatile struct BOOST_STATE_ID_s state_id
BOOST state machine operating state ID.
Definition: dev_boost_typedef.h:530
BOOST_SWITCH_NODE_SETTINGS_s::master_period_enable
volatile bool master_period_enable
Selecting MASTER or Individual period register.
Definition: dev_boost_typedef.h:409
BOOST_GPIO_SETTINGS_s::EnableInput
volatile struct BOOST_GPIO_INSTANCE_s EnableInput
External ENABLE input.
Definition: dev_boost_typedef.h:516
BOOST_CONVERTER_STARTUP_s::i_ramp
volatile struct BOOST_STARTUP_PERIOD_HANDLER_s i_ramp
Current Ramp-Up period deinitions.
Definition: dev_boost_typedef.h:308
BOOST_CONVERTER_s
BOOST control & monitoring data structure.
Definition: dev_boost_typedef.h:527
BOOST_CONVERTER_STATUS_s::autorun
volatile bool autorun
Bit #14: Control bit determining if charger is starting automatically or on command (using the GO bit...
Definition: dev_boost_typedef.h:224
BOOST_FEEDBACK_SETTINGS_s
Boost converter feedback declarations.
Definition: dev_boost_typedef.h:476
BOOST_LOOP_SETTINGS_s::trigger_offset
volatile uint16_t trigger_offset
ADC trigger offset value for trigger fine-tuning.
Definition: dev_boost_typedef.h:376
BOOST_STATE_ID_s::opstate_id
enum BOOST_OPSTATES_e opstate_id
Most recent operating state of main state machine.
Definition: dev_boost_typedef.h:243
BOOST_FEEDBACK_SETTINGS_s::ad_isns
volatile struct BOOST_ADC_INPUT_SETTINGS_s ad_isns[BOOST_MPHASE_COUNT]
ADC input sampling phase current.
Definition: dev_boost_typedef.h:480
BOOST_ADC_INPUT_SETTINGS_s::level_trigger
volatile bool level_trigger
input channel level trigger mode enable bit
Definition: dev_boost_typedef.h:464
BOOST_CONVERTER_s::set_values
volatile struct BOOST_CONVERTER_SETTINGS_s set_values
Control field for global access to references.
Definition: dev_boost_typedef.h:532
BOOST_ADC_INPUT_SCALING_s::scaler
volatile int16_t scaler
Feedback bit-shift scaler used for number normalization.
Definition: dev_boost_typedef.h:440