JMotor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
JMotorDriverTMC7300 Class Reference

control a motor connected to a TMC7300 motor driver chip More...

#include <JMotorDriverTMC7300.h>

Inheritance diagram for JMotorDriverTMC7300:
Inheritance graph
[legend]
Collaboration diagram for JMotorDriverTMC7300:
Collaboration graph
[legend]

Public Member Functions

 JMotorDriverTMC7300 (TMC7300IC &_ic, boolean _channel, boolean _checkDriver=true, byte _enablePin=-1)
 control a motor connected to a TMC7300 dual motor driver chip
 
bool set (float val)
 set motor power
 
bool setEnable (bool _enable)
 use to enable or disable a motor, and sets up pin states
 
bool getEnable ()
 get the enable state of the driver
 
float getMaxRange ()
 high end of the range
 
float getMinRange ()
 low end of the range
 
bool enable ()
 
bool disable ()
 
- Public Member Functions inherited from JMotorDriver
bool enable ()
 enable motor
 
bool disable ()
 disable motor
 

Public Attributes

TMC7300IC & ic
 reference to TMC7300IC class, use ic.writeField() to change advanced settings
 

Protected Attributes

boolean enabled
 
boolean channel
 
boolean checkDriver
 
unsigned long lastCheckedIC
 
byte enablePin
 

Detailed Description

control a motor connected to a TMC7300 motor driver chip

Note
make sure to call ic.begin() for each tmc7300 chip before enabling a motor driver. https://github.com/joshua-8/TMC7300 https://www.analog.com/media/en/technical-documentation/data-sheets/TMC7300_datasheet_rev1.08.pdf

Constructor & Destructor Documentation

◆ JMotorDriverTMC7300()

JMotorDriverTMC7300::JMotorDriverTMC7300 ( TMC7300IC &  _ic,
boolean  _channel,
boolean  _checkDriver = true,
byte  _enablePin = -1 
)
inline

control a motor connected to a TMC7300 dual motor driver chip

Parameters
_ican instance of the TMC7300IC class, for communicating with the motor driver chip
_channel0 or 1, which motor?
_checkDrivertrue to check driver settings and reset if needed (helps recover from power cycling the driver and from driver errors)
_enablePinpin to enable the driver, -1 if not used

Member Function Documentation

◆ disable()

bool JMotorDriverTMC7300::disable ( )
inline

◆ enable()

bool JMotorDriverTMC7300::enable ( )
inline

◆ getEnable()

bool JMotorDriverTMC7300::getEnable ( )
inlinevirtual

get the enable state of the driver

Return values
(bool)true if enabled, false if disabled

Reimplemented from JMotorDriver.

◆ getMaxRange()

float JMotorDriverTMC7300::getMaxRange ( )
inlinevirtual

high end of the range

Note
usually 1.0
Return values
(float)maxRange

Reimplemented from JMotorDriver.

◆ getMinRange()

float JMotorDriverTMC7300::getMinRange ( )
inlinevirtual

low end of the range

Note
usually -1.0, if 0, that indicates a motor controller with no reverse function
Return values
(float)minRange

Reimplemented from JMotorDriver.

◆ set()

bool JMotorDriverTMC7300::set ( float  val)
inlinevirtual

set motor power

Note
val should be between getMinRange and getMaxRange, but constrained internally
Parameters
val(float) val
Return values
(bool)false if at end of power range, true otherwise

Reimplemented from JMotorDriver.

◆ setEnable()

bool JMotorDriverTMC7300::setEnable ( bool  _enable)
inlinevirtual

use to enable or disable a motor, and sets up pin states

Note
setEnable(true) must be called before a motor driver will activate
Parameters
_enable(bool) true=enable, false=disable
Return values
(bool)true if state changed, false if state already set

Reimplemented from JMotorDriver.

Member Data Documentation

◆ channel

boolean JMotorDriverTMC7300::channel
protected

◆ checkDriver

boolean JMotorDriverTMC7300::checkDriver
protected

◆ enabled

boolean JMotorDriverTMC7300::enabled
protected

◆ enablePin

byte JMotorDriverTMC7300::enablePin
protected

◆ ic

TMC7300IC& JMotorDriverTMC7300::ic

reference to TMC7300IC class, use ic.writeField() to change advanced settings

◆ lastCheckedIC

unsigned long JMotorDriverTMC7300::lastCheckedIC
protected

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