pub struct Shared<P>(/* private fields */);Expand description
One bridge, held by everything that needs it.
The concentrator driver takes its SPI device and its reset pin as two values it owns, and over USB both are the same bridge. This is how they share it.
Implementations§
Sourcepub fn concentrator(&self) -> BridgeSpi<P>
pub fn concentrator(&self) -> BridgeSpi<P>
The SPI device the concentrator answers on.
§Returns
A device the driver takes, carrying every frame to the concentrator and the front ends behind it.
Sourcepub fn listener(&self) -> BridgeSpi<P>
pub fn listener(&self) -> BridgeSpi<P>
The SPI device the radio beside the concentrator answers on.
§Returns
A device carrying every frame to that radio, which is what a carrier check drives.
Sourcepub fn with<T>(
&self,
with: impl FnOnce(&mut Bridge<P>) -> Result<T, UsbError>,
) -> Result<T, UsbError>
pub fn with<T>( &self, with: impl FnOnce(&mut Bridge<P>) -> Result<T, UsbError>, ) -> Result<T, UsbError>
Does something with the bridge itself, holding it for the duration.
§Arguments
with- what to do.
§Returns
Whatever it returned.
§Errors
UsbError::Poisoned when another holder panicked, and whatever with returned.
Trait Implementations§
Auto Trait Implementations§
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