Skip to content

Feature/python support nuttx periphery#3537

Open
fdcavalcanti wants to merge 2 commits into
apache:masterfrom
fdcavalcanti:feature/python-support-nuttx-periphery
Open

Feature/python support nuttx periphery#3537
fdcavalcanti wants to merge 2 commits into
apache:masterfrom
fdcavalcanti:feature/python-support-nuttx-periphery

Conversation

@fdcavalcanti

Copy link
Copy Markdown
Contributor

Summary

  • interpreters/python: support nuttx-periphery package

Adds support for installing nuttx-periphery Python package by default
on Python support. This package provides API for accessing Nuttx
character drivers.

  • interpreters/python: update repack_wheel script

Updates the repack_wheel_add_pyc.py script to support other packages,
not only pip.

Impact

Impact on user: Adds support for using Python as a mean to access character devices.

Impact on build: No.

Impact on hardware: No.

Impact on documentation: No.

Impact on security: No.

Impact on compatibility: No.

Testing

Tested on ESP32-P4.

Building

  • ./tools/configure.sh -S esp32p4-function-ev-board:python
  • Make and flash

Running

Open Python and try importing the nuttx_periphery package.

nsh> python
Python 3.13.0 (main, Jun 10 2026, 16:56:35) [GCC 14.2.0] on nuttx
Type "help", "copyright", "credits" or "license" for more information.
>>> from nuttx_periphery import GPIO
>>> 

Control GPIO through Python:

>>> from nuttx_periphery import GPIO, GPIOPinType
>>> gpio = GPIO("/dev/gpio0")
>>> gpio.set_pin_type(GPIOPinType.GPIO_OUTPUT_PIN)
>>> gpio.write(True)

Results

Python package is successfully installed and able to be imported.
GPIO test works and LED blinks successfully.

Updates the repack_wheel_add_pyc.py script to support other packages,
not only pip.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Adds support for installing nuttx-periphery Python package by default
on Python support. This package provides API for accessing Nuttx
character drivers.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant