Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

otMicrostepShield Class Reference
[MicrostepShield - Double driver for step-motor with microstep capability and opto-coupled inputs, MicrostepShield - Double driver for step-motor with microstep capability and opto-coupled inputs]

Class to manage two step motors with microstep capability and with encoders and user opto-coupled inputs.

#include <otMicrostepShield.h>

Inheritance diagram for otMicrostepShield:

otMCP23017

Public Types

typedef enum otMicrostepShield::EncoderSelection EncoderSelection
typedef enum otMicrostepShield::InputSelection InputSelection
typedef enum otMicrostepShield::ClockSignal ClockSignal
enum  EncoderSelection {
  ENCODER_OFF = 0x00, ENCODER_0 = 0x10, ENCODER_1 = 0x20, ENCODER_2 = 0x40,
  ENCODER_3 = 0x80
}
enum  InputSelection { INPUT_1 = 8, INPUT_2 = 9, INPUT_3 = 10, INPUT_4 = 11 }
enum  ClockSignal { SEL_0 = 0, SEL_1 = 4, SEL_2 = 8, SEL_3 = 12 }

Public Member Functions

 otMicrostepShield ()
void init (otL6470 *drv, bool track=false, U8 addressIndex=0)
void driverSelect (U8 id)
void boardOff ()
void encoderSelection (EncoderSelection selection)
U8 input (InputSelection input)
void setClockSelection (ClockSignal sx)
void move (S32 step0, S32 step1)
void move (U8 dir0, U32 step0, U8 dir1, U32 step1)
bool readyMove (bool wait=true)
bool ready (U8 drv, bool wait=true)
void motorOff ()

Member Typedef Documentation

typedef enum otMicrostepShield::ClockSignal otMicrostepShield.ClockSignal
 

typedef enum otMicrostepShield::EncoderSelection otMicrostepShield.EncoderSelection
 

typedef enum otMicrostepShield::InputSelection otMicrostepShield.InputSelection
 


Member Enumeration Documentation

enum otMicrostepShield::ClockSignal
 

Enumeration values:
SEL_0  PF12 for driver 0 and PF13 for driver 1.
SEL_1  PF13 for driver 0 and PF14 for driver 1.
SEL_2  PF14 for driver 0 and PF15 for driver 1.
SEL_3  PF15 for driver 0 and PF12 for driver 1.

enum otMicrostepShield::EncoderSelection
 

Enumeration values:
ENCODER_OFF  Selection of encoder inputs.
ENCODER_0 
ENCODER_1 
ENCODER_2 
ENCODER_3 

enum otMicrostepShield::InputSelection
 

Enumeration values:
INPUT_1  Y1.2 Y1.4.
INPUT_2  Y1.6 Y1.8.
INPUT_3  Y1.10 Y1.12.
INPUT_4  Y1.14 Y1.16.


Constructor & Destructor Documentation

otMicrostepShield.otMicrostepShield (   ) 
 

Create the class.


Member Function Documentation

void otMicrostepShield.boardOff (   ) 
 

Disable SPI selection for this board. driverSelect can select again it.

void otMicrostepShield.driverSelect (  U8  id  ) 
 

Select the driver to operate

Parameters:
id 0 or 1

void otMicrostepShield.encoderSelection (  EncoderSelection  selection  ) 
 

Set which encoder channel will be used.

Parameters:
selection Encoder channel selection, example: ENCODER_0 | ENCODER_1

void otMicrostepShield.init (  otL6470 *  drv,
bool  track = false,
U8  addressIndex = 0
) 
 

Set the base address

Parameters:
drv L6470 driver pointer
track True if arbitrary tracking is performed.
addressIndex Select which device is selected in the range 0:7

U8 otMicrostepShield.input (  InputSelection  input  ) 
 

Read a selected input from available.

Parameters:
input Bit selection, see InputSelection
Returns:
0 or 1

void otMicrostepShield.motorOff (   ) 
 

Stop all movements action and a put the motors off. Fuction requested before set a new motor configuration.

void otMicrostepShield.move (  U8  dir0,
U32  step0,
U8  dir1,
U32  step1
) 
 

Start a positioning on all axys.

Parameters:
dir0 Direction
step0 Number of steps on driver 0
dir1 Direction
step1 Number of steps on driver 1

void otMicrostepShield.move (  S32  step0,
S32  step1
) 
 

Start a positioning on all axys.

Parameters:
step0 Number of steps on driver 0, positive value move forward, negative value move backward
step1 Number of steps on driver 1, positive value move forward, negative value move backward

bool otMicrostepShield.ready (  U8  drv,
bool  wait = true
) 
 

Check if the postioning on a specified axys is done.

Parameters:
drv Driver selection, 0 or 1
wait If true wait positioning complete
Returns:
True if positioning is done

bool otMicrostepShield.readyMove (  bool  wait = true  ) 
 

Check if a positioning is done on all axys

Parameters:
wait If true wait positioning complete
Returns:
True if positioning is done

void otMicrostepShield.setClockSelection (  ClockSignal  sx  ) 
 

For arbitrary rate generation select which bit will be used.

Parameters:
sx Select wich bit will be used for the clock generation. See ClockSignal.


The documentation for this class was generated from the following file: footer
otStudio - Library Reference - (C) 2020-25 Officina Turini, All Rights Reserved
Document built with Doxygen 1.4.0