13 #include <mbot/defs/mbot_pins.h>
16 static uint16_t slice_frequencies[PWM_SLICES] = {0};
17 static uint16_t pwm_wraps[PWM_SLICES] = {0};
19 typedef enum mbot_motor_state {OFF, ON} mbot_motor_state;
22 typedef enum mbot_motor_pins {
34 static uint16_t motor_en[4] = {M0_EN, M1_EN, M2_EN, M3_EN};
35 static uint16_t motor_ph[4] = {M0_PH, M1_PH, M2_PH, M3_PH};
int mbot_motor_cleanup(uint8_t ch)
Cleanup motor settings.
Definition: motor.c:58
float mbot_motor_read_voltage()
Returns voltage for motor driver read from ADC3 on Pico+ boards.
Definition: motor.c:94
int mbot_motor_init(uint8_t ch)
Initialize motor with default frequency.
Definition: motor.c:47
void mbot_motor_adc_init()
Initialize ADC3 to read motor driver voltage. Must be called before mbot_motor_read_voltage.
Definition: motor.c:52
int mbot_motor_set_duty(uint8_t ch, float duty)
Set duty cycle for the motor using an int16_t value.
Definition: motor.c:67
int mbot_motor_init_freq(uint8_t ch, uint16_t freq)
Initialize motor with specific frequency.
Definition: motor.c:11