File syn_dshot.c¶
FileList > output > syn_dshot.c
Go to the source code of this file
Zero-Heap DShot (DShot150/300/600) Digital ESC Driver Implementation.
#include "syntropic/output/syn_dshot.h"
Public Functions¶
| Type | Name |
|---|---|
| uint8_t | syn_dshot_calc_crc (uint16_t payload_12bit) Calculate 4-bit DShot CRC for an 12-bit payload ( throttle[11:1] +telemetry[0] ). |
| SYN_Status | syn_dshot_encode (uint16_t throttle, bool telemetry, SYN_DShot_Packet * packet) Encode throttle value and telemetry flag into a 16-bit DShot frame. |
| uint16_t | syn_dshot_us_to_throttle (uint16_t us) Convert standard 1000..2000 us RC pulse width to DShot 48..2047 throttle value. |
Public Functions Documentation¶
function syn_dshot_calc_crc¶
Calculate 4-bit DShot CRC for an 12-bit payload ( throttle[11:1] +telemetry[0] ).
Parameters:
payload_12bit12-bit value(throttle << 1) | (telemetry ? 1 : 0).
Returns:
4-bit CRC value.
function syn_dshot_encode¶
Encode throttle value and telemetry flag into a 16-bit DShot frame.
Parameters:
throttle11-bit throttle value (clamped 0..2047).telemetryTelemetry request flag.packetPointer to output packet struct.
Returns:
SYN_OK on success, SYN_INVALID_PARAM if packet is NULL.
function syn_dshot_us_to_throttle¶
Convert standard 1000..2000 us RC pulse width to DShot 48..2047 throttle value.
Parameters:
usPulse width in microseconds (1000..2000 us).
Returns:
DShot throttle value (0 if us < 1048, 48..2047).
The documentation for this class was generated from the following file src/syntropic/output/syn_dshot.c