SimpleFOClibrary  2.1
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 More...
 
int pin_dir
 direction pin More...
 
long count
 current counter value - should be set to 0 for homing More...
 

Detailed Description

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

Definition at line 10 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.

◆ handle()

void StepDirListener::handle ( )

step handler

Definition at line 23 of file StepDirListener.cpp.

◆ 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 49 of file StepDirListener.h.

◆ pin_dir

int StepDirListener::pin_dir

direction pin

Definition at line 48 of file StepDirListener.h.

◆ pin_step

int StepDirListener::pin_step

step pin

Definition at line 47 of file StepDirListener.h.


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