Speeduino
Loading...
Searching...
No Matches
speeduino
src
controllers
idle
stepper.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
src/pins/outputPin.h
"
4
#include "
src/pins/invertableOutputPin.h
"
5
#include "
src/pins/pinNumbers_t.h
"
6
#include "
config_pages.h
"
7
8
namespace
idleController
{
9
10
namespace
detail {
11
13
enum class
StepperStatus
: uint8_t
14
{
15
OFF
,
16
STEPPING
,
17
COOLING
18
};
19
20
struct
stepperPosition_t
21
{
22
uint16_t
curStep
= 0;
23
uint16_t
completedHomeSteps
= 0;
24
StepperStatus
status
=
StepperStatus::OFF
;
25
};
26
28
struct
stepperState_t
:
public
stepperPosition_t
29
{
30
uint16_t
targetStep
= 0;
31
uint32_t
startTime
= 0;
32
33
outputPin_t
pinStepperEnable
;
34
outputPin_t
pinStepperStep
;
35
invertableOutputPinAdaper_t<outputPin_t>
pinStepperDir
;
36
37
stepperState_t
() =
default
;
38
stepperState_t
(
const
pinNumbers_t
&
pins
,
const
config9
&
page9
);
39
};
40
}
41
}
invertableOutputPinAdaper_t
An output pin that, optionally, can be have it's state inverted.
Definition
invertableOutputPin.h:13
outputPin_t
A class for output pin operations. Must have same signature as fastOutputPin_t to allow for interchan...
Definition
outputPin.h:9
config_pages.h
The tune page structs and related defines.
page9
const config4 const config6 const config9 & page9
Definition
engineProtection.cpp:172
invertableOutputPin.h
idleController::detail::StepperStatus
StepperStatus
Stepper motor status.
Definition
stepper.h:14
idleController::detail::StepperStatus::OFF
@ OFF
The motor is not stepping or cooling.
idleController::detail::StepperStatus::STEPPING
@ STEPPING
The motor is moving.
idleController::detail::StepperStatus::COOLING
@ COOLING
The motor is in it's cooling phase.
idleController
Definition
idleController_state.cpp:5
outputPin.h
pinNumbers_t.h
pins
static fastOutputPin_t pins[_countof(coil_pins_t::_M_elems)]
Definition
scheduledIO_direct_ign.cpp:10
config9
Definition
config_pages.h:578
idleController::detail::stepperPosition_t
Definition
stepper.h:21
idleController::detail::stepperPosition_t::curStep
uint16_t curStep
The current location of the motor.
Definition
stepper.h:22
idleController::detail::stepperPosition_t::status
StepperStatus status
What phase the motor is in.
Definition
stepper.h:24
idleController::detail::stepperPosition_t::completedHomeSteps
uint16_t completedHomeSteps
Number of homing steps completed.
Definition
stepper.h:23
idleController::detail::stepperState_t
Captures the state of the stepper motor.
Definition
stepper.h:29
idleController::detail::stepperState_t::targetStep
uint16_t targetStep
The target step we want to move to
Definition
stepper.h:30
idleController::detail::stepperState_t::pinStepperEnable
outputPin_t pinStepperEnable
Definition
stepper.h:33
idleController::detail::stepperState_t::pinStepperDir
invertableOutputPinAdaper_t< outputPin_t > pinStepperDir
Definition
stepper.h:35
idleController::detail::stepperState_t::startTime
uint32_t startTime
The time in µS that we started the current phase.
Definition
stepper.h:31
idleController::detail::stepperState_t::stepperState_t
stepperState_t()=default
idleController::detail::stepperState_t::pinStepperStep
outputPin_t pinStepperStep
Definition
stepper.h:34
pinNumbers_t
Store the pin assignments, as defined by the board.
Definition
pinNumbers_t.h:41
Generated by
1.9.8