control a motor connected to a TMC7300 motor driver chip
More...
#include <JMotorDriverTMC7300.h>
|
| 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 () |
|
bool | enable () |
| enable motor
|
|
bool | disable () |
| disable motor
|
|
|
TMC7300IC & | ic |
| reference to TMC7300IC class, use ic.writeField() to change advanced settings
|
|
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
◆ 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
-
_ic | an instance of the TMC7300IC class, for communicating with the motor driver chip |
_channel | 0 or 1, which motor? |
_checkDriver | true to check driver settings and reset if needed (helps recover from power cycling the driver and from driver errors) |
_enablePin | pin to enable the driver, -1 if not used |
◆ 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
-
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
-
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
-
- 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.
◆ 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: