PyTmcStepper 0.13.0__tar.gz → 0.14.0__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.13.0 → pytmcstepper-0.14.0}/PKG-INFO +2 -2
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/README.md +1 -1
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/pyproject.toml +1 -1
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/PyTmcStepper.egg-info/PKG-INFO +2 -2
- pytmcstepper-0.14.0/src/tmc_driver/__init__.py +96 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/_tmc_stepperdriver.py +1 -1
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/_tmc_xxxx.py +10 -8
- pytmcstepper-0.14.0/src/tmc_driver/com/__init__.py +64 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com.py +1 -1
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com_spi_base.py +4 -5
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com_uart_base.py +386 -341
- pytmcstepper-0.14.0/src/tmc_driver/enable_control/__init__.py +55 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/enable_control/_tmc_ec_toff.py +0 -12
- pytmcstepper-0.14.0/src/tmc_driver/motion_control/__init__.py +111 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/motion_control/_tmc_mc_int_ramp_generator.py +0 -12
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/motion_control/_tmc_mc_step_reg.py +0 -12
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/motion_control/_tmc_mc_vactual.py +0 -12
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/reg/_tmc220x_reg.py +1 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/reg/_tmc224x_reg.py +1 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/reg/_tmc5160_reg.py +1 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_220x.py +1 -9
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_2240.py +0 -9
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_5160.py +0 -9
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_logger/_tmc_logger_micropython.py +2 -0
- pytmcstepper-0.13.0/src/tmc_driver/com/__init__.py +0 -0
- pytmcstepper-0.13.0/src/tmc_driver/enable_control/__init__.py +0 -0
- pytmcstepper-0.13.0/src/tmc_driver/motion_control/__init__.py +0 -0
- pytmcstepper-0.13.0/src/tmc_driver/reg/__init__.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/LICENSE +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/setup.cfg +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/PyTmcStepper.egg-info/SOURCES.txt +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/PyTmcStepper.egg-info/dependency_links.txt +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/PyTmcStepper.egg-info/requires.txt +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/PyTmcStepper.egg-info/top_level.txt +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/_tmc_exceptions.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/_tmc_math.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/_tmc_stallguard.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/_tmc_validation.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com_spi.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com_spi_ftdi.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com_spi_micropython.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com_uart.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/com/_tmc_com_uart_micropython.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/enable_control/_tmc_ec.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/enable_control/_tmc_ec_pin.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/motion_control/_tmc_mc.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/motion_control/_tmc_mc_step_dir.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/motion_control/_tmc_mc_step_pwm_dir.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/platform_utils.py +0 -0
- {pytmcstepper-0.13.0/src/tmc_driver → pytmcstepper-0.14.0/src/tmc_driver/reg}/__init__.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/reg/_tmc2209_reg.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/reg/_tmc_reg.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/reg/_tmc_shared_regs.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_2208.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_2209.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_gpio/__init__.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_gpio/_tmc_gpio_board_base.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_gpio/_tmc_gpio_board_ftdi.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_gpio/_tmc_gpio_board_gpiozero.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_gpio/_tmc_gpio_board_micropython.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_gpio/_tmc_gpio_board_periphery.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_gpio/_tmc_gpio_board_rpi_gpio.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_logger/__init__.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_logger/_tmc_logger_base.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/src/tmc_driver/tmc_logger/_tmc_logger_cpython.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc2209.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc2240.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_com_spi.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_com_uart.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_ec_pin.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_math.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_modules.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_move.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_set_current.py +0 -0
- {pytmcstepper-0.13.0 → pytmcstepper-0.14.0}/tests/test_tmc_stallguard.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyTmcStepper
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
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
|
Author-email: Christian Köhlke <christian@koehlke.de>
|
|
6
6
|
License-Expression: GPL-3.0
|
|
@@ -283,7 +283,7 @@ from tmc_driver.tmc_2209 import *
|
|
|
283
283
|
tmc = Tmc2209(TmcEnableControlPin(21), TmcMotionControlStepDir(16, 20), TmcComUart("/dev/serial0"))
|
|
284
284
|
|
|
285
285
|
tmc.set_direction_reg(False)
|
|
286
|
-
tmc.
|
|
286
|
+
tmc.set_current_rms(300)
|
|
287
287
|
tmc.set_interpolation(True)
|
|
288
288
|
tmc.set_spreadcycle(False)
|
|
289
289
|
tmc.set_microstepping_resolution(2)
|
|
@@ -253,7 +253,7 @@ from tmc_driver.tmc_2209 import *
|
|
|
253
253
|
tmc = Tmc2209(TmcEnableControlPin(21), TmcMotionControlStepDir(16, 20), TmcComUart("/dev/serial0"))
|
|
254
254
|
|
|
255
255
|
tmc.set_direction_reg(False)
|
|
256
|
-
tmc.
|
|
256
|
+
tmc.set_current_rms(300)
|
|
257
257
|
tmc.set_interpolation(True)
|
|
258
258
|
tmc.set_spreadcycle(False)
|
|
259
259
|
tmc.set_microstepping_resolution(2)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "PyTmcStepper"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.14.0"
|
|
8
8
|
authors = [{ name = "Christian Köhlke", email = "christian@koehlke.de" }]
|
|
9
9
|
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"
|
|
10
10
|
readme = "README.md"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PyTmcStepper
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
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
|
Author-email: Christian Köhlke <christian@koehlke.de>
|
|
6
6
|
License-Expression: GPL-3.0
|
|
@@ -283,7 +283,7 @@ from tmc_driver.tmc_2209 import *
|
|
|
283
283
|
tmc = Tmc2209(TmcEnableControlPin(21), TmcMotionControlStepDir(16, 20), TmcComUart("/dev/serial0"))
|
|
284
284
|
|
|
285
285
|
tmc.set_direction_reg(False)
|
|
286
|
-
tmc.
|
|
286
|
+
tmc.set_current_rms(300)
|
|
287
287
|
tmc.set_interpolation(True)
|
|
288
288
|
tmc.set_spreadcycle(False)
|
|
289
289
|
tmc.set_microstepping_resolution(2)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PyTmcStepper - Python library for Trinamic TMC stepper motor drivers
|
|
3
|
+
|
|
4
|
+
This package provides a high-level interface for controlling TMC stepper motor drivers
|
|
5
|
+
via UART or SPI communication on various platforms including Raspberry Pi, Jetson, and MicroPython.
|
|
6
|
+
|
|
7
|
+
Main Components:
|
|
8
|
+
- Driver Classes: Tmc2208, Tmc2209, Tmc2240, Tmc5160
|
|
9
|
+
- Communication: TmcCom and subclasses for UART/SPI
|
|
10
|
+
- Motion Control: Various strategies for motor movement
|
|
11
|
+
- Enable Control: Motor enable/disable functionality
|
|
12
|
+
- GPIO Abstraction: Platform-independent GPIO access
|
|
13
|
+
- Logging: Configurable logging support
|
|
14
|
+
|
|
15
|
+
Example:
|
|
16
|
+
>>> from tmc_driver import Tmc2209, Loglevel
|
|
17
|
+
>>> from tmc_driver.com import TmcComUart
|
|
18
|
+
>>> from tmc_driver.motion_control import TmcMotionControlStepDir
|
|
19
|
+
>>> from tmc_driver.enable_control import TmcEnableControlPin
|
|
20
|
+
>>>
|
|
21
|
+
>>> tmc = Tmc2209(
|
|
22
|
+
... TmcEnableControlPin(21),
|
|
23
|
+
... TmcMotionControlStepDir(16, 20),
|
|
24
|
+
... TmcComUart("/dev/serial0"),
|
|
25
|
+
... loglevel=Loglevel.INFO
|
|
26
|
+
... )
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
# Driver classes
|
|
30
|
+
from .tmc_2208 import Tmc2208
|
|
31
|
+
from .tmc_2209 import Tmc2209
|
|
32
|
+
from .tmc_2240 import Tmc2240
|
|
33
|
+
from .tmc_5160 import Tmc5160
|
|
34
|
+
|
|
35
|
+
# Exceptions
|
|
36
|
+
from ._tmc_exceptions import (
|
|
37
|
+
TmcException,
|
|
38
|
+
TmcDriverException,
|
|
39
|
+
TmcComException,
|
|
40
|
+
TmcMotionControlException,
|
|
41
|
+
TmcEnableControlException,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Logger
|
|
45
|
+
from .tmc_logger import TmcLogger, Loglevel
|
|
46
|
+
|
|
47
|
+
# GPIO
|
|
48
|
+
from . import tmc_gpio
|
|
49
|
+
from .tmc_gpio import Board
|
|
50
|
+
|
|
51
|
+
# Enable Control
|
|
52
|
+
from .enable_control._tmc_ec_pin import TmcEnableControlPin
|
|
53
|
+
from .enable_control._tmc_ec_toff import TmcEnableControlToff
|
|
54
|
+
|
|
55
|
+
# Motion Control
|
|
56
|
+
from .motion_control._tmc_mc import StopMode, MovementAbsRel, MovementPhase, Direction
|
|
57
|
+
from .motion_control._tmc_mc_step_dir import TmcMotionControlStepDir
|
|
58
|
+
from .motion_control._tmc_mc_step_pwm_dir import TmcMotionControlStepPwmDir
|
|
59
|
+
from .motion_control._tmc_mc_step_reg import TmcMotionControlStepReg
|
|
60
|
+
from .motion_control._tmc_mc_vactual import TmcMotionControlVActual
|
|
61
|
+
from .motion_control._tmc_mc_int_ramp_generator import TmcMotionControlIntRampGenerator
|
|
62
|
+
|
|
63
|
+
__all__ = [
|
|
64
|
+
# Driver classes
|
|
65
|
+
"Tmc2208",
|
|
66
|
+
"Tmc2209",
|
|
67
|
+
"Tmc2240",
|
|
68
|
+
"Tmc5160",
|
|
69
|
+
# Exceptions
|
|
70
|
+
"TmcException",
|
|
71
|
+
"TmcDriverException",
|
|
72
|
+
"TmcComException",
|
|
73
|
+
"TmcMotionControlException",
|
|
74
|
+
"TmcEnableControlException",
|
|
75
|
+
# Logger
|
|
76
|
+
"TmcLogger",
|
|
77
|
+
"Loglevel",
|
|
78
|
+
# GPIO
|
|
79
|
+
"tmc_gpio",
|
|
80
|
+
"Board",
|
|
81
|
+
# Enable Control
|
|
82
|
+
"TmcEnableControlPin",
|
|
83
|
+
"TmcEnableControlToff",
|
|
84
|
+
# Motion Control
|
|
85
|
+
"StopMode",
|
|
86
|
+
"MovementAbsRel",
|
|
87
|
+
"MovementPhase",
|
|
88
|
+
"Direction",
|
|
89
|
+
"TmcMotionControlStepDir",
|
|
90
|
+
"TmcMotionControlStepPwmDir",
|
|
91
|
+
"TmcMotionControlStepReg",
|
|
92
|
+
"TmcMotionControlVActual",
|
|
93
|
+
"TmcMotionControlIntRampGenerator",
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
__version__ = "0.5.0"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# pylint: disable=wildcard-import
|
|
2
2
|
# pylint: disable=unused-wildcard-import
|
|
3
|
+
# pylint: disable=unused-import
|
|
3
4
|
# pylint: disable=too-many-arguments
|
|
4
5
|
# pylint: disable=too-many-positional-arguments
|
|
5
6
|
# pylint: disable=too-many-public-methods
|
|
@@ -13,6 +14,7 @@ this module has two different functions:
|
|
|
13
14
|
|
|
14
15
|
import time
|
|
15
16
|
from abc import abstractmethod
|
|
17
|
+
from .tmc_gpio import Gpio
|
|
16
18
|
from ._tmc_stepperdriver import *
|
|
17
19
|
from .tmc_logger import Loglevel
|
|
18
20
|
from .enable_control._tmc_ec import TmcEnableControl
|
|
@@ -21,7 +23,13 @@ from .com._tmc_com import TmcCom
|
|
|
21
23
|
from .reg._tmc_reg import TmcReg
|
|
22
24
|
from .reg import _tmc_shared_regs as tmc_shared_regs
|
|
23
25
|
from ._tmc_validation import validate_submodule
|
|
24
|
-
from ._tmc_exceptions import
|
|
26
|
+
from ._tmc_exceptions import (
|
|
27
|
+
TmcException,
|
|
28
|
+
TmcComException,
|
|
29
|
+
TmcMotionControlException,
|
|
30
|
+
TmcEnableControlException,
|
|
31
|
+
TmcDriverException,
|
|
32
|
+
)
|
|
25
33
|
|
|
26
34
|
|
|
27
35
|
class TmcXXXX(TmcStepperDriver):
|
|
@@ -92,14 +100,8 @@ class TmcXXXX(TmcStepperDriver):
|
|
|
92
100
|
if self.tmc_com is not None:
|
|
93
101
|
self.tmc_com.tmc_logger = self.tmc_logger
|
|
94
102
|
self.tmc_com.driver_address = driver_address
|
|
95
|
-
|
|
96
103
|
self.tmc_com.init()
|
|
97
104
|
|
|
98
|
-
if self.tmc_mc is not None:
|
|
99
|
-
setattr(self.tmc_mc, "tmc_com", self.tmc_com)
|
|
100
|
-
if self.tmc_ec is not None:
|
|
101
|
-
setattr(self.tmc_ec, "tmc_com", self.tmc_com)
|
|
102
|
-
|
|
103
105
|
# Register callback for submodules to access registers
|
|
104
106
|
self.tmc_com.set_get_register_callback(self._get_register)
|
|
105
107
|
if self.tmc_mc is not None:
|
|
@@ -479,4 +481,4 @@ class TmcXXXX(TmcStepperDriver):
|
|
|
479
481
|
self.tmc_logger.log("---")
|
|
480
482
|
self.tmc_logger.log("TEST COM")
|
|
481
483
|
|
|
482
|
-
return self.tmc_com.test_com()
|
|
484
|
+
return self.tmc_com.test_com(self.ioin)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# pylint: disable=import-outside-toplevel
|
|
2
|
+
"""Communication module for TMC stepper drivers
|
|
3
|
+
|
|
4
|
+
Provides UART and SPI communication implementations for different platforms:
|
|
5
|
+
- TmcComUart: Standard UART communication (CPython with pyserial)
|
|
6
|
+
- TmcComSpi: Standard SPI communication (CPython with spidev)
|
|
7
|
+
- TmcComUartMicroPython: UART for MicroPython
|
|
8
|
+
- TmcComSpiMicroPython: SPI for MicroPython
|
|
9
|
+
- TmcComSpiFtdi: SPI via FTDI USB devices
|
|
10
|
+
|
|
11
|
+
Example:
|
|
12
|
+
>>> from tmc_driver.com import TmcComUart
|
|
13
|
+
>>> tmc_com = TmcComUart("/dev/serial0")
|
|
14
|
+
|
|
15
|
+
Note: Base classes (TmcCom, TmcComUartBase, TmcComSpiBase) can be imported
|
|
16
|
+
directly from their respective files if needed for type hints or subclassing.
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
from typing import TYPE_CHECKING
|
|
21
|
+
|
|
22
|
+
if TYPE_CHECKING:
|
|
23
|
+
# Import for type checkers/IDE only - not executed at runtime
|
|
24
|
+
from ._tmc_com_uart import TmcComUart
|
|
25
|
+
from ._tmc_com_spi import TmcComSpi
|
|
26
|
+
from ._tmc_com_uart_micropython import TmcComUartMicroPython
|
|
27
|
+
from ._tmc_com_spi_micropython import TmcComSpiMicroPython
|
|
28
|
+
from ._tmc_com_spi_ftdi import TmcComSpiFtdi
|
|
29
|
+
except ImportError:
|
|
30
|
+
pass
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def __getattr__(name):
|
|
34
|
+
"""Lazy import of communication classes to avoid circular imports"""
|
|
35
|
+
if name == "TmcComUart":
|
|
36
|
+
from ._tmc_com_uart import TmcComUart
|
|
37
|
+
|
|
38
|
+
return TmcComUart
|
|
39
|
+
if name == "TmcComSpi":
|
|
40
|
+
from ._tmc_com_spi import TmcComSpi
|
|
41
|
+
|
|
42
|
+
return TmcComSpi
|
|
43
|
+
if name == "TmcComUartMicroPython":
|
|
44
|
+
from ._tmc_com_uart_micropython import TmcComUartMicroPython
|
|
45
|
+
|
|
46
|
+
return TmcComUartMicroPython
|
|
47
|
+
if name == "TmcComSpiMicroPython":
|
|
48
|
+
from ._tmc_com_spi_micropython import TmcComSpiMicroPython
|
|
49
|
+
|
|
50
|
+
return TmcComSpiMicroPython
|
|
51
|
+
if name == "TmcComSpiFtdi":
|
|
52
|
+
from ._tmc_com_spi_ftdi import TmcComSpiFtdi
|
|
53
|
+
|
|
54
|
+
return TmcComSpiFtdi
|
|
55
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
__all__ = [
|
|
59
|
+
"TmcComUart",
|
|
60
|
+
"TmcComSpi",
|
|
61
|
+
"TmcComUartMicroPython",
|
|
62
|
+
"TmcComSpiMicroPython",
|
|
63
|
+
"TmcComSpiFtdi",
|
|
64
|
+
]
|
|
@@ -138,16 +138,15 @@ class TmcComSpiBase(TmcCom):
|
|
|
138
138
|
def flush_com_buffer(self):
|
|
139
139
|
"""this function clear the communication buffers of the Raspberry Pi"""
|
|
140
140
|
|
|
141
|
-
def test_com(self):
|
|
141
|
+
def test_com(self, ioin: tmc_shared_reg.Ioin):
|
|
142
142
|
"""test com connection
|
|
143
143
|
|
|
144
|
+
Args:
|
|
145
|
+
ioin: IOIN register instance
|
|
146
|
+
|
|
144
147
|
Returns:
|
|
145
148
|
bool: True if communication is OK, False otherwise
|
|
146
|
-
|
|
147
|
-
Raises:
|
|
148
|
-
TmcComException: if TMC register IOIN not available
|
|
149
149
|
"""
|
|
150
|
-
ioin: tmc_shared_reg.Ioin = self.get_register("ioin") # type: ignore
|
|
151
150
|
data, flags = ioin.read()
|
|
152
151
|
del flags # unused
|
|
153
152
|
|