PyTmcStepper 0.7.4__tar.gz → 0.7.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytmcstepper-0.7.4/src/PyTmcStepper.egg-info → pytmcstepper-0.7.6}/PKG-INFO +1 -1
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/setup.cfg +1 -1
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6/src/PyTmcStepper.egg-info}/PKG-INFO +1 -1
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/_tmc_gpio_board.py +2 -2
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/reg/_tmc220x_reg.py +30 -1
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/tmc_220x.py +17 -8
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/tmc_2240.py +3 -5
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/LICENSE +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/README.md +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/pyproject.toml +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/PyTmcStepper.egg-info/SOURCES.txt +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/PyTmcStepper.egg-info/dependency_links.txt +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/PyTmcStepper.egg-info/requires.txt +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/PyTmcStepper.egg-info/top_level.txt +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/__init__.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/_tmc_exceptions.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/_tmc_logger.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/_tmc_math.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/_tmc_stallguard.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/_tmc_stepperdriver.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/com/__init__.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/com/_tmc_com.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/com/_tmc_com_spi.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/com/_tmc_com_uart.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/enable_control/__init__.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/enable_control/_tmc_ec.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/enable_control/_tmc_ec_pin.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/enable_control/_tmc_ec_toff.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/motion_control/__init__.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/motion_control/_tmc_mc.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/motion_control/_tmc_mc_step_dir.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/motion_control/_tmc_mc_step_pwm_dir.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/motion_control/_tmc_mc_step_reg.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/motion_control/_tmc_mc_vactual.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/reg/__init__.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/reg/_tmc2209_reg.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/reg/_tmc224x_reg.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/reg/_tmc_reg.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/tmc_2208.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/tmc_2209.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/tests/test_tmc2209.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/tests/test_tmc2240.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/tests/test_tmc_com_spi.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/tests/test_tmc_com_uart.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/tests/test_tmc_ec_pin.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/tests/test_tmc_math.py +0 -0
- {pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/tests/test_tmc_move.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyTmcStepper
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.6
|
|
4
4
|
Summary: This is a Python libary to drive a stepper motor with a Trinamic stepper driver and a single board computer like a Raspberry Pi
|
|
5
5
|
Home-page: https://github.com/Chr157i4n/PyTmcStepper
|
|
6
6
|
Author: Christian Köhlke
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = PyTmcStepper
|
|
3
|
-
version = 0.7.
|
|
3
|
+
version = 0.7.6
|
|
4
4
|
author = Christian Köhlke
|
|
5
5
|
author_email = christian@koehlke.de
|
|
6
6
|
description = This is a Python libary to drive a stepper motor with a Trinamic stepper driver and a single board computer like a Raspberry Pi
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyTmcStepper
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.6
|
|
4
4
|
Summary: This is a Python libary to drive a stepper motor with a Trinamic stepper driver and a single board computer like a Raspberry Pi
|
|
5
5
|
Home-page: https://github.com/Chr157i4n/PyTmcStepper
|
|
6
6
|
Author: Christian Köhlke
|
|
@@ -234,7 +234,7 @@ class GpiozeroWrapper(BaseGPIOWrapper):
|
|
|
234
234
|
def gpio_setup(self, pin:int, mode:GpioMode, initial:Gpio=Gpio.LOW, pull_up_down:GpioPUD=GpioPUD.PUD_OFF):
|
|
235
235
|
"""setup GPIO pin"""
|
|
236
236
|
if mode == GpioMode.OUT:
|
|
237
|
-
self._gpios[pin] = self.gpiozero.DigitalOutputDevice(pin)
|
|
237
|
+
self._gpios[pin] = self.gpiozero.DigitalOutputDevice(pin, initial_value =bool(initial))
|
|
238
238
|
else:
|
|
239
239
|
self._gpios[pin] = self.gpiozero.DigitalInputDevice(pin)
|
|
240
240
|
|
|
@@ -327,7 +327,7 @@ class peripheryWrapper(BaseGPIOWrapper):
|
|
|
327
327
|
|
|
328
328
|
board_mapping = {
|
|
329
329
|
"raspberry pi 5": (GpiozeroWrapper, Board.RASPBERRY_PI5, "gpiozero", "https://gpiozero.readthedocs.io/en/stable/installing.html"),
|
|
330
|
-
"raspberry": (
|
|
330
|
+
"raspberry": (GpiozeroWrapper, Board.RASPBERRY_PI, "RPi.GPIO", "https://sourceforge.net/p/raspberry-gpio-python/wiki/install"),
|
|
331
331
|
"jetson": (JetsonGPIOWrapper, Board.NVIDIA_JETSON, "jetson-gpio", "https://github.com/NVIDIA/jetson-gpio"),
|
|
332
332
|
"luckfox": (peripheryWrapper, Board.LUCKFOX_PICO, "periphery", "https://github.com/vsergeev/python-periphery"),
|
|
333
333
|
"orange": (OPiGPIOWrapper, Board.ORANGE_PI, "OPi.GPIO", "https://github.com/rm-hull/OPi.GPIO")
|
|
@@ -125,6 +125,18 @@ class TStep(TmcReg):
|
|
|
125
125
|
super().__init__(0x12, "TSTEP", tmc_com, reg_map)
|
|
126
126
|
|
|
127
127
|
|
|
128
|
+
class TPwmThrs(TmcReg):
|
|
129
|
+
"""TPWMTHRS register class"""
|
|
130
|
+
|
|
131
|
+
def __init__(self, tmc_com: TmcCom):
|
|
132
|
+
"""constructor"""
|
|
133
|
+
|
|
134
|
+
reg_map = [
|
|
135
|
+
["tpwmthrs", 0, 0xFFFFF, int, None, ""]
|
|
136
|
+
]
|
|
137
|
+
super().__init__(0x13, "TPWMTHRS", tmc_com, reg_map)
|
|
138
|
+
|
|
139
|
+
|
|
128
140
|
class VActual(TmcReg):
|
|
129
141
|
"""VACTUAL register class"""
|
|
130
142
|
|
|
@@ -132,7 +144,7 @@ class VActual(TmcReg):
|
|
|
132
144
|
"""constructor"""
|
|
133
145
|
|
|
134
146
|
reg_map = [
|
|
135
|
-
["vactual", 0,
|
|
147
|
+
["vactual", 0, 0xFFFFFF, int, None, ""]
|
|
136
148
|
]
|
|
137
149
|
super().__init__(0x22, "VACTUAL", tmc_com, reg_map)
|
|
138
150
|
|
|
@@ -183,6 +195,23 @@ class ChopConf(TmcReg):
|
|
|
183
195
|
mres_bit = 8 - mres_bit
|
|
184
196
|
self.mres = mres_bit
|
|
185
197
|
|
|
198
|
+
class PwmConf(TmcReg):
|
|
199
|
+
"""PWMCONF register class"""
|
|
200
|
+
|
|
201
|
+
def __init__(self, tmc_com: TmcCom):
|
|
202
|
+
"""constructor"""
|
|
203
|
+
|
|
204
|
+
reg_map = [
|
|
205
|
+
["pwm_lim", 28, 0xF, int, None, ""],
|
|
206
|
+
["pwm_reg", 24, 0xF, int, None, ""],
|
|
207
|
+
["freewheel", 20, 0x3, int, None, ""],
|
|
208
|
+
["pwm_autograd", 19, 0x1, bool, None, ""],
|
|
209
|
+
["pwm_autoscale", 18, 0x1, bool, None, ""],
|
|
210
|
+
["pwm_freq", 16, 0x3, int, None, ""],
|
|
211
|
+
["pwm_grad", 8, 0xFF, int, None, ""],
|
|
212
|
+
["pwm_ofs", 0, 0xFF, int, None, ""]
|
|
213
|
+
]
|
|
214
|
+
super().__init__(0x70, "PWMCONF", tmc_com, reg_map)
|
|
186
215
|
|
|
187
216
|
class DrvStatus(TmcReg):
|
|
188
217
|
"""DRVSTATUS register class"""
|
|
@@ -22,7 +22,6 @@ import typing
|
|
|
22
22
|
from ._tmc_stepperdriver import *
|
|
23
23
|
from .com._tmc_com import TmcCom
|
|
24
24
|
from .com._tmc_com_uart import TmcComUart
|
|
25
|
-
from .com._tmc_com_spi import TmcComSpi
|
|
26
25
|
from .motion_control._tmc_mc_step_reg import TmcMotionControlStepReg
|
|
27
26
|
from .enable_control._tmc_ec_toff import TmcEnableControlToff
|
|
28
27
|
from .motion_control._tmc_mc_vactual import TmcMotionControlVActual
|
|
@@ -77,9 +76,10 @@ class Tmc220x(TmcStepperDriver):
|
|
|
77
76
|
Defaults to None (messages are logged in the format
|
|
78
77
|
'%(asctime)s - %(name)s - %(levelname)s - %(message)s').
|
|
79
78
|
"""
|
|
80
|
-
|
|
79
|
+
if logprefix is None:
|
|
80
|
+
logprefix = f"TMC2209 {driver_address}"
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
super().__init__(tmc_ec, tmc_mc, gpio_mode, loglevel, logprefix, log_handlers, log_formatter)
|
|
83
83
|
|
|
84
84
|
if tmc_com is not None:
|
|
85
85
|
self.tmc_com = tmc_com
|
|
@@ -102,9 +102,11 @@ class Tmc220x(TmcStepperDriver):
|
|
|
102
102
|
IHoldIRun,
|
|
103
103
|
TPowerDown,
|
|
104
104
|
TStep,
|
|
105
|
+
TPwmThrs,
|
|
105
106
|
VActual,
|
|
106
107
|
MsCnt,
|
|
107
108
|
ChopConf,
|
|
109
|
+
PwmConf,
|
|
108
110
|
DrvStatus
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -127,9 +129,9 @@ class Tmc220x(TmcStepperDriver):
|
|
|
127
129
|
# Setup Registers
|
|
128
130
|
self.tmc_com.tmc_registers = self.tmc_registers
|
|
129
131
|
|
|
132
|
+
self.clear_gstat()
|
|
130
133
|
if self.tmc_mc is not None:
|
|
131
134
|
self.read_steps_per_rev()
|
|
132
|
-
self.clear_gstat()
|
|
133
135
|
self.tmc_com.flush_serial_buffer()
|
|
134
136
|
|
|
135
137
|
|
|
@@ -207,11 +209,9 @@ class Tmc220x(TmcStepperDriver):
|
|
|
207
209
|
def clear_gstat(self):
|
|
208
210
|
"""clears the "GSTAT" register"""
|
|
209
211
|
self.tmc_logger.log("clearing GSTAT", Loglevel.INFO)
|
|
210
|
-
self.gstat.read()
|
|
211
212
|
|
|
212
|
-
self.gstat.
|
|
213
|
-
|
|
214
|
-
self.gstat.uv_cp = True
|
|
213
|
+
for reg in self.gstat.reg_map:
|
|
214
|
+
setattr(self.gstat, reg[0], True)
|
|
215
215
|
|
|
216
216
|
self.gstat.write_check()
|
|
217
217
|
|
|
@@ -581,6 +581,15 @@ class Tmc220x(TmcStepperDriver):
|
|
|
581
581
|
return self.chopconf.tstep
|
|
582
582
|
|
|
583
583
|
|
|
584
|
+
def set_tpwmthrs(self, tpwmthrs: int):
|
|
585
|
+
"""sets the current tpwmthrs
|
|
586
|
+
|
|
587
|
+
Args:
|
|
588
|
+
tpwmthrs (int): value for tpwmthrs
|
|
589
|
+
"""
|
|
590
|
+
self.tpwmthrs.tpwmthrs = tpwmthrs
|
|
591
|
+
self.tpwmthrs.write_check()
|
|
592
|
+
|
|
584
593
|
|
|
585
594
|
def set_vactual(self, vactual:int):
|
|
586
595
|
"""sets the register bit "VACTUAL" to to a given value
|
|
@@ -140,9 +140,9 @@ class Tmc2240(TmcStepperDriver, StallGuard):
|
|
|
140
140
|
# Setup Registers
|
|
141
141
|
self.tmc_com.tmc_registers = self.tmc_registers
|
|
142
142
|
|
|
143
|
+
self.clear_gstat()
|
|
143
144
|
if self.tmc_mc is not None:
|
|
144
145
|
self.read_steps_per_rev()
|
|
145
|
-
self.clear_gstat()
|
|
146
146
|
self.tmc_com.flush_serial_buffer()
|
|
147
147
|
|
|
148
148
|
|
|
@@ -220,11 +220,9 @@ class Tmc2240(TmcStepperDriver, StallGuard):
|
|
|
220
220
|
def clear_gstat(self):
|
|
221
221
|
"""clears the "GSTAT" register"""
|
|
222
222
|
self.tmc_logger.log("clearing GSTAT", Loglevel.INFO)
|
|
223
|
-
self.gstat.read()
|
|
224
223
|
|
|
225
|
-
self.gstat.
|
|
226
|
-
|
|
227
|
-
self.gstat.uv_cp = True
|
|
224
|
+
for reg in self.gstat.reg_map:
|
|
225
|
+
setattr(self.gstat, reg[0], True)
|
|
228
226
|
|
|
229
227
|
self.gstat.write_check()
|
|
230
228
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytmcstepper-0.7.4 → pytmcstepper-0.7.6}/src/tmc_driver/motion_control/_tmc_mc_step_pwm_dir.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|