[][src]Struct wishbone_bridge::Bridge

pub struct Bridge { /* fields omitted */ }

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

impl Clone for Bridge[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.