pub struct Pdo<'a> {
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<'a> Pdo<'a>
impl<'a> Pdo<'a>
Sourcepub const fn new(
od: &'a [ODEntry<'a>],
nmt_state: &'a dyn NmtStateAccess,
) -> Self
pub const fn new( od: &'a [ODEntry<'a>], nmt_state: &'a dyn NmtStateAccess, ) -> Self
Create a new PDO object
Sourcepub const fn new_with_defaults(
od: &'static [ODEntry<'static>],
nmt_state: &'static dyn NmtStateAccess,
defaults: &'static PdoDefaults<'_>,
) -> Self
pub const fn new_with_defaults( od: &'static [ODEntry<'static>], nmt_state: &'static dyn NmtStateAccess, defaults: &'static PdoDefaults<'_>, ) -> Self
Create a new PDO object with provided defaults
Sourcepub fn set_transmission_type(&self, value: u8)
pub fn set_transmission_type(&self, value: u8)
Set the transmission type for this PDO
Sourcepub fn transmission_type(&self) -> u8
pub fn transmission_type(&self) -> u8
Get the transmission type for this PDO
Sourcepub fn default_cob_id(&self) -> CanId
pub fn default_cob_id(&self) -> CanId
Get the default COB ID for transmission of this PDO
Sourcepub fn sync_update(&self) -> bool
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
Sourcepub fn read_events(&self) -> bool
pub fn read_events(&self) -> bool
Check mapped objects for TPDO event flag
Sourcepub fn init_defaults(&'a self, node_id: NodeId)
pub fn init_defaults(&'a self, node_id: NodeId)
Initialize the PDO configuration with its default value
Auto Trait Implementations§
impl<'a> !Freeze for Pdo<'a>
impl<'a> !RefUnwindSafe for Pdo<'a>
impl<'a> Send for Pdo<'a>
impl<'a> Sync for Pdo<'a>
impl<'a> Unpin for Pdo<'a>
impl<'a> !UnwindSafe for Pdo<'a>
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