How irnas/ppk2-api-python works
This Python library automates power measurements with a Nordic PPK2 over serial. The main workflow initializes the device, configures source-meter mode and voltage, starts acquisition, collects and decodes samples, then exposes current, power, and charge summaries and optionally writes samples to CSV. The API also documents a buffered multiprocessing variant and device discovery. The README describes broader GUI-like functionality and selectable-format logging as in progress; those capabilities are not detailed in the sampled implementation. Connections below follow shown calls or README statements.
Main entry points: power_profiler.py PowerProfiler · ppk2_api.py PPK2 API
Components 14
Power profiling
- PowerProfiler
src/power_profiler.py - Measurement loop
src/power_profiler.py - Measurement summaries
src/power_profiler.py - CSV logging
src/power_profiler.py - Selectable log formats
src/power_profiler.py
PPK2 API
- PPK2 API
src/ppk2_api/ppk2_api.py - Device discovery
src/ppk2_api/ppk2_api.py - Mode and power control
src/ppk2_api/ppk2_api.py - Sample processing
src/ppk2_api/ppk2_api.py - Buffered reader
src/ppk2_api/ppk2_api.py - Profiler GUI features
src/ppk2_api/ppk2_api.py
Hardware
- Serial interface
- PPK2 device
Other components
- Python caller
Connections 13
- Python caller → PowerProfiler: initializes or controls
src/power_profiler.py - PowerProfiler → Device discovery: discovers device
src/power_profiler.py - PowerProfiler → PPK2 API: configures and controls
src/power_profiler.py - PPK2 API → Serial interface: reads and writes
src/ppk2_api/ppk2_api.py - Serial interface → PPK2 device: communicates with
- PowerProfiler → Measurement loop: starts thread
src/power_profiler.py - Measurement loop → PPK2 API: fetches and decodes
src/power_profiler.py - Measurement loop → PowerProfiler: appends samples
src/power_profiler.py - PowerProfiler → Measurement summaries: provides metrics
src/power_profiler.py - PowerProfiler → CSV logging: writes samples
src/power_profiler.py - Python caller → Buffered reader: may use variant
README.md - Python caller → Selectable log formats: requests format
README.md - Python caller → Profiler GUI features: may use capabilities
README.md