mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-08-17 17:01:58 +08:00
25 lines
572 B
C++
25 lines
572 B
C++
#ifndef __MECHANICAL_BRAKE_HPP
|
|
#define __MECHANICAL_BRAKE_HPP
|
|
|
|
#include <autogen/interfaces.hpp>
|
|
|
|
class MechanicalBrake : public ODriveIntf::MechanicalBrakeIntf {
|
|
public:
|
|
struct Config_t {
|
|
uint16_t gpio_num = 0;
|
|
bool is_active_low = true;
|
|
|
|
// custom setters
|
|
MechanicalBrake* parent = nullptr;
|
|
void set_gpio_num(uint16_t value) { gpio_num = value; }
|
|
};
|
|
|
|
MechanicalBrake() {}
|
|
|
|
MechanicalBrake::Config_t config_;
|
|
Axis* axis_ = nullptr;
|
|
|
|
void release();
|
|
void engage();
|
|
};
|
|
#endif // __MECHANICAL_BRAKE_HPP
|