51#define EDGE_COUNT_BITS 31u
52#define EDGE_COUNT_MASK 0x7FFFFFFFu
61uint32_t
edge_word(uint32_t count,
bool level);
88uint64_t
edge_tick(uint32_t count, uint64_t est);
130 uint32_t wr, uint64_t est,
tone_edge_t *out,
size_t max,
uint64_t edge_tick(uint32_t count, uint64_t est)
The tick of the counter value count nearest est, with a counter that started at 0 and counts down.
Definition edge_ring.c:32
bool edge_word_level(uint32_t word)
The word's level after the edge.
Definition edge_ring.c:27
uint32_t edge_word_count(uint32_t word)
A word's 31-bit count and level.
Definition edge_ring.c:22
uint32_t edge_word(uint32_t count, bool level)
The word the program pushes for an edge at counter value count.
Definition edge_ring.c:17
size_t edge_ring_take(edge_ring_t *r, const uint32_t *ring, uint32_t size, uint32_t wr, uint64_t est, tone_edge_t *out, size_t max, bool *overrun)
Take the words in ring ( size words, a power of two) written since the last call, wr being the slot t...
Definition edge_ring.c:52
void edge_ring_init(edge_ring_t *r)
Start reading a ring from slot 0, as after the DMA channel restarts.
Definition edge_ring.c:45
Read position of an edge ring.
Definition edge_ring.h:91
uint32_t overruns
Definition edge_ring.h:94
uint32_t rd
Definition edge_ring.h:92
uint32_t last
Definition edge_ring.h:93
One edge: the tick it happened at and the level after it.
Definition tone.h:182
ESC (electronic speed controller) tones from the edges of one motor phase.