pub struct ErpmTelemetry {
pub shift: u8,
pub period_base: u16,
pub crc: u8,
}Expand description
eRPM telemetry frame as sent by ESC in bidirectional DShot mode.
Despite being used in bidirectional mode, this frame is not inverted, and its CRC is computed using the standard (non-inverted) DShot algorithm.
Format (16 bits): [3-bit shift][9-bit period_base][4-bit CRC]
Fields§
§shift: u8Raw 3-bit shift value (0–7)
period_base: u16Raw 9-bit period base (0–511)
crc: u8Raw 4-bit CRC (for debugging)
Implementations§
Source§impl ErpmTelemetry
impl ErpmTelemetry
Sourcepub fn try_from_raw(raw: u16) -> Option<Self>
pub fn try_from_raw(raw: u16) -> Option<Self>
Attempts to parse a 16-bit raw telemetry value.
Returns None if the CRC is invalid.
Sourcepub fn period_us(&self) -> Option<u32>
pub fn period_us(&self) -> Option<u32>
Returns the period in microseconds.
If period_base is zero, the period is considered infinite (motor stopped).
Trait Implementations§
Source§impl Clone for ErpmTelemetry
impl Clone for ErpmTelemetry
Source§fn clone(&self) -> ErpmTelemetry
fn clone(&self) -> ErpmTelemetry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErpmTelemetry
impl Debug for ErpmTelemetry
Source§impl PartialEq for ErpmTelemetry
impl PartialEq for ErpmTelemetry
impl Copy for ErpmTelemetry
impl StructuralPartialEq for ErpmTelemetry
Auto Trait Implementations§
impl Freeze for ErpmTelemetry
impl RefUnwindSafe for ErpmTelemetry
impl Send for ErpmTelemetry
impl Sync for ErpmTelemetry
impl Unpin for ErpmTelemetry
impl UnwindSafe for ErpmTelemetry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more