embassy-stm32

Crates

git

Versions

stm32h573ii

Flavors

embassy_stm32::can::frame

Struct FdFrame

source
pub struct FdFrame { /* private fields */ }
Expand description

Frame with up to 8 bytes of data payload as per Fd CAN

Implementations§

source§

impl FdFrame

source

pub fn new( can_header: Header, raw_data: &[u8], ) -> Result<Self, FrameCreateError>

Create a new CAN classic Frame

source

pub fn new_extended( raw_id: u32, raw_data: &[u8], ) -> Result<Self, FrameCreateError>

Create new extended frame

source

pub fn new_standard( raw_id: u16, raw_data: &[u8], ) -> Result<Self, FrameCreateError>

Create new standard frame

source

pub fn new_remote( id: impl Into<Id>, len: usize, ) -> Result<Self, FrameCreateError>

Create new remote frame

source

pub fn header(&self) -> &Header

Get reference to data

source

pub fn id(&self) -> &Id

Return ID

source

pub fn data(&self) -> &[u8]

Get reference to data

Trait Implementations§

source§

impl CanHeader for FdFrame

source§

fn from_header(header: Header, data: &[u8]) -> Result<Self, FrameCreateError>

Construct frame from header and payload
source§

fn header(&self) -> &Header

Get this frame’s header struct
source§

impl Clone for FdFrame

source§

fn clone(&self) -> FdFrame

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FdFrame

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Format for FdFrame

source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
source§

impl Frame for FdFrame

source§

fn new(id: impl Into<Id>, raw_data: &[u8]) -> Option<Self>

Creates a new frame. Read more
source§

fn new_remote(id: impl Into<Id>, len: usize) -> Option<Self>

Creates a new remote frame (RTR bit set). Read more
source§

fn is_extended(&self) -> bool

Returns true if this frame is a extended frame.
source§

fn is_remote_frame(&self) -> bool

Returns true if this frame is a remote frame.
source§

fn id(&self) -> Id

Returns the frame identifier.
source§

fn dlc(&self) -> usize

Returns the data length code (DLC) which is in the range 0..8. Read more
source§

fn data(&self) -> &[u8]

Returns the frame data (0..8 bytes in length).
source§

fn is_standard(&self) -> bool

Returns true if this frame is a standard frame.
source§

fn is_data_frame(&self) -> bool

Returns true if this frame is a data frame.
source§

impl Copy for FdFrame

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.