Add trackball driver layer: ITrackball, quadrature driver, factory
Bring the trackball to the same device-driver structure as PMIC/RTC/IMU/
keyboard. A trackball is a passive GPIO device — no bus, registers, or chip
identity — so the layer is honest about that: it cannot be electrically
probed, and its motion needs a physical finger.
- i_trackball.h: device-level ITrackball contract (init/isAvailable/name,
drainSteps raw quadrature snapshot, isClickDown, inject, selfTest) + the
QuadratureSteps transport struct.
- quadrature_trackball.{h,cpp}: generic four-direction + click GPIO quadrature
driver parameterized on its pin mapping (the T-Deck is one mapping). Holds
the falling-edge IRAM ISRs, ISR-resident step accumulators and velocity
timestamps (a hardware singleton), moved verbatim from the HAL wrapper so
ISR discipline and velocity math are unchanged.
- trackball_factory.{h,cpp}: flag-gated createTrackball (TRACKBALL_TYPE_*,
like the LilyGo keyboard leg) with a natively-testable constexpr classifier
and pin-validity check standing in for the impossible address probe; returns
the shared NullTrackball otherwise.
- trackball_selftest.h: pure, hardware-free pass/fail helpers (drain coherence,
informational click-idle level, overall gate) — the passive-device analogue
of imu_selftest.h / keyboard_selftest.h.
- null_trackball.h: never-null no-op driver for boards without a trackball.
- TRACKBALL_TYPE_QUADRATURE flag default (platform_defaults.h) + T-Deck enable;
drv_trackball Doxygen group.
Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4
Add trackball driver layer: ITrackball, quadrature driver, factory
Bring the trackball to the same device-driver structure as PMIC/RTC/IMU/
keyboard. A trackball is a passive GPIO device — no bus, registers, or chip
identity — so the layer is honest about that: it cannot be electrically
probed, and its motion needs a physical finger.
- i_trackball.h: device-level ITrackball contract (init/isAvailable/name,
drainSteps raw quadrature snapshot, isClickDown, inject, selfTest) + the
QuadratureSteps transport struct.
- quadrature_trackball.{h,cpp}: generic four-direction + click GPIO quadrature
driver parameterized on its pin mapping (the T-Deck is one mapping). Holds
the falling-edge IRAM ISRs, ISR-resident step accumulators and velocity
timestamps (a hardware singleton), moved verbatim from the HAL wrapper so
ISR discipline and velocity math are unchanged.
- trackball_factory.{h,cpp}: flag-gated createTrackball (TRACKBALL_TYPE_*,
like the LilyGo keyboard leg) with a natively-testable constexpr classifier
and pin-validity check standing in for the impossible address probe; returns
the shared NullTrackball otherwise.
- trackball_selftest.h: pure, hardware-free pass/fail helpers (drain coherence,
informational click-idle level, overall gate) — the passive-device analogue
of imu_selftest.h / keyboard_selftest.h.
- null_trackball.h: never-null no-op driver for boards without a trackball.
- TRACKBALL_TYPE_QUADRATURE flag default (platform_defaults.h) + T-Deck enable;
drv_trackball Doxygen group.
Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4