HPM SDK
HPMicro Software Development Kit
hpm_mcl_hw_loop.h File Reference
#include "hpm_common.h"
#include "hpm_mcl_common.h"

Go to the source code of this file.

Data Structures

struct  mcl_hw_loop_callback_t
 Hardware loop callback. More...
 
struct  mcl_hw_loop_cfg_t
 Hardware loop configuration. More...
 
struct  mcl_hw_loop_t
 

Functions

static hpm_mcl_stat_t hpm_mcl_enable_vsc_hardware_loop (mcl_hw_loop_t *loop)
 Enable VSC hardware loop. More...
 
static hpm_mcl_stat_t hpm_mcl_disable_vsc_hardware_loop (mcl_hw_loop_t *loop)
 Disable VSC hardware loop. More...
 
static hpm_mcl_stat_t hpm_mcl_enable_clc_hardware_loop (mcl_hw_loop_t *loop)
 Enable CLC hardware loop. More...
 
static hpm_mcl_stat_t hpm_mcl_disable_clc_hardware_loop (mcl_hw_loop_t *loop)
 Disable CLC hardware loop. More...
 
static hpm_mcl_stat_t hpm_mcl_enable_qeo_hardware_loop (mcl_hw_loop_t *loop)
 Enable QEO hardware loop. More...
 
static hpm_mcl_stat_t hpm_mcl_disable_qeo_hardware_loop (mcl_hw_loop_t *loop)
 Disable QEO hardware loop. More...
 
static hpm_mcl_stat_t hpm_mcl_get_vsc_hardware_loop_status (mcl_hw_loop_t *loop, bool *status)
 Get VSC hardware loop status. More...
 
static hpm_mcl_stat_t hpm_mcl_get_clc_hardware_loop_status (mcl_hw_loop_t *loop, bool *status)
 Get CLC hardware loop status. More...
 
static hpm_mcl_stat_t hpm_mcl_get_qeo_hardware_loop_status (mcl_hw_loop_t *loop, bool *status)
 Get QEO hardware loop status. More...
 
hpm_mcl_stat_t hpm_mcl_hw_loop_init (mcl_hw_loop_t *loop, mcl_hw_loop_cfg_t *cfg)
 Initialize hardware loop components. More...
 
hpm_mcl_stat_t hpm_mcl_vsc_run (mcl_hw_loop_t *loop)
 Run VSC (Vector Signal Controller) hardware acceleration. More...
 
hpm_mcl_stat_t hpm_mcl_clc_run (mcl_hw_loop_t *loop, float d_expect, float q_expect)
 Run CLC (Current Loop Controller) hardware acceleration. More...
 
hpm_mcl_stat_t hpm_mcl_qeo_run (mcl_hw_loop_t *loop)
 Run QEO (Quadrature Encoder Output) hardware acceleration. More...
 

Function Documentation

◆ hpm_mcl_clc_run()

hpm_mcl_stat_t hpm_mcl_clc_run ( mcl_hw_loop_t loop,
float  d_expect,
float  q_expect 
)

Run CLC (Current Loop Controller) hardware acceleration.

This function performs current loop control using hardware CLC module. It calculates d-q axis voltage outputs based on expected and actual current values.

Parameters
loopPointer to hardware loop structure
d_expectExpected d-axis current reference
q_expectExpected q-axis current reference
Returns
mcl_success if operation successful, error code otherwise

◆ hpm_mcl_disable_clc_hardware_loop()

static hpm_mcl_stat_t hpm_mcl_disable_clc_hardware_loop ( mcl_hw_loop_t loop)
inlinestatic

Disable CLC hardware loop.

Parameters
loopmcl_hw_loop_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_disable_qeo_hardware_loop()

static hpm_mcl_stat_t hpm_mcl_disable_qeo_hardware_loop ( mcl_hw_loop_t loop)
inlinestatic

Disable QEO hardware loop.

Parameters
loopmcl_hw_loop_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_disable_vsc_hardware_loop()

static hpm_mcl_stat_t hpm_mcl_disable_vsc_hardware_loop ( mcl_hw_loop_t loop)
inlinestatic

Disable VSC hardware loop.

Parameters
loopmcl_hw_loop_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_enable_clc_hardware_loop()

static hpm_mcl_stat_t hpm_mcl_enable_clc_hardware_loop ( mcl_hw_loop_t loop)
inlinestatic

Enable CLC hardware loop.

Parameters
loopmcl_hw_loop_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_enable_qeo_hardware_loop()

static hpm_mcl_stat_t hpm_mcl_enable_qeo_hardware_loop ( mcl_hw_loop_t loop)
inlinestatic

Enable QEO hardware loop.

Parameters
loopmcl_hw_loop_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_enable_vsc_hardware_loop()

static hpm_mcl_stat_t hpm_mcl_enable_vsc_hardware_loop ( mcl_hw_loop_t loop)
inlinestatic

Enable VSC hardware loop.

Parameters
loopmcl_hw_loop_t
Returns
hpm_mcl_stat_t

◆ hpm_mcl_get_clc_hardware_loop_status()

static hpm_mcl_stat_t hpm_mcl_get_clc_hardware_loop_status ( mcl_hw_loop_t loop,
bool *  status 
)
inlinestatic

Get CLC hardware loop status.

Parameters
loopmcl_hw_loop_t
statuspointer to bool status
Returns
hpm_mcl_stat_t

◆ hpm_mcl_get_qeo_hardware_loop_status()

static hpm_mcl_stat_t hpm_mcl_get_qeo_hardware_loop_status ( mcl_hw_loop_t loop,
bool *  status 
)
inlinestatic

Get QEO hardware loop status.

Parameters
loopmcl_hw_loop_t
statuspointer to bool status
Returns
hpm_mcl_stat_t

◆ hpm_mcl_get_vsc_hardware_loop_status()

static hpm_mcl_stat_t hpm_mcl_get_vsc_hardware_loop_status ( mcl_hw_loop_t loop,
bool *  status 
)
inlinestatic

Get VSC hardware loop status.

Parameters
loopmcl_hw_loop_t
statuspointer to bool status
Returns
hpm_mcl_stat_t

◆ hpm_mcl_hw_loop_init()

hpm_mcl_stat_t hpm_mcl_hw_loop_init ( mcl_hw_loop_t loop,
mcl_hw_loop_cfg_t cfg 
)

Initialize hardware loop components.

This function initializes the hardware loop components including VSC, CLC, and QEO modules. Each component is initialized through callback functions if they are configured.

Parameters
loopPointer to hardware loop structure
cfgPointer to hardware loop configuration
Returns
mcl_success if initialization successful, error code otherwise

◆ hpm_mcl_qeo_run()

hpm_mcl_stat_t hpm_mcl_qeo_run ( mcl_hw_loop_t loop)

Run QEO (Quadrature Encoder Output) hardware acceleration.

This function performs inverse Park and inverse Clarke transformations using hardware QEO module. It converts d-q voltages to three-phase PWM duty cycles.

Parameters
loopPointer to hardware loop structure
Returns
mcl_success if operation successful, error code otherwise

◆ hpm_mcl_vsc_run()

hpm_mcl_stat_t hpm_mcl_vsc_run ( mcl_hw_loop_t loop)

Run VSC (Vector Signal Controller) hardware acceleration.

This function performs Clarke and Park transformations using hardware VSC module. It converts three-phase currents (ia, ib, ic) to alpha-beta and d-q coordinates.

Parameters
loopPointer to hardware loop structure
Returns
mcl_success if operation successful, error code otherwise