Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
dev_buck_typedef.h
1 
33 /*
34  * File: dev_buck_typedef.h
35  * Author: M91406
36  * Comments: Type definitions of single- and multiphase Buck 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 BUCK_CONVERTER_TYPE_DEF_H
46 #define BUCK_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 
62 #define BUCK_MPHASE_COUNT BUCK_NO_OF_PHASES
63 
64 // Controller Status Bits
65 
72 {
73  BUCK_STAT_READY = 0b0000000000000001,
74  BUCK_STAT_ADC_ACTIVE = 0b0000000000000010,
75  BUCK_STAT_PWM_ACTIVE = 0b0000000000000100,
76  BUCK_STAT_POWERSOURCE_DETECTED = 0b0000000000001000,
77  BUCK_STAT_CS_SENSE_READY = 0b0000000000010000,
78 
79  BUCK_STAT_FORCED_SHUT_DOWN = 0b0000000010000000,
80  BUCK_STAT_BUSY = 0b0000000100000000,
81 
82 // Controller Control Bits
83  BUCK_STAT_GO = 0b0010000000000000,
84  BUCK_STAT_AUTORUN = 0b0100000000000000,
85  BUCK_STAT_NO_AUTORUN = 0b0000000000000000,
86 
87  BUCK_STAT_ENABLED = 0b1000000000000000,
88  BUCK_STAT_DISABLED = 0b0000000000000000
89 };
90 typedef enum BUCK_STATUS_FLAGS_e BUCK_STATUS_FLAGS_t;
91 
92 
100 
101  BUCK_OPSTATE_ERROR = 0x00,
102  BUCK_OPSTATE_INITIALIZE = 0x01,
103  BUCK_OPSTATE_RESET = 0x02,
104  BUCK_OPSTATE_STANDBY = 0x03,
105  BUCK_OPSTATE_RAMPUP = 0x04,
106  BUCK_OPSTATE_ONLINE = 0x05
107 
108 };
109 typedef enum BUCK_OPSTATES_e BUCK_OPSTATE_t;
110 
111 
118 enum BUCK_SUBSTATES_e { // Enumeration of state machine operating sub-states
119 
120  BUCK_OPSTATE_POWER_ON_DELAY = 0x00,
121  BUCK_OPSTATE_PREPARE_V_RAMP = 0x01,
122  BUCK_OPSTATE_V_RAMP_UP = 0x02,
123  BUCK_OPSTATE_I_RAMP_UP = 0x03,
124  BUCK_OPSTATE_PWRGOOD_DELAY = 0x04
125 
126 };
127 typedef enum BUCK_SUBSTATES_e BUCK_OP_SUBSTATES_t;
128 
129 
135 enum BUCK_OPSTATE_RETURNS_e { // Enumeration of state machine operating state return values
136 
137  BUCK_OPSRET_ERROR = 0x0000,
138  BUCK_OPSRET_COMPLETE = 0x0001,
139  BUCK_OPSRET_REPEAT = 0x0002
140 
141 }; // Enumeration of state machine operating state return values
142 typedef enum BUCK_OPSTATE_RETURNS_e BUCK_OPSTATE_RETURNS_t; // State Machine Operating State Return Values
143 
144 
152 
153  BUCK_CONTROL_MODE_VMC = 0,
154 // BUCK_CONTROL_MODE_PCMC = 1, // Peak Current Mode Control (not supported yet)
155  BUCK_CONTROL_MODE_ACMC = 2
156 
157 };
158 typedef enum BUCK_CONTROL_MODE_e BUCK_CONTROL_MODE_t;
159 
160 
166 {
167  volatile enum BUCK_STATUS_FLAGS_e StatusFlags;
168  volatile enum BUCK_OPSTATES_e OpStateOpCodes;
169  volatile enum BUCK_SUBSTATES_e SubStateOpCodes;
171  volatile enum BUCK_CONTROL_MODE_e ControlModes;
172 };
174 
175 
181 
182 
205 {
206  union {
207  struct{
208  volatile bool ready:1;
209  volatile bool adc_active:1;
210  volatile bool pwm_active:1;
211  volatile unsigned :1;
212  volatile bool cs_calib_complete :1;
213  volatile bool fault_active :1;
214  volatile bool suspend :1;
215  volatile bool busy :1;
216 
217  volatile bool cs_calib_enable :1;
218  volatile bool async_mode :1;
219  volatile unsigned :1;
220  volatile unsigned :1;
221  volatile unsigned :1;
222  volatile bool GO :1;
223  volatile bool autorun :1;
224  volatile bool enabled :1;
225  } __attribute__((packed)) bits;
226 
227  volatile uint16_t value; // buffer for 16-bit word read/write operations
228  };
229 }; // Buck Converter Status & Control word
230 typedef struct BUCK_CONVERTER_STATUS_s BUCK_CONVERTER_STATUS_t; // Buck Converter Status & Control word data type
231 
232 
239 {
240  union {
241  struct {
242  volatile enum BUCK_OPSTATES_e opstate_id;
243  volatile enum BUCK_SUBSTATES_e substate_id;
244  } bits;
245  volatile uint32_t value; // full state ID value access to main and sub-state machine state
246  };
247 }; // Buck Converter State Machine operating state ID
248 typedef struct BUCK_STATE_ID_s BUCK_STATE_ID_t; // Buck Converter State Machine operating state ID data type
249 
250 
264 
265  volatile uint16_t counter;
266  volatile uint16_t period;
267  volatile uint16_t reference;
268  volatile uint16_t ref_inc_step;
269 
270 }; // Power converter soft-start auxiliary variables
271 typedef struct BUCK_STARTUP_PERIOD_HANDLER_s BUCK_STARTUP_PERIOD_HANDLER_t; // Power converter soft-start auxiliary variables data types
272 
273 
280 
283  volatile struct BUCK_STARTUP_PERIOD_HANDLER_s i_ramp;
284  volatile struct BUCK_STARTUP_PERIOD_HANDLER_s v_ramp;
285 
286 }; // Power converter start-up settings and variables
287 typedef struct BUCK_CONVERTER_STARTUP_s BUCK_CONVERTER_STARTUP_t; // Power converter start-up settings and variables data type
288 
289 
297 
298  volatile uint16_t i_sns[BUCK_MPHASE_COUNT];
299  volatile uint16_t i_out;
300  volatile uint16_t v_in;
301  volatile uint16_t v_out;
302  volatile uint16_t temp;
303 
304  volatile uint16_t control_input;
305  volatile uint16_t control_error;
306  volatile uint16_t control_output;
307 
308 }; // BUCK runtime data buffer
309 typedef struct BUCK_CONVERTER_DATA_s BUCK_CONVERTER_DATA_t; // BUCK runtime data buffer data type
310 
311 
323 
324  volatile enum BUCK_CONTROL_MODE_e control_mode;
325  volatile uint16_t no_of_phases;
326  volatile uint16_t v_ref;
327  volatile uint16_t i_ref;
328 
329 };
331 
332 
345 
346  // Properties (user settings)
347  volatile uint16_t reference;
348  volatile uint16_t feedback_offset;
349  volatile uint16_t trigger_offset;
350  volatile uint16_t minimum;
351  volatile uint16_t maximum;
352  // Control Loop Object
353  volatile struct NPNZ16b_s* controller;
354  // Function pointers
355  volatile uint16_t (*ctrl_Initialize)(volatile struct NPNZ16b_s*);
356  void (*ctrl_Reset)(volatile struct NPNZ16b_s*);
357  void (*ctrl_Update)(volatile struct NPNZ16b_s*);
358  void (*ctrl_Precharge)(volatile struct NPNZ16b_s*, volatile fractional, volatile fractional);
359 
360 };
362 
363 
376 
377  volatile uint16_t pwm_instance;
378  volatile uint16_t gpio_instance;
379  volatile uint16_t gpio_high;
380  volatile uint16_t gpio_low;
381  volatile bool swap_outputs;
382  volatile bool master_period_enable;
383  volatile bool high_resolution_enable;
384  volatile bool sync_drive;
385  volatile uint16_t period;
386  volatile uint16_t phase;
387  volatile uint16_t duty_ratio_init;
388  volatile uint16_t duty_ratio_min;
389  volatile uint16_t duty_ratio_max;
390  volatile uint16_t dead_time_rising;
391  volatile uint16_t dead_time_falling;
392  volatile uint16_t leb_period;
393  volatile uint16_t trigger_scaler;
394  volatile uint16_t trigger_offset;
395 
396 };
398 
399 
411 
412  volatile int16_t factor;
413  volatile int16_t scaler;
414  volatile int16_t offset;
415 
416 };
418 
419 
426 
427  volatile bool enabled;
428  volatile uint16_t* adc_buffer;
429  volatile uint16_t gpio_instance;
430  volatile uint8_t adc_input;
431  volatile uint8_t adc_core;
432  volatile uint8_t trigger_source;
433  volatile bool interrupt_enable;
434  volatile bool early_interrupt_enable;
435  volatile bool differential_input;
436  volatile bool signed_result;
437  volatile bool level_trigger;
438  volatile struct BUCK_ADC_INPUT_SCALING_s scaling;
439 
440 };
442 
443 
450 
451  volatile struct BUCK_ADC_INPUT_SETTINGS_s ad_vin;
452  volatile struct BUCK_ADC_INPUT_SETTINGS_s ad_vout;
454  volatile struct BUCK_ADC_INPUT_SETTINGS_s ad_temp;
455 
456 };
458 
459 
471 
472  volatile bool enabled;
473  volatile uint16_t port;
474  volatile uint16_t pin;
475  volatile uint16_t polarity;
476  volatile uint16_t io_type;
477 
478 };
480 
481 
488 
489  volatile struct BUCK_GPIO_INSTANCE_s EnableInput;
490  volatile struct BUCK_GPIO_INSTANCE_s PowerGood;
491 
492 };
494 
495 
501 {
502  volatile struct BUCK_CONVERTER_STATUS_s status;
503  volatile struct BUCK_STATE_ID_s state_id;
504  volatile struct BUCK_CONVERTER_STARTUP_s startup;
505  volatile struct BUCK_CONVERTER_SETTINGS_s set_values;
506  volatile struct BUCK_CONVERTER_DATA_s data;
507  volatile struct BUCK_FEEDBACK_SETTINGS_s feedback;
508 
510  volatile struct BUCK_GPIO_SETTINGS_s gpio;
511 
512  volatile struct BUCK_LOOP_SETTINGS_s v_loop;
514 
515 };
516 typedef struct BUCK_CONVERTER_s BUCK_CONVERTER_t;
517 
518 
519 //#else
520 // #pragma message "Warning: dev_buck_typedef.h inclusion bypassed"
521 #endif /* BUCK_CONVERTER_TYPE_DEF_H */
BUCK_CONVERTER_STATUS_s::async_mode
volatile bool async_mode
Bit #9: Control bit suspending the synchronous rectifier switch PWM channel.
Definition: dev_buck_typedef.h:218
BUCK_STARTUP_PERIOD_HANDLER_s::period
volatile uint16_t period
Soft-Start Period (POD, RAMP PERIOD, PGD, etc.)
Definition: dev_buck_typedef.h:266
BUCK_ADC_INPUT_SETTINGS_s::differential_input
volatile bool differential_input
input channel differential mode enable bit
Definition: dev_buck_typedef.h:435
BUCK_ADC_INPUT_SETTINGS_s::interrupt_enable
volatile bool interrupt_enable
input channel interrupt enable bit
Definition: dev_buck_typedef.h:433
BUCK_SWITCH_NODE_SETTINGS_s::gpio_high
volatile uint16_t gpio_high
GPIO port pin-number of PWMxH of the selected PWM generator.
Definition: dev_buck_typedef.h:379
BUCK_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_buck_typedef.h:390
BUCK_LOOP_SETTINGS_s::reference
volatile uint16_t reference
Control loop reference variable.
Definition: dev_buck_typedef.h:347
BUCK_SWITCH_NODE_SETTINGS_s::swap_outputs
volatile bool swap_outputs
Selecting if PWMxH (default) or PWMxL should be the leading PWM output.
Definition: dev_buck_typedef.h:381
BUCK_CONVERTER_s::startup
volatile struct BUCK_CONVERTER_STARTUP_s startup
BUCK startup timing settings.
Definition: dev_buck_typedef.h:504
BUCK_LOOP_SETTINGS_s::ctrl_Update
void(* ctrl_Update)(volatile struct NPNZ16b_s *)
Function pointer to UPDATE routine.
Definition: dev_buck_typedef.h:357
BUCK_STARTUP_PERIOD_HANDLER_s::counter
volatile uint16_t counter
Soft-Start Execution Counter (read only)
Definition: dev_buck_typedef.h:265
BUCK_CONVERTER_CONSTANTS_s::SubStateOpCodes
enum BUCK_SUBSTATES_e SubStateOpCodes
List of State Machine Sub-State IDs.
Definition: dev_buck_typedef.h:169
BUCK_CONVERTER_STARTUP_s::v_ramp
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s v_ramp
Definition: dev_buck_typedef.h:284
BUCK_CONVERTER_s::feedback
volatile struct BUCK_FEEDBACK_SETTINGS_s feedback
BUCK converter feedback settings.
Definition: dev_buck_typedef.h:507
BUCK_ADC_INPUT_SCALING_s::factor
volatile int16_t factor
Fractional scaling factor (range -1 ... 0.99969)
Definition: dev_buck_typedef.h:412
BUCK_FEEDBACK_SETTINGS_s
Buck converter feedback declarations.
Definition: dev_buck_typedef.h:449
BuckConverterConstants
volatile struct BUCK_CONVERTER_CONSTANTS_s BuckConverterConstants
Structure providing all public enumerated lists of constants.
BUCK_SWITCH_NODE_SETTINGS_s::trigger_scaler
volatile uint16_t trigger_scaler
PWM triggers for ADC will be generated every n-th cycle.
Definition: dev_buck_typedef.h:393
BUCK_CONVERTER_SETTINGS_s::control_mode
enum BUCK_CONTROL_MODE_e control_mode
Fundamental control mode.
Definition: dev_buck_typedef.h:324
BUCK_CONVERTER_DATA_s::v_in
volatile uint16_t v_in
BUCK input voltage.
Definition: dev_buck_typedef.h:300
BUCK_CONVERTER_CONSTANTS_s::StatusFlags
enum BUCK_STATUS_FLAGS_e StatusFlags
List of all status and control flags of the Buck Converter status word.
Definition: dev_buck_typedef.h:167
BUCK_LOOP_SETTINGS_s
User defined settings for control loops;.
Definition: dev_buck_typedef.h:344
BUCK_CONTROL_MODE_e
BUCK_CONTROL_MODE_e
Enumeration of the power supply mode control.
Definition: dev_buck_typedef.h:151
BUCK_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_buck_typedef.h:476
BUCK_CONVERTER_s::i_loop
volatile struct BUCK_LOOP_SETTINGS_s i_loop[BUCK_MPHASE_COUNT]
BUCK Current control loop objects.
Definition: dev_buck_typedef.h:513
BUCK_CONVERTER_s::status
volatile struct BUCK_CONVERTER_STATUS_s status
BUCK operation status bits.
Definition: dev_buck_typedef.h:502
NPNZ16b_s
Global NPNZ controller data object.
Definition: npnz16b.h:502
BUCK_CONVERTER_STARTUP_s
Power Converter Startup Timing Settings.
Definition: dev_buck_typedef.h:279
BUCK_ADC_INPUT_SETTINGS_s::adc_core
volatile uint8_t adc_core
number of the ADC core connected to the selected channel
Definition: dev_buck_typedef.h:431
BUCK_SWITCH_NODE_SETTINGS_s::gpio_instance
volatile uint16_t gpio_instance
GPIO instance of the selected PWM generator.
Definition: dev_buck_typedef.h:378
BUCK_SWITCH_NODE_SETTINGS_s::gpio_low
volatile uint16_t gpio_low
GPIO port pin-number of PWMxL of the selected PWM generator.
Definition: dev_buck_typedef.h:380
BUCK_ADC_INPUT_SETTINGS_s::trigger_source
volatile uint8_t trigger_source
input channel trigger source
Definition: dev_buck_typedef.h:432
BUCK_SWITCH_NODE_SETTINGS_s::duty_ratio_min
volatile uint16_t duty_ratio_min
Absolute duty cycle minimum during normal operation.
Definition: dev_buck_typedef.h:388
BUCK_CONVERTER_DATA_s::control_input
volatile uint16_t control_input
BUCK most recent control input value (raw input)
Definition: dev_buck_typedef.h:304
BUCK_GPIO_SETTINGS_s
GPIO instance of the converter control GPIO.
Definition: dev_buck_typedef.h:487
BUCK_ADC_INPUT_SETTINGS_s
ADC input channel configuration.
Definition: dev_buck_typedef.h:425
BUCK_CONVERTER_DATA_s::i_sns
volatile uint16_t i_sns[BUCK_MPHASE_COUNT]
BUCK output current.
Definition: dev_buck_typedef.h:298
BUCK_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_buck_typedef.h:215
BUCK_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_buck_typedef.h:213
BUCK_ADC_INPUT_SETTINGS_s::enabled
volatile bool enabled
input channel enable bit
Definition: dev_buck_typedef.h:427
BUCK_SWITCH_NODE_SETTINGS_s::sync_drive
volatile bool sync_drive
Selecting if switch node is driven in synchronous or asnchronous mode.
Definition: dev_buck_typedef.h:384
BUCK_STARTUP_PERIOD_HANDLER_s::reference
volatile uint16_t reference
Internal dummy reference used to increment/decrement controller reference.
Definition: dev_buck_typedef.h:267
BUCK_GPIO_INSTANCE_s::polarity
volatile uint16_t polarity
Output polarity, where 0=ACTIVE HIGH, 1=ACTIVE_LOW.
Definition: dev_buck_typedef.h:475
BUCK_CONVERTER_STATUS_s::unsigned
volatile unsigned
Bit #3: (reserved)
Definition: dev_buck_typedef.h:211
BUCK_LOOP_SETTINGS_s::minimum
volatile uint16_t minimum
output clamping value (minimum)
Definition: dev_buck_typedef.h:350
BUCK_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_buck_typedef.h:214
BUCK_CONVERTER_STATUS_s
Generic power controller status word.
Definition: dev_buck_typedef.h:205
BUCK_STATE_ID_s::opstate_id
enum BUCK_OPSTATES_e opstate_id
Most recent operating state of main state machine.
Definition: dev_buck_typedef.h:242
BUCK_FEEDBACK_SETTINGS_s::ad_vout
volatile struct BUCK_ADC_INPUT_SETTINGS_s ad_vout
ADC input sampling output voltage.
Definition: dev_buck_typedef.h:452
BUCK_ADC_INPUT_SETTINGS_s::adc_input
volatile uint8_t adc_input
number of the ADC input channel used
Definition: dev_buck_typedef.h:430
BUCK_CONVERTER_STARTUP_s::power_on_delay
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s power_on_delay
Definition: dev_buck_typedef.h:281
BUCK_ADC_INPUT_SETTINGS_s::level_trigger
volatile bool level_trigger
input channel level trigger mode enable bit
Definition: dev_buck_typedef.h:437
BUCK_SWITCH_NODE_SETTINGS_s::pwm_instance
volatile uint16_t pwm_instance
number of the PWM channel used
Definition: dev_buck_typedef.h:377
BUCK_CONVERTER_CONSTANTS_s::OpStateOpCodes
enum BUCK_OPSTATES_e OpStateOpCodes
List of State Machine Operating State IDs.
Definition: dev_buck_typedef.h:168
BUCK_STATE_ID_s::value
volatile uint32_t value
Definition: dev_buck_typedef.h:245
BUCK_GPIO_INSTANCE_s::enabled
volatile bool enabled
Specifies, if this IO is used or not.
Definition: dev_buck_typedef.h:472
BUCK_SUBSTATES_e
BUCK_SUBSTATES_e
Enumeration of state machine operating sub-states.
Definition: dev_buck_typedef.h:118
BUCK_CONVERTER_STATUS_s::ready
volatile bool ready
Bit #0: status bit, indicating buck converter is initialized and ready to run.
Definition: dev_buck_typedef.h:208
BUCK_STATE_ID_s::substate_id
enum BUCK_SUBSTATES_e substate_id
Most recent operating state of active sub state machine.
Definition: dev_buck_typedef.h:243
BUCK_CONVERTER_SETTINGS_s
Generic power controller control settings.
Definition: dev_buck_typedef.h:322
BUCK_FEEDBACK_SETTINGS_s::ad_vin
volatile struct BUCK_ADC_INPUT_SETTINGS_s ad_vin
ADC input sampling input voltage.
Definition: dev_buck_typedef.h:451
BUCK_SWITCH_NODE_SETTINGS_s::phase
volatile uint16_t phase
Switching signal phase-shift.
Definition: dev_buck_typedef.h:386
BUCK_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_buck_typedef.h:387
BUCK_CONVERTER_STARTUP_s::i_ramp
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s i_ramp
Definition: dev_buck_typedef.h:283
BUCK_CONVERTER_CONSTANTS_s::OpStateReturnValues
enum BUCK_OPSTATE_RETURNS_e OpStateReturnValues
List of State Machine Operating State Return Values.
Definition: dev_buck_typedef.h:170
BUCK_SWITCH_NODE_SETTINGS_s::trigger_offset
volatile uint16_t trigger_offset
PWM triggers for ADC will be offset by n cycles.
Definition: dev_buck_typedef.h:394
BUCK_CONVERTER_s::sw_node
volatile struct BUCK_SWITCH_NODE_SETTINGS_s sw_node[BUCK_MPHASE_COUNT]
BUCK converter switch node settings.
Definition: dev_buck_typedef.h:509
BUCK_MPHASE_COUNT
#define BUCK_MPHASE_COUNT
Declaration of the number of power train phases of the Buck Converter.
Definition: dev_buck_typedef.h:62
BUCK_GPIO_SETTINGS_s::EnableInput
volatile struct BUCK_GPIO_INSTANCE_s EnableInput
External ENABLE input.
Definition: dev_buck_typedef.h:489
BUCK_GPIO_INSTANCE_s::port
volatile uint16_t port
GPIO port instance number (0=Port RA, 0=Port RB, 0=Port RC, etc.)
Definition: dev_buck_typedef.h:473
BUCK_LOOP_SETTINGS_s::ctrl_Initialize
volatile uint16_t(* ctrl_Initialize)(volatile struct NPNZ16b_s *)
Function pointer to INIT routine.
Definition: dev_buck_typedef.h:355
BUCK_CONVERTER_DATA_s::control_output
volatile uint16_t control_output
BUCK most recent control output value.
Definition: dev_buck_typedef.h:306
BUCK_CONVERTER_s::data
volatile struct BUCK_CONVERTER_DATA_s data
BUCK runtime data.
Definition: dev_buck_typedef.h:506
BUCK_LOOP_SETTINGS_s::ctrl_Reset
void(* ctrl_Reset)(volatile struct NPNZ16b_s *)
Function pointer to RESET routine.
Definition: dev_buck_typedef.h:356
BUCK_ADC_INPUT_SCALING_s::offset
volatile int16_t offset
Signal offset as signed integer to be subtracted from ADC input.
Definition: dev_buck_typedef.h:414
BUCK_CONVERTER_s::gpio
volatile struct BUCK_GPIO_SETTINGS_s gpio
BUCK converter additional GPIO specification.
Definition: dev_buck_typedef.h:510
BUCK_LOOP_SETTINGS_s::trigger_offset
volatile uint16_t trigger_offset
ADC trigger offset value for trigger fine-tuning.
Definition: dev_buck_typedef.h:349
BUCK_LOOP_SETTINGS_s::maximum
volatile uint16_t maximum
output clamping value (maximum)
Definition: dev_buck_typedef.h:351
BUCK_SWITCH_NODE_SETTINGS_s
Switching signal timing settings.
Definition: dev_buck_typedef.h:375
BUCK_LOOP_SETTINGS_s::ctrl_Precharge
void(* ctrl_Precharge)(volatile struct NPNZ16b_s *, volatile fractional, volatile fractional)
Function pointer to PRECHARGE routine.
Definition: dev_buck_typedef.h:358
BUCK_CONVERTER_DATA_s
Publicly accessible data buffer of most recent runtime data values.
Definition: dev_buck_typedef.h:296
BUCK_CONVERTER_SETTINGS_s::v_ref
volatile uint16_t v_ref
User reference setting used to control the power converter controller.
Definition: dev_buck_typedef.h:326
BUCK_CONVERTER_STATUS_s::cs_calib_enable
volatile bool cs_calib_enable
Bit #8: Flag bit indicating that current sensors need to calibrated.
Definition: dev_buck_typedef.h:217
BUCK_ADC_INPUT_SCALING_s::scaler
volatile int16_t scaler
Feedback bit-shift scaler used for number normalization.
Definition: dev_buck_typedef.h:413
BUCK_FEEDBACK_SETTINGS_s::ad_isns
volatile struct BUCK_ADC_INPUT_SETTINGS_s ad_isns[BUCK_MPHASE_COUNT]
ADC input sampling phase current.
Definition: dev_buck_typedef.h:453
BUCK_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_buck_typedef.h:268
BUCK_CONVERTER_s::set_values
volatile struct BUCK_CONVERTER_SETTINGS_s set_values
Control field for global access to references.
Definition: dev_buck_typedef.h:505
BUCK_GPIO_INSTANCE_s::pin
volatile uint16_t pin
GPIO port pin number.
Definition: dev_buck_typedef.h:474
BUCK_CONVERTER_STATUS_s::cs_calib_complete
volatile bool cs_calib_complete
Bit #4: indicating that current sensor calibration has completed.
Definition: dev_buck_typedef.h:212
BUCK_CONVERTER_DATA_s::i_out
volatile uint16_t i_out
BUCK common output current.
Definition: dev_buck_typedef.h:299
BUCK_GPIO_SETTINGS_s::PowerGood
volatile struct BUCK_GPIO_INSTANCE_s PowerGood
Power Good Output.
Definition: dev_buck_typedef.h:490
BUCK_CONVERTER_STATUS_s::pwm_active
volatile bool pwm_active
Bit #2: indicating that PWM has been started and ADC triggers are generated.
Definition: dev_buck_typedef.h:210
BUCK_SWITCH_NODE_SETTINGS_s::master_period_enable
volatile bool master_period_enable
Selecting MASTER or Individual period register.
Definition: dev_buck_typedef.h:382
BUCK_STARTUP_PERIOD_HANDLER_s
Generic power controller startup period settings.
Definition: dev_buck_typedef.h:263
BUCK_SWITCH_NODE_SETTINGS_s::leb_period
volatile uint16_t leb_period
Leading-Edge Blanking period.
Definition: dev_buck_typedef.h:392
BUCK_OPSTATES_e
BUCK_OPSTATES_e
Enumeration of state machine operating states.
Definition: dev_buck_typedef.h:99
BUCK_STATE_ID_s
data structure for the buck statement ID for sub-operating and operating states
Definition: dev_buck_typedef.h:239
BUCK_SWITCH_NODE_SETTINGS_s::duty_ratio_max
volatile uint16_t duty_ratio_max
Absolute duty cycle maximum during normal operation.
Definition: dev_buck_typedef.h:389
BUCK_ADC_INPUT_SETTINGS_s::early_interrupt_enable
volatile bool early_interrupt_enable
input channel early interrupt enable bit
Definition: dev_buck_typedef.h:434
BUCK_CONVERTER_SETTINGS_s::i_ref
volatile uint16_t i_ref
User reference setting used to control the power converter controller.
Definition: dev_buck_typedef.h:327
BUCK_LOOP_SETTINGS_s::controller
volatile struct NPNZ16b_s * controller
pointer to control loop object data structure
Definition: dev_buck_typedef.h:353
BUCK_CONVERTER_DATA_s::temp
volatile uint16_t temp
BUCK board temperature.
Definition: dev_buck_typedef.h:302
BUCK_CONVERTER_STATUS_s::adc_active
volatile bool adc_active
Bit #1: indicating that ADC has been started and samples are taken.
Definition: dev_buck_typedef.h:209
BUCK_CONVERTER_s
BUCK control & monitoring data structure.
Definition: dev_buck_typedef.h:501
BUCK_STATE_ID_s::bits
struct BUCK_STATE_ID_s::@3::@4 bits
BUCK_CONVERTER_s::state_id
volatile struct BUCK_STATE_ID_s state_id
BUCK state machine operating state ID.
Definition: dev_buck_typedef.h:503
BUCK_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_buck_typedef.h:391
BUCK_ADC_INPUT_SETTINGS_s::gpio_instance
volatile uint16_t gpio_instance
GPIO instance of the selected PWM generator.
Definition: dev_buck_typedef.h:429
BUCK_CONVERTER_STARTUP_s::power_good_delay
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s power_good_delay
Definition: dev_buck_typedef.h:282
BUCK_FEEDBACK_SETTINGS_s::ad_temp
volatile struct BUCK_ADC_INPUT_SETTINGS_s ad_temp
ADC input sampling temperature.
Definition: dev_buck_typedef.h:454
BUCK_CONVERTER_STATUS_s::value
volatile uint16_t value
Definition: dev_buck_typedef.h:227
BUCK_CONVERTER_s::v_loop
volatile struct BUCK_LOOP_SETTINGS_s v_loop
BUCK voltage control loop object.
Definition: dev_buck_typedef.h:512
BUCK_STATUS_FLAGS_e
BUCK_STATUS_FLAGS_e
Enumeration of status and control flags.
Definition: dev_buck_typedef.h:72
BUCK_CONVERTER_DATA_s::control_error
volatile uint16_t control_error
BUCK most recent control error value.
Definition: dev_buck_typedef.h:305
BUCK_GPIO_INSTANCE_s
GPIO instance of the converter control GPIO.
Definition: dev_buck_typedef.h:470
BUCK_ADC_INPUT_SCALING_s
ADC input signal scaling = (ADCBUF - <offset>) * <factor> >> 2^<scaler>
Definition: dev_buck_typedef.h:410
BUCK_CONVERTER_STATUS_s::GO
volatile bool GO
Bit #13: When set, the GO-bit fires up the power supply.
Definition: dev_buck_typedef.h:222
BUCK_ADC_INPUT_SETTINGS_s::scaling
volatile struct BUCK_ADC_INPUT_SCALING_s scaling
normalization scaling settings
Definition: dev_buck_typedef.h:438
BUCK_CONVERTER_SETTINGS_s::no_of_phases
volatile uint16_t no_of_phases
number of converter phases
Definition: dev_buck_typedef.h:325
BUCK_SWITCH_NODE_SETTINGS_s::period
volatile uint16_t period
Switching period.
Definition: dev_buck_typedef.h:385
BUCK_ADC_INPUT_SETTINGS_s::signed_result
volatile bool signed_result
input channel singed result mode enable bit
Definition: dev_buck_typedef.h:436
BUCK_CONVERTER_CONSTANTS_s
Structure providing all public enumerated lists of constants.
Definition: dev_buck_typedef.h:166
BUCK_LOOP_SETTINGS_s::feedback_offset
volatile uint16_t feedback_offset
Feedback offset value for calibration or bi-direction feedback signals.
Definition: dev_buck_typedef.h:348
BUCK_SWITCH_NODE_SETTINGS_s::high_resolution_enable
volatile bool high_resolution_enable
Selecting if PWM module should use high-resolution mode.
Definition: dev_buck_typedef.h:383
BUCK_CONVERTER_CONSTANTS_s::ControlModes
enum BUCK_CONTROL_MODE_e ControlModes
List of Supported Control Modes.
Definition: dev_buck_typedef.h:171
BUCK_CONVERTER_STATUS_s::enabled
volatile bool enabled
Bit #15: Control bit enabling/disabling the charger port.
Definition: dev_buck_typedef.h:224
BUCK_CONVERTER_DATA_s::v_out
volatile uint16_t v_out
BUCK output voltage.
Definition: dev_buck_typedef.h:301
BUCK_OPSTATE_RETURNS_e
BUCK_OPSTATE_RETURNS_e
Enumeration of state machine operating state return values.
Definition: dev_buck_typedef.h:135
BUCK_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_buck_typedef.h:223
BUCK_ADC_INPUT_SETTINGS_s::adc_buffer
volatile uint16_t * adc_buffer
pointer to ADC result buffer
Definition: dev_buck_typedef.h:428