19 class ResultFormatter;
35 return is_rmt_driver && tx_pin == rx_pin;
51 bool has_explicit_override,
52 bool is_parlio_driver,
54 if (!has_explicit_override && is_parlio_driver && is_esp32_c6) {
57 return requested_backend;
66 size_t expected_data_bytes,
68 constexpr size_t kEdgesPerByte = 16;
69 constexpr size_t kFramingEdges = 2;
70 const size_t max_size =
static_cast<size_t>(-1);
73 if (shared_buffer_bytes >
max_size / 8) {
76 return shared_buffer_bytes * 8;
79 if (expected_data_bytes > (
max_size - kFramingEdges) / kEdgesPerByte) {
82 const size_t required =
83 expected_data_bytes * kEdgesPerByte + kFramingEdges;
85 while (capacity < required) {
108 u32 lead_run_ns, u32 idle_threshold_ns,
110 constexpr size_t kLeadPlusOneByteRuns = 1 + 8 + 7;
111 if (run_count >= min_frame_runs) {
114 return run_count >= kLeadPlusOneByteRuns && lead_run_is_low &&
115 lead_run_ns > idle_threshold_ns;
157 size_t dma_tail_words,
158 u32 samples_per_dma_word,
159 u32 sample_period_ns,
161 u32 arming_lead_in_ns,
163 constexpr size_t kPhasesPerByte = 16;
164 constexpr u64 kBitsPerByte = 8;
166 if (bit_period_ns == 0 || edge_capacity == 0 || samples_per_dma_word == 0 ||
167 sample_period_ns == 0) {
171 const size_t by_pool = edge_capacity / kPhasesPerByte;
173 const u64 dma_words =
174 static_cast<u64>((edge_capacity + 1u) / 2u) + dma_tail_words;
175 const u64 budget_ns =
176 dma_words * samples_per_dma_word * sample_period_ns;
177 const u64 reserved_ns =
178 static_cast<u64>(idle_tail_ns) + arming_lead_in_ns;
179 if (budget_ns <= reserved_ns) {
183 (budget_ns - reserved_ns) / (kBitsPerByte * bit_period_ns);
185 if (
static_cast<u64>(by_pool) < by_clock) {
188 return static_cast<size_t>(by_clock);
bool useRmtInternalLoopback(bool is_rmt_driver, int tx_pin, int rx_pin) FL_NO_EXCEPT
Whether an RMT validation capture should use ESP-IDF loopback.
RxBackend resolveCaptureBackend(RxBackend requested_backend, bool has_explicit_override, bool is_parlio_driver, bool is_esp32_c6) FL_NO_EXCEPT
Select the independent capture backend used by AutoResearch.
bool isWholeCaptureFrame(size_t run_count, bool lead_run_is_low, u32 lead_run_ns, u32 idle_threshold_ns, size_t min_frame_runs) FL_NO_EXCEPT
Whether an oversampled capture holds a whole frame, not a fragment.
size_t captureEdgeCapacity(size_t shared_buffer_bytes, size_t expected_data_bytes, RxBackend backend) FL_NO_EXCEPT
Compute the RX edge-buffer capacity for a validation frame.
size_t rpPioMaxWireBytes(size_t edge_capacity, size_t dma_tail_words, u32 samples_per_dma_word, u32 sample_period_ns, u32 idle_tail_ns, u32 arming_lead_in_ns, u32 bit_period_ns) FL_NO_EXCEPT
Largest frame, in wire bytes, an RP PIO RX capture can hold.
u8 u8 fract8 blur_amount FL_NO_EXCEPT
@ ISR
Platform-neutral interrupt-driven edge capture backend when available.
@ PARLIO_RX
PARLIO 1-bit oversampling backend (ESP32-C6 et al) — DMA sampling at 16 MHz with no per-edge interrup...
SingleTestResult runSingleValidationTest(const SingleTestConfig &config) FL_NO_EXCEPT
Run a single stateless validation test.
Base definition for an LED controller.
bool skipped
True if driver was skipped (e.g., failed to set exclusive)
int total_tests
Total test count across all chipset timings.
DriverTestResult(const char *name) FL_NO_EXCEPT
int passed_tests
Passed test count across all chipset timings.
DriverTestResult() FL_NO_EXCEPT
bool allPassed() const FL_NO_EXCEPT
Check if all tests passed.
fl::string driver_name
Driver name (e.g., "RMT", "SPI", "PARLIO")
bool anyFailed() const FL_NO_EXCEPT
Check if any tests failed.
int iterations
Number of test iterations (default: 1)
string driver_name
Driver to test (e.g., "PARLIO", "RMT")
SingleTestConfig() FL_NO_EXCEPT
vector< int > lane_sizes
LED count per lane [100, 100, 200].
string pattern
Test pattern name (default: "MSB_LSB_A")
int pin_tx
TX pin (base pin for multi-lane)
vector< int > lane_sizes
LED counts per lane.
bool passed
All validation tests passed.
int total_tests
Total validation tests run.
int lane_count
Number of lanes tested.
SingleTestResult() FL_NO_EXCEPT
optional< string > failure_details
Failure details.
optional< string > error_message
Error message if !success.
int passed_tests
Number of tests that passed.
bool success
RPC execution succeeded.
optional< string > failure_pattern
Pattern that failed if !passed.
string pattern
Pattern tested.
u32 duration_ms
Test execution time (milliseconds)
string driver
Driver tested.