Skip to main content

Python implementation of Microchip LNet protocol

Project description

PyX2CScope Logo

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

  1. Navigate to the Examples directory in the mchplnet project to explore the available examples or create a new .py file based on your requirements.
  2. Import the necessary classes:
from mchplnet.interfaces.factory import InterfaceFactory
from mchplnet.interfaces.factory import InterfaceType as IType
from mchplnet.lnet import LNet
  1. 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))
  1. 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)
  1. 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:

  1. Fork the repository.
  2. Create a new branch for your changes.
  3. Make the necessary changes and commit them.
  4. Push your changes to your forked repository.
  5. Open a pull request on the main repository, describing your changes.

We appreciate your contribution!

Development Setup

To set up the development environment:

  1. Clone the repository:

    git clone https://github.com/X2Cscope/mchplnet.git
    cd mchplnet
    
  2. Install development dependencies:

    pip install -r requirements.txt
    pip install -r quality.txt
    
  3. Install pre-commit hooks:

    pre-commit install
    
  4. The pre-commit hook will now run automatically on each commit to ensure code quality and version consistency.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mchplnet-0.4.2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mchplnet-0.4.2-py2.py3-none-any.whl (26.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mchplnet-0.4.2.tar.gz.

File metadata

  • Download URL: mchplnet-0.4.2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.20 Linux/6.14.0-1017-azure

File hashes

Hashes for mchplnet-0.4.2.tar.gz
Algorithm Hash digest
SHA256 e4bbcb496b9f78a9f63583831699fc472f4d06f1090b117f1c0c553c1459e365
MD5 4e850e7d3eedb5f0848650601fba3284
BLAKE2b-256 49124edbd4b87fa607a75583da313820050335ca61d9aba1fddaab90118b10ce

See more details on using hashes here.

File details

Details for the file mchplnet-0.4.2-py2.py3-none-any.whl.

File metadata

  • Download URL: mchplnet-0.4.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.20 Linux/6.14.0-1017-azure

File hashes

Hashes for mchplnet-0.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5c47f61dc075489ce049e08ce10591b78934b4752306be1f6f94c6f37028aaac
MD5 99ebecd3097f64afe9f3c30ceba593f5
BLAKE2b-256 a0ba11a4ad62fb8de2bdf413f4d3a5f3603908a227770e5d662f2eb17f5695e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page