Struct ectool::Ec [−][src]
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]
&mut self,
target: SpiTarget,
scratch: bool
) -> Result<EcSpi<'_, A>, Error>
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]
&mut self,
layer: u8,
output: u8,
input: u8
) -> Result<u16, Error>
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]
&mut self,
layer: u8,
output: u8,
input: u8,
value: u16
) -> Result<(), Error>
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]
&mut self,
index: u8,
value: u8
) -> Result<(), Error>
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]
&mut self,
index: u8,
red: u8,
green: u8,
blue: u8
) -> Result<(), Error>
pub unsafe fn led_get_mode(&mut self, layer: u8) -> Result<(u8, u8), Error>
[src]
pub unsafe fn led_set_mode(
&mut self,
layer: u8,
mode: u8,
speed: u8
) -> Result<(), Error>
[src]
&mut self,
layer: u8,
mode: u8,
speed: u8
) -> Result<(), Error>
pub unsafe fn led_save(&mut self) -> Result<(), Error>
[src]
pub unsafe fn matrix_get(&mut self, matrix: &mut [u8]) -> Result<(), Error>
[src]
pub fn into_dyn(self) -> Ec<Box<dyn Access>> where
A: 'static,
[src]
A: 'static,
Auto Trait Implementations
impl<A> RefUnwindSafe for Ec<A> where
A: RefUnwindSafe,
A: RefUnwindSafe,
impl<A> Send for Ec<A>
impl<A> Sync for Ec<A> where
A: Sync,
A: Sync,
impl<A> Unpin for Ec<A> where
A: Unpin,
A: Unpin,
impl<A> UnwindSafe for Ec<A> where
A: UnwindSafe,
A: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,