Python implementation of Microchip LNet protocol
Project description
mchplnet
- mchplnet is the Python implementation of the LNet protocol.
- It implements multiple LNet services to communicate to embedded systems/microcontrollers.
- Currently only pyserial interface is supported.
- It is recommended to use the pyx2cscope package, which offers a higher-level interface.
Getting Started
- Navigate to the Examples directory in the mchplnet project to explore the available examples or create a new .py file based on your requirements.
- Import the necessary classes:
from mchplnet.interfaces.factory import InterfaceFactory
from mchplnet.interfaces.factory import InterfaceType as IType
from mchplnet.lnet import LNet
- Create an interface according to your requirements and initialize the LNet with the interface:
interface = InterfaceFactory.get_interface(IType.SERIAL, port="COM8", baudrate=115200)
l_net = mchplnet.LNet(interface))
- Use the appropriate functions, such as get_ram, to interact with variables by specifying their address and size:
var_address = 0x00000000
var_size = 4
var_value = l_net.get_ram(var_address, var_size)
logging.debug(var_value)
- To modify the value of a variable, use the put_ram function:
var_newValue = 500
l_net.put_ram(var_address, var_size, var_newValue)
Contribute
If you discover a bug or have an idea for an improvement, we encourage you to contribute! You can do so by following these steps:
- Fork the repository.
- Create a new branch for your changes.
- Make the necessary changes and commit them.
- Push your changes to your forked repository.
- Open a pull request on the main repository, describing your changes.
We appreciate your contribution!
Development Setup
To set up the development environment:
-
Clone the repository:
git clone https://github.com/X2Cscope/mchplnet.git cd mchplnet
-
Install development dependencies:
pip install -r requirements.txt pip install -r quality.txt
-
Install pre-commit hooks:
pre-commit install -
The pre-commit hook will now run automatically on each commit to ensure code quality and version consistency.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mchplnet-0.4.1.tar.gz.
File metadata
- Download URL: mchplnet-0.4.1.tar.gz
- Upload date:
- Size: 18.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.19 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6771c37e5a7894e2e77c0a443be9f5c810d40cae7ecb7ea566db94120617d41c
|
|
| MD5 |
1f6476310c5898faf0ae8a3b3c0da9e4
|
|
| BLAKE2b-256 |
f91ecc76072863f1a4eea9dcda1c01c4a9dd76ea92ecc9c225de544f0036f06f
|
File details
Details for the file mchplnet-0.4.1-py2.py3-none-any.whl.
File metadata
- Download URL: mchplnet-0.4.1-py2.py3-none-any.whl
- Upload date:
- Size: 26.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.19 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5abe38e29e02e1ee21983791440290b09d88c3a8de23d9bced24447809288bbb
|
|
| MD5 |
ab2a5d12d8ce3420fd60b2455cb81ff4
|
|
| BLAKE2b-256 |
154e5f0e508734b7f771fc81e1ca303f2c2df28624c8cf36030dea59365d926f
|