102#ifndef CONFIG_MOTOR_DRIVER_MAX
103#define CONFIG_MOTOR_DRIVER_MAX (2)
110#define MOTOR_DRIVER_DEV(x) (x)
163 int32_t pwm_duty_cycle);
201 int32_t pwm_duty_cycle);
Low-level GPIO peripheral driver interface definitions.
#define CONFIG_MOTOR_DRIVER_MAX
Maximum number of motors by motor driver.
int motor_brake(const motor_driver_t motor_driver, uint8_t motor_id)
Brake the motor of a given motor driver.
void(* motor_driver_cb_t)(const motor_driver_t motor_driver, uint8_t motor_id, int32_t pwm_duty_cycle)
Motor callback.
motor_direction_t
Describe DC motor direction states.
unsigned int motor_driver_t
Default motor driver type definition.
motor_driver_mode_t
Describe DC motor driver modes.
int motor_set(const motor_driver_t motor_driver, uint8_t motor_id, int32_t pwm_duty_cycle)
Set motor speed and direction.
void motor_disable(const motor_driver_t motor_driver, uint8_t motor_id)
Disable a motor of a given motor driver.
void motor_enable(const motor_driver_t motor_driver, uint8_t motor_id)
Enable a motor of a given motor driver.
int motor_driver_init(const motor_driver_t motor_driver)
Initialize DC motor driver board.
motor_driver_mode_brake_t
Describe DC motor driver brake modes.
@ MOTOR_CCW
counter clockwise
@ MOTOR_DRIVER_1_DIR
Single GPIO for direction, \ no BRAKE.
@ MOTOR_DRIVER_1_DIR_BRAKE
Single GPIO for direction, \ Single GPIO for BRAKE.
@ MOTOR_DRIVER_2_DIRS
2 GPIOS for direction, \ handling BRAKE
@ MOTOR_BRAKE_LOW
Low stage brake.
@ MOTOR_BRAKE_HIGH
High stage brake.
uint_fast8_t pwm_t
Default PWM type definition.
Low-level PWM peripheral driver interface definitions.
Describe DC motor driver with PWM device and motors array.
uint32_t pwm_frequency
PWM device frequency.
pwm_mode_t pwm_mode
PWM mode.
motor_driver_mode_brake_t mode_brake
driver brake mode
motor_driver_cb_t cb
callback on motor_set
motor_driver_mode_t mode
driver mode
uint8_t nb_motors
number of moros
uint32_t pwm_resolution
PWM device resolution.
pwm_t pwm_dev
PWM device driving motors.
Describe DC motor with PWM channel and GPIOs.
uint8_t gpio_enable_invert
flag to set enable GPIO inverted mode
gpio_t gpio_dir0
GPIO to control rotation direction.
uint8_t gpio_brake_invert
flag to make brake active low
int pwm_channel
PWM channel the motor is connected to.
gpio_t gpio_enable
GPIO to enable/disable motor.
uint8_t gpio_dir_reverse
flag to reverse direction
gpio_t gpio_dir1_or_brake
GPIO to control rotation direction.