pub struct SubDevicePdi<'group, const MAX_PDI: usize> { /* private fields */ }
Expand description
Process Data Image (PDI) segments for a given SubDevice.
Used in conjunction with SubDeviceRef
.
Methods from Deref<Target = SubDevice>§
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Get the SubDevice’s human readable short name.
To get a longer, more descriptive name, use SubDevice::description
.
Sourcepub async fn description(
&self,
maindevice: &MainDevice<'_>,
) -> Result<Option<String<128>>, Error>
pub async fn description( &self, maindevice: &MainDevice<'_>, ) -> Result<Option<String<128>>, Error>
Get the long name of the SubDevice.
Using the EK1100 as an example, SubDevice::name
will return
"EK1100"
whereas this method will return "EK1100 EtherCAT-Koppler (2A E-Bus)"
.
In the case that a SubDevice does not have a description, this method will return
Ok(None)
.
Sourcepub async fn eeprom_size(
&self,
maindevice: &MainDevice<'_>,
) -> Result<usize, Error>
pub async fn eeprom_size( &self, maindevice: &MainDevice<'_>, ) -> Result<usize, Error>
Get the SubDevice’s EEPROM size in bytes.
Sourcepub async fn eeprom_read_raw(
&self,
maindevice: &MainDevice<'_>,
start_word: u16,
buf: &mut [u8],
) -> Result<usize, Error>
pub async fn eeprom_read_raw( &self, maindevice: &MainDevice<'_>, start_word: u16, buf: &mut [u8], ) -> Result<usize, Error>
Read raw bytes from the SubDevice’s EEPROM, starting at the given word address.
The given start address is in words NOT bytes. To address the EEPROM using a byte address, divide the given byte address by two.
To read individual typed values including fixed size chunks of [u8; N]
, see
eeprom_read
.
Sourcepub async fn eeprom_read<T>(
&self,
maindevice: &MainDevice<'_>,
start_word: u16,
) -> Result<T, Error>where
T: EtherCrabWireReadSized,
pub async fn eeprom_read<T>(
&self,
maindevice: &MainDevice<'_>,
start_word: u16,
) -> Result<T, Error>where
T: EtherCrabWireReadSized,
Read a value from the SubDevice’s EEPROM at the given word address.
The given start address is in words NOT bytes. To address the EEPROM using a byte address, divide the given byte address by two.
To read raw bytes, see eeprom_read_raw
.
Sourcepub async fn eeprom_write_dangerously<T>(
&self,
maindevice: &MainDevice<'_>,
start_word: u16,
value: T,
) -> Result<(), Error>where
T: EtherCrabWireWriteSized,
pub async fn eeprom_write_dangerously<T>(
&self,
maindevice: &MainDevice<'_>,
start_word: u16,
value: T,
) -> Result<(), Error>where
T: EtherCrabWireWriteSized,
Write a value to the SubDevice’s EEPROM at the given word address.
Warning: This method is safe in the Rust sense, but can cause EEPROM corruption if mishandled. Be very careful when writing data to a SubDevice’s EEPROM.
The given start address is in words NOT bytes. To address the EEPROM using a byte address, divide the given byte address by two.
Sourcepub fn identity(&self) -> SubDeviceIdentity
pub fn identity(&self) -> SubDeviceIdentity
Get additional identifying details for the SubDevice.
Sourcepub fn configured_address(&self) -> u16
pub fn configured_address(&self) -> u16
Get the configured station address of the SubDevice.
Sourcepub fn alias_address(&self) -> u16
pub fn alias_address(&self) -> u16
Get alias address for the SubDevice.
Sourcepub fn propagation_delay(&self) -> u32
pub fn propagation_delay(&self) -> u32
Get the network propagation delay of this device in nanoseconds.
Note that before MainDevice::init
is called, this method will
always return 0
.
Sourcepub fn dc_support(&self) -> DcSupport
pub fn dc_support(&self) -> DcSupport
Distributed Clock (DC) support.