9#ifndef INC_MOTOR_DRIVER_H_
10#define INC_MOTOR_DRIVER_H_
15#include "stm32f4xx_hal.h"
23 TIM_HandleTypeDef *
tim;
void go_to(motor_t *p_mot, int k_p, int where, int from)
Uses proportional control to move motor to a target.
Definition motor_driver.c:65
void disable(motor_t *p_mot)
Disables the motor by setting both channels to zero.
Definition motor_driver.c:40
void enable(motor_t *p_mot)
Enables the motor by setting both channels to maximum.
Definition motor_driver.c:51
void set_duty(motor_t *p_mot, int32_t duty)
Sets the duty cycle and direction of the motor.
Definition motor_driver.c:23
Motor object data structure.
Definition motor_driver.h:22
uint32_t chan2
Definition motor_driver.h:25
uint32_t chan1
Definition motor_driver.h:24
TIM_HandleTypeDef * tim
Definition motor_driver.h:23