rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
DcMotor Class Referenceabstract

Brushed or brushless DC motor interface. More...

#include <dc_motor.h>

Inheritance diagram for DcMotor:
Inheritance graph
[legend]
Collaboration diagram for DcMotor:
Collaboration graph
[legend]

Public Member Functions

virtual bool set (float duty)=0
 Sets the motor duty cycle.
 
virtual float get () const =0
 Get the current motor duty cycle.
 
virtual void disable (const char *msg)=0
 
virtual void enable ()=0
 
virtual bool isOpenDirection () const =0
 
const charmsg () const
 

Protected Attributes

const charm_msg = nullptr
 

Detailed Description

Brushed or brushless DC motor interface.

Represents a DC motor (brushed or brushless) that provides simple torque/power/current/duty cycle control, but not accurate absolute position control.

Definition at line 19 of file dc_motor.h.

Member Function Documentation

◆ disable()

virtual void DcMotor::disable ( const char msg)
pure virtual

Implemented in TwoPinDcMotor.

Referenced by EtbController::setOutput(), and EtbController::update().

Here is the caller graph for this function:

◆ enable()

virtual void DcMotor::enable ( )
pure virtual

Implemented in TwoPinDcMotor.

Referenced by EtbController::setOutput().

Here is the caller graph for this function:

◆ get()

virtual float DcMotor::get ( ) const
pure virtual

Get the current motor duty cycle.

Returns
The current duty cycle setting. +1.0f represents full power forward, and -1.0f represents full power backward.

Implemented in TwoPinDcMotor.

◆ isOpenDirection()

virtual bool DcMotor::isOpenDirection ( ) const
pure virtual

Implemented in TwoPinDcMotor.

◆ msg()

const char * DcMotor::msg ( ) const
inline

Definition at line 40 of file dc_motor.h.

40 {
41 return m_msg;
42 }
const char * m_msg
Definition dc_motor.h:45

Referenced by TwoPinDcMotor::disable(), and DcHardware::msg().

Here is the caller graph for this function:

◆ set()

virtual bool DcMotor::set ( float  duty)
pure virtual

Sets the motor duty cycle.

Parameters
duty+1.0f represents full power forward, and -1.0f represents full power backward.
Returns
True if any fault was detected driving the motor, and false if successful.

Implemented in TwoPinDcMotor.

Referenced by EtbController::setOutput(), and DualHBridgeStepper::update().

Here is the caller graph for this function:

Field Documentation

◆ m_msg

const char* DcMotor::m_msg = nullptr
protected

Definition at line 45 of file dc_motor.h.

Referenced by TwoPinDcMotor::disable(), TwoPinDcMotor::enable(), and msg().


The documentation for this class was generated from the following file: