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§
Sourcefn disable_all_interrupt(&mut self)
fn disable_all_interrupt(&mut self)
Disable all interrupt
Sourcefn disable_data_interrupt(&mut self)
fn disable_data_interrupt(&mut self)
Disable receiving data interrupt
fn it_send_start(&mut self)
Sourcefn it_prepare_write(&mut self, addr: Address, step: &mut u8) -> Result<(), bool>
fn it_prepare_write(&mut self, addr: Address, step: &mut u8) -> Result<(), bool>
§Returns
Ok(): finishedErr(true): did something but hasn’t finishedErr(false): did nothing and need to wait
Sourcefn it_prepare_read(
&mut self,
addr: Address,
total_len: usize,
last_operation: bool,
step: &mut u8,
) -> Result<(), bool>
fn it_prepare_read( &mut self, addr: Address, total_len: usize, last_operation: bool, step: &mut u8, ) -> Result<(), bool>
§Returns
Ok(): finishedErr(true): did something but hasn’t finishedErr(false): did nothing and need to wait
Sourcefn it_write_with(&mut self, f: impl FnMut() -> Option<u8>) -> Result<(), bool>
fn it_write_with(&mut self, f: impl FnMut() -> Option<u8>) -> Result<(), bool>
§Returns
Ok(): finished writing all dataErr(true): wrote some dataErr(false): did nothing and need to wait
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
Sourcefn get_and_clean_error(&mut self) -> Option<Error>
fn get_and_clean_error(&mut self) -> Option<Error>
Read and clean the error flag
fn get_flag(&mut self, flag: Flag) -> bool
fn set_speed(&mut self, speed: HertzU32)
Sourcefn soft_reset(&mut self)
fn soft_reset(&mut self)
Perform an I2C software reset
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.