Pdo

Struct Pdo 

Source
pub struct Pdo {
    pub buffered_value: AtomicCell<Option<[u8; 8]>>,
    /* private fields */
}
Expand description

Represents a single PDO state

Fields§

§buffered_value: AtomicCell<Option<[u8; 8]>>

The last received data value for an RPDO, or ready to transmit data for a TPDO

Implementations§

Source§

impl Pdo

Source

pub const fn new(od: &'static [ODEntry<'static>]) -> Self

Create a new PDO object

Source

pub const fn new_with_defaults( od: &'static [ODEntry<'static>], defaults: &'static PdoDefaults, ) -> Self

Create a new PDO object with provided defaults

Source

pub fn set_valid(&self, value: bool)

Set the valid bit

Source

pub fn valid(&self) -> bool

Get the valid bit value

Source

pub fn set_transmission_type(&self, value: u8)

Set the transmission type for this PDO

Source

pub fn transmission_type(&self) -> u8

Get the transmission type for this PDO

Source

pub fn cob_id(&self) -> CanId

Get the COB ID used for transmission of this PDO

Source

pub fn default_cob_id(&self) -> CanId

Get the default COB ID for transmission of this PDO

Source

pub fn sync_update(&self) -> bool

This function should be called when a SYNC event occurs

It will return true if the PDO should be sent in response to the SYNC event

Source

pub fn read_events(&self) -> bool

Check mapped objects for TPDO event flag

Source

pub fn init_defaults(&self, node_id: NodeId)

Initialize the PDO configuration with its default value

Auto Trait Implementations§

§

impl !Freeze for Pdo

§

impl !RefUnwindSafe for Pdo

§

impl Send for Pdo

§

impl Sync for Pdo

§

impl Unpin for Pdo

§

impl !UnwindSafe for Pdo

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.