ModusToolbox Power Conversion Middleware
All Data Structures Functions Variables Typedefs Modules Pages
Functions

General Description

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...
 

Function Documentation

◆ mtb_pwrconv_init()

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.

Parameters
[in]instThe pointer to the power convertor instance structure.
Returns
The result of the function operation Status

◆ mtb_pwrconv_enable()

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.

Parameters
[in]instThe pointer to the power converter instance structure.
Returns
The result of the function operation Status Currently it returns always MTB_PWRCONV_RSLT_SUCCESS, for future capabilities.

◆ mtb_pwrconv_start()

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)

Parameters
[in]instThe pointer to the power converter instance structure.
Returns
The result of the function operation Status Possible error codes from underlying Trigger Multiplexer PDL API.

◆ mtb_pwrconv_disable()

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.

Parameters
[in]instThe pointer to the power converter instance structure
Returns
The result of the function operation Status Currently it returns always MTB_PWRCONV_RSLT_SUCCESS, for future capabilities.

◆ mtb_pwrconv_get_state()

__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.

Parameters
[in]instThe pointer to the power converter instance structure.
[in]maskThe mask to get one or more specified power converter states.
Returns
The power converter state States.

◆ mtb_pwrconv_set_target()

__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):

Parameters
[in]instThe pointer to the power converter instance structure.
[in]targThe target value to be set. The valid range is defined by mtb_stc_pwrconv_t::targMin and mtb_stc_pwrconv_t::targMax.
Returns
The reference value validness status Status
Function Usage
See Ramp Generator section

◆ mtb_pwrconv_ramp()

__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.

Parameters
[in]instThe pointer to the power converter instance structure.
Function Usage
See the Ramp Generator section

◆ mtb_pwrconv_get_error()

__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.

Parameters
[in]ctxThe pointer to the power converter instance context structure.
Returns
The error value, also saved into mtb_stc_pwrconv_ctx_t::err.
Function Usage
See myPwrConv_get_error()