7 #ifndef HPM_MCL_HW_LOOP_H
8 #define HPM_MCL_HW_LOOP_H
20 void (*vsc_init)(
void *data);
21 void (*clc_init)(
void *data);
22 void (*qeo_init)(
void *data);
24 void (*vsc_pre_process)(
void *loop);
25 void (*clc_pre_process)(
void *loop);
26 void (*qeo_pre_process)(
void *loop);
28 void (*vsc_post_process)(
void *loop);
29 void (*clc_post_process)(
void *loop);
30 void (*qeo_post_process)(
void *loop);
32 void (*vsc_convert_input)(
float ia,
float ib,
float ic,
float position, uint32_t *ia_hardware, uint32_t *ib_hardware, uint32_t *ic_hardware, uint32_t *position_hardware);
33 void (*clc_convert_input)(
float d,
float q, uint32_t *d_hardware, uint32_t *q_hardware);
34 void (*qeo_convert_input)(
float ud,
float uq,
float predicted_position, uint32_t *ud_hardware, uint32_t *uq_hardware, uint32_t *predicted_position_hardware);
36 void (*vsc_convert_output)(uint32_t alpha_hardware, uint32_t beta_hardware, uint32_t d_hardware, uint32_t q_hardware,
float *alpha,
float *beta,
float *d,
float *q);
37 void (*clc_convert_output)(uint32_t ud_hardware, uint32_t uq_hardware,
float *ud,
float *uq);
38 void (*qeo_convert_output)(uint32_t duty_u_hardware, uint32_t duty_v_hardware, uint32_t duty_w_hardware,
float *duty_u,
float *duty_v,
float *duty_w);
uint32_t hpm_mcl_stat_t
Definition: hpm_mcl_common.h:15
#define MCL_ASSERT_OPT
Definition: hpm_mcl_common.h:89
@ mcl_invalid_pointer
Definition: hpm_mcl_common.h:38
@ mcl_success
Definition: hpm_mcl_common.h:35
hpm_mcl_stat_t hpm_mcl_qeo_run(mcl_hw_loop_t *loop)
Run QEO (Quadrature Encoder Output) hardware acceleration.
Definition: hpm_mcl_hw_loop.c:148
static hpm_mcl_stat_t hpm_mcl_disable_clc_hardware_loop(mcl_hw_loop_t *loop)
Disable CLC hardware loop.
Definition: hpm_mcl_hw_loop.h:154
static hpm_mcl_stat_t hpm_mcl_enable_qeo_hardware_loop(mcl_hw_loop_t *loop)
Enable QEO hardware loop.
Definition: hpm_mcl_hw_loop.h:168
static hpm_mcl_stat_t hpm_mcl_get_qeo_hardware_loop_status(mcl_hw_loop_t *loop, bool *status)
Get QEO hardware loop status.
Definition: hpm_mcl_hw_loop.h:227
static hpm_mcl_stat_t hpm_mcl_disable_vsc_hardware_loop(mcl_hw_loop_t *loop)
Disable VSC hardware loop.
Definition: hpm_mcl_hw_loop.h:126
static hpm_mcl_stat_t hpm_mcl_enable_vsc_hardware_loop(mcl_hw_loop_t *loop)
Enable VSC hardware loop.
Definition: hpm_mcl_hw_loop.h:112
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.
Definition: hpm_mcl_hw_loop.c:100
hpm_mcl_stat_t hpm_mcl_hw_loop_init(mcl_hw_loop_t *loop, mcl_hw_loop_cfg_t *cfg)
Initialize hardware loop components.
Definition: hpm_mcl_hw_loop.c:19
static hpm_mcl_stat_t hpm_mcl_get_clc_hardware_loop_status(mcl_hw_loop_t *loop, bool *status)
Get CLC hardware loop status.
Definition: hpm_mcl_hw_loop.h:212
static hpm_mcl_stat_t hpm_mcl_enable_clc_hardware_loop(mcl_hw_loop_t *loop)
Enable CLC hardware loop.
Definition: hpm_mcl_hw_loop.h:140
static hpm_mcl_stat_t hpm_mcl_disable_qeo_hardware_loop(mcl_hw_loop_t *loop)
Disable QEO hardware loop.
Definition: hpm_mcl_hw_loop.h:182
static hpm_mcl_stat_t hpm_mcl_get_vsc_hardware_loop_status(mcl_hw_loop_t *loop, bool *status)
Get VSC hardware loop status.
Definition: hpm_mcl_hw_loop.h:197
hpm_mcl_stat_t hpm_mcl_vsc_run(mcl_hw_loop_t *loop)
Run VSC (Vector Signal Controller) hardware acceleration.
Definition: hpm_mcl_hw_loop.c:57
Hardware loop callback.
Definition: hpm_mcl_hw_loop.h:19
Hardware loop configuration.
Definition: hpm_mcl_hw_loop.h:44
mcl_hw_loop_callback_t callback
Definition: hpm_mcl_hw_loop.h:57
void * base
Definition: hpm_mcl_hw_loop.h:47
Definition: hpm_mcl_hw_loop.h:60
bool clc_enabled
Definition: hpm_mcl_hw_loop.h:65
float duty_w
Definition: hpm_mcl_hw_loop.h:99
float position
Definition: hpm_mcl_hw_loop.h:90
float beta
Definition: hpm_mcl_hw_loop.h:92
uint32_t duty_w
Definition: hpm_mcl_hw_loop.h:83
uint32_t ud
Definition: hpm_mcl_hw_loop.h:79
float duty_v
Definition: hpm_mcl_hw_loop.h:98
float uq
Definition: hpm_mcl_hw_loop.h:96
float q
Definition: hpm_mcl_hw_loop.h:94
float ic
Definition: hpm_mcl_hw_loop.h:89
bool vsc_enabled
Definition: hpm_mcl_hw_loop.h:64
float ib
Definition: hpm_mcl_hw_loop.h:88
bool qeo_enabled
Definition: hpm_mcl_hw_loop.h:66
uint32_t q
Definition: hpm_mcl_hw_loop.h:78
uint32_t ib
Definition: hpm_mcl_hw_loop.h:72
mcl_hw_loop_cfg_t * cfg
Definition: hpm_mcl_hw_loop.h:61
uint32_t position
Definition: hpm_mcl_hw_loop.h:74
uint32_t duty_v
Definition: hpm_mcl_hw_loop.h:82
float predicted_position
Definition: hpm_mcl_hw_loop.h:100
uint32_t d
Definition: hpm_mcl_hw_loop.h:77
uint32_t ic
Definition: hpm_mcl_hw_loop.h:73
uint32_t predicted_position
Definition: hpm_mcl_hw_loop.h:84
float duty_u
Definition: hpm_mcl_hw_loop.h:97
struct mcl_hw_loop_t::@1006 hw_loop_status
uint32_t ia
Definition: hpm_mcl_hw_loop.h:71
uint32_t uq
Definition: hpm_mcl_hw_loop.h:80
uint32_t beta
Definition: hpm_mcl_hw_loop.h:76
float ud
Definition: hpm_mcl_hw_loop.h:95
uint32_t alpha
Definition: hpm_mcl_hw_loop.h:75
float ia
Definition: hpm_mcl_hw_loop.h:87
float d
Definition: hpm_mcl_hw_loop.h:93
uint32_t duty_u
Definition: hpm_mcl_hw_loop.h:81
float alpha
Definition: hpm_mcl_hw_loop.h:91