Skip to content

audioif, cameraif, usbhost: type stubs and simpletests; btclassic, picotts: __revision__ - #399

Merged
bdbarnett merged 2 commits into
mainfrom
d-c-modules
Nov 10, 2026
Merged

bdbarnett merged 2 commits into
mainfrom
d-c-modules

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

The last C modules on the docs template.

audioif, cameraif and usbhost get .pyi stubs, so an editor completes their API and the Stubs check reads them. Each name in the stubs matches the module's C tables (audioif's stubs are audiobusio, audioio, audioi2sin, analogbufio and _audioif; usbhost's is _usbhost, the C half the usb packages sit on, since there is no importable usbhost). A script compared every module's global table and the Camera class's members with the stubs: no name is missing or extra. Each stub passes mypy.

btclassic.__revision__ and picotts.__revision__ come from git describe at build time, the way cameraif's does, through the Make and CMake glue (btclassic on esp32, rp2 and unix; picotts via _picotts, which picotts.py passes on). I haven't built them locally; CI's firmware builds are the proof.

cameraif_simpletest.py ran on an ESP32-P4X-EYE with an OV2710 and printed the sensor, the 1920x1080 frame size and a 4,147,200-byte frame. usbhost_simpletest.py ran on a P4 WIFI6 DEV-KIT with nothing plugged into the host port: the host started, printed 0 USB device(s) found and stopped cleanly. It hasn't listed a real device yet.

… picotts: __revision__

audioif, cameraif and usbhost ship .pyi stubs, checked name for name against each module's C tables (audioif's are audiobusio, audioio, audioi2sin, analogbufio and _audioif; usbhost's is _usbhost, the C half the usb packages use). cameraif and usbhost get a simpletest, the shortest program that proves the module works. btclassic and picotts report which source a firmware was built from in __revision__, set from git describe at build time like the other modules.
@bdbarnett
bdbarnett merged commit 7909893 into main Nov 10, 2026
16 checks passed
@bdbarnett
bdbarnett deleted the d-c-modules branch November 10, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant