embassy-stm32

Crates

git

Versions

stm32l471qe

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.