[−][src]Struct wishbone_bridge::Bridge
Bridges represent the actual connection to the device. You must create
a Bridge by constructing a configuration from the relevant
configuration type, and then calling create()
.
For example, to create a USB bridge, use the UsbBridge
object:
use wishbone_bridge::UsbBridge; let mut bridge_config = UsbBridge::new(); let bridge = bridge_config.pid(0x1234).create().unwrap();
Implementations
impl Bridge
[src]
pub fn connect(&self) -> Result<(), BridgeError>
[src]
Ensure the bridge is connected. Many bridges support performing connection
in the background, so calling connect()
ensures that the bridge has been
established.
pub fn peek(&self, addr: u32) -> Result<u32, BridgeError>
[src]
Read a single 32-bit value from the target device.
use wishbone_bridge::UsbBridge; let mut bridge_config = UsbBridge::new(); let bridge = bridge_config.pid(0x5bf0).create().unwrap(); println!("The value at address 0 is: {:08x}", bridge.peek(0).unwrap());
pub fn poke(&self, addr: u32, value: u32) -> Result<(), BridgeError>
[src]
Write a single 32-bit value into the specified address.
use wishbone_bridge::UsbBridge; let mut bridge_config = UsbBridge::new(); let bridge = bridge_config.pid(0x5bf0).create().unwrap(); // Poke 0x12345678 into the target device at address 0 bridge.poke(0, 0x12345678).unwrap();
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Bridge
impl Send for Bridge
impl !Sync for Bridge
impl Unpin for Bridge
impl !UnwindSafe for Bridge
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,