industry/foc/*/foc_angle.c: add methods to set the zero angle and direction of the angle
This commit is contained in:
parent
2e61b3e310
commit
6cafdae44a
@ -74,6 +74,14 @@ struct foc_angle_ops_b16_s
|
|||||||
|
|
||||||
CODE int (*cfg)(FAR foc_angle_b16_t *h, FAR void *cfg);
|
CODE int (*cfg)(FAR foc_angle_b16_t *h, FAR void *cfg);
|
||||||
|
|
||||||
|
/* Zero */
|
||||||
|
|
||||||
|
CODE int (*zero)(FAR foc_angle_b16_t *h);
|
||||||
|
|
||||||
|
/* Direction */
|
||||||
|
|
||||||
|
CODE int (*dir)(FAR foc_angle_b16_t *h, b16_t dir);
|
||||||
|
|
||||||
/* Run */
|
/* Run */
|
||||||
|
|
||||||
CODE int (*run)(FAR foc_angle_b16_t *h,
|
CODE int (*run)(FAR foc_angle_b16_t *h,
|
||||||
@ -131,6 +139,18 @@ int foc_angle_deinit_b16(FAR foc_angle_b16_t *h);
|
|||||||
|
|
||||||
int foc_angle_cfg_b16(FAR foc_angle_b16_t *h, FAR void *cfg);
|
int foc_angle_cfg_b16(FAR foc_angle_b16_t *h, FAR void *cfg);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_zero_b16
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_zero_b16(FAR foc_angle_b16_t *h);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_dir_b16
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_dir_b16(FAR foc_angle_b16_t *h, b16_t dir);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: foc_angle_run_b16
|
* Name: foc_angle_run_b16
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -74,6 +74,14 @@ struct foc_angle_ops_f32_s
|
|||||||
|
|
||||||
CODE int (*cfg)(FAR foc_angle_f32_t *h, FAR void *cfg);
|
CODE int (*cfg)(FAR foc_angle_f32_t *h, FAR void *cfg);
|
||||||
|
|
||||||
|
/* Zero */
|
||||||
|
|
||||||
|
CODE int (*zero)(FAR foc_angle_f32_t *h);
|
||||||
|
|
||||||
|
/* Direction */
|
||||||
|
|
||||||
|
CODE int (*dir)(FAR foc_angle_f32_t *h, float dir);
|
||||||
|
|
||||||
/* Run angle handler */
|
/* Run angle handler */
|
||||||
|
|
||||||
CODE int (*run)(FAR foc_angle_f32_t *h,
|
CODE int (*run)(FAR foc_angle_f32_t *h,
|
||||||
@ -131,6 +139,18 @@ int foc_angle_deinit_f32(FAR foc_angle_f32_t *h);
|
|||||||
|
|
||||||
int foc_angle_cfg_f32(FAR foc_angle_f32_t *h, FAR void *cfg);
|
int foc_angle_cfg_f32(FAR foc_angle_f32_t *h, FAR void *cfg);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_zero_f32
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_zero_f32(FAR foc_angle_f32_t *h);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_dir_f32
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_dir_f32(FAR foc_angle_f32_t *h, float dir);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: foc_angle_run_f32
|
* Name: foc_angle_run_f32
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -130,6 +130,42 @@ int foc_angle_cfg_b16(FAR foc_angle_b16_t *h, FAR void *cfg)
|
|||||||
return h->ops->cfg(h, cfg);
|
return h->ops->cfg(h, cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_zero_b16
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Reset the FOC angle handler (fixed16)
|
||||||
|
*
|
||||||
|
* Input Parameter:
|
||||||
|
* h - pointer to FOC angle handler
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_zero_b16(FAR foc_angle_b16_t *h)
|
||||||
|
{
|
||||||
|
DEBUGASSERT(h);
|
||||||
|
|
||||||
|
return h->ops->zero(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_dir_b16
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Set the FOC angle handler direction (fixed16)
|
||||||
|
*
|
||||||
|
* Input Parameter:
|
||||||
|
* h - pointer to FOC angle handler
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_dir_b16(FAR foc_angle_b16_t *h, b16_t dir)
|
||||||
|
{
|
||||||
|
DEBUGASSERT(h);
|
||||||
|
|
||||||
|
return h->ops->dir(h, dir);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: foc_angle_run_b16
|
* Name: foc_angle_run_b16
|
||||||
*
|
*
|
||||||
|
@ -130,6 +130,42 @@ int foc_angle_cfg_f32(FAR foc_angle_f32_t *h, FAR void *cfg)
|
|||||||
return h->ops->cfg(h, cfg);
|
return h->ops->cfg(h, cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_zero_f32
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Reset the FOC angle handler (float32)
|
||||||
|
*
|
||||||
|
* Input Parameter:
|
||||||
|
* h - pointer to FOC angle handler
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_zero_f32(FAR foc_angle_f32_t *h)
|
||||||
|
{
|
||||||
|
DEBUGASSERT(h);
|
||||||
|
|
||||||
|
return h->ops->zero(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: foc_angle_dir_f32
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Set the FOC angle handler direction (float32)
|
||||||
|
*
|
||||||
|
* Input Parameter:
|
||||||
|
* h - pointer to FOC angle handler
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int foc_angle_dir_f32(FAR foc_angle_f32_t *h, float dir)
|
||||||
|
{
|
||||||
|
DEBUGASSERT(h);
|
||||||
|
|
||||||
|
return h->ops->dir(h, dir);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: foc_angle_run_f32
|
* Name: foc_angle_run_f32
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user