lenz-flashtool 0.1.9__tar.gz → 0.2.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.
Files changed (39) hide show
  1. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/.gitignore +16 -14
  2. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/LICENSE +21 -21
  3. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/PKG-INFO +7 -2
  4. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/README.md +111 -106
  5. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/__init__.py +109 -85
  6. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/biss/__init__.py +67 -42
  7. lenz_flashtool-0.2.0/lenz_flashtool/biss/cli.py +955 -0
  8. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/biss/commands.py +154 -154
  9. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/biss/crc.py +54 -54
  10. lenz_flashtool-0.2.0/lenz_flashtool/biss/encoder_state.py +122 -0
  11. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/biss/registers.py +185 -185
  12. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/encproc/__init__.py +48 -48
  13. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/encproc/processing.py +464 -464
  14. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/flashtool/__init__.py +50 -45
  15. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/biss_io.py +1064 -0
  16. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/bootloader.py +560 -0
  17. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/core.py +323 -0
  18. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/data_streaming.py +483 -0
  19. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/encoder_control.py +403 -0
  20. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/errors.py +170 -0
  21. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/flashtool/ft_bl_connection.py +216 -216
  22. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/flashtool/hex_generator.py +305 -286
  23. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/flashtool/hex_utils.py +1381 -1381
  24. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/flashtool/logging.py +161 -161
  25. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/mock_flashtool.py +597 -0
  26. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/flashtool/operations.py +252 -252
  27. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/serial_io.py +202 -0
  28. lenz_flashtool-0.2.0/lenz_flashtool/flashtool/timing.py +61 -0
  29. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/flashtool/uart.py +807 -725
  30. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/testing/__init__.py +6 -6
  31. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/testing/mock_flashtool.py +426 -426
  32. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/utils/__init__.py +28 -28
  33. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/utils/plot.py +117 -115
  34. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/utils/progress.py +125 -125
  35. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/lenz_flashtool/utils/termcolors.py +101 -76
  36. {lenz_flashtool-0.1.9 → lenz_flashtool-0.2.0}/pyproject.toml +85 -79
  37. lenz_flashtool-0.1.9/lenz_flashtool/biss/cli.py +0 -390
  38. lenz_flashtool-0.1.9/lenz_flashtool/flashtool/core.py +0 -2743
  39. lenz_flashtool-0.1.9/lenz_flashtool/flashtool/errors.py +0 -7
@@ -1,14 +1,16 @@
1
- __pycache__/
2
- *.pyc
3
- *.pyo
4
- *.pyd
5
- .venv/
6
- venv/
7
- env/
8
- *.egg-info/
9
- dist/
10
- build/
11
- _bak/
12
- *.log
13
- *.ps1
14
- update_version.py
1
+ __pycache__/
2
+ *.pyc
3
+ *.pyo
4
+ *.pyd
5
+ .venv/
6
+ venv/
7
+ env/
8
+ *.egg-info/
9
+ dist/
10
+ build/
11
+ _bak/
12
+ *.log
13
+ *.ps1
14
+ update_version.py
15
+ .flake8
16
+ .github
@@ -1,22 +1,22 @@
1
- MIT License
2
-
3
- Copyright (c) 2020-2025 Design Bureau fo Robotic Systems, llc.
4
- LENZ ENCODERS is Trademark of Design Bureau fo Robotic Systems, llc.
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2026 Design Bureau fo Robotic Systems, llc.
4
+ LENZ ENCODERS is Trademark of Design Bureau fo Robotic Systems, llc.
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lenz-flashtool
3
- Version: 0.1.9
3
+ Version: 0.2.0
4
4
  Summary: FlashTool library for BiSS C Firmware Update and Calibration by LENZ Encoders
5
5
  Project-URL: Homepage, https://github.com/lenzencoders/lenz-flashtool-lib
6
6
  Project-URL: Source, https://github.com/lenzencoders/lenz-flashtool-lib
@@ -8,7 +8,7 @@ Project-URL: Documentation, https://flashtool.lenzencoders.com
8
8
  Author-email: LENZ ENCODERS <devs@lenzencoders.com>
9
9
  License: MIT License
10
10
 
11
- Copyright (c) 2020-2025 Design Bureau fo Robotic Systems, llc.
11
+ Copyright (c) 2020-2026 Design Bureau fo Robotic Systems, llc.
12
12
  LENZ ENCODERS is Trademark of Design Bureau fo Robotic Systems, llc.
13
13
 
14
14
  Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -119,6 +119,11 @@ with FlashTool(port_description_prefixes=('XR21V')) as ft:
119
119
  ### Note on Naming
120
120
  The package is installed as `lenz-flashtool` (with a hyphen), but imported in Python as `lenz_flashtool` (with an underscore) due to Python’s naming conventions.
121
121
 
122
+ ### Shell completion (zsh)
123
+ A zsh completion for the `lenz-flashtool-cli` command ships in
124
+ [`completions/`](completions/). See [`completions/README.md`](completions/README.md)
125
+ for installation and the `zstyle` settings required to display argument hints.
126
+
122
127
  ## Documentation
123
128
 
124
129
  For detailed API documentation, examples, and usage instructions, visit the [LENZ FlashTool Documentation](https://flashtool.lenzencoders.com).
@@ -1,106 +1,111 @@
1
- # lenz-flashtool
2
- [![PyPI Version](https://img.shields.io/pypi/v/lenz-flashtool)](https://pypi.org/project/lenz-flashtool/)
3
-
4
- FlashTool library for BiSS C Firmware Update and Calibration by LENZ Encoders.
5
-
6
- This is the source repository for the `lenz-flashtool` Python package, designed to interface with LENZ BiSS C encoders for firmware updates, calibration, and data reading. It provides a `FlashTool` class and utility functions for working with encoder hardware, including hex file manipulation and color formatting utilities.
7
-
8
- [**📚 Full Documentation: flashtool.lenzencoders.com**](https://flashtool.lenzencoders.com)
9
-
10
- ## Features
11
-
12
- - Control LENZ BiSS C encoders via serial communication.
13
- - Upload firmware and calibration data.
14
- - Read encoder status, serial numbers, and error flags.
15
- - Utilities for CRC calculation, hex data generation, and colored logging output.
16
-
17
- ## Installation
18
-
19
- ### From PyPI (Recommended)
20
- ```bash
21
- pip install lenz-flashtool
22
- ```
23
-
24
- ### From local folder
25
- ```bash
26
- pip install .
27
- ```
28
-
29
- ### From GitHub
30
- ```bash
31
- pip install git+https://github.com/lenzencoders/lenz-flashtool-lib.git
32
- ```
33
-
34
- ## Requirements
35
-
36
- - Python 3.8 or higher
37
- - `pyserial>=3.5` (for serial communication)
38
- - `numpy>=1.21.0` (for data handling)
39
-
40
- ## Usage
41
-
42
- ### Basic Example
43
- ```python
44
- from lenz_flashtool import FlashTool, init_logging
45
-
46
- # Set up logging
47
- #
48
- # Level Integer Value
49
- # logging.CRITICAL 50
50
- # logging.ERROR 40
51
- # logging.WARNING 30
52
- # logging.INFO 20
53
- # logging.DEBUG 10
54
- # logging.NOTSET 0
55
- init_logging(logfilename="flashtool.log", stdout_level=20, file_level=10)
56
-
57
- # Initialize FlashTool
58
- with FlashTool(port_description_prefixes=('XR21V')) as ft:
59
- # Power cycle the encoder
60
- ft.encoder_power_cycle()
61
-
62
- # Read serial number
63
- bootloader_ver, serial_num, mfg_date, program_ver = ft.biss_read_snum()
64
- print(f"Encoder Serial Number: {serial_num}")
65
- # The connection is automatically closed when exiting the 'with' block
66
- ```
67
- ### Note on Naming
68
- The package is installed as `lenz-flashtool` (with a hyphen), but imported in Python as `lenz_flashtool` (with an underscore) due to Python’s naming conventions.
69
-
70
- ## Documentation
71
-
72
- For detailed API documentation, examples, and usage instructions, visit the [LENZ FlashTool Documentation](https://flashtool.lenzencoders.com).
73
-
74
- ## Development
75
-
76
- ### Install Locally
77
- ```bash
78
- git clone https://github.com/lenzencoders/lenz-flashtool-lib.git
79
- cd lenz-flashtool-lib
80
- pip install .
81
- ```
82
-
83
- ### Run Tests
84
- ```bash
85
- pip install pytest
86
- pytest tests/
87
- ```
88
-
89
- ## Contributing
90
-
91
- Contributions are welcome! Please:
92
- 1. Fork the repository.
93
- 2. Create a feature branch (`git checkout -b feature/my-feature`).
94
- 3. Commit your changes (`git commit -m "Add my feature"`).
95
- 4. Push to the branch (`git push origin feature/my-feature`).
96
- 5. Open a pull request.
97
-
98
- Report issues at [github.com/lenzencoders/lenz-flashtool-lib/issues](https://github.com/lenzencoders/lenz-flashtool-lib/issues).
99
-
100
- ## License
101
-
102
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
103
-
104
- ## Contact
105
-
106
- For support or inquiries, contact LENZ ENCODERS at [info@lenzencoders.com](mailto:devs@lenzencoders.com).
1
+ # lenz-flashtool
2
+ [![PyPI Version](https://img.shields.io/pypi/v/lenz-flashtool)](https://pypi.org/project/lenz-flashtool/)
3
+
4
+ FlashTool library for BiSS C Firmware Update and Calibration by LENZ Encoders.
5
+
6
+ This is the source repository for the `lenz-flashtool` Python package, designed to interface with LENZ BiSS C encoders for firmware updates, calibration, and data reading. It provides a `FlashTool` class and utility functions for working with encoder hardware, including hex file manipulation and color formatting utilities.
7
+
8
+ [**📚 Full Documentation: flashtool.lenzencoders.com**](https://flashtool.lenzencoders.com)
9
+
10
+ ## Features
11
+
12
+ - Control LENZ BiSS C encoders via serial communication.
13
+ - Upload firmware and calibration data.
14
+ - Read encoder status, serial numbers, and error flags.
15
+ - Utilities for CRC calculation, hex data generation, and colored logging output.
16
+
17
+ ## Installation
18
+
19
+ ### From PyPI (Recommended)
20
+ ```bash
21
+ pip install lenz-flashtool
22
+ ```
23
+
24
+ ### From local folder
25
+ ```bash
26
+ pip install .
27
+ ```
28
+
29
+ ### From GitHub
30
+ ```bash
31
+ pip install git+https://github.com/lenzencoders/lenz-flashtool-lib.git
32
+ ```
33
+
34
+ ## Requirements
35
+
36
+ - Python 3.8 or higher
37
+ - `pyserial>=3.5` (for serial communication)
38
+ - `numpy>=1.21.0` (for data handling)
39
+
40
+ ## Usage
41
+
42
+ ### Basic Example
43
+ ```python
44
+ from lenz_flashtool import FlashTool, init_logging
45
+
46
+ # Set up logging
47
+ #
48
+ # Level Integer Value
49
+ # logging.CRITICAL 50
50
+ # logging.ERROR 40
51
+ # logging.WARNING 30
52
+ # logging.INFO 20
53
+ # logging.DEBUG 10
54
+ # logging.NOTSET 0
55
+ init_logging(logfilename="flashtool.log", stdout_level=20, file_level=10)
56
+
57
+ # Initialize FlashTool
58
+ with FlashTool(port_description_prefixes=('XR21V')) as ft:
59
+ # Power cycle the encoder
60
+ ft.encoder_power_cycle()
61
+
62
+ # Read serial number
63
+ bootloader_ver, serial_num, mfg_date, program_ver = ft.biss_read_snum()
64
+ print(f"Encoder Serial Number: {serial_num}")
65
+ # The connection is automatically closed when exiting the 'with' block
66
+ ```
67
+ ### Note on Naming
68
+ The package is installed as `lenz-flashtool` (with a hyphen), but imported in Python as `lenz_flashtool` (with an underscore) due to Python’s naming conventions.
69
+
70
+ ### Shell completion (zsh)
71
+ A zsh completion for the `lenz-flashtool-cli` command ships in
72
+ [`completions/`](completions/). See [`completions/README.md`](completions/README.md)
73
+ for installation and the `zstyle` settings required to display argument hints.
74
+
75
+ ## Documentation
76
+
77
+ For detailed API documentation, examples, and usage instructions, visit the [LENZ FlashTool Documentation](https://flashtool.lenzencoders.com).
78
+
79
+ ## Development
80
+
81
+ ### Install Locally
82
+ ```bash
83
+ git clone https://github.com/lenzencoders/lenz-flashtool-lib.git
84
+ cd lenz-flashtool-lib
85
+ pip install .
86
+ ```
87
+
88
+ ### Run Tests
89
+ ```bash
90
+ pip install pytest
91
+ pytest tests/
92
+ ```
93
+
94
+ ## Contributing
95
+
96
+ Contributions are welcome! Please:
97
+ 1. Fork the repository.
98
+ 2. Create a feature branch (`git checkout -b feature/my-feature`).
99
+ 3. Commit your changes (`git commit -m "Add my feature"`).
100
+ 4. Push to the branch (`git push origin feature/my-feature`).
101
+ 5. Open a pull request.
102
+
103
+ Report issues at [github.com/lenzencoders/lenz-flashtool-lib/issues](https://github.com/lenzencoders/lenz-flashtool-lib/issues).
104
+
105
+ ## License
106
+
107
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
108
+
109
+ ## Contact
110
+
111
+ For support or inquiries, contact LENZ ENCODERS at [info@lenzencoders.com](mailto:devs@lenzencoders.com).
@@ -1,85 +1,109 @@
1
- """
2
-
3
- FlashTool library for BiSS C Firmware Update and Calibration.
4
-
5
- This library provides functions for interfacing with BiSS C encoders using LENZ FlashTool, performing firmware updates,
6
- and executing calibration routines.
7
-
8
- Author:
9
- LENZ ENCODERS, 2020-2025
10
- """
11
-
12
- #
13
- # r'''
14
- # _ _____ _ _ _____ _____ _ _ ____ ___ ____ _____ ____ ____
15
- # | | | ____| \ | |__ / | ____| \ | |/ ___/ _ \| _ \| ____| _ \/ ___|
16
- # | | | _| | \| | / / | _| | \| | | | | | | | | | _| | |_) \___ \
17
- # | |___| |___| |\ |/ /_ | |___| |\ | |__| |_| | |_| | |___| _ < ___) |
18
- # |_____|_____|_| \_/____| |_____|_| \_|\____\___/|____/|_____|_| \_|____/
19
- # '''
20
-
21
- from .utils import plot, plot2, TermColors
22
- from .biss import (
23
- ERROR_FLAGS, BISS_COMMANDSTATE, biss_commands, BiSSBank
24
- )
25
- from .flashtool import (
26
- UartCmd,
27
- UartBootloaderSeq,
28
- FlashTool,
29
- FlashToolError,
30
- generate_hex_line,
31
- init_logging,
32
- get_nonce,
33
- _readhex,
34
- biss_send_hex,
35
- biss_send_dif,
36
- send_hex_irs_enc,
37
- calculate_checksum,
38
- dif2hex,
39
- prep_hex,
40
- read_hex_file_irs,
41
- connect_and_enter_fw,
42
- connect_and_stay_in_bl
43
- )
44
- from .testing import MockFlashTool
45
- from .encproc import LenzEncoderProcessor
46
-
47
- __all__ = [
48
- # Constants
49
- 'ERROR_FLAGS',
50
- 'BISS_COMMANDSTATE',
51
- 'biss_commands',
52
- 'BiSSBank',
53
-
54
- # Command constants
55
- 'UartCmd',
56
- 'UartBootloaderSeq',
57
-
58
- # Core classes
59
- 'FlashTool',
60
- 'FlashToolError',
61
- 'MockFlashTool',
62
- 'LenzEncoderProcessor',
63
-
64
- # Utility functions and classes
65
- 'generate_hex_line',
66
- 'init_logging',
67
- 'get_nonce',
68
- 'calculate_checksum',
69
- '_readhex',
70
- 'biss_send_dif',
71
- 'biss_send_hex',
72
- 'send_hex_irs_enc',
73
- 'plot',
74
- 'plot2',
75
- 'TermColors',
76
- 'dif2hex',
77
- 'prep_hex',
78
- 'read_hex_file_irs',
79
-
80
- 'connect_and_stay_in_bl',
81
- 'connect_and_enter_fw'
82
- ]
83
-
84
- __version__ = "0.1.9"
85
- __author__ = "LENZ ENCODERS"
1
+ """
2
+
3
+ FlashTool library for BiSS C Firmware Update and Calibration.
4
+
5
+ This library provides functions for interfacing with BiSS C encoders using LENZ FlashTool, performing firmware updates,
6
+ and executing calibration routines.
7
+
8
+ Author:
9
+ LENZ ENCODERS, 2020-2026
10
+ """
11
+
12
+ #
13
+ # r'''
14
+ # _ _____ _ _ _____ _____ _ _ ____ ___ ____ _____ ____ ____
15
+ # | | | ____| \ | |__ / | ____| \ | |/ ___/ _ \| _ \| ____| _ \/ ___|
16
+ # | | | _| | \| | / / | _| | \| | | | | | | | | | _| | |_) \___ \
17
+ # | |___| |___| |\ |/ /_ | |___| |\ | |__| |_| | |_| | |___| _ < ___) |
18
+ # |_____|_____|_| \_/____| |_____|_| \_|\____\___/|____/|_____|_| \_|____/
19
+ # '''
20
+
21
+ from .utils import plot, plot2, TermColors
22
+ from .biss import (
23
+ ERROR_FLAGS, BISS_COMMANDSTATE, biss_commands, BiSSBank,
24
+ SetupLock, FlashLock, Zeroing, ClearDifLUT, AmplitudeCalibration,
25
+ ArcCalibration, Flashing, ClearDifFlash, FlashDifLUT, UserBankState,
26
+ ENCODER_STATE_FIELDS,
27
+ )
28
+ from .flashtool import (
29
+ UartCmd,
30
+ UartBootloaderSeq,
31
+ FlashTool,
32
+ FlashToolError,
33
+ RESOLUTION_MAP,
34
+ UARTErrorType,
35
+ UARTErrorCode,
36
+ BiSSFaultState,
37
+ generate_hex_line,
38
+ init_logging,
39
+ get_nonce,
40
+ _readhex,
41
+ biss_send_hex,
42
+ biss_send_dif,
43
+ send_hex_irs_enc,
44
+ calculate_checksum,
45
+ dif2hex,
46
+ prep_hex,
47
+ read_hex_file_irs,
48
+ connect_and_enter_fw,
49
+ connect_and_stay_in_bl
50
+ )
51
+ from .testing import MockFlashTool
52
+ from .encproc import LenzEncoderProcessor
53
+
54
+ __all__ = [
55
+ # Constants
56
+ 'ERROR_FLAGS',
57
+ 'BISS_COMMANDSTATE',
58
+ 'biss_commands',
59
+ 'BiSSBank',
60
+
61
+ # EncoderState bitfield enums
62
+ 'SetupLock',
63
+ 'FlashLock',
64
+ 'Zeroing',
65
+ 'ClearDifLUT',
66
+ 'AmplitudeCalibration',
67
+ 'ArcCalibration',
68
+ 'Flashing',
69
+ 'ClearDifFlash',
70
+ 'FlashDifLUT',
71
+ 'UserBankState',
72
+ 'ENCODER_STATE_FIELDS',
73
+
74
+ # Command constants
75
+ 'UartCmd',
76
+ 'UartBootloaderSeq',
77
+
78
+ # Core classes
79
+ 'FlashTool',
80
+ 'FlashToolError',
81
+ 'UARTErrorType',
82
+ 'UARTErrorCode',
83
+ 'BiSSFaultState',
84
+ 'MockFlashTool',
85
+ 'LenzEncoderProcessor',
86
+ 'RESOLUTION_MAP',
87
+
88
+ # Utility functions and classes
89
+ 'generate_hex_line',
90
+ 'init_logging',
91
+ 'get_nonce',
92
+ 'calculate_checksum',
93
+ '_readhex',
94
+ 'biss_send_dif',
95
+ 'biss_send_hex',
96
+ 'send_hex_irs_enc',
97
+ 'plot',
98
+ 'plot2',
99
+ 'TermColors',
100
+ 'dif2hex',
101
+ 'prep_hex',
102
+ 'read_hex_file_irs',
103
+
104
+ 'connect_and_stay_in_bl',
105
+ 'connect_and_enter_fw'
106
+ ]
107
+
108
+ __version__ = "0.2.0"
109
+ __author__ = "LENZ ENCODERS"
@@ -1,42 +1,67 @@
1
- """
2
-
3
- LENZ BiSS Protocol Implementation
4
-
5
- Provides BiSS encoder protocol standarts and utilities.
6
-
7
- Author:
8
- LENZ ENCODERS, 2020-2025
9
- """
10
-
11
- #
12
- # r'''
13
- # _ _____ _ _ _____ _____ _ _ ____ ___ ____ _____ ____ ____
14
- # | | | ____| \ | |__ / | ____| \ | |/ ___/ _ \| _ \| ____| _ \/ ___|
15
- # | | | _| | \| | / / | _| | \| | | | | | | | | | _| | |_) \___ \
16
- # | |___| |___| |\ |/ /_ | |___| |\ | |__| |_| | |_| | |___| _ < ___) |
17
- # |_____|_____|_| \_/____| |_____|_| \_|\____\___/|____/|_____|_| \_|____/
18
- #
19
-
20
- from .commands import (
21
- BISS_COMMANDSTATE,
22
- ERROR_FLAGS,
23
- biss_commands,
24
- interpret_biss_commandstate,
25
- interpret_error_flags
26
- )
27
- from .crc import biss_crc6_calc
28
- from .registers import (
29
- BiSSBank,
30
- )
31
-
32
- __all__ = [
33
- 'BISS_COMMANDSTATE',
34
- 'ERROR_FLAGS',
35
- 'biss_commands',
36
- 'interpret_biss_commandstate',
37
- 'interpret_error_flags',
38
-
39
- 'biss_crc6_calc',
40
-
41
- 'BiSSBank'
42
- ]
1
+ """
2
+
3
+ LENZ BiSS Protocol Implementation
4
+
5
+ Provides BiSS encoder protocol standarts and utilities.
6
+
7
+ Author:
8
+ LENZ ENCODERS, 2020-2025
9
+ """
10
+
11
+ #
12
+ # r'''
13
+ # _ _____ _ _ _____ _____ _ _ ____ ___ ____ _____ ____ ____
14
+ # | | | ____| \ | |__ / | ____| \ | |/ ___/ _ \| _ \| ____| _ \/ ___|
15
+ # | | | _| | \| | / / | _| | \| | | | | | | | | | _| | |_) \___ \
16
+ # | |___| |___| |\ |/ /_ | |___| |\ | |__| |_| | |_| | |___| _ < ___) |
17
+ # |_____|_____|_| \_/____| |_____|_| \_|\____\___/|____/|_____|_| \_|____/
18
+ #
19
+
20
+ from .commands import (
21
+ BISS_COMMANDSTATE,
22
+ ERROR_FLAGS,
23
+ biss_commands,
24
+ interpret_biss_commandstate,
25
+ interpret_error_flags
26
+ )
27
+ from .crc import biss_crc6_calc
28
+ from .registers import (
29
+ BiSSBank,
30
+ )
31
+ from .encoder_state import (
32
+ SetupLock,
33
+ FlashLock,
34
+ Zeroing,
35
+ ClearDifLUT,
36
+ AmplitudeCalibration,
37
+ ArcCalibration,
38
+ Flashing,
39
+ ClearDifFlash,
40
+ FlashDifLUT,
41
+ UserBankState,
42
+ ENCODER_STATE_FIELDS,
43
+ )
44
+
45
+ __all__ = [
46
+ 'BISS_COMMANDSTATE',
47
+ 'ERROR_FLAGS',
48
+ 'biss_commands',
49
+ 'interpret_biss_commandstate',
50
+ 'interpret_error_flags',
51
+
52
+ 'biss_crc6_calc',
53
+
54
+ 'BiSSBank',
55
+
56
+ 'SetupLock',
57
+ 'FlashLock',
58
+ 'Zeroing',
59
+ 'ClearDifLUT',
60
+ 'AmplitudeCalibration',
61
+ 'ArcCalibration',
62
+ 'Flashing',
63
+ 'ClearDifFlash',
64
+ 'FlashDifLUT',
65
+ 'UserBankState',
66
+ 'ENCODER_STATE_FIELDS',
67
+ ]