[−][src]Struct nrf52840_hal::twis::Twis
Interface to a TWIS instance.
Implementations
impl<T> Twis<T> where
T: Instance,
[src]
T: Instance,
pub fn new(twis: T, pins: Pins, address0: u8) -> Twis<T>
[src]
pub fn set_address1(&self, address1: u8) -> &Twis<T>
[src]
Configures secondary I2C address.
pub fn set_orc(&self, orc: u8) -> &Twis<T>
[src]
Sets the over-read character (character sent on over-read of the transmit buffer).
pub fn enable(&self) -> &Twis<T>
[src]
Enables the TWIS instance.
pub fn disable(&self) -> &Twis<T>
[src]
Disables the TWIS instance.
pub fn stop(&self) -> &Twis<T>
[src]
Stops the TWI transaction and waits until it has stopped.
pub fn enable_interrupt(&self, event: TwiEvent) -> &Twis<T>
[src]
Enables interrupt for specified command.
pub fn disable_interrupt(&self, event: TwiEvent) -> &Twis<T>
[src]
Disables interrupt for specified command.
pub fn reset_events(&self)
[src]
Resets read and write events.
pub fn reset_event(&self, event: TwiEvent)
[src]
Resets specified event.
pub fn address_match(&self) -> u8
[src]
Returns matched address for latest command.
pub fn is_event_triggered(&self, event: TwiEvent) -> bool
[src]
Checks if specified event has been triggered.
pub fn is_done(&self) -> bool
[src]
Checks if the TWI transaction is done.
pub fn amount(&self) -> u32
[src]
Returns number of bytes received in last granted transaction.
pub fn is_overflow(&self) -> bool
[src]
Checks if RX buffer overflow was detected.
pub fn is_data_nack(&self) -> bool
[src]
Checks if NACK was sent after receiving a data byte.
pub fn is_overread(&self) -> bool
[src]
Checks if TX buffer over-read was detected and ORC was clocked out.
pub fn event_read(&self) -> &Reg<u32, _EVENTS_READ>
[src]
Returns reference to READ
event endpoint for PPI.
pub fn event_write(&self) -> &Reg<u32, _EVENTS_WRITE>
[src]
Returns reference to WRITE
event endpoint for PPI.
pub fn event_stopped(&self) -> &Reg<u32, _EVENTS_STOPPED>
[src]
Returns reference to STOPPED
event endpoint for PPI.
pub fn event_error(&self) -> &Reg<u32, _EVENTS_ERROR>
[src]
Returns reference to ERROR
event endpoint for PPI.
pub fn event_rx_started(&self) -> &Reg<u32, _EVENTS_RXSTARTED>
[src]
Returns reference to RXSTARTED
event endpoint for PPI.
pub fn event_tx_started(&self) -> &Reg<u32, _EVENTS_TXSTARTED>
[src]
Returns reference to TXSTARTED
event endpoint for PPI.
pub fn task_stop(&self) -> &Reg<u32, _TASKS_STOP>
[src]
Returns reference to STOP
task endpoint for PPI.
pub fn task_suspend(&self) -> &Reg<u32, _TASKS_SUSPEND>
[src]
Returns reference to SUSPEND
task endpoint for PPI.
pub fn task_resume(&self) -> &Reg<u32, _TASKS_RESUME>
[src]
Returns reference to RESUME
task endpoint for PPI.
pub fn task_prepare_rx(&self) -> &Reg<u32, _TASKS_PREPARERX>
[src]
Returns reference to PREPARERX
task endpoint for PPI.
pub fn task_prepare_tx(&self) -> &Reg<u32, _TASKS_PREPARETX>
[src]
Returns reference to PREPARETX
task endpoint for PPI.
pub fn tx_blocking(&mut self, buffer: &[u8]) -> Result<(), Error>
[src]
Write to an I2C controller.
The buffer must reside in RAM and have a length of at most 255 bytes on the nRF52832 and at most 65535 bytes on the nRF52840.
pub fn rx_blocking(&mut self, buffer: &mut [u8]) -> Result<(), Error>
[src]
Read from an I2C controller.
The buffer must have a length of at most 255 bytes on the nRF52832 and at most 65535 bytes on the nRF52840.
pub fn rx<W, B>(self, buffer: B) -> Result<Transfer<T, B>, Error> where
B: WriteBuffer<Word = W> + 'static,
[src]
B: WriteBuffer<Word = W> + 'static,
Receives data into the given buffer
. Buffer must be located in RAM.
Returns a value that represents the in-progress DMA transfer.
pub fn tx<W, B>(self, buffer: B) -> Result<Transfer<T, B>, Error> where
B: ReadBuffer<Word = W> + 'static,
[src]
B: ReadBuffer<Word = W> + 'static,
Transmits data from the given buffer
. Buffer must be located in RAM.
Returns a value that represents the in-progress DMA transfer.
pub fn free(self) -> T
[src]
Return the raw interface to the underlying TWIS peripheral.
Auto Trait Implementations
impl<T> Send for Twis<T> where
T: Send,
T: Send,
impl<T> Sync for Twis<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Twis<T> where
T: Unpin,
T: Unpin,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
Dst: LosslessTryFrom<Src>,
pub fn lossless_try_into(self) -> Option<Dst>
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
Dst: LossyFrom<Src>,
pub fn lossy_into(self) -> Dst
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
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>,