You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
532 B
24 lines
532 B
#pragma once
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef struct {
|
|
int uartNum;
|
|
} motor_t;
|
|
typedef enum {
|
|
kRunToPosition,
|
|
} motor_event_t;
|
|
typedef void (*motor_on_event_t)(motor_event_t event);
|
|
|
|
bool motor_turning;
|
|
|
|
void motor_init(motor_t* motor);
|
|
void motor_set_zero_point();
|
|
double motor_get_position_degree();
|
|
uint8_t motor_run_to_postion(int rotation_direction, double position, int speed_level);
|
|
void motor_reg_event_cb(motor_on_event_t onevent);
|
|
|
|
void motor_module_schedule();
|
|
|
|
bool motor_stop();
|