python implementation of X2Cscope
Project description
PyX2CScope
- PyX2CScope is the Python implementation of the X2Cscope plugin from MPLABX.
- This will let the user use the functionality of X2Cscope even outside of mplabx enviroment / Standalone.
Getting Started
- You can install the module using pip:
pip install pyx2cscope
- Go to the
Examples
directory in the PyX2CScope project to check out the available examples or create a new .py file according to your requirements. - start with importing PyX2CScope:
import pyx2cscope
- Choose the communication interface from the interfaces' module. Currently, only Serial is supported: CAN and LIN coming in near future:
from mchplnet.interfaces.factory import InterfaceFactory
from mchplnet.interfaces.factory import InterfaceType as IType
from mchplnet.lnet import LNet
- Set up the Serial connection with the desired COM port and baud rate:
serial_port = "COM9"
baud_rate = 115200
interface = InterfaceFactory.get_interface(IType.SERIAL, port = serial_port, baudrate = baud_rate)
- Initialize the LNet object with the serial connection:
l_net = pyx2cscope.LNet(interface)
- Setup the Variable factory.
variable_factory = pyx2cscope.VariableFactory(l_net, elf_file)
- Replace the elf_file with the path to the ELF file of your project.
- Create a Variable object for the variable you want to monitor:
Variable = variable_factory.get_variable_elf('Variable_name')
- Replace 'Variable_name' with the name of the variable you want to monitor. You can create multiple variable objects as needed.
- Once you have gone through these steps, you can use the get_value() function to retrieve the value of the variable:
Variable.get_value()
. You can also use theVariable.set_value(value)
function to set the value of the variable.
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 PyX2CScope 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 PyX2CScope repository, describing your changes.
We appreciate your contribution!
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
pyx2cscope-0.0.2.tar.gz
(118.7 kB
view details)
Built Distribution
File details
Details for the file pyx2cscope-0.0.2.tar.gz
.
File metadata
- Download URL: pyx2cscope-0.0.2.tar.gz
- Upload date:
- Size: 118.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05903e2c247f742df25bcad4b10e829cdb2886f5fac38695c81382215764e9bd |
|
MD5 | 75efeb0f9e5fe563108b2e08ad02e3ef |
|
BLAKE2b-256 | af0fd2f0d149694ae0c5db6d03adf4745b4bbfb4853958a53d9f70bc9d058760 |
Provenance
File details
Details for the file pyx2cscope-0.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: pyx2cscope-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 122.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e27b92d0944cba95728ebc128ead0be9d896b02d10bffb09f37ba236c0d50d65 |
|
MD5 | a6565a08f95991e98aaf13fb38eb4b25 |
|
BLAKE2b-256 | 0063701406094f82ed6d069981ff0f42ccd576b7d3c919bf6fcd52899cff42ee |