pub struct MappedMmio { /* private fields */ }Expand description
Volatile access to one locally mapped MMIO region.
Implementations§
Source§impl MappedMmio
impl MappedMmio
Sourcepub fn from_region(region: MmioRegion<VmoMemory>) -> Self
pub fn from_region(region: MmioRegion<VmoMemory>) -> Self
Wraps an already-mapped MmioRegion.
Sourcepub fn from_vmo(vmo: &Vmo, offset: usize, size: usize) -> Result<Self, Status>
pub fn from_vmo(vmo: &Vmo, offset: usize, size: usize) -> Result<Self, Status>
Creates an independent local MMIO mapping by duplicating an existing
driver MMIO VMO handle (zx::Rights::SAME_RIGHTS) and mapping it into
the current driver host process address space (Spec Phase 2 Section 2.1).
Preserves the VMO’s existing cache policy so already-mapped VMOs can be
mapped a second time without failing on zx_vmo_set_cache_policy.
Trait Implementations§
Source§impl Debug for MappedMmio
impl Debug for MappedMmio
Source§impl MmioBackend for MappedMmio
impl MmioBackend for MappedMmio
Source§fn read32(&mut self, offset: u64) -> Result<u32, BackendError>
fn read32(&mut self, offset: u64) -> Result<u32, BackendError>
Performs one volatile 32-bit read at
offset bytes from the start
of the logical resource.Source§impl ResourceBackend for MappedMmio
impl ResourceBackend for MappedMmio
fn read32(&mut self, offset: u64) -> Result<u32, BackendError>
fn write32(&mut self, offset: u64, value: u32) -> Result<(), BackendError>
fn barrier(&mut self)
fn gpio_read(&mut self) -> Result<bool, BackendError>
fn gpio_write(&mut self, _value: bool) -> Result<(), BackendError>
fn i2c_transfer( &mut self, _write_data: &[u8], _read_length: usize, ) -> Result<Vec<u8>, BackendError>
fn spi_transmit(&mut self, _tx_data: &[u8]) -> Result<Vec<u8>, BackendError>
fn clock_enable(&mut self) -> Result<(), BackendError>
fn clock_disable(&mut self) -> Result<(), BackendError>
fn clock_is_enabled(&mut self) -> Result<bool, BackendError>
fn clock_set_rate(&mut self, _hz: u64) -> Result<(), BackendError>
fn clock_query_rate(&mut self, _hz_in: u64) -> Result<u64, BackendError>
fn clock_get_rate(&mut self) -> Result<u64, BackendError>
fn reset_assert(&mut self) -> Result<(), BackendError>
fn reset_deassert(&mut self) -> Result<(), BackendError>
fn reset_toggle(&mut self) -> Result<(), BackendError>
fn reset_status(&mut self) -> Result<bool, BackendError>
fn serial_read(&mut self) -> Result<Vec<u8>, BackendError>
fn serial_write(&mut self, _data: &[u8]) -> Result<(), BackendError>
Auto Trait Implementations§
impl Freeze for MappedMmio
impl RefUnwindSafe for MappedMmio
impl Send for MappedMmio
impl Sync for MappedMmio
impl Unpin for MappedMmio
impl UnsafeUnpin for MappedMmio
impl UnwindSafe for MappedMmio
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more