Files
esp32-racer/software/wacky_bully/components/drv8701/include/drv8701.h

39 lines
760 B
C

#ifndef DRV8701_H
#define DRV8701_H
#include "freertos/idf_additions.h"
// Enable PWM for speed control
// Phase chooses direction
typedef struct {
uint8_t en_pin;
uint8_t ph_pin;
uint8_t pwm_group_num;
// Do not populate, done as part of task creation
QueueHandle_t in_ctrl_queue;
SemaphoreHandle_t current_mutex;
} drv8701_task_config_t;
/**
* @brief Launch the motor driver task
*
* @param motor_cfg The configuration for the motor driver
*/
void drv8701_task(void *args);
/**
* @brief Set the velocity of a specific motor driver
*
* @param motor_cfg The configuration for the specific motor driver
* @param velocity -1.0 to 1.0
*/
void set_motor_vel(drv8701_task_config_t *motor_cfg, float velocity);
#endif