pub struct Bridge<P> { /* private fields */ }Expand description
The bridge on a USB card, reached over a port.
Implementations§
Source§impl<P: Read + Write> Bridge<P>
impl<P: Read + Write> Bridge<P>
Sourcepub fn reset_card(&mut self) -> Result<(), UsbError>
pub fn reset_card(&mut self) -> Result<(), UsbError>
Sourcepub fn power_up(&mut self) -> Result<(), UsbError>
pub fn power_up(&mut self) -> Result<(), UsbError>
Brings the card up the way the reference does before it is used.
The supply is switched on, the concentrator’s reset is pulsed, then the radio beside it has its own reset pulsed, which is active low.
§Errors
When any of those pin writes fails.
Sourcepub fn bulk(&mut self, bulk: &Bulk, into: &mut [u8]) -> Result<usize, UsbError>
pub fn bulk(&mut self, bulk: &Bulk, into: &mut [u8]) -> Result<usize, UsbError>
Sends a bulk of SPI transfers and reads back what the chip clocked.
§Arguments
bulk- the entries.into- where the answer goes, which needs as much room as the entries took plus nothing, since the answer echoes each entry at the same length.
§Returns
How many bytes of answer were read, which Replies then walks.
§Errors
When the port fails, the bridge answers another order, or the answer does not fit.
Auto Trait Implementations§
impl<P> Freeze for Bridge<P>where
P: Freeze,
impl<P> RefUnwindSafe for Bridge<P>where
P: RefUnwindSafe,
impl<P> Send for Bridge<P>where
P: Send,
impl<P> Sync for Bridge<P>where
P: Sync,
impl<P> Unpin for Bridge<P>where
P: Unpin,
impl<P> UnsafeUnpin for Bridge<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Bridge<P>where
P: UnwindSafe,
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