rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions
StepperMotor Class Referencefinal

#include <stepper.h>

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

Public Member Functions

 StepperMotor ()
 
void initialize (StepperHw *hardware, int totalSteps)
 
void ThreadTask () override
 
- Public Member Functions inherited from StepperMotorBase
void doIteration ()
 
void setTargetPosition (float targetPositionSteps)
 
float getTargetPosition () const
 
bool isBusy () const
 

Additional Inherited Members

- Data Fields inherited from StepperMotorBase
int m_currentPosition = 0
 
int m_totalSteps = 0
 
- Protected Member Functions inherited from StepperMotorBase
void setInitialPosition (void)
 
void saveStepperPos (int pos)
 
int loadStepperPos ()
 
void changeCurrentPosition (bool positive)
 
void postCurrentPosition (void)
 
- Protected Attributes inherited from StepperMotorBase
StepperHwm_hw = nullptr
 
float m_targetPosition = 0
 
bool initialPositionSet = false
 
bool m_isBusy = false
 
- Private Member Functions inherited from ThreadController< UTILITY_THREAD_STACK_SIZE >
 ThreadController (const char *name, tprio_t priority)
 
void start ()
 Start the thread.
 
void stop ()
 Request thread termination and waits for termination.
 
void main () override
 
- Private Attributes inherited from ThreadController< UTILITY_THREAD_STACK_SIZE >
const char *const m_name
 

Detailed Description

Definition at line 97 of file stepper.h.

Constructor & Destructor Documentation

◆ StepperMotor()

StepperMotor::StepperMotor ( )
inline

Definition at line 99 of file stepper.h.

99: ThreadController("stepper", PRIO_STEPPER) {}
A base class for a controller that requires its own thread.

Member Function Documentation

◆ initialize()

void StepperMotor::initialize ( StepperHw hardware,
int  totalSteps 
)
virtual

Reimplemented from StepperMotorBase.

Definition at line 211 of file stepper.cpp.

211 {
212 StepperMotorBase::initialize(hardware, totalSteps);
213
214 start();
215}
virtual void initialize(StepperHw *hardware, int totalSteps)
Definition stepper.cpp:26
Here is the call graph for this function:

◆ ThreadTask()

void StepperMotor::ThreadTask ( )
inlineoverridevirtual

Implements ThreadController< UTILITY_THREAD_STACK_SIZE >.

Definition at line 103 of file stepper.h.

103 {
104 // Require hardware to be set
105 if (!m_hw) {
106 return;
107 }
108
109 while (true) {
110 doIteration();
111 }
112 }
StepperHw * m_hw
Definition stepper.h:88
Here is the call graph for this function:

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