Files
MeshCore/tools/hil/TDeckSpiClockTiming.h
T
mikecarper e8d1e537e4 Record T-Deck radio2 hardware timing and regression coverage
Add receive-only same-image display, SPI, modem/IQ-cache and scoped-priority experiments with checkpointed collectors. Keep rejected clock-phase correction and elevated-priority experiments out of production.

Publish sanitized timing data, Full Companion/Bluetooth/USB checks and redraw measurements with their limits. Wire the new behavioral checks into CI.
2026-10-18 23:20:50 -07:00

20 lines
757 B
C

#pragma once
#include <stdint.h>
// HIL-only ESP32-S3 SPI2/3 clock register experiment. Keep it independent of
// the peripheral so every N/pre combination can be checked on the host.
struct TDeckSpiClockTiming {
static constexpr uint32_t ClockEqualsSource = uint32_t(1) << 31;
static constexpr uint32_t PhaseMask = 0x0fff;
static uint32_t corrected(uint32_t original) {
const uint32_t n = (original >> 12) & 0x3f;
// Source-clock mode has no divided phases. N=0 likewise cannot represent
// both a high and a low phase; leave it untouched rather than underflow H.
if ((original & ClockEqualsSource) || n == 0) return original;
const uint32_t high = (n + 1) / 2 - 1;
return (original & ~PhaseMask) | n | (high << 6);
}
};