rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
tone_holdoff_t Struct Reference

The capture's hold-off: the rule the PIO program applies before an edge reaches the detector, written here so it is tested on the host and the PIO is held to it. More...

#include <tone.h>

Data Fields

uint64_t hold
bool line
bool pending
uint64_t fall
uint64_t out_t

Detailed Description

The capture's hold-off: the rule the PIO program applies before an edge reaches the detector, written here so it is tested on the host and the PIO is held to it.

A fall is reported only once the line has stayed low for at least the hold-off; a low that ends sooner is not reported at all, and the pulse around it goes on. A reported fall carries the time the line fell, not the time the low qualified. A rise is reported at once.

Why: a carrier's lows inside a burst are (1 - duty) / carrier long. At the default 8us, every low of a carrier above 125kHz, and every low at 50% duty above 62.5kHz, is shorter, so such a burst reaches the detector as one pulse: two edges per burst instead of two per carrier period, 288,000 edges/s at 144kHz. Lows between bursts, at least a quarter of the longest tone period in range, are far longer.

A fall is reported up to the hold-off late, so the detector is advanced only to tone_holdoff_horizon(), before which every edge is out: now less the hold-off, or the latest edge handed out if that is later. The sequence for each pass: every edge up to now through tone_holdoff_edge(), then tone_holdoff_advance(now), each output to tone_edge(), then tone_advance() to the horizon.

Field Documentation

◆ fall

uint64_t tone_holdoff_t::fall

when it fell

◆ hold

uint64_t tone_holdoff_t::hold

ticks; 0 passes every edge

◆ line

bool tone_holdoff_t::line

the line's level after the last edge

◆ out_t

uint64_t tone_holdoff_t::out_t

the latest edge handed out

◆ pending

bool tone_holdoff_t::pending

a fall is being held


The documentation for this struct was generated from the following file:
  • protocols/phase_tap/include/tone.h