EPC9143 300 W 16th Brick DC/DC Module Reference Design
app_power_config.c
1 
32 /*
33  * File: app_power_config.c
34  * Author: M91406
35  *
36  * Created on December 9, 2020, 5:01 PM
37  */
38 
39 #include <xc.h> // include processor files - each processor file is guarded.
40 #include <stdint.h> // include standard integer data types
41 #include <stdbool.h> // include standard boolean data types
42 #include <stddef.h> // include standard definition data types
43 
44 #include "config/hal.h" // include hardware abstraction layer declarations
45 #include "app_power_control.h"
46 #include "./devices/dev_buck_converter.h" // include buck converter device
47 
48 #include "./drivers/v_loop.h" // include voltage control loop object
49 #include "./drivers/v_loop_agc.h" // include voltage control loop adaptive gain control object
50 
51 #include "fault_handler/app_fault_monitor.h" // include fault monitor application object declarations
52 
53 
54 
67 {
68  volatile uint16_t retval = 1;
69  volatile uint16_t _i = 0;
70  volatile bool adc_trigger_mode=false;
71 
72  // Initialize Buck Converter Object Status
73  buck.status.bits.ready = false; // Clear Converter Ready flag
74  buck.status.bits.adc_active = false; // Clear ADC STARTED flag
75  buck.status.bits.pwm_active = false; // clear PWM STARTED flag
76  buck.status.bits.cs_calib_complete = false; // Clear Current Sense Calibration flag
77  buck.status.bits.fault_active = true; // Set global FAULT flag
78  buck.status.bits.cs_calib_enable = BUCK_ISNS_OFFSET_CALIBRATION_ENABLE; // Topology current sensors need to be calibrated
79  buck.status.bits.autorun = true; // Allow the buck converter to run when cleared of faults
80  buck.status.bits.enabled = false; // Disable buck converter
81  buck.status.bits.suspend = true; // Set SUSPEND flag bit to keep power supply on hold until startup conditions are cleared
82  buck.status.bits.async_mode = false; // The power converter is starting up in synchronous mode
83 
84  // Set Initial State Machine State
85  buck.state_id.value = (uint32_t)BUCK_OPSTATE_INITIALIZE; // Reset Buck State Machine
86 
87  // Set Reference values
88  buck.set_values.control_mode = BUCK_CONTROL_MODE_VMC; // Set Control Mode
89  buck.set_values.i_ref = BUCK_ISNS_REF; // Set current loop reference
90  buck.set_values.v_ref = BUCK_VOUT_REF; // Set voltage loop reference
91  buck.set_values.no_of_phases = BUCK_NO_OF_PHASES; // Set number of converter phases
92 
93  // Clear Runtime Data
94  for (_i=0; _i<buck.set_values.no_of_phases; _i++) // Reset phase current values
95  { buck.data.i_sns[0] = 0; }
96  buck.data.i_out = 0; // Reset output current value
97  buck.data.v_out = 0; // Reset output voltage value
98  buck.data.v_in = 0; // Reset input voltage value
99  buck.data.temp = 0; // Reset output temperature value
100 
101  // Initialize Switch Node of PWM #1
106  buck.sw_node[0].master_period_enable = false; // Master time base is disabled, synchronization is established among PWM generators
108  buck.sw_node[0].sync_drive = true; // This topology is a synchronous buck converter
109  buck.sw_node[0].swap_outputs = false; // PWMxH is high-side, PWMxL is low-side
111  buck.sw_node[0].phase = 0; // Master phase starts at time-base count of =0
120 
121  // Initialize Switch Node of PWM #1
126  buck.sw_node[1].master_period_enable = false;
128  buck.sw_node[1].sync_drive = true; // This topology is a synchronous buck converter
129  buck.sw_node[1].swap_outputs = false; // PWMxH is high-side, PWMxL is low-side
140 
141  // Initialize additional GPIOs
142 
143  // ~~~ EXTERNAL ENABLE INPUT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144  buck.gpio.EnableInput.enabled = false; // this converter doesn't support external enable control
145  // ~~~ EXTERNAL ENABLE INPUT END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146 
147  // ~~~ POWER GOOD OUTPUT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148 
149  buck.gpio.PowerGood.enabled = true; // This converter supports an additional POWER GOOD output
150  buck.gpio.PowerGood.port = PWRGOOD_PORT; // Number of the GPIO port (0=Port RA, 0=Port RB, 0=Port RC, etc.)
151  buck.gpio.PowerGood.pin = PWRGOOD_PIN; // Number of the GPIO port pin
152  buck.gpio.PowerGood.polarity = 0; // This pin is ACTIVE HIGH (only required if io_type = OUTPUT)
153  buck.gpio.PowerGood.io_type = 0; // This pin is configured as OUTPUT
154 
155  // ~~~ POWER GOOD OUTPUT END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156 
157  // Initialize Feedback Channels
158 
159  // ~~~ OUTPUT VOLTAGE FEEDBACK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160 
161  buck.feedback.ad_vout.enabled = true; // Use this channel
162  adc_trigger_mode = (bool)(BUCK_VOUT_TRIGGER_MODE == BUCK_VOUT_TRIG_ADC);
163 
168 
170  buck.feedback.ad_vout.interrupt_enable = adc_trigger_mode;
171  buck.feedback.ad_vout.early_interrupt_enable = adc_trigger_mode;
174 
178 
180 
181  // ~~~ OUTPUT VOLTAGE FEEDBACK END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182 
183  // ~~~ INPUT VOLTAGE FEEDBACK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184 
185  buck.feedback.ad_vin.enabled = true; // Use this channel
186 
191 
197 
201 
203 
204  // ~~~ INPUT VOLTAGE FEEDBACK END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205 
206  // ~~~ OUTPUT CURRENT FEEDBACK ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207 
208  buck.feedback.ad_isns[0].enabled = true; // Use this channel
209 
214 
218  buck.feedback.ad_isns[0].level_trigger = false;
219  buck.feedback.ad_isns[0].signed_result = false;
220 
224 
225 
227 
228 
229  buck.feedback.ad_isns[1].enabled = true; // Use this channel
230 
235 
239  buck.feedback.ad_isns[1].level_trigger = false;
240  buck.feedback.ad_isns[1].signed_result = false;
241 
245 
247 
248 
249  // ~~~ OUTPUT CURRENT FEEDBACK END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
250 
251  // Initialize Startup Settings
252 
257 
261  if (buck.startup.v_ramp.ref_inc_step == 0)
264 
265  if (buck.set_values.control_mode == BUCK_CONTROL_MODE_ACMC)
266  {
271  }
272 
277 
278 
279  return(retval);
280 }
281 
282 
283 
305 volatile uint16_t appPowerSupply_ControllerInitialize(void)
306 {
307  volatile uint16_t retval = 1;
308 
309  // ~~~ VOLTAGE LOOP CONFIGURATION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 
311  // Initialize Default Loop Configuration
317 
318  // Set Controller Object of Voltage Loop
324 
325  // Configure Voltage Loop Controller Object
326  buck.v_loop.ctrl_Initialize(&v_loop); // Call Initialization Routine setting histories and scaling
327 
328  // Configure controller input ports
329  buck.v_loop.controller->Ports.Source.ptrAddress = &BUCK_VOUT_ADCBUF; // Output Voltage is Common Source
330  buck.v_loop.controller->Ports.Source.Offset = buck.v_loop.feedback_offset; // Output Voltage feedback signal offset
331  buck.v_loop.controller->Ports.Source.NormScaler = BUCK_VOUT_NORM_SCALER; // Output voltage normalization factor bit-shift scaler
332  buck.v_loop.controller->Ports.Source.NormFactor = BUCK_VOUT_NORM_FACTOR; // Output voltage normalization factor fractional
333 
334  buck.v_loop.controller->Ports.AltSource.ptrAddress = &BUCK_VIN_ADCBUF; // Input Voltage Is Alternate Source
335  buck.v_loop.controller->Ports.AltSource.Offset = BUCK_VIN_OFFSET; // Input Voltage feedback signal offset
336  buck.v_loop.controller->Ports.AltSource.NormScaler = BUCK_VIN_NORM_SCALER; // Input voltage normalization factor bit-shift scaler
337  buck.v_loop.controller->Ports.AltSource.NormFactor = BUCK_VIN_NORM_FACTOR; // Input voltage normalization factor fractional
338 
339  // Configure controller output ports
340  buck.v_loop.controller->Ports.Target.ptrAddress = &BUCK_PWM1_PDC; // PWM Duty Cycle is Control Target
341  buck.v_loop.controller->Ports.Target.Offset = 0; // Static primary output value offset
342  buck.v_loop.controller->Ports.Target.NormScaler = 0; // Primary control output normalization factor bit-shift scaler
343  buck.v_loop.controller->Ports.Target.NormFactor = 0x7FFF; // Primary control output normalization factor fractional
344 
345  buck.v_loop.controller->Ports.AltTarget.ptrAddress = &BUCK_PWM2_PDC; // PWM Duty Cycle is Control Target
346  buck.v_loop.controller->Ports.AltTarget.Offset = 0; // Static secondary output value offset
347  buck.v_loop.controller->Ports.AltTarget.NormScaler = 0; // Secondary control output normalization factor bit-shift scaler
348  buck.v_loop.controller->Ports.AltTarget.NormFactor = 0x7FFF; // Secondary control output normalization factor fractional
349 
350  // Configure controller control ports
351  buck.v_loop.controller->Ports.ptrControlReference = &buck.set_values.v_ref; // Set pointer to Reference
352 
353  // Data Input/Output Limit Configuration
356  buck.v_loop.controller->Limits.AltMinOutput = 0; // not used
357  buck.v_loop.controller->Limits.AltMaxOutput = 0; // not used
358 
359  // ADC Trigger Control Configuration
360  buck.v_loop.controller->ADCTriggerControl.ptrADCTriggerARegister = &BUCK_VOUT_ADCTRIG; // Using PGxTRIGA = ADC Trigger 1
362  buck.v_loop.controller->ADCTriggerControl.ptrADCTriggerBRegister = &BUCK_VIN_ADCTRIG; // Using PGxTRIGB = ADC Trigger 2
364 
365  // Data Provider Configuration
370 
371  // Initialize Advanced Control Settings (not used in this code example)
375 
376  buck.v_loop.controller->GainControl.ptrAgcObserverFunction = (uint16_t)&v_loop_AGCFactorUpdate;
377 
378  // Custom Advanced Control Settings
379 
380  /* Extension Functions Configuration */
381  v_loop.ExtensionHooks.ptrExtHookEndFunction = NULL; // No pointer to user specified function
382  v_loop.ExtensionHooks.ExtHookEndFunctionParam = 0; // No user specified function parameter
383 
384  // Use proprietary control parameters to place VIN-2-VOUT scaling factor
385  buck.v_loop.controller->Advanced.usrParam0 = 0; // No additional advanced control options used
388  buck.v_loop.controller->Advanced.usrParam3 = 0; // No additional advanced control options used
389  buck.v_loop.controller->Advanced.usrParam4 = 0; // No additional advanced control options used
390  buck.v_loop.controller->Advanced.usrParam5 = 0; // No additional advanced control options used
391  buck.v_loop.controller->Advanced.usrParam6 = 0; // No additional advanced control options used
392  buck.v_loop.controller->Advanced.usrParam7 = 0; // No additional advanced control options used
393 
394  // Reset Controller Status
395  buck.v_loop.controller->status.bits.enabled = false; // Keep controller disabled
396  buck.v_loop.controller->status.bits.swap_source = false; // use SOURCE as major control input
397  buck.v_loop.controller->status.bits.swap_target = false; // use TARGET as major control output
398  buck.v_loop.controller->status.bits.invert_input = false; // Do not invert input value
399  buck.v_loop.controller->status.bits.lower_saturation_event = false; // Reset Anti-Windup Minimum Status bit
400  buck.v_loop.controller->status.bits.upper_saturation_event = false; // Reset Anti-Windup Maximum Status bits
401  buck.v_loop.controller->status.bits.agc_enabled = false; // Enable Adaptive Gain Modulation by default
402 
403  // ~~~ VOLTAGE LOOP CONFIGURATION END ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
404 
405 
406  return(retval);
407 }
408 
409 
421 {
422  volatile uint16_t retval=1;
423 
424  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
425  // Write standard configurations supported by BUCK_POWER_CONTROLLER_s
426  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427 
428  retval &= drv_BuckConverter_Initialize(&buck); // Hand over peripheral configuration to driver
429 
430  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
431  // Write Custom Configuration of Remappable PWM Channel #4
432  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435 
436  retval &= PPS_UnlockIO();
437  retval &= PPS_RemapOutput(BUCK_PWM2H_RPx, PPSOUT_PWM4H);
438  retval &= PPS_RemapOutput(BUCK_PWM2L_RPx, PPSOUT_PWM4L);
439  retval &= PPS_LockIO();
440 
441  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
442  // Custom configurations
443  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
444 
445  // ToDo: Incorporate hard coded register settings into generic data structure scheme, if possible
446  ADCON4Hbits.C1CHS = 1; // Set ADC input channel to read from ANA1
447 
448  // Synchronize PWM channels #1 and #2
449  // => taken care of by the state machine automatically, when multiple phases are defined
450  // If PWM channels need to be synchronized to other converter PWMs, this needs to be done
451  // manually here
452 
453  return(retval);
454 }
455 
456 
457 // end of file
BUCK_VOUT_NORM_FACTOR
#define BUCK_VOUT_NORM_FACTOR
VOUT normalization factor scaled in Q15.
Definition: epc9143_r40_hwdescr.h:538
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_ISNS2_ADCBUF
#define BUCK_ISNS2_ADCBUF
ADC input buffer of this ADC channel.
Definition: epc9143_r40_hwdescr.h:639
NPNZ_STATUS_s::swap_source
volatile bool swap_source
Bit 13: when set, AltSource is used as data input to controller.
Definition: npnz16b.h:200
BUCK_PWM2_GPIO_INSTANCE
#define BUCK_PWM2_GPIO_INSTANCE
Number indicating device port, where 0=Port RA, 0=Port RB, 0=Port RC, etc.
Definition: epc9143_r40_hwdescr.h:332
BUCK_VRAMP_PER
#define BUCK_VRAMP_PER
Definition: epc9143_r40_hwdescr.h:730
NPNZ_DATA_PROVIDERS_s::ptrDProvControlError
volatile uint16_t * ptrDProvControlError
Pointer to external data buffer of most recent control error.
Definition: npnz16b.h:413
BUCK_ADC_INPUT_SETTINGS_s::differential_input
volatile bool differential_input
input channel differential mode enable bit
Definition: dev_buck_typedef.h:435
BUCK_VIN_ADC_TRGDLY
#define BUCK_VIN_ADC_TRGDLY
Input voltage ADC trigger delay.
Definition: epc9143_r40_hwdescr.h:462
BUCK_VOUT_ADCBUF
#define BUCK_VOUT_ADCBUF
ADC input buffer of this ADC channel.
Definition: epc9143_r40_hwdescr.h:510
BUCK_ADC_INPUT_SETTINGS_s::scaling
volatile struct BUCK_ADC_INPUT_SCALING_s scaling
normalization scaling settings
Definition: dev_buck_typedef.h:438
NPNZ_STATUS_s::upper_saturation_event
volatile bool upper_saturation_event
Bit 1: control loop is clamped at maximum output level.
Definition: npnz16b.h:187
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
NPNZ_USER_DATA_BUFFER_s::usrParam7
volatile uint16_t usrParam7
generic 16-bit wide, user-defined parameter #8 for advanced control options
Definition: npnz16b.h:483
BUCK_CONVERTER_SETTINGS_s::control_mode
enum BUCK_CONTROL_MODE_e control_mode
Fundamental control mode.
Definition: dev_buck_typedef.h:324
BUCK_PWM_PHASE_SHIFT
#define BUCK_PWM_PHASE_SHIFT
This sets the phase shift between phase #1 and #2.
Definition: epc9143_r40_hwdescr.h:381
BUCK_ADC_INPUT_SETTINGS_s::interrupt_enable
volatile bool interrupt_enable
input channel interrupt enable bit
Definition: dev_buck_typedef.h:433
BUCK_PWM2_CHANNEL
#define BUCK_PWM2_CHANNEL
PWM peripheral output pins, control signals and register assignments of converter phase #2.
Definition: epc9143_r40_hwdescr.h:331
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
NPNZ_PORTS_s::ptrControlReference
volatile uint16_t * ptrControlReference
Pointer to global variable of input register holding the controller reference value (e....
Definition: npnz16b.h:265
BUCK_CONVERTER_DATA_s::i_out
volatile uint16_t i_out
BUCK common output current.
Definition: dev_buck_typedef.h:299
NPNZ_USER_DATA_BUFFER_s::usrParam6
volatile uint16_t usrParam6
generic 16-bit wide, user-defined parameter #7 for advanced control options
Definition: npnz16b.h:482
BUCK_PWM1_GPIO_INSTANCE
#define BUCK_PWM1_GPIO_INSTANCE
Number indicating device port, where 0=Port RA, 0=Port RB, 0=Port RC, etc.
Definition: epc9143_r40_hwdescr.h:284
BUCK_VIN_OFFSET
#define BUCK_VIN_OFFSET
Input voltage feedback offset.
Definition: epc9143_r40_hwdescr.h:463
NPNZ16b_s::GainControl
volatile struct NPNZ_GAIN_CONTROL_s GainControl
Parameter section for advanced control options.
Definition: npnz16b.h:507
NPNZ_STATUS_s::lower_saturation_event
volatile bool lower_saturation_event
Bit 0: control loop is clamped at minimum output level.
Definition: npnz16b.h:186
BUCK_CONVERTER_s::gpio
volatile struct BUCK_GPIO_SETTINGS_s gpio
BUCK converter additional GPIO specification.
Definition: dev_buck_typedef.h:510
BUCK_CONVERTER_SETTINGS_s::no_of_phases
volatile uint16_t no_of_phases
number of converter phases
Definition: dev_buck_typedef.h:325
BUCK_AGC_NOM_FACTOR
#define BUCK_AGC_NOM_FACTOR
Fractional of the floating point number of the maimum limit of the adaptive gain modulation factor.
Definition: epc9143_r40_hwdescr.h:673
BUCK_VOUT_NORM_SCALER
#define BUCK_VOUT_NORM_SCALER
VOUT normalization
Definition: epc9143_r40_hwdescr.h:537
BUCK_VOUT_TRIG_ADC
#define BUCK_VOUT_TRIG_ADC
Buck VOUT control loop is called in ADC interrupt.
Definition: epc9143_r40_hwdescr.h:807
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
NPNZ_LIMITS_s::AltMaxOutput
volatile int16_t AltMaxOutput
Alternate maximum output value used for clamping (R/W)
Definition: npnz16b.h:360
BUCK_ADC_INPUT_SETTINGS_s::enabled
volatile bool enabled
input channel enable bit
Definition: dev_buck_typedef.h:427
BUCK_CONVERTER_DATA_s::i_sns
volatile uint16_t i_sns[BUCK_MPHASE_COUNT]
BUCK output current.
Definition: dev_buck_typedef.h:298
BUCK_VOUT_ADCCORE
#define BUCK_VOUT_ADCCORE
0=Dedicated Core #0, 1=Dedicated Core #1, 8=Shared ADC Core
Definition: epc9143_r40_hwdescr.h:508
v_loop_Initialize
volatile uint16_t v_loop_Initialize(volatile struct NPNZ16b_s *controller)
Initializes controller coefficient arrays and normalization factors.
Definition: v_loop.c:111
NPNZ_EXTENSION_HOOKS_s::ExtHookEndFunctionParam
volatile uint16_t ExtHookEndFunctionParam
Parameter of function called (can be a variable or a pointer to a data structure)
Definition: npnz16b.h:456
appPowerSupply_PeripheralsInitialize
volatile uint16_t appPowerSupply_PeripheralsInitialize(void)
This function is used to load peripheral configuration templates from the power controller device dri...
Definition: app_power_config.c:420
BUCK_VIN_ANSEL
#define BUCK_VIN_ANSEL
GPIO analog function mode enable bit.
Definition: epc9143_r40_hwdescr.h:433
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_VIN_TRGSRC
#define BUCK_VIN_TRGSRC
PWM2 (=PG4) Trigger 1 via PGxTRIGA.
Definition: epc9143_r40_hwdescr.h:438
NPNZ_USER_DATA_BUFFER_s::usrParam1
volatile uint16_t usrParam1
generic 16-bit wide, user-defined parameter #2 for advanced control options
Definition: npnz16b.h:477
BUCK_VIN_NORM_SCALER
#define BUCK_VIN_NORM_SCALER
VIN normalization
Definition: epc9143_r40_hwdescr.h:466
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_VOUT_ADC_TRGDLY
#define BUCK_VOUT_ADC_TRGDLY
Macro calculating the integer number equivalent of the signal chain time delay between internal PWM t...
Definition: epc9143_r40_hwdescr.h:534
NPNZ_STATUS_s::enabled
volatile bool enabled
Bit 15: enables/disables control loop execution.
Definition: npnz16b.h:202
BUCK_ISNS2_TRGSRC
#define BUCK_ISNS2_TRGSRC
PWM2 (=PG4) Trigger 2 via PGxTRIGB.
Definition: epc9143_r40_hwdescr.h:641
BUCK_LOOP_SETTINGS_s::minimum
volatile int16_t minimum
output clamping value (minimum)
Definition: dev_buck_typedef.h:350
NPNZ_STATUS_s::swap_target
volatile bool swap_target
Bit 12: when set, AltTarget is used as data output of controller.
Definition: npnz16b.h:199
BUCK_PWM2_ADTR1OFS
#define BUCK_PWM2_ADTR1OFS
ADC Trigger 1 Offset: 0...31.
Definition: epc9143_r40_hwdescr.h:360
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_s::feedback
volatile struct BUCK_FEEDBACK_SETTINGS_s feedback
BUCK converter feedback settings.
Definition: dev_buck_typedef.h:507
BUCK_STARTUP_PERIOD_HANDLER_s::counter
volatile uint16_t counter
Soft-Start Execution Counter (read only)
Definition: dev_buck_typedef.h:265
BUCK_PWM_DEAD_TIME_FE
#define BUCK_PWM_DEAD_TIME_FE
Falling edge dead time [tick = 250ps].
Definition: epc9143_r40_hwdescr.h:386
BUCK_NO_OF_PHASES
#define BUCK_NO_OF_PHASES
User-declaration of global defines for PWM signal generator settings.
Definition: epc9143_r40_hwdescr.h:258
BUCK_VIN_ADCTRIG
#define BUCK_VIN_ADCTRIG
Register used for trigger placement.
Definition: epc9143_r40_hwdescr.h:437
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_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_ISNS2_ADCCORE
#define BUCK_ISNS2_ADCCORE
0=Dedicated Core #0, 1=Dedicated Core #1, 2=Shared ADC Core
Definition: epc9143_r40_hwdescr.h:637
NPNZ16b_s::Ports
volatile struct NPNZ_PORTS_s Ports
Controller input and output ports.
Definition: npnz16b.h:505
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
NPNZ_PORT_s::NormFactor
volatile fractional NormFactor
Q15 normalization factor.
Definition: npnz16b.h:230
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
NPNZ16b_s::status
volatile struct NPNZ_STATUS_s status
Control Loop Status and Control flags.
Definition: npnz16b.h:504
BUCK_ADC_INPUT_SETTINGS_s::signed_result
volatile bool signed_result
input channel singed result mode enable bit
Definition: dev_buck_typedef.h:436
appPowerSupply_ConverterObjectInitialize
volatile uint16_t appPowerSupply_ConverterObjectInitialize(void)
This function initializes the buck converter device driver instance.
Definition: app_power_config.c:66
BUCK_PWM2_GPIO_PORT_PINH
#define BUCK_PWM2_GPIO_PORT_PINH
Port Pin Number.
Definition: epc9143_r40_hwdescr.h:333
BUCK_ISNS2_OFFFSET
#define BUCK_ISNS2_OFFFSET
Definition: epc9143_r40_hwdescr.h:601
BUCK_ISNS1_ANSEL
#define BUCK_ISNS1_ANSEL
GPIO analog function mode enable bit.
Definition: epc9143_r40_hwdescr.h:626
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
NPNZ_PORTS_s::AltTarget
volatile struct NPNZ_PORT_s AltTarget
Secondary data output port declaration.
Definition: npnz16b.h:264
NPNZ_ADC_TRGCTRL_s::ADCTriggerBOffset
volatile uint16_t ADCTriggerBOffset
ADC trigger #2 offset to compensate propagation delays.
Definition: npnz16b.h:387
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_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::pin
volatile uint16_t pin
GPIO port pin number.
Definition: dev_buck_typedef.h:474
BUCK_AGC_IO_NORM_SCALER
#define BUCK_AGC_IO_NORM_SCALER
Nominal VL Q15 scaler
Definition: epc9143_r40_hwdescr.h:667
BUCK_VOUT_OFFSET
#define BUCK_VOUT_OFFSET
Macro calculating the integer number equivalent of the physical, static signal offset of this feedbac...
Definition: epc9143_r40_hwdescr.h:533
BUCK_IREF_STEP
#define BUCK_IREF_STEP
Definition: epc9143_r40_hwdescr.h:733
BUCK_VIN_ADCBUF
#define BUCK_VIN_ADCBUF
ADC input buffer of this ADC channel.
Definition: epc9143_r40_hwdescr.h:436
BUCK_CONVERTER_DATA_s::v_in
volatile uint16_t v_in
BUCK input voltage.
Definition: dev_buck_typedef.h:300
BUCK_PWM2L_RPx
#define BUCK_PWM2L_RPx
Device Pin output remappable pin number (RPx)
Definition: epc9143_r40_hwdescr.h:347
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
PPS_UnlockIO
volatile uint16_t PPS_UnlockIO(void)
Unlocks the Peripheral Pin Select Configuration registers to enable changes.
Definition: p33c_pps.c:102
buck
volatile struct BUCK_CONVERTER_s buck
Global data object for a BUCK CONVERTER.
Definition: app_power_control.c:63
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_VOUT_ADCIN
#define BUCK_VOUT_ADCIN
Analog input number (e.g. '5' for 'AN5')
Definition: epc9143_r40_hwdescr.h:509
BUCK_LOOP_SETTINGS_s::maximum
volatile uint16_t maximum
output clamping value (maximum)
Definition: dev_buck_typedef.h:351
NPNZ_GAIN_CONTROL_s::ptrAgcObserverFunction
volatile uint16_t ptrAgcObserverFunction
Function Pointer to Observer function updating the AGC modulation factor.
Definition: npnz16b.h:333
BUCK_PWM2_PDC
#define BUCK_PWM2_PDC
PWM Instance Duty Cycle Register.
Definition: epc9143_r40_hwdescr.h:336
BUCK_CONVERTER_s::startup
volatile struct BUCK_CONVERTER_STARTUP_s startup
BUCK startup timing settings.
Definition: dev_buck_typedef.h:504
NPNZ_USER_DATA_BUFFER_s::usrParam2
volatile uint16_t usrParam2
generic 16-bit wide, user-defined parameter #3 for advanced control options
Definition: npnz16b.h:478
NPNZ_ADC_TRGCTRL_s::ADCTriggerAOffset
volatile uint16_t ADCTriggerAOffset
ADC trigger #1 offset to compensate propagation delays.
Definition: npnz16b.h:385
BUCK_ADC_INPUT_SCALING_s::scaler
volatile int16_t scaler
Feedback bit-shift scaler used for number normalization.
Definition: dev_buck_typedef.h:413
NPNZ_GAIN_CONTROL_s::AgcFactor
volatile fractional AgcFactor
Q15 value of Adaptive Gain Modulation factor.
Definition: npnz16b.h:331
NPNZ_LIMITS_s::AltMinOutput
volatile int16_t AltMinOutput
Alternate minimum output value used for clamping (R/W)
Definition: npnz16b.h:359
BUCK_CONVERTER_STARTUP_s::i_ramp
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s i_ramp
Definition: dev_buck_typedef.h:283
BUCK_ISNS1_OFFFSET
#define BUCK_ISNS1_OFFFSET
Definition: epc9143_r40_hwdescr.h:596
NPNZ_DATA_PROVIDERS_s::ptrDProvControlOutput
volatile uint16_t * ptrDProvControlOutput
Pointer to external data buffer of most recent control output.
Definition: npnz16b.h:414
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_ISNS1_TRGSRC
#define BUCK_ISNS1_TRGSRC
PWM1 (=PG2) Trigger 2 via PGxTRIGB.
Definition: epc9143_r40_hwdescr.h:631
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_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_ISNS1_ADCIN
#define BUCK_ISNS1_ADCIN
Analog input number (e.g. '5' for 'AN5')
Definition: epc9143_r40_hwdescr.h:628
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_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_LEB_PERIOD
#define BUCK_LEB_PERIOD
Leading Edge Blanking = n x PWM resolution (here: 50 x 2ns = 100ns)
Definition: epc9143_r40_hwdescr.h:384
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_PWM1_PDC
#define BUCK_PWM1_PDC
PWM Instance Duty Cycle Register.
Definition: epc9143_r40_hwdescr.h:288
v_loop_Precharge
void v_loop_Precharge(volatile struct NPNZ16b_s *controller, volatile fractional ctrl_input, volatile fractional ctrl_output)
Prototype of the Assembly routine '_v_loop_Precharge' loading user-defined values into the NPNZ16b co...
BUCK_VOUT_ANSEL
#define BUCK_VOUT_ANSEL
ADC input assignments of output voltage feedback signals.
Definition: epc9143_r40_hwdescr.h:507
PWRGOOD_PORT
#define PWRGOOD_PORT
GPIO port declaration where 0=Port RA, 0=Port RB, 0=Port RC, etc.
Definition: epc9143_r40_hwdescr.h:218
PPS_RemapOutput
volatile uint16_t PPS_RemapOutput(volatile uint8_t pinno, volatile uint8_t peripheral)
Assigns a digital function output to a pin.
Definition: p33c_pps.c:133
NPNZ_USER_DATA_BUFFER_s::usrParam0
volatile uint16_t usrParam0
generic 16-bit wide, user-defined parameter #1 for advanced control options
Definition: npnz16b.h:476
BUCK_CONVERTER_s::status
volatile struct BUCK_CONVERTER_STATUS_s status
BUCK operation status bits.
Definition: dev_buck_typedef.h:502
BUCK_PWM_DC_MIN
#define BUCK_PWM_DC_MIN
This sets the minimum duty cycle.
Definition: epc9143_r40_hwdescr.h:382
NPNZ_PORTS_s::Target
volatile struct NPNZ_PORT_s Target
Primary data output port declaration.
Definition: npnz16b.h:263
BUCK_PWM_PERIOD
#define BUCK_PWM_PERIOD
This sets the switching period of the converter.
Definition: epc9143_r40_hwdescr.h:380
BUCK_CONVERTER_STARTUP_s::power_on_delay
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s power_on_delay
Definition: dev_buck_typedef.h:281
NPNZ_STATUS_s::invert_input
volatile bool invert_input
Bit 14: when set, most recent error input value to controller is inverted.
Definition: npnz16b.h:201
BUCK_ISNS1_ADCCORE
#define BUCK_ISNS1_ADCCORE
0=Dedicated Core #0, 1=Dedicated Core #1, 2=Shared ADC Core
Definition: epc9143_r40_hwdescr.h:627
BUCK_POD
#define BUCK_POD
Conversion Macros of Startup Timing Settings.
Definition: epc9143_r40_hwdescr.h:729
BUCK_CONVERTER_STARTUP_s::power_good_delay
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s power_good_delay
Definition: dev_buck_typedef.h:282
BUCK_SWITCH_NODE_SETTINGS_s::period
volatile uint16_t period
Switching period.
Definition: dev_buck_typedef.h:385
NPNZ_DATA_PROVIDERS_s::ptrDProvControlInput
volatile uint16_t * ptrDProvControlInput
Pointer to external data buffer of most recent, raw control input.
Definition: npnz16b.h:411
BUCK_SWITCH_NODE_SETTINGS_s::leb_period
volatile uint16_t leb_period
Leading-Edge Blanking period.
Definition: dev_buck_typedef.h:392
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_VIN_NORM_FACTOR
#define BUCK_VIN_NORM_FACTOR
VIN normalization factor scaled in Q15.
Definition: epc9143_r40_hwdescr.h:467
PWRGOOD_PIN
#define PWRGOOD_PIN
GPIO port pin declaration where 0=Rx0, 1=Rx1, 2=Rx3, etc.
Definition: epc9143_r40_hwdescr.h:219
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_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_CONVERTER_s::v_loop
volatile struct BUCK_LOOP_SETTINGS_s v_loop
BUCK voltage control loop object.
Definition: dev_buck_typedef.h:512
NPNZ16b_s::DataProviders
volatile struct NPNZ_DATA_PROVIDERS_s DataProviders
Automated data sources pushing recent data points to user-defined variables.
Definition: npnz16b.h:510
NPNZ_PORT_s::ptrAddress
volatile uint16_t * ptrAddress
Pointer to register or variable where the value is read from (e.g. ADCBUFx) or written to (e....
Definition: npnz16b.h:228
NPNZ_ADC_TRGCTRL_s::ptrADCTriggerBRegister
volatile uint16_t * ptrADCTriggerBRegister
Pointer to ADC trigger #2 register (e.g. TRIG2)
Definition: npnz16b.h:386
BUCK_PWM_DEAD_TIME_LE
#define BUCK_PWM_DEAD_TIME_LE
Rising edge dead time [tick = 250ps].
Definition: epc9143_r40_hwdescr.h:385
NPNZ_USER_DATA_BUFFER_s::usrParam5
volatile uint16_t usrParam5
generic 16-bit wide, user-defined parameter #6 for advanced control options
Definition: npnz16b.h:481
BUCK_ISNS_REF
#define BUCK_ISNS_REF
Conversion macros of phase current feedback parameters.
Definition: epc9143_r40_hwdescr.h:588
BUCK_PWM1_GPIO_PORT_PINL
#define BUCK_PWM1_GPIO_PORT_PINL
Port Pin Number.
Definition: epc9143_r40_hwdescr.h:286
BUCK_LOOP_SETTINGS_s::reference
volatile uint16_t reference
Control loop reference variable.
Definition: dev_buck_typedef.h:347
NPNZ16b_s::ExtensionHooks
volatile struct NPNZ_EXTENSION_HOOKS_s ExtensionHooks
User extension function triggers using function pointers with parameters.
Definition: npnz16b.h:511
BUCK_IRAMP_PER
#define BUCK_IRAMP_PER
Definition: epc9143_r40_hwdescr.h:732
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
NPNZ_PORTS_s::AltSource
volatile struct NPNZ_PORT_s AltSource
Secondary data input port declaration.
Definition: npnz16b.h:262
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_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::adc_core
volatile uint8_t adc_core
number of the ADC core connected to the selected channel
Definition: dev_buck_typedef.h:431
BUCK_AGC_IO_NORM_FACTOR
#define BUCK_AGC_IO_NORM_FACTOR
Nominal VL Q15 factor.
Definition: epc9143_r40_hwdescr.h:668
BUCK_SWITCH_NODE_SETTINGS_s::phase
volatile uint16_t phase
Switching signal phase-shift.
Definition: dev_buck_typedef.h:386
BUCK_LOOP_SETTINGS_s::ctrl_Update
void(* ctrl_Update)(volatile struct NPNZ16b_s *)
Function pointer to UPDATE routine.
Definition: dev_buck_typedef.h:357
NPNZ_STATUS_s::agc_enabled
volatile bool agc_enabled
Bit 11: when set, Adaptive Gain Control Modulation is enabled.
Definition: npnz16b.h:198
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_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_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_PWM_DC_MAX
#define BUCK_PWM_DC_MAX
This sets the maximum duty cycle.
Definition: epc9143_r40_hwdescr.h:383
NPNZ16b_s::ADCTriggerControl
volatile struct NPNZ_ADC_TRGCTRL_s ADCTriggerControl
Automatic ADC trigger placement options for ADC Trigger A and B.
Definition: npnz16b.h:509
BUCK_ADC_INPUT_SETTINGS_s::trigger_source
volatile uint8_t trigger_source
input channel trigger source
Definition: dev_buck_typedef.h:432
BUCK_CONVERTER_DATA_s::v_out
volatile uint16_t v_out
BUCK output voltage.
Definition: dev_buck_typedef.h:301
BUCK_ADC_INPUT_SETTINGS_s::adc_buffer
volatile uint16_t * adc_buffer
pointer to ADC result buffer
Definition: dev_buck_typedef.h:428
NPNZ_GAIN_CONTROL_s::AgcScaler
volatile uint16_t AgcScaler
Bit-shift scaler of Adaptive Gain Modulation factor.
Definition: npnz16b.h:330
drv_BuckConverter_Initialize
volatile uint16_t drv_BuckConverter_Initialize(volatile struct BUCK_CONVERTER_s *buckInstance)
This function initializes all peripheral modules and their instances used by the power controller.
Definition: dev_buck_converter.c:30
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_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_VREF_STEP
#define BUCK_VREF_STEP
Definition: epc9143_r40_hwdescr.h:731
BUCK_ISNS_OFFSET_CALIBRATION_ENABLE
#define BUCK_ISNS_OFFSET_CALIBRATION_ENABLE
Enables/Disables Current Sense Offset Calibration.
Definition: epc9143_r40_hwdescr.h:92
NPNZ16b_s::Limits
volatile struct NPNZ_LIMITS_s Limits
Input and output clamping values.
Definition: npnz16b.h:508
BUCK_PWM2H_INIT
#define BUCK_PWM2H_INIT
Definition: epc9143_r40_hwdescr.h:342
NPNZ_PORTS_s::Source
volatile struct NPNZ_PORT_s Source
Primary data input port declaration.
Definition: npnz16b.h:261
BUCK_PWM2_GPIO_PORT_PINL
#define BUCK_PWM2_GPIO_PORT_PINL
Port Pin Number.
Definition: epc9143_r40_hwdescr.h:334
appPowerSupply_ControllerInitialize
volatile uint16_t appPowerSupply_ControllerInitialize(void)
This function initializes the control system feedback loop objects.
Definition: app_power_config.c:305
BUCK_VOUT_REF
#define BUCK_VOUT_REF
Macro calculating the integer number equivalent of the output voltage reference given above in [V].
Definition: epc9143_r40_hwdescr.h:529
BUCK_STATE_ID_s::value
volatile uint32_t value
Definition: dev_buck_typedef.h:245
NPNZ16b_s::Advanced
volatile struct NPNZ_USER_DATA_BUFFER_s Advanced
Parameter section for advanced user control options.
Definition: npnz16b.h:512
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_ISNS_NORM_SCALER
#define BUCK_ISNS_NORM_SCALER
ISNS normalization
Definition: epc9143_r40_hwdescr.h:605
BUCK_CONVERTER_s::data
volatile struct BUCK_CONVERTER_DATA_s data
BUCK runtime data.
Definition: dev_buck_typedef.h:506
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
NPNZ_LIMITS_s::MinOutput
volatile int16_t MinOutput
Minimum output value used for clamping (R/W)
Definition: npnz16b.h:357
BUCK_GPIO_INSTANCE_s::enabled
volatile bool enabled
Specifies, if this IO is used or not.
Definition: dev_buck_typedef.h:472
NPNZ_ADC_TRGCTRL_s::ptrADCTriggerARegister
volatile uint16_t * ptrADCTriggerARegister
Pointer to ADC trigger #1 register (e.g. TRIG1)
Definition: npnz16b.h:384
BUCK_ISNS_NORM_FACTOR
#define BUCK_ISNS_NORM_FACTOR
ISNS normalization factor scaled in Q15.
Definition: epc9143_r40_hwdescr.h:606
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_GPIO_SETTINGS_s::PowerGood
volatile struct BUCK_GPIO_INSTANCE_s PowerGood
Power Good Output.
Definition: dev_buck_typedef.h:490
BUCK_PWM1_ADTR1PS
#define BUCK_PWM1_ADTR1PS
ADC Trigger 1 Postscaler: 0...31.
Definition: epc9143_r40_hwdescr.h:309
BUCK_PWM2L_INIT
#define BUCK_PWM2L_INIT
Definition: epc9143_r40_hwdescr.h:348
v_loop_Update
void v_loop_Update(volatile struct NPNZ16b_s *controller)
Prototype of the Assembly feedback control loop routine helping to call the v_loop controller from C-...
BUCK_VOUT_TRGSRC
#define BUCK_VOUT_TRGSRC
PWM1 (=PG2) Trigger 1 via PGxTRIGA.
Definition: epc9143_r40_hwdescr.h:512
BUCK_AGC_MEDIAN
#define BUCK_AGC_MEDIAN
Adaptive gain modulation factor at nominal operating point.
Definition: epc9143_r40_hwdescr.h:671
BUCK_VOUT_ADCTRIG
#define BUCK_VOUT_ADCTRIG
Register used for trigger placement.
Definition: epc9143_r40_hwdescr.h:511
BUCK_AGC_NOM_SCALER
#define BUCK_AGC_NOM_SCALER
Bit-shift scaler of the floating point number of the maimum limit of the adaptive gain modulation fac...
Definition: epc9143_r40_hwdescr.h:672
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_ISNS1_ADCBUF
#define BUCK_ISNS1_ADCBUF
ADC input buffer of this ADC channel.
Definition: epc9143_r40_hwdescr.h:629
BUCK_ISNS2_ANSEL
#define BUCK_ISNS2_ANSEL
GPIO analog function mode enable bit.
Definition: epc9143_r40_hwdescr.h:636
BUCK_LOOP_SETTINGS_s::controller
volatile struct NPNZ16b_s * controller
pointer to control loop object data structure
Definition: dev_buck_typedef.h:353
NPNZ_GAIN_CONTROL_s::AgcMedian
volatile fractional AgcMedian
Q15 value of Adaptive Gain Modulation nominal operating point.
Definition: npnz16b.h:332
BUCK_GPIO_SETTINGS_s::EnableInput
volatile struct BUCK_GPIO_INSTANCE_s EnableInput
External ENABLE input.
Definition: dev_buck_typedef.h:489
BUCK_CONVERTER_DATA_s::temp
volatile uint16_t temp
BUCK board temperature.
Definition: dev_buck_typedef.h:302
BUCK_PWM2_ADTR1PS
#define BUCK_PWM2_ADTR1PS
ADC Trigger 1 Postscaler: 0...31.
Definition: epc9143_r40_hwdescr.h:361
PPS_LockIO
volatile uint16_t PPS_LockIO(void)
Locks the Peripheral Pin Select Configuration registers against accidental changes.
Definition: p33c_pps.c:75
NPNZ_PORT_s::Offset
volatile int16_t Offset
Value/signal offset of this port.
Definition: npnz16b.h:231
NPNZ_EXTENSION_HOOKS_s::ptrExtHookEndFunction
volatile uint16_t ptrExtHookEndFunction
Pointer to Function which is called at the end of the control loop and will also be called when the c...
Definition: npnz16b.h:455
BUCK_PGD
#define BUCK_PGD
Definition: epc9143_r40_hwdescr.h:734
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
v_loop_Reset
void v_loop_Reset(volatile struct NPNZ16b_s *controller)
Prototype of the Assembly routine '_v_loop_Reset' clearing the NPNZ16b controller output and error hi...
BUCK_VOUT_TRIGGER_MODE
#define BUCK_VOUT_TRIGGER_MODE
Currently selected voltage loop interrupt vector.
Definition: epc9143_r40_hwdescr.h:809
v_loop
volatile struct NPNZ16b_s v_loop
External reference to user-defined NPNZ16b controller data object 'v_loop'.
Definition: v_loop.c:98
BUCK_ISNS2_ADCIN
#define BUCK_ISNS2_ADCIN
Analog input number (e.g. '5' for 'AN5')
Definition: epc9143_r40_hwdescr.h:638
BUCK_VIN_ADCIN
#define BUCK_VIN_ADCIN
Analog input number (e.g. '5' for 'AN5')
Definition: epc9143_r40_hwdescr.h:435
BUCK_ADC_INPUT_SCALING_s::factor
volatile int16_t factor
Fractional scaling factor (range -1 ... 0.99969)
Definition: dev_buck_typedef.h:412
BUCK_VIN_ADCCORE
#define BUCK_VIN_ADCCORE
0=Dedicated Core #0, 1=Dedicated Core #1, 8=Shared ADC Core
Definition: epc9143_r40_hwdescr.h:434
BUCK_CONVERTER_STARTUP_s::v_ramp
volatile struct BUCK_STARTUP_PERIOD_HANDLER_s v_ramp
Definition: dev_buck_typedef.h:284
NPNZ_PORT_s::NormScaler
volatile int16_t NormScaler
Bit-shift scaler of the Q15 normalization factor.
Definition: npnz16b.h:229
BUCK_PWM1_ADTR1OFS
#define BUCK_PWM1_ADTR1OFS
ADC Trigger 1 Offset: 0...31.
Definition: epc9143_r40_hwdescr.h:308
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_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_ADC_INPUT_SETTINGS_s::level_trigger
volatile bool level_trigger
input channel level trigger mode enable bit
Definition: dev_buck_typedef.h:437
NPNZ_USER_DATA_BUFFER_s::usrParam3
volatile uint16_t usrParam3
generic 16-bit wide, user-defined parameter #4 for advanced control options
Definition: npnz16b.h:479
NPNZ_LIMITS_s::MaxOutput
volatile int16_t MaxOutput
Maximum output value used for clamping (R/W)
Definition: npnz16b.h:358
BUCK_PWM2H_RPx
#define BUCK_PWM2H_RPx
Device Pin output remappable pin number (RPx)
Definition: epc9143_r40_hwdescr.h:341
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_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::adc_input
volatile uint8_t adc_input
number of the ADC input channel used
Definition: dev_buck_typedef.h:430
NPNZ_USER_DATA_BUFFER_s::usrParam4
volatile uint16_t usrParam4
generic 16-bit wide, user-defined parameter #5 for advanced control options
Definition: npnz16b.h:480
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_PWM1_CHANNEL
#define BUCK_PWM1_CHANNEL
PWM peripheral output pins, control signals and register assignments of converter phase #1.
Definition: epc9143_r40_hwdescr.h:283
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_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
NPNZ_DATA_PROVIDERS_s::ptrDProvControlInputCompensated
volatile uint16_t * ptrDProvControlInputCompensated
Pointer to external data buffer of most recent, compensated control input.
Definition: npnz16b.h:412
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_PWM1_GPIO_PORT_PINH
#define BUCK_PWM1_GPIO_PORT_PINH
Port Pin Number.
Definition: epc9143_r40_hwdescr.h:285