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 mplabx enviroment / Standalone.
Getting Started with Scripting
- 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.
Getting Started with pyX2Cscope-GUI
- pyX2Cscope-GUI is based on Serial interface.
- The Firmware of the microcontroller should have the X2CScope library/Peripheral enabled.
- Select the COM Port, Baud Rate from the drop-down menus and the ELF file of the project, the microcontroller programmed with.
- Sample time can be changed during run time as well, by default its set to 500ms.
- Press on Connect
- Once the connection between pyX2Cscope and Microcontroller takes place, the buttons will be enabled.
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.5.tar.gz
(223.4 kB
view details)
Built Distribution
File details
Details for the file pyx2cscope-0.0.5.tar.gz
.
File metadata
- Download URL: pyx2cscope-0.0.5.tar.gz
- Upload date:
- Size: 223.4 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 | 89a5d5f6630dbf62f4097cc6a8404203756a28c35b86ef325c2a29c84513e22e |
|
MD5 | 594d5d54aa735e308b86c96fb1ab2492 |
|
BLAKE2b-256 | 1a96a063de8747b5ca0843e7afb916c4b51e2c4198ee8f9ed93e2a7e3365571c |
Provenance
File details
Details for the file pyx2cscope-0.0.5-py2.py3-none-any.whl
.
File metadata
- Download URL: pyx2cscope-0.0.5-py2.py3-none-any.whl
- Upload date:
- Size: 175.2 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 | a76bd798fb4f3f48cbbc1f995a0ea60b1c86743d2e6c64a1942708e7e9a36dd5 |
|
MD5 | 42445cbb3a3c689b61b32107c7c4cda6 |
|
BLAKE2b-256 | 4456bdb3bc991ff1ce425543e26c54228655b38946522eb76fe1f32894011567 |