Struct ectool::Ec[][src]

pub struct Ec<A: Access> { /* fields omitted */ }

Run EC commands using a provided access method

Implementations

impl<A: Access> Ec<A>[src]

pub unsafe fn new(access: A) -> Result<Self, Error>[src]

Probes for a compatible EC

pub unsafe fn access(&mut self) -> &mut A[src]

Unsafe access to access

pub unsafe fn probe(&mut self) -> Result<u8, Error>[src]

Probe for EC

pub unsafe fn board(&mut self, data: &mut [u8]) -> Result<usize, Error>[src]

Read board from EC

pub unsafe fn version(&mut self, data: &mut [u8]) -> Result<usize, Error>[src]

Read version from EC

pub unsafe fn print(&mut self, data: &[u8]) -> Result<usize, Error>[src]

Print data to EC console

pub unsafe fn spi(
    &mut self,
    target: SpiTarget,
    scratch: bool
) -> Result<EcSpi<'_, A>, Error>
[src]

Access EC SPI bus

pub unsafe fn reset(&mut self) -> Result<(), Error>[src]

Reset EC. Will also power off computer.

pub unsafe fn fan_get(&mut self, index: u8) -> Result<u8, Error>[src]

Read fan duty cycle by fan index

pub unsafe fn fan_set(&mut self, index: u8, duty: u8) -> Result<(), Error>[src]

Set fan duty cycle by fan index

pub unsafe fn keymap_get(
    &mut self,
    layer: u8,
    output: u8,
    input: u8
) -> Result<u16, Error>
[src]

Read keymap data by layout, output pin, and input pin

pub unsafe fn keymap_set(
    &mut self,
    layer: u8,
    output: u8,
    input: u8,
    value: u16
) -> Result<(), Error>
[src]

Set keymap data by layout, output pin, and input pin

pub unsafe fn led_get_value(&mut self, index: u8) -> Result<(u8, u8), Error>[src]

pub unsafe fn led_set_value(
    &mut self,
    index: u8,
    value: u8
) -> Result<(), Error>
[src]

pub unsafe fn led_get_color(&mut self, index: u8) -> Result<(u8, u8, u8), Error>[src]

pub unsafe fn led_set_color(
    &mut self,
    index: u8,
    red: u8,
    green: u8,
    blue: u8
) -> Result<(), Error>
[src]

pub fn into_dyn(self) -> Ec<Box<dyn Access>> where
    A: 'static, 
[src]

Auto Trait Implementations

impl<A> RefUnwindSafe for Ec<A> where
    A: RefUnwindSafe

impl<A> Send for Ec<A> where
    A: Send

impl<A> Sync for Ec<A> where
    A: Sync

impl<A> Unpin for Ec<A> where
    A: Unpin

impl<A> UnwindSafe for Ec<A> where
    A: UnwindSafe

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> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[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.