[][src]Struct matrix_rhal::Bus

pub struct Bus {
    pub device_file: &'static str,
    pub regmap_fd: RawFd,
    pub device_name: Device,
    pub device_leds: u8,
}

Bridge for talking to the MATRIX Kernel Modules. Most, if not all, MATRIX functionality requires this Bus to read and write data.

Fields

device_file: &'static str

Path for the device file being used. This is what's used to communicate with the MATRIX Kernel.

regmap_fd: RawFd

File descriptor for kernel abstraction.

device_name: Device

The type of MATRIX device that's currently attached.

device_leds: u8

Number of LEDS on the MATRIX device.

Methods

impl Bus[src]

pub fn init() -> Result<Bus, Error>[src]

Create, initialize, and return a MATRIX Bus

pub fn write(&self, write_buffer: &mut [u8])[src]

Populate a buffer with the requested data. address and read_buffer will be added to the 1 and 2 index of your buffer. Any data added should start at index 2.

pub fn read(&self, read_buffer: &mut [u8])[src]

Populate a buffer with the requested data. address and read_buffer will be added to the 1 and 2 index of your buffer. Any data returned will start at the index 2.

pub fn close(&self)[src]

Close the file descriptor that's communicating with the MATRIX Kernel's device file.

Trait Implementations

impl Debug for Bus[src]

Auto Trait Implementations

impl RefUnwindSafe for Bus

impl Send for Bus

impl Sync for Bus

impl Unpin for Bus

impl UnwindSafe for Bus

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, 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.