pub struct ActivePdPhy<'a, 'd, T: Instance> { /* private fields */ }Expand description
Power Delivery (PD) PHY with PD communication enabled, created by IdlePdPhy::activate.
Derefs to PdPhy for receiving and transmitting messages. Dropping it disables PD
reception.
Methods from Deref<Target = PdPhy<'d, T>>§
Sourcepub async fn receive(&mut self, buf: &mut [u8]) -> Result<usize, RxError>
pub async fn receive(&mut self, buf: &mut [u8]) -> Result<usize, RxError>
Receives a PD message into the provided buffer.
Returns the number of received bytes or an error.
Sourcepub async fn receive_with_sop(
&mut self,
buf: &mut [u8],
) -> Result<(Sop, usize), RxError>
pub async fn receive_with_sop( &mut self, buf: &mut [u8], ) -> Result<(Sop, usize), RxError>
Receives SOP and a PD message into the provided buffer.
Messages are received in the background, so a message that arrived before this call is
returned right away. One message can wait for this call; one that arrives while another one
is still waiting is dropped, and reported as RxError::Overrun after the waiting one. A
received Hard Reset discards the waiting message, and is reported as RxError::HardReset.
Returns the start of packet type and number of received bytes or an error.
Sourcepub async fn transmit(&mut self, buf: &[u8]) -> Result<(), TxError>
pub async fn transmit(&mut self, buf: &[u8]) -> Result<(), TxError>
Transmits an SOP PD message.
Sourcepub async fn transmit_with_sop(
&mut self,
sop: Sop,
buf: &[u8],
) -> Result<(), TxError>
pub async fn transmit_with_sop( &mut self, sop: Sop, buf: &[u8], ) -> Result<(), TxError>
Transmits a PD message with a given SOP.
Sourcepub async fn transmit_hardreset(&mut self) -> Result<(), TxError>
pub async fn transmit_hardreset(&mut self) -> Result<(), TxError>
Transmit a hard reset.