rusEFI
The most advanced open source ECU
|
Represents a DC motor controller (H-bridge) with some combination of PWM and on/off control pins. 2024: what does 'TwoPin' class name mean? is that just a historic artifact? More...
#include <dc_motor.h>
Public Types | |
enum class | ControlType { PwmDirectionPins , PwmEnablePin } |
Public Member Functions | |
TwoPinDcMotor (OutputPin &disable) | |
void | configure (IPwm &enable, IPwm &dir1, IPwm &dir2, bool isInverted) |
virtual bool | set (float duty) override |
float | get () const override |
Get the current motor duty cycle. | |
bool | isOpenDirection () const override |
void | enable () override |
void | disable (const char *msg) override |
void | setType (ControlType type) |
![]() | |
const char * | msg () const |
Private Attributes | |
IPwm * | m_enable = nullptr |
IPwm * | m_dir1 = nullptr |
IPwm * | m_dir2 = nullptr |
OutputPin *const | m_disable |
float | m_value = 0 |
bool | m_isInverted = false |
ControlType | m_type = ControlType::PwmDirectionPins |
Additional Inherited Members | |
![]() | |
const char * | m_msg = nullptr |
Represents a DC motor controller (H-bridge) with some combination of PWM and on/off control pins. 2024: what does 'TwoPin' class name mean? is that just a historic artifact?
Definition at line 55 of file dc_motor.h.
|
strong |
Definition at line 58 of file dc_motor.h.
TwoPinDcMotor::TwoPinDcMotor | ( | OutputPin & | disable | ) |
enable | IPwm driver for enable pin, for PWM speed control. |
dir1 | Enable 1 or direction 1 pin. Gets set high to rotate forward. |
dir2 | Enable 2 or direction 2 pin. Gets set high to rotate backward. |
Definition at line 13 of file dc_motor.cpp.
Definition at line 19 of file dc_motor.cpp.
Referenced by DcHardware::start().
|
overridevirtual |
Implements DcMotor.
Definition at line 34 of file dc_motor.cpp.
Referenced by TwoPinDcMotor().
|
overridevirtual |
Implements DcMotor.
Definition at line 26 of file dc_motor.cpp.
Referenced by configure().
|
overridevirtual |
Get the current motor duty cycle.
Implements DcMotor.
Definition at line 48 of file dc_motor.cpp.
Referenced by showDcMotorInfo(), and updateTunerStudioState().
|
overridevirtual |
Implements DcMotor.
Definition at line 44 of file dc_motor.cpp.
Referenced by showDcMotorInfo().
duty | value between -1.0 and 1.0 |
Implements DcMotor.
Definition at line 55 of file dc_motor.cpp.
Referenced by disable(), and setDcMotorDuty().
|
inline |
Definition at line 106 of file dc_motor.h.
Referenced by DcHardware::start().
|
private |
Definition at line 82 of file dc_motor.h.
Referenced by configure(), and set().
|
private |
Definition at line 83 of file dc_motor.h.
Referenced by configure(), and set().
|
private |
Definition at line 84 of file dc_motor.h.
|
private |
Definition at line 81 of file dc_motor.h.
Referenced by configure(), and set().
|
private |
Definition at line 86 of file dc_motor.h.
Referenced by configure(), and set().
|
private |
Definition at line 88 of file dc_motor.h.
|
private |
Definition at line 85 of file dc_motor.h.
Referenced by get(), isOpenDirection(), and set().