24#ifndef PROTOCORE_DSHOT_H
25#define PROTOCORE_DSHOT_H
29#if PROTOCORE_ENABLE_DSHOT
37#define DSHOT_CMD_MOTOR_STOP 0
39#define DSHOT_CMD_BEACON1 1
41#define DSHOT_CMD_BEACON5 5
43#define DSHOT_CMD_ESC_INFO 6
45#define DSHOT_CMD_SPIN_DIRECTION_1 7
47#define DSHOT_CMD_SPIN_DIRECTION_2 8
49#define DSHOT_CMD_3D_MODE_OFF 9
51#define DSHOT_CMD_3D_MODE_ON 10
53#define DSHOT_CMD_SETTINGS_REQUEST 11
55#define DSHOT_CMD_SAVE_SETTINGS 12
57#define DSHOT_THROTTLE_MIN 48
59#define DSHOT_THROTTLE_MAX 2047
61#define DSHOT_VALUE_MAX 2047
67 PROTOCORE_ESC_ONESHOT125,
68 PROTOCORE_ESC_ONESHOT42,
69 PROTOCORE_ESC_MULTISHOT,
99 uint16_t throttle_1000;
100 protocore_esc_pwm mode;
133 DshotEncodeArgs encode_args;
134 DshotDecodeArgs decode_args;
135 DshotBitNsArgs bit_ns_args;
136 DshotEscPwmNsArgs esc_pwm_ns_args;
143extern DshotVars DshotV;
148 void (*
const encode)(uint8_t *work);
149 void (*
const decode)(uint8_t *work);
150 void (*
const bit_ns)(uint8_t *work);
151 void (*
const esc_pwm_ns)(uint8_t *work);
156void protocore_dshot_encode(uint8_t *work);
157void protocore_dshot_decode(uint8_t *work);
158void protocore_dshot_bit_ns(uint8_t *work);
159void protocore_dshot_esc_pwm_ns(uint8_t *work);
165static const DshotNs Dshot __attribute__((unused)) = {
166 .encode = protocore_dshot_encode,
167 .decode = protocore_dshot_decode,
168 .bit_ns = protocore_dshot_bit_ns,
169 .esc_pwm_ns = protocore_dshot_esc_pwm_ns,
PROTO_ENUM_PACKED
Application protocol spoken on a listener port or connection slot.
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS