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.
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.
Trait Implementations§
Source§impl<'a, 'd, T: Instance> Deref for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T: Instance> Deref for ActivePdPhy<'a, 'd, T>
Source§impl<'a, 'd, T: Instance> DerefMut for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T: Instance> DerefMut for ActivePdPhy<'a, 'd, T>
Source§impl<'a, 'd, T: Instance> Drop for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T: Instance> Drop for ActivePdPhy<'a, 'd, T>
Auto Trait Implementations§
impl<'a, 'd, T> !UnwindSafe for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T> Forget for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T> Freeze for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T> Move for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T> RefUnwindSafe for ActivePdPhy<'a, 'd, T>where
&'a mut PdPhy<'d, T>: RefUnwindSafe,
impl<'a, 'd, T> Send for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T> Sync for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T> Unpin for ActivePdPhy<'a, 'd, T>
impl<'a, 'd, T> UnsafeUnpin for ActivePdPhy<'a, 'd, T>where
&'a mut PdPhy<'d, T>: UnsafeUnpin,
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