Bank

Trait Bank 

Source
pub trait Bank<R: GpioRegisters> {
    const BASE_ADDRESS: usize;

    // Provided methods
    fn get_handle() -> Gpio<R> { ... }
    fn addr() -> *mut R { ... }
}
Expand description

Abstraction representing a GPIO bank on the target platform.

A concrete bank type (provided by a platform-specific crate) must implement Bank<R> for its register block R. The trait provides the physical address of the registers and a convenience get_handle() that returns an io::Gpio<R> wrapper around the register pointer.

Required Associated Constants§

Source

const BASE_ADDRESS: usize

Base physical address of the GPIO bank registers.

Provided Methods§

Source

fn get_handle() -> Gpio<R>

Return a new Gpio handle pointing at the bank’s register block.

This default implementation calls Self::addr() and constructs the thin io::Gpio wrapper. Platform crates may rely on this helper to obtain a typed handle.

Source

fn addr() -> *mut R

Return the base pointer to the register block for this bank.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§