pub struct NrziFrame(/* private fields */);Expand description
NRZI stands for Non-Return-to-Zero, Inverted.
21-bit edge transition NRZI.
Decodes to 20-bit binary GCR,
which then decodes to 16-bit DshotTelemetryFrame.
Implementations§
Source§impl NrziFrame
impl NrziFrame
pub const fn from_raw_21(raw_21: u32) -> Self
pub const fn raw_21(self) -> u32
Sourcepub const fn is_valid(self) -> bool
pub const fn is_valid(self) -> bool
Check if checksum is ok (XOR of all 4 nibbles must equal 0x0F). Fast validation check on the raw telemetry framework layout.
Sourcepub fn try_decode(self) -> Result<DshotTelemetryFrame, DshotError>
pub fn try_decode(self) -> Result<DshotTelemetryFrame, DshotError>
Public processing method to ingest raw incoming wire metrics.
§Errors
Source§impl NrziFrame
impl NrziFrame
Sourcepub fn decode_samples(value: u64) -> Result<DshotTelemetryFrame, DshotError>
pub fn decode_samples(value: u64) -> Result<DshotTelemetryFrame, DshotError>
Decode samples returned by Raspberry Pi PIO implementation. 64-bit value gives 3x oversampling of NRZI21 code.
Returns the value of the Extended Dshot Telemetry (EDT) frame (without the checksum).
§Errors DshotError
Trait Implementations§
impl Copy for NrziFrame
impl Eq for NrziFrame
Source§impl Ord for NrziFrame
impl Ord for NrziFrame
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for NrziFrame
impl PartialOrd for NrziFrame
impl StructuralPartialEq for NrziFrame
Auto Trait Implementations§
impl Freeze for NrziFrame
impl RefUnwindSafe for NrziFrame
impl Send for NrziFrame
impl Sync for NrziFrame
impl Unpin for NrziFrame
impl UnsafeUnpin for NrziFrame
impl UnwindSafe for NrziFrame
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