I2cPeriph

Trait I2cPeriph 

Source
pub trait I2cPeriph {
Show 15 methods // Required methods fn disable_all_interrupt(&mut self); fn disable_data_interrupt(&mut self); fn it_send_start(&mut self); fn it_prepare_write( &mut self, addr: Address, step: &mut u8, ) -> Result<(), bool>; fn it_prepare_read( &mut self, addr: Address, total_len: usize, last_operation: bool, step: &mut u8, ) -> Result<(), bool>; fn it_write_with( &mut self, f: impl FnMut() -> Option<u8>, ) -> Result<(), bool>; fn it_read(&mut self, left_len: usize, last_operation: bool) -> Option<u8>; fn send_stop(&mut self); fn is_stopped(&mut self) -> bool; fn is_slave_stopped(&mut self) -> bool; fn get_and_clean_error(&mut self) -> Option<Error>; fn get_flag(&mut self, flag: Flag) -> bool; fn set_speed(&mut self, speed: HertzU32); fn soft_reset(&mut self); fn handle_error(&mut self, err: Error);
}

Required Methods§

Source

fn disable_all_interrupt(&mut self)

Disable all interrupt

Source

fn disable_data_interrupt(&mut self)

Disable receiving data interrupt

Source

fn it_send_start(&mut self)

Source

fn it_prepare_write(&mut self, addr: Address, step: &mut u8) -> Result<(), bool>

§Returns
  • Ok(): finished
  • Err(true): did something but hasn’t finished
  • Err(false): did nothing and need to wait
Source

fn it_prepare_read( &mut self, addr: Address, total_len: usize, last_operation: bool, step: &mut u8, ) -> Result<(), bool>

§Returns
  • Ok(): finished
  • Err(true): did something but hasn’t finished
  • Err(false): did nothing and need to wait
Source

fn it_write_with(&mut self, f: impl FnMut() -> Option<u8>) -> Result<(), bool>

§Returns
  • Ok(): finished writing all data
  • Err(true): wrote some data
  • Err(false): did nothing and need to wait
Source

fn it_read(&mut self, left_len: usize, last_operation: bool) -> Option<u8>

Source

fn send_stop(&mut self)

Source

fn is_stopped(&mut self) -> bool

Source

fn is_slave_stopped(&mut self) -> bool

Source

fn get_and_clean_error(&mut self) -> Option<Error>

Read and clean the error flag

Source

fn get_flag(&mut self, flag: Flag) -> bool

Source

fn set_speed(&mut self, speed: HertzU32)

Source

fn soft_reset(&mut self)

Perform an I2C software reset

Source

fn handle_error(&mut self, err: Error)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§