AYAB Arduino Firmware 0.95
The goal of the AYAB project is to provide an alternative way to control the famous Brother KH-9xx range of knitting machines using a computer
Encoders Class Reference
Inheritance diagram for Encoders:
Inheritance graph
Collaboration diagram for Encoders:
Collaboration graph

Public Member Functions

void encA_interrupt () final
 Service encoder A interrupt routine.
 
uint16_t getHallValue (Direction_t pSensor) final
 Read hall sensor on left and right.
 
void init (Machine_t machineType) final
 Initialize machine type.
 
Machine_t getMachineType () final
 Get machine type.
 
BeltShift_t getBeltShift () final
 Get beltShift member.
 
Carriage_t getCarriage () final
 Get carriage member.
 
Direction_t getDirection () final
 Get direction member.
 
Direction_t getHallActive () final
 Get hallActive member.
 
uint8_t getPosition () final
 Get position member.
 

Private Member Functions

Carriage_t detectCarriageLeft ()
 
Carriage_t detectCarriageRight ()
 
void encA_rising ()
 Interrupt service subroutine.
 
void encA_falling ()
 Interrupt service subroutine.
 

Private Attributes

Machine_t m_machineType
 
volatile BeltShift_t m_beltShift
 
volatile Carriage_t m_carriage
 
volatile Carriage_t m_previousDetectedCarriageLeft
 
volatile Carriage_t m_previousDetectedCarriageRight
 
volatile Direction_t m_direction
 
volatile Direction_t m_hallActive
 
volatile uint8_t m_position
 
volatile bool m_oldState
 
volatile bool m_passedLeft
 
volatile bool m_passedRight
 

Member Function Documentation

◆ encA_falling()

void Encoders::encA_falling ( )
private

Interrupt service subroutine.

Called when encoder pin A is falling. Must execute as fast as possible. Bounds on m_machineType not checked.

Here is the caller graph for this function:

◆ encA_interrupt()

void Encoders::encA_interrupt ( )
finalvirtual

Service encoder A interrupt routine.

Determines edge of signal and dispatches to private rising/falling functions. m_machineType assumed valid.

Implements EncodersInterface.

References encA_falling(), and encA_rising().

Here is the call graph for this function:

◆ encA_rising()

void Encoders::encA_rising ( )
private

Interrupt service subroutine.

Called when encoder pin A is rising. Must execute as fast as possible. Bounds on m_machineType not checked.

Here is the caller graph for this function:

◆ getBeltShift()

BeltShift_t Encoders::getBeltShift ( )
finalvirtual

Get beltShift member.

Implements EncodersInterface.

◆ getCarriage()

Carriage_t Encoders::getCarriage ( )
finalvirtual

Get carriage member.

Implements EncodersInterface.

◆ getDirection()

Direction_t Encoders::getDirection ( )
finalvirtual

Get direction member.

Implements EncodersInterface.

◆ getHallActive()

Direction_t Encoders::getHallActive ( )
finalvirtual

Get hallActive member.

Implements EncodersInterface.

◆ getHallValue()

uint16_t Encoders::getHallValue ( Direction_t  pSensor)
finalvirtual

Read hall sensor on left and right.

Parameters
pSensorWhich sensor to read (left or right).

Implements EncodersInterface.

◆ getMachineType()

Machine_t Encoders::getMachineType ( )
finalvirtual

Get machine type.

Implements EncodersInterface.

◆ getPosition()

uint8_t Encoders::getPosition ( )
finalvirtual

Get position member.

Implements EncodersInterface.

◆ init()

void Encoders::init ( Machine_t  machineType)
finalvirtual

Initialize machine type.

Parameters
machineTypeMachine type.

Implements EncodersInterface.


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