Project structure redefined
This commit is contained in:
29
src/Motor/BrushedMotor.hpp
Normal file
29
src/Motor/BrushedMotor.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <stdint.h>
|
||||
|
||||
// TODO: implement class
|
||||
|
||||
class BrushedMotor {
|
||||
/* Driver for native MCPWM controller. */
|
||||
// TODO: define default values
|
||||
public:
|
||||
BrushedMotor(uint32_t PwmAGpioNum, uint32_t PwmBGpioNum, uint32_t PwmFreqHz,
|
||||
uint32_t McpwmResolutionHz, int McpwmGroupId = 0);
|
||||
void setDuty(uint16_t duty);
|
||||
uint16_t maxDuty();
|
||||
void enable();
|
||||
void disable();
|
||||
void forward();
|
||||
void reverse();
|
||||
void coast();
|
||||
void brake();
|
||||
|
||||
protected:
|
||||
/* MCPWM group */
|
||||
int _mcpwmGroupId = 0;
|
||||
uint32_t _mcpwmResolutionHz;
|
||||
|
||||
/* Brushed motor properties */
|
||||
uint32_t _pwmAGpioNum;
|
||||
uint32_t _pwmBGpioNum;
|
||||
uint32_t _pwmFreqHz;
|
||||
};
|
||||
Reference in New Issue
Block a user