Skip to main content

A Python library for DLN2 GPIO adapters. Originally developed for Pico USB IO Board.

Project description

DLN2 GPIO Wrapper

A Python library for interfacing with DLN2 USB-to-GPIO adapters. It targets the Pico USB I/O Board firmware and packages the host-side GPIO access layer as a standalone Python project.

Features

  • Low-level DLN2 USB GPIO client built on pyusb
  • High-level GPIO helper for pin enable, direction, read, write, and event config
  • GPIO event polling with async packet handling
  • Command-line helpers for GPIO info, watch, and toggle
  • Pure Python, no compiled extension

Installation

From source:

git clone https://github.com/syabyr/dln2_gpio_wrapper.git
cd dln2_gpio_wrapper
pip install .

For development:

pip install -e ".[dev]"

Quick Start

from dln2_gpio_wrapper import GPIO

with GPIO() as gpio:
    pin = 25
    gpio.enable(pin, output=True)
    gpio.write(pin, 1)
    print(gpio.read(pin))
    gpio.toggle(pin)

Firmware Notes

  • PIN_GET_VAL returns the current live pin level.
  • Edge events are latched only in a small firmware queue and delivered asynchronously.
  • Debounce is not implemented by this firmware.
  • Event queue depth in firmware is limited, so bursts can overflow.

Command-Line Tools

dln2-gpio-info --help
dln2-gpio-watch --help
dln2-gpio-toggle --help

Development

make test
make build

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

dln2_gpio_wrapper-0.1.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

dln2_gpio_wrapper-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file dln2_gpio_wrapper-0.1.0.tar.gz.

File metadata

  • Download URL: dln2_gpio_wrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for dln2_gpio_wrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7a25d9ecdd4b803ea9d7a700d93905a80f711070bb789da7c14a4441c3fa5fe4
MD5 1d3fdd79442b698cef5a7a2c58cd31ca
BLAKE2b-256 11df2725264b86348631355c495138247bb5c70539ac25a1595a3839cf8a1484

See more details on using hashes here.

File details

Details for the file dln2_gpio_wrapper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dln2_gpio_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f2233cdf9bf6de0d2b3d67ef4c7e1d2b0804ecea86cca06ab76f6fa4acfe4ea
MD5 33b6f5b756844b5c895ea6819fc51bd9
BLAKE2b-256 f8cb8023386f5a8fca29c3d5f39c8856e1ef8ecaea11adb1f6966d622177a5ef

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