Metadata-Version: 2.4
Name: dln2-adc-wrapper
Version: 0.1.0
Summary: A Python library for DLN2 ADC adapters. Originally developed for Pico USB IO Board.
Home-page: https://github.com/syabyr/dln2_adc_wrapper
Author: IPM Group
Author-email: IPM Group <contact@ipmgroup.dev>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/syabyr/dln2_adc_wrapper
Project-URL: Documentation, https://github.com/syabyr/dln2_adc_wrapper#readme
Project-URL: Repository, https://github.com/syabyr/dln2_adc_wrapper.git
Project-URL: Bug Tracker, https://github.com/syabyr/dln2_adc_wrapper/issues
Keywords: dln2,adc,usb,hardware,driver
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Hardware :: Hardware Drivers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyusb>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: build; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# DLN2 ADC Wrapper

A Python library for interfacing with DLN2 USB-to-ADC adapters.
This package targets the Pico USB I/O Board firmware in this repository and mirrors
the packaging style of the other standalone DLN2 wrapper packages.

## Features

- Low-level DLN2 USB ADC client built on `pyusb`
- High-level `ADC` helper for enabling channels and reading raw samples
- Raw 10-bit readings with optional voltage conversion
- Read-one and read-all channel helpers
- Command-line helpers for channel info and live watch output
- Pure Python, no compiled extension

## Firmware Notes

The current firmware exposes three ADC channels:

- channel `0` -> GP26 / ADC0
- channel `1` -> GP27 / ADC1
- channel `2` -> GP28 / ADC2

`CHANNEL_GET_ALL_VAL` returns space for eight values because it matches the DLN2
driver shape, but only the first three values are real on this firmware.

## Installation

```bash
git clone https://github.com/syabyr/dln2_adc_wrapper.git
cd dln2_adc_wrapper
pip install .
```

For development:

```bash
pip install -e ".[dev]"
```

## Quick Start

```python
from dln2_adc_wrapper import ADC

with ADC() as adc:
    print(adc.get_channel_count())
    adc.enable_channel(0)
    raw = adc.read_channel(0)
    print(raw, adc.to_voltage(raw))
```

## Command-Line Tools

```bash
dln2-adc-info --help
dln2-adc-watch --help
```

## Development

```bash
make test
make build
```
