Struct esp32c2_hal::pac::I2C0
pub struct I2C0 { /* private fields */ }
Expand description
I2C (Inter-Integrated Circuit) Controller
Implementations
impl I2C0
impl I2C0
pub const PTR: *const RegisterBlock = {0x60013000 as *const esp_hal_common::esp32c2::i2c0::RegisterBlock}
pub const PTR: *const RegisterBlock = {0x60013000 as *const esp_hal_common::esp32c2::i2c0::RegisterBlock}
Pointer to the register block
pub const fn ptr() -> *const RegisterBlock
pub const fn ptr() -> *const RegisterBlock
Return the pointer to the register block
Trait Implementations
sourceimpl Instance for I2C0
impl Instance for I2C0
fn register_block(&self) -> &RegisterBlock
fn i2c_number(&self) -> usize
fn setup(
&mut self,
frequency: Rate<u32, 1, 1>,
clocks: &Clocks
) -> Result<(), SetupError>
sourcefn reset_command_list(&self)
fn reset_command_list(&self)
Resets the I2C peripheral’s command registers
sourcefn set_filter(&mut self, sda_threshold: Option<u8>, scl_threshold: Option<u8>)
fn set_filter(&mut self, sda_threshold: Option<u8>, scl_threshold: Option<u8>)
Sets the filter with a supplied threshold in clock cycles for which a
pulse must be present to pass the filter Read more
sourcefn set_frequency(
&mut self,
source_clk: Rate<u32, 1, 1>,
bus_freq: Rate<u32, 1, 1>
) -> Result<(), SetupError>
fn set_frequency(
&mut self,
source_clk: Rate<u32, 1, 1>,
bus_freq: Rate<u32, 1, 1>
) -> Result<(), SetupError>
Sets the frequency of the I2C interface by calculating and applying the
associated timings - corresponds to i2c_ll_cal_bus_clk and
i2c_ll_set_bus_timing in ESP-IDF Read more
fn configure_clock(
&mut self,
sclk_div: u32,
scl_low_period: u32,
scl_high_period: u32,
scl_wait_high_period: u32,
sda_hold_time: u32,
sda_sample_time: u32,
scl_rstart_setup_time: u32,
scl_stop_setup_time: u32,
scl_start_hold_time: u32,
scl_stop_hold_time: u32,
time_out_value: u32,
time_out_en: bool
)
fn perform_write<'a, I>(
&self,
addr: u8,
bytes: &[u8],
cmd_iterator: &mut I
) -> Result<(), Error>where
I: Iterator<Item = &'a Reg<COMD_SPEC>>,
fn perform_read<'a, I>(
&self,
addr: u8,
buffer: &mut [u8],
cmd_iterator: &mut I
) -> Result<(), Error>where
I: Iterator<Item = &'a Reg<COMD_SPEC>>,
fn read_all_from_fifo(&self, buffer: &mut [u8]) -> Result<(), Error>
fn clear_all_interrupts(&self)
fn wait_for_completion(&self) -> Result<(), Error>
fn check_errors(&self) -> Result<(), Error>
fn update_config(&self)
fn start_transmission(&self)
fn fill_tx_fifo(&self, bytes: &[u8]) -> usize
fn write_remaining_tx_fifo(
&self,
start_index: usize,
bytes: &[u8]
) -> Result<(), Error>
sourcefn reset_fifo(&self)
fn reset_fifo(&self)
Resets the transmit and receive FIFO buffers
impl Send for I2C0
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more