mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
drivers/foc: get hardware information via lower-half interface
This commit is contained in:
@@ -98,9 +98,9 @@ struct foc_params_s
|
||||
foc_duty_t duty[CONFIG_MOTOR_FOC_PHASES]; /* PWM duty cycle for phases */
|
||||
};
|
||||
|
||||
/* Hardware specific configuration */
|
||||
/* Hardware specific informations */
|
||||
|
||||
struct foc_hw_config_s
|
||||
struct foc_info_hw_s
|
||||
{
|
||||
uint32_t pwm_dt_ns; /* PWM dead-time in nano seconds */
|
||||
foc_duty_t pwm_max; /* Maximum PWM duty cycle */
|
||||
@@ -110,7 +110,7 @@ struct foc_hw_config_s
|
||||
|
||||
struct foc_info_s
|
||||
{
|
||||
struct foc_hw_config_s hw_cfg; /* Hardware specific configuration */
|
||||
struct foc_info_hw_s hw_cfg; /* Hardware specific informations */
|
||||
};
|
||||
|
||||
/* FOC device upper-half */
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#define FOC_OPS_PWMOFF(d, o) (d)->lower->ops->pwm_off(d, o)
|
||||
#define FOC_OPS_DUTY(d, x) (d)->lower->ops->pwm_duty_set(d, x)
|
||||
#define FOC_OPS_IOCTL(d, c, a) (d)->lower->ops->ioctl(d, c, a)
|
||||
#define FOC_OPS_INFOGET(d, i) (d)->lower->ops->info_get(d, i)
|
||||
#define FOC_OPS_BIND(d, c) (d)->lower->ops->bind(d, c)
|
||||
#define FOC_OPS_FAULT_CLEAR(d) (d)->lower->ops->fault_clear(d)
|
||||
#ifdef CONFIG_MOTOR_FOC_TRACE
|
||||
@@ -119,6 +120,11 @@ struct foc_lower_ops_s
|
||||
|
||||
CODE int (*start)(FAR struct foc_dev_s *dev, bool state);
|
||||
|
||||
/* Get all hardware information */
|
||||
|
||||
CODE int (*info_get)(FAR struct foc_dev_s *dev,
|
||||
FAR struct foc_info_s *info);
|
||||
|
||||
/* Lower-half IOCTL */
|
||||
|
||||
CODE int (*ioctl)(FAR struct foc_dev_s *dev, int cmd,
|
||||
|
||||
Reference in New Issue
Block a user