1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-05-16 20:18:06 +02:00
cdf2018-principal/chef/src/motor.h
2018-05-11 05:34:06 +02:00

50 lines
825 B
C

#ifndef __MOTOR_H__
#define __MOTOR_H__
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
#include "dimensions.h"
#define INVERSE_L_MOTOR
// #define INVERSE_R_MOTOR
#define ENABLE_RATE_LIMITER
// V/s
#define RATE_LIMITER_UP 6
#define RATE_LIMITER_DOWN 24
#define TESTINATOR
// #define TLE5206
#define IN1 0
#define IN2 1
#define IN3 2
#define IN4 3
enum motorState {
running,
braking,
freewheeling
};
// Public
void configureMotor();
void deconfigureMotor();
void setMoteurTension(float lVolt, float rVolt);
void setPWMTension(float lVolt, float rVolt);
int brake();
int freewheel();
int stop();
// Private
void* TaskMotor(void* pData);
uint8_t moteurTensionToPWM(float V);
void setMoteurTensionRaw(float lVolt, float rVolt, bool lFor, bool rFor);
void rawFreewheel();
void rawBrake();
#endif