Struct nrf52::i2c::TWIM
[−]
[src]
pub struct TWIM { registers: *const TWIM, client: Cell<Option<&'static I2CHwMasterClient>>, buf: TakeCell<'static, [u8]>, }
An I2C master device.
A TWIM
instance wraps a registers::TWIM
together with
additional data necessary to implement an asynchronous interface.
Fields
registers: *const TWIM
client: Cell<Option<&'static I2CHwMasterClient>>
buf: TakeCell<'static, [u8]>
Methods
impl TWIM
[src]
const fn new(instance: usize) -> TWIM
[src]
pub fn set_client(&self, client: &'static I2CHwMasterClient)
[src]
fn regs(&self) -> &TWIM
[src]
pub fn configure(&self, scl: Pinmux, sda: Pinmux)
[src]
Configures an already constructed TWIM
.
pub fn set_speed(&self, speed: Speed)
[src]
Sets the I2C bus speed to one of three possible values
enumerated in Speed
.
pub fn enable(&self)
[src]
Enables hardware TWIM peripheral.
pub fn disable(&self)
[src]
Disables hardware TWIM peripheral.
pub fn handle_interrupt(&self)
[src]
pub fn is_enabled(&self) -> bool
[src]
Trait Implementations
impl I2CMaster for TWIM
[src]
fn enable(&self)
[src]
fn disable(&self)
[src]
fn write_read(
&self,
addr: u8,
data: &'static mut [u8],
write_len: u8,
read_len: u8
)
[src]
&self,
addr: u8,
data: &'static mut [u8],
write_len: u8,
read_len: u8
)