Class PowerAPI
Public Functions
Type | Name |
---|---|
void | connectCapacitor (leg_t leg) Connect the electrolytic capacitor. |
void | connectDriver (leg_t leg) Turns the driver of the leg ON. This enables control over the power switches. |
void | disconnectCapacitor (leg_t leg) Disconnect the electrolytic capacitor. |
void | disconnectDriver (leg_t leg) Turns the driver of the leg ON. This disenables control over the power switches. |
void | initBoost (leg_t leg) Initialise all the legs for boost topology, current mode is not supported for boost. |
void | initBuck (leg_t leg, hrtim_pwm_mode_t leg_mode=VOLTAGE_MODE) Initialise a leg for buck topology. |
void | initMode (leg_t leg, \ hrtim_switch_convention_t leg_convention, \ hrtim_pwm_mode_t leg_mode) Initialize the power mode for a given leg. |
void | setAdcDecim (leg_t leg, uint16_t adc_decim) set ADC decimator for a leg |
void | setDeadTime (leg_t leg, \ uint16_t ns_rising_dt, \ uint16_t ns_falling_dt) set the dead time value for a leg |
void | setDutyCycle (leg_t leg, float32_t duty_leg) Set the duty cycle for a specific leg's power control. |
void | setPhaseShift (leg_t leg, int16_t phase_shift) Set the phase shift value for a specific leg's power control. |
void | setSlopeCompensation (leg_t leg, \ float32_t set_voltage, \ float32_t reset_voltage) Set the slope compensation in current mode for a leg. |
void | setTriggerValue (leg_t leg, float32_t trigger_value) Set the trigger value for a specific leg's ADC trigger. |
void | start (leg_t leg) Start power output for a specific leg. |
void | stop (leg_t leg) Stop power output for a specific leg. |
Public Functions Documentation
function connectCapacitor
Connect the electrolytic capacitor.
Parameters:
leg
The selected leg for which the capacitor will be connected.
Warning:
This function can only be called AFTER initializing the LEG.
function connectDriver
Turns the driver of the leg ON. This enables control over the power switches.
Parameters:
leg
The leg for which the driver will be turned on.
Warning:
This function can only be called AFTER initializing the LEG.
function disconnectCapacitor
Disconnect the electrolytic capacitor.
Parameters:
leg
The selected leg for which the capacitor will be disconnected.
Warning:
This function can only be called AFTER initializing the LEG.
function disconnectDriver
Turns the driver of the leg ON. This disenables control over the power switches.
Parameters:
leg
The leg for which the driver will be turned off.
Warning:
This function can only be called AFTER initializing the LEG.
function initBoost
Initialise all the legs for boost topology, current mode is not supported for boost.
Parameters:
leg
Leg to initialize
function initBuck
Initialise a leg for buck topology.
Parameters:
leg
Leg to initializeleg_mode
PWM mode - VOLTAGE_MODE or CURRENT_MODE
function initMode
Initialize the power mode for a given leg.
void PowerAPI::initMode (
leg_t leg,
\ hrtim_switch_convention_t leg_convention,
\ hrtim_pwm_mode_t leg_mode
)
This function configures modulation, frequency, phase shift, dead time, and other parameters for power control of a specified leg.
Parameters:
leg
The leg to initializeleg_convention
PWM Switch to be driven by the duty cycle. The other will be complementary - PWMx1 or PWMx2leg_mode
PWM mode - VOLTAGE_MODE or CURRENT_MODE
function setAdcDecim
set ADC decimator for a leg
this function sets the number of event which will be ignored between two events. ie. you divide the number of trigger in a fixed period. For example if adc_decim = 1, nothing changes but with adc_decims = 2 you have twice less adc trigger.
Parameters:
leg
- leg for which to set adc decimator valueadc_decim
- adc decimator, a number between 1 and 32
function setDeadTime
set the dead time value for a leg
Parameters:
leg
- the leg for which to set dead time valuens_rising_dt
- rising dead time value in nsns_falling_dt
- falling dead time value in ns
function setDutyCycle
Set the duty cycle for a specific leg's power control.
This function sets the duty cycle for the power control of a specified leg. The duty cycle determines the ON/OFF ratio of the power signal for the leg.
Parameters:
leg
The leg for which to set the duty cycle.duty_leg
The duty cycle value to set (a floating-point number between 0.1 and 0.9).
function setPhaseShift
Set the phase shift value for a specific leg's power control.
Parameters:
leg
The leg for which to set the phase shift value.phase_shift
phase shift value in degrees between -360 and 360
function setSlopeCompensation
Set the slope compensation in current mode for a leg.
void PowerAPI::setSlopeCompensation (
leg_t leg,
\ float32_t set_voltage,
\ float32_t reset_voltage
)
Parameters:
leg
The leg to initializeset_voltage
in volt, the DAC peak voltage for slope compensation (value between 0 and 2.048)reset_voltage
in volt, the DAC lowest voltage for slope compensation (value between 0 and 2.048)
Warning:
Be sure that set_voltage > reset_voltage
function setTriggerValue
Set the trigger value for a specific leg's ADC trigger.
This function sets the trigger value for the ADC trigger of a specified leg. The trigger value determines the level at which the ADC trigger is activated.
Parameters:
leg
The leg for which to set the ADC trigger value.trigger_value
The trigger value to set between 0.05 and 0.95.
function start
Start power output for a specific leg.
This function initiates the power output for a specified leg by starting the PWM subunits associated with the leg's output pins. If the leg's output pins are not declared inactive in the device tree, the corresponding subunits are started. eg. If output1 is declared inactive in the device tree, PWMA1 will not start
Parameters:
leg
The leg for which to start the power output.
function stop
Stop power output for a specific leg.
Parameters:
leg
The leg for which to stop the power output.
The documentation for this class was generated from the following file docs/core/zephyr/modules/owntech_shield_api/zephyr/src/Power.h