Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions inc/Controller.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

/**
* @brief Interface for motor speed controllers
* @author Erick Daniel Ortiz Cervantes
* @date October 26, 2024
*/
#ifndef Controller_HPP
#define Controller_HPP

#include "stm32f4xx_hal.h"

typedef enum { PWM, CAN } ControllerType;

class Controller {
private:
// Defines the controller type for debugging purposes
ControllerType type;

public:
Controller();
~Controller();

void setType(ControllerType);
ControllerType getType();

// Abstract functions
virtual void sendSignal(uint32_t);
virtual uint32_t readSignal();
virtual void stopActuator(uint32_t);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Este por qué?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creo que lo habia puesto para tener explícito un método para asignar a 0 el valor del actuador, pero si gustas lo puedo eliminar

};

#endif