Serial Wombat Arduino Library
Loading...
Searching...
No Matches
SerialWombatSimulatedQuadEnc Class Reference

A class for testing SerialWombatQuadEnc inputs. More...

#include <SerialWombatSimulatedQuadEnc.h>

Public Member Functions

 SerialWombatSimulatedQuadEnc (SerialWombatChip &serialWombat0, SerialWombatChip &serialWombat1, uint8_t _pin0, uint8_t _pin1, bool openDrain, bool doubleTransition)
 
void bothPinsHigh ()
 
void togglePin0 ()
 
void togglePin1 ()
 
void pin0High ()
 
void pin1High ()
 
void pin0Low ()
 
void pin1Low ()
 
bool service ()
 
void initialize ()
 

Public Attributes

bool doubleTransition = false
 
SIMQUE_STATE_t state = SIMQE_IDLE
 
int32_t currentPosition = 0
 
int32_t targetPosition = 0
 
uint32_t delayAfterFirstPinFirstTransition_mS = 20
 
uint32_t delayAfterSecondPinFirstTransition_mS = 20
 
uint32_t delayAfterFirstPinSecondTransition_mS = 20
 
uint32_t delayAfterSecondPinSecondTransition_mS = 20
 
bool openDrain = true
 
uint32_t lastTransitionTime_millis = 0
 

Detailed Description

A class for testing SerialWombatQuadEnc inputs.

This class uses digital IO calls to simulate the output of a quadrature encoder. This is used to unit test the SerialWombatQuadEnc class. All processing occurs on the Arduino side. This class does not currently wrap a pin mode on the Serial Wombat chip. See the Unit Test example sketch for usage.

Definition at line 22 of file SerialWombatSimulatedQuadEnc.h.

Constructor & Destructor Documentation

◆ SerialWombatSimulatedQuadEnc()

SerialWombatSimulatedQuadEnc::SerialWombatSimulatedQuadEnc ( SerialWombatChip & serialWombat0,
SerialWombatChip & serialWombat1,
uint8_t _pin0,
uint8_t _pin1,
bool openDrain,
bool doubleTransition )
inline

Definition at line 25 of file SerialWombatSimulatedQuadEnc.h.

Member Function Documentation

◆ bothPinsHigh()

void SerialWombatSimulatedQuadEnc::bothPinsHigh ( )
inline

Definition at line 36 of file SerialWombatSimulatedQuadEnc.h.

◆ initialize()

void SerialWombatSimulatedQuadEnc::initialize ( )
inline

Definition at line 208 of file SerialWombatSimulatedQuadEnc.h.

◆ pin0High()

void SerialWombatSimulatedQuadEnc::pin0High ( )
inline

Definition at line 64 of file SerialWombatSimulatedQuadEnc.h.

◆ pin0Low()

void SerialWombatSimulatedQuadEnc::pin0Low ( )
inline

Definition at line 77 of file SerialWombatSimulatedQuadEnc.h.

◆ pin1High()

void SerialWombatSimulatedQuadEnc::pin1High ( )
inline

Definition at line 70 of file SerialWombatSimulatedQuadEnc.h.

◆ pin1Low()

void SerialWombatSimulatedQuadEnc::pin1Low ( )
inline

Definition at line 83 of file SerialWombatSimulatedQuadEnc.h.

◆ service()

bool SerialWombatSimulatedQuadEnc::service ( )
inline

Definition at line 89 of file SerialWombatSimulatedQuadEnc.h.

◆ togglePin0()

void SerialWombatSimulatedQuadEnc::togglePin0 ( )
inline

Definition at line 41 of file SerialWombatSimulatedQuadEnc.h.

◆ togglePin1()

void SerialWombatSimulatedQuadEnc::togglePin1 ( )
inline

Definition at line 53 of file SerialWombatSimulatedQuadEnc.h.

Member Data Documentation

◆ currentPosition

int32_t SerialWombatSimulatedQuadEnc::currentPosition = 0

Definition at line 222 of file SerialWombatSimulatedQuadEnc.h.

◆ delayAfterFirstPinFirstTransition_mS

uint32_t SerialWombatSimulatedQuadEnc::delayAfterFirstPinFirstTransition_mS = 20

Definition at line 224 of file SerialWombatSimulatedQuadEnc.h.

◆ delayAfterFirstPinSecondTransition_mS

uint32_t SerialWombatSimulatedQuadEnc::delayAfterFirstPinSecondTransition_mS = 20

Definition at line 226 of file SerialWombatSimulatedQuadEnc.h.

◆ delayAfterSecondPinFirstTransition_mS

uint32_t SerialWombatSimulatedQuadEnc::delayAfterSecondPinFirstTransition_mS = 20

Definition at line 225 of file SerialWombatSimulatedQuadEnc.h.

◆ delayAfterSecondPinSecondTransition_mS

uint32_t SerialWombatSimulatedQuadEnc::delayAfterSecondPinSecondTransition_mS = 20

Definition at line 227 of file SerialWombatSimulatedQuadEnc.h.

◆ doubleTransition

bool SerialWombatSimulatedQuadEnc::doubleTransition = false

Definition at line 219 of file SerialWombatSimulatedQuadEnc.h.

◆ lastTransitionTime_millis

uint32_t SerialWombatSimulatedQuadEnc::lastTransitionTime_millis = 0

Definition at line 229 of file SerialWombatSimulatedQuadEnc.h.

◆ openDrain

bool SerialWombatSimulatedQuadEnc::openDrain = true

Definition at line 228 of file SerialWombatSimulatedQuadEnc.h.

◆ state

SIMQUE_STATE_t SerialWombatSimulatedQuadEnc::state = SIMQE_IDLE

Definition at line 220 of file SerialWombatSimulatedQuadEnc.h.

◆ targetPosition

int32_t SerialWombatSimulatedQuadEnc::targetPosition = 0

Definition at line 223 of file SerialWombatSimulatedQuadEnc.h.