How yyax13/sparktype works
SparkType is Digispark firmware that presents a clearly identified USB boot-protocol keyboard. Its main setup demonstrates the user-to-result path: firmware invokes the PT-BR keyboard layout to type text and blinks the onboard LED. Separate HID infrastructure tracks host LED replies, reconnects USB, and can infer the host OS. The README documents USB identity and layout extensibility; the legacy PT-BR implementation is retained as a reference. Some USB-stack wiring is documented but its vendor implementation is outside the supplied tree.
Main entry points: LEDS/main.cpp Host LED state · OS/main.cpp Host OS detection · src/main.cpp Demo behavior · pt-br/main.cpp PT-BR layout
Components 12
Firmware entry
- Digispark firmware
SparkType.ino - Demo behavior
src/main.cpp
Keyboard output
- PT-BR layout
src/lib/SparkKeyboard/layouts/pt-br/main.cpp - Keyboard base
src/lib/SparkKeyboard/main.h - Legacy PT-BR keyboard
src/lib/DigiKeyboardPtBr.cpp
HID infrastructure
- USB connection control
src/infra/HID/CONNECTION/main.cpp - Host LED state
src/infra/HID/LEDS/main.cpp - Host OS detection
src/infra/OS/main.cpp
Identity and signals
- Onboard LED alerts
src/shared/utils/blink-alert/main.cpp - USB identity config
src/config.h
Other components
- USB HID host
- Computer host
Connections 14
- Digispark firmware → Demo behavior: calls setup
README.md - Demo behavior → PT-BR layout: types text
src/main.cpp - Demo behavior → Onboard LED alerts: blinks
src/main.cpp - PT-BR layout → Keyboard base: extends
- PT-BR layout → USB HID host: sends key reports
src/lib/SparkKeyboard/layouts/pt-br/main.cpp - USB HID host → Computer host: enumerates as HID
README.md - Computer host → Host LED state: returns LED state
README.md - Host OS detection → Host LED state: reads and restores
src/infra/OS/main.cpp - Host OS detection → USB connection control: reconnects
src/infra/OS/main.cpp - Host OS detection → Onboard LED alerts: signals detection
src/infra/OS/main.cpp - USB connection control → Host LED state: clears LED replies
src/infra/HID/CONNECTION/main.cpp - Host LED state → USB HID host: toggles lock keys
src/infra/HID/LEDS/main.cpp - USB identity config → USB HID host: configures identity
README.md - Legacy PT-BR keyboard → USB HID host: provides keyboard output