rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
dshot_edt.c File Reference

When to ask an ESC (electronic speed controller) for extended telemetry. More...

#include "dshot.h"

Functions

void dshot_edt_bind (dshot_edt_t *e, uint32_t now_ms)
 A new binding: nothing asked, nothing heard, an ask due at once.
void dshot_edt_idle (dshot_edt_t *e, uint32_t now_ms)
 Not driving: the next run owes the ask again, due from its first frame.
bool dshot_edt_frame (dshot_edt_t *e, bool stopped, uint32_t now_ms)
 Whether the frame about to go out is a repeat of DSHOT_CMD_EDT_ENABLE.
void dshot_edt_heard (dshot_edt_t *e, dshot_telem_kind_t kind)
 A reply arrived; an extended kind after an ask ends the asking.

Detailed Description

When to ask an ESC (electronic speed controller) for extended telemetry.

See dshot.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ dshot_edt_bind()

void dshot_edt_bind ( dshot_edt_t * e,
uint32_t now_ms )

A new binding: nothing asked, nothing heard, an ask due at once.

Parameters
eAsk state to bind.
now_msCurrent time, in milliseconds.

◆ dshot_edt_frame()

bool dshot_edt_frame ( dshot_edt_t * e,
bool stopped,
uint32_t now_ms )

Whether the frame about to go out is a repeat of DSHOT_CMD_EDT_ENABLE.

stopped says the throttle this frame would carry is zero. False means send the throttle.

Parameters
eAsk state.
stoppedtrue when the throttle this frame would carry is zero.
now_msCurrent time, in milliseconds.
Returns
true when the frame is a repeat of the ask.

◆ dshot_edt_heard()

void dshot_edt_heard ( dshot_edt_t * e,
dshot_telem_kind_t kind )

A reply arrived; an extended kind after an ask ends the asking.

Parameters
eAsk state.
kindKind of the reply that arrived.

◆ dshot_edt_idle()

void dshot_edt_idle ( dshot_edt_t * e,
uint32_t now_ms )

Not driving: the next run owes the ask again, due from its first frame.

Called on every service while disarmed, so it is idempotent; asked is kept.

Parameters
eAsk state.
now_msCurrent time, in milliseconds.