generated from sirlilpanda/kicad-project-template-actionless
Created wacky_bully project + a bit of work towards implementing motor drivers
This commit is contained in:
38
software/wacky_bully/components/drv8701/include/drv8701.h
Normal file
38
software/wacky_bully/components/drv8701/include/drv8701.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user