Functions | |
cy_rslt_t | mtb_pwrconv_init (mtb_stc_pwrconv_t const *inst) |
Initialize the Power Conversion Control System. More... | |
cy_rslt_t | mtb_pwrconv_enable (mtb_stc_pwrconv_t const *inst) |
Enables the Power Conversion Control System. More... | |
cy_rslt_t | mtb_pwrconv_start (mtb_stc_pwrconv_t const *inst) |
Starts the Power Conversion Control System. More... | |
cy_rslt_t | mtb_pwrconv_disable (mtb_stc_pwrconv_t const *inst) |
Disables (stops) the Power Conversion Control System. More... | |
__STATIC_INLINE uint32_t | mtb_pwrconv_get_state (mtb_stc_pwrconv_t const *inst, uint32_t mask) |
Returns the state of a Power Conversion Control System instance. More... | |
__STATIC_INLINE cy_rslt_t | mtb_pwrconv_set_target (mtb_stc_pwrconv_t const *inst, uint32_t targ) |
Sets the desired target reference value mtb_stc_pwrconv_ctx_t::targ for the Ramp Generator. More... | |
__STATIC_INLINE void | mtb_pwrconv_ramp (mtb_stc_pwrconv_t const *inst) |
Generates the reference ramping for soft-start and target changing features. More... | |
__STATIC_FORCEINLINE int32_t | mtb_pwrconv_get_error (mtb_stc_pwrconv_ctx_t *ctx) |
Calculates the error value from the result mtb_stc_pwrconv_ctx_t::res and reference mtb_stc_pwrconv_ctx_t::ref values and stores it into the context structure mtb_stc_pwrconv_ctx_t::err. More... | |
cy_rslt_t mtb_pwrconv_init | ( | mtb_stc_pwrconv_t const * | inst | ) |
Initialize the Power Conversion Control System.
This function initializes all the HW and FW resources of the Power Conversion Solution.
[in] | inst | The pointer to the power convertor instance structure. |
cy_rslt_t mtb_pwrconv_enable | ( | mtb_stc_pwrconv_t const * | inst | ) |
Enables the Power Conversion Control System.
This function enables (prepares to run) the Power Conversion components: PWM, ADC and regulator.
[in] | inst | The pointer to the power converter instance structure. |
cy_rslt_t mtb_pwrconv_start | ( | mtb_stc_pwrconv_t const * | inst | ) |
Starts the Power Conversion Control System.
This function triggers the synchronous start of the Power Conversion PWM(s)
[in] | inst | The pointer to the power converter instance structure. |
cy_rslt_t mtb_pwrconv_disable | ( | mtb_stc_pwrconv_t const * | inst | ) |
Disables (stops) the Power Conversion Control System.
This function disables (stops) the Power Conversion components: stops PWM(s) and DAC(s) (if used), and disables ADC interrupts.
[in] | inst | The pointer to the power converter instance structure |
__STATIC_INLINE uint32_t mtb_pwrconv_get_state | ( | mtb_stc_pwrconv_t const * | inst, |
uint32_t | mask | ||
) |
Returns the state of a Power Conversion Control System instance.
[in] | inst | The pointer to the power converter instance structure. |
[in] | mask | The mask to get one or more specified power converter states. |
__STATIC_INLINE cy_rslt_t mtb_pwrconv_set_target | ( | mtb_stc_pwrconv_t const * | inst, |
uint32_t | targ | ||
) |
Sets the desired target reference value mtb_stc_pwrconv_ctx_t::targ for the Ramp Generator.
In the MTB_PWRCONV_STATE_RUN state, it also triggers MTB_PWRCONV_STATE_RAMP, see mtb_pwrconv_get_state
mtb_stc_pwrconv_ctx_t::targ is recalculated from millivolts into feedback ADC counts using the mtb_stc_pwrconv_t::refNum and mtb_stc_pwrconv_t::refDen values in the Infineon Control Loop mode.
Also, in the Infineon Control Loop mode, the target value is limited by the mtb_stc_pwrconv_t::targMax and mtb_stc_pwrconv_t::targMin values - they are defined by the min/max controlled parameter (Vout/Iout) in the PCC tool:
In the Custom Control Loop mode, mtb_stc_pwrconv_t::refNum and mtb_stc_pwrconv_t::refDen are both initialized as '1', and mtb_stc_pwrconv_t::targMin and mtb_stc_pwrconv_t::targMax are the minimal and maximal uint32 values correspondingly.
However, all these values can be customized in the application code by storing the instance configuration structure in RAM (configurable in the Device Configurator):
[in] | inst | The pointer to the power converter instance structure. |
[in] | targ | The target value to be set. The valid range is defined by mtb_stc_pwrconv_t::targMin and mtb_stc_pwrconv_t::targMax. |
__STATIC_INLINE void mtb_pwrconv_ramp | ( | mtb_stc_pwrconv_t const * | inst | ) |
Generates the reference ramping for soft-start and target changing features.
See the Ramp Generator section for details.
[in] | inst | The pointer to the power converter instance structure. |
__STATIC_FORCEINLINE int32_t mtb_pwrconv_get_error | ( | mtb_stc_pwrconv_ctx_t * | ctx | ) |
Calculates the error value from the result mtb_stc_pwrconv_ctx_t::res and reference mtb_stc_pwrconv_ctx_t::ref values and stores it into the context structure mtb_stc_pwrconv_ctx_t::err.
[in] | ctx | The pointer to the power converter instance context structure. |