SimpleFOClibrary 2.4.0
Loading...
Searching...
No Matches
StepDirListener Class Reference

#include <StepDirListener.h>

Public Member Functions

 StepDirListener (int pinStep, int pinDir, float counter_to_value=1)
 
void enableInterrupt (void(*handleStep)())
 
void init ()
 
void handle ()
 
float getValue ()
 
void attach (float *variable)
 

Public Attributes

int pin_step
 step pin
 
int pin_dir
 direction pin
 
long count
 current counter value - should be set to 0 for homing
 
decltype(RISING) polarity = RISING
 polarity of the step pin
 

Detailed Description

Step/Dir listenner class for easier interraction with this communication interface.

Definition at line 11 of file StepDirListener.h.

Constructor & Destructor Documentation

◆ StepDirListener()

StepDirListener::StepDirListener ( int  pinStep,
int  pinDir,
float  counter_to_value = 1 
)

Constructor for step/direction interface

Parameters
step- pin
direction- pin
counter_to_value- step counter to value

Definition at line 3 of file StepDirListener.cpp.

Member Function Documentation

◆ attach()

void StepDirListener::attach ( float *  variable)

Attach the value to be updated on each step receive

  • no need to call getValue function

Definition at line 19 of file StepDirListener.cpp.

◆ enableInterrupt()

void StepDirListener::enableInterrupt ( void(*)()  handleStep)

Start listenning for step commands

Parameters
handleStep- on step received handler

Definition at line 15 of file StepDirListener.cpp.

◆ getValue()

float StepDirListener::getValue ( )

Get so far received valued

Definition at line 38 of file StepDirListener.cpp.

Here is the caller graph for this function:

◆ handle()

void StepDirListener::handle ( )

step handler

Definition at line 23 of file StepDirListener.cpp.

Here is the call graph for this function:

◆ init()

void StepDirListener::init ( )

Initialise dir and step commands

Definition at line 9 of file StepDirListener.cpp.

Member Data Documentation

◆ count

long StepDirListener::count

current counter value - should be set to 0 for homing

Definition at line 50 of file StepDirListener.h.

◆ pin_dir

int StepDirListener::pin_dir

direction pin

Definition at line 49 of file StepDirListener.h.

◆ pin_step

int StepDirListener::pin_step

step pin

Definition at line 48 of file StepDirListener.h.

◆ polarity

decltype(RISING) StepDirListener::polarity = RISING

polarity of the step pin

Definition at line 51 of file StepDirListener.h.


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