RRxPayload

Struct RRxPayload 

Source
pub struct RRxPayload<const N: usize>();
Expand description

§R_RX_PAYLOAD command

Read RX payload.

§Const Parameter N

Width of RX payload.

Must be 1 to 32 bytes.

§Example

#![feature(generic_const_exprs)] // TODO: https://github.com/rust-lang/rust/issues/133199#issuecomment-2630615573
use nrf24l01_commands::commands;

// Generate SPI byte sequence for R_RX_PAYLOAD with 17 byte payload.
let bytes = commands::RRxPayload::<17>::bytes();
let mut expected_bytes = [0; 18];
expected_bytes[0] = 0b0110_0001;
assert_eq!(bytes, expected_bytes);

Implementations§

Source§

impl<const N: usize> RRxPayload<N>

Source

pub const fn bytes() -> [u8; { _ }]

Generate the command’s SPI byte sequence.

Trait Implementations§

Source§

impl<const N: usize> Command for RRxPayload<N>

Source§

const WORD: u8 = 97u8

Command word.

Auto Trait Implementations§

§

impl<const N: usize> Freeze for RRxPayload<N>

§

impl<const N: usize> RefUnwindSafe for RRxPayload<N>

§

impl<const N: usize> Send for RRxPayload<N>

§

impl<const N: usize> Sync for RRxPayload<N>

§

impl<const N: usize> Unpin for RRxPayload<N>

§

impl<const N: usize> UnwindSafe for RRxPayload<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.