49#define TONE_SVC_SYS_HZ 150000000u
50#define TONE_SVC_TICK_HZ (TONE_SVC_SYS_HZ / 4u)
52#define TONE_SVC_HOLD_NS 8000u
54#define TONE_SVC_MARGIN_US 20u
58#define TONE_RING_WORDS 4096u
60#define TONE_SVC_BATCH 64u
62#define TONE_SVC_BEEPS TONE_BEEP_QUEUE
170 const uint32_t *ring, uint32_t wr, uint64_t now,
The words the tap's PIO (programmable input/output) program pushes, and the ring a DMA (direct memory...
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295
Read position of an edge ring.
Definition edge_ring.h:91
One beep as the page reported it.
Definition tone_link.h:193
Detector settings, as given to tone_init().
Definition tone.h:144
The order from core 0.
Definition tone_svc.h:65
uint16_t cap_gen
Definition tone_svc.h:67
uint32_t f_max_hz
Definition tone_svc.h:71
uint32_t split_pct
Definition tone_svc.h:72
bool run
Definition tone_svc.h:69
uint16_t gen
Definition tone_svc.h:66
uint32_t gap_ms
Definition tone_svc.h:73
uint32_t min_periods
Definition tone_svc.h:74
uint32_t f_min_hz
Definition tone_svc.h:70
One edge: the tick it happened at and the level after it.
Definition tone.h:182
The capture's hold-off: the rule the PIO program applies before an edge reaches the detector,...
Definition tone.h:437
A finished beep, in the TONE page's units.
Definition tone_svc.h:82
uint8_t flags
Definition tone_svc.h:88
uint16_t carrier_hhz
Definition tone_svc.h:87
uint16_t bursts
Definition tone_svc.h:86
uint16_t len_dms
Definition tone_svc.h:84
uint16_t freq_dhz
Definition tone_svc.h:85
uint32_t start_ms
Definition tone_svc.h:83
What the service reports each pass.
Definition tone_svc.h:92
uint32_t glitches
Definition tone_svc.h:103
uint16_t window
Definition tone_svc.h:99
uint16_t cap_gen
Definition tone_svc.h:94
uint16_t win_periods
Definition tone_svc.h:101
uint16_t win_freq_dhz
Definition tone_svc.h:100
uint16_t gen
Definition tone_svc.h:93
bool running
Definition tone_svc.h:95
bool beep
Definition tone_svc.h:97
bool tone
Definition tone_svc.h:98
bool overrun
Definition tone_svc.h:96
uint32_t lost
Definition tone_svc.h:102
State of the tone service: the detector, the ring reader and the generations last seen.
Definition tone_svc.h:108
tone_holdoff_t hold
Definition tone_svc.h:110
bool active
Definition tone_svc.h:114
uint16_t cap_gen
Definition tone_svc.h:113
tone_edge_t batch[TONE_SVC_BATCH]
One pass's words as edges.
Definition tone_svc.h:127
uint16_t gen
Definition tone_svc.h:112
uint8_t discard
Passes still to discard after a FIFO overflow: the one that sees it and the next.
Definition tone_svc.h:121
bool overrun
Whether a lap or a FIFO overflow happened since the start.
Definition tone_svc.h:116
edge_ring_t ring
Definition tone_svc.h:111
Detector state. The fields belong to tone.c.
Definition tone.h:240
ESC (electronic speed controller) tones from the edges of one motor phase.
#define TONE_SVC_BATCH
Edges taken in one pass.
Definition tone_svc.h:60
void tone_svc_cfg(const tone_cmd_t *cmd, tone_cfg_t *c)
The detector's configuration for an order: the defaults of tone.h at the capture's tick,...
Definition tone_svc.c:58
void tone_svc_rec(const tone_beep_t *b, tone_rec_t *r)
A detector beep in the page's units, ticks of TONE_SVC_TICK_HZ.
Definition tone_svc.c:69
void tone_svc_init(tone_svc_t *s)
Clear the service state.
Definition tone_svc.c:45
uint64_t tone_svc_ticks(uint64_t us)
us microseconds after the capture started, in ticks.
Definition tone_svc.c:52
size_t tone_svc_step(tone_svc_t *s, const tone_cmd_t *cmd, const uint32_t *ring, uint32_t wr, uint64_t now, bool fifo_overrun, tone_rec_t *rec, tone_status_t *st)
One pass.
Definition tone_svc.c:144