starina_driver_utils::mmio

Trait Endianess

Source
pub trait Endianess {
    // Required methods
    fn into_host_u16(&self, n: u16) -> u16;
    fn into_host_u32(&self, n: u32) -> u32;
    fn into_host_u64(&self, n: u64) -> u64;
    fn from_host_u16(&self, n: u16) -> u16;
    fn from_host_u32(&self, n: u32) -> u32;
    fn from_host_u64(&self, n: u64) -> u64;
}
Expand description

A trait for endianness conversion.

Required Methods§

Source

fn into_host_u16(&self, n: u16) -> u16

Converts a device-endian u16 to host-endian u16.

Source

fn into_host_u32(&self, n: u32) -> u32

Converts a device-endian u32 to host-endian u32.

Source

fn into_host_u64(&self, n: u64) -> u64

Converts a device-endian u64 to host-endian u64.

Source

fn from_host_u16(&self, n: u16) -> u16

Converts a host-endian u16 to device-endian u16.

Source

fn from_host_u32(&self, n: u32) -> u32

Converts a host-endian u32 to device-endian u32.

Source

fn from_host_u64(&self, n: u64) -> u64

Converts a host-endian u64 to device-endian u64.

Implementors§