Struct nrf52832_hal::spis::Spis [−][src]
pub struct Spis<T> where
T: Instance, { /* fields omitted */ }
Expand description
Interface to a SPIS instance.
Implementations
impl<T> Spis<T> where
T: Instance,
[src]
impl<T> Spis<T> where
T: Instance,
[src]pub fn new(spis: T, pins: Pins) -> Spis<T>
[src]
pub fn new(spis: T, pins: Pins) -> Spis<T>
[src]Takes ownership of the raw SPIS peripheral and relevant pins, returning a safe wrapper.
pub fn set_default_char(&self, def: u8) -> &Spis<T>
[src]
pub fn set_default_char(&self, def: u8) -> &Spis<T>
[src]Sets the ´default´ character (character clocked out in case of an ignored transaction).
pub fn set_orc(&self, orc: u8) -> &Spis<T>
[src]
pub fn set_orc(&self, orc: u8) -> &Spis<T>
[src]Sets the over-read character (character sent on over-read of the transmit buffer).
pub fn set_polarity(&self, polarity: Polarity) -> &Spis<T>
[src]
pub fn set_polarity(&self, polarity: Polarity) -> &Spis<T>
[src]Sets serial clock (SCK) polarity.
pub fn acquire(&self) -> &Spis<T>
[src]
pub fn acquire(&self) -> &Spis<T>
[src]Requests acquiring the SPIS semaphore and waits until acquired.
pub fn try_acquire(&self) -> Result<&Spis<T>, Error>
[src]
pub fn try_acquire(&self) -> Result<&Spis<T>, Error>
[src]Requests acquiring the SPIS semaphore, returning an error if not possible.
Note: The semaphore will still be requested, and will be made available at a later point.
pub fn enable_interrupt(&self, event: SpisEvent) -> &Spis<T>
[src]
pub fn enable_interrupt(&self, event: SpisEvent) -> &Spis<T>
[src]Enables interrupt for specified event.
pub fn disable_interrupt(&self, event: SpisEvent) -> &Spis<T>
[src]
pub fn disable_interrupt(&self, event: SpisEvent) -> &Spis<T>
[src]Disables interrupt for specified event.
pub fn auto_acquire(&self, enabled: bool) -> &Spis<T>
[src]
pub fn auto_acquire(&self, enabled: bool) -> &Spis<T>
[src]Automatically acquire the semaphore after transfer has ended.
pub fn reset_events(&self)
[src]
pub fn reset_events(&self)
[src]Resets all events.
pub fn reset_event(&self, event: SpisEvent)
[src]
pub fn reset_event(&self, event: SpisEvent)
[src]Resets specified event.
pub fn is_event_triggered(&self, event: SpisEvent) -> bool
[src]
pub fn is_event_triggered(&self, event: SpisEvent) -> bool
[src]Checks if specified event has been triggered.
pub fn is_acquired(&self) -> bool
[src]
pub fn is_acquired(&self) -> bool
[src]Checks if the semaphore is acquired.
pub fn is_overread(&self) -> bool
[src]
pub fn is_overread(&self) -> bool
[src]Checks if last transaction overread.
pub fn is_overflow(&self) -> bool
[src]
pub fn is_overflow(&self) -> bool
[src]Checks if last transaction overflowed.
pub fn semaphore_status(&self) -> SemaphoreStatus
[src]
pub fn semaphore_status(&self) -> SemaphoreStatus
[src]Returns the semaphore status.
pub fn event_acquired(&self) -> &Reg<u32, _EVENTS_ACQUIRED>
[src]
pub fn event_acquired(&self) -> &Reg<u32, _EVENTS_ACQUIRED>
[src]Returns reference to Acquired
event endpoint for PPI.
pub fn event_end(&self) -> &Reg<u32, _EVENTS_END>
[src]
pub fn event_end(&self) -> &Reg<u32, _EVENTS_END>
[src]Returns reference to End
event endpoint for PPI.
pub fn event_end_rx(&self) -> &Reg<u32, _EVENTS_ENDRX>
[src]
pub fn event_end_rx(&self) -> &Reg<u32, _EVENTS_ENDRX>
[src]Returns reference to EndRx
event endpoint for PPI.
pub fn task_acquire(&self) -> &Reg<u32, _TASKS_ACQUIRE>
[src]
pub fn task_acquire(&self) -> &Reg<u32, _TASKS_ACQUIRE>
[src]Returns reference to Acquire
task endpoint for PPI.
pub fn task_release(&self) -> &Reg<u32, _TASKS_RELEASE>
[src]
pub fn task_release(&self) -> &Reg<u32, _TASKS_RELEASE>
[src]Returns reference to Release
task endpoint for PPI.
pub fn transfer<W, B>(
self,
buffer: B
) -> Result<Transfer<T, B>, (Error, Spis<T>, B)> where
B: WriteBuffer<Word = W> + 'static,
[src]
pub fn transfer<W, B>(
self,
buffer: B
) -> Result<Transfer<T, B>, (Error, Spis<T>, B)> where
B: WriteBuffer<Word = W> + 'static,
[src]Full duplex DMA transfer. Transmits the given buffer while simultaneously receiving data into the same buffer until it is filled. Buffer must be located in RAM. Returns a value that represents the in-progress DMA transfer.
pub fn transfer_split<TxW, RxW, TxB, RxB>(
self,
tx_buffer: TxB,
rx_buffer: RxB
) -> Result<TransferSplit<T, TxB, RxB>, (Error, Spis<T>, TxB, RxB)> where
TxB: ReadBuffer<Word = TxW> + 'static,
RxB: WriteBuffer<Word = RxW> + 'static,
[src]
pub fn transfer_split<TxW, RxW, TxB, RxB>(
self,
tx_buffer: TxB,
rx_buffer: RxB
) -> Result<TransferSplit<T, TxB, RxB>, (Error, Spis<T>, TxB, RxB)> where
TxB: ReadBuffer<Word = TxW> + 'static,
RxB: WriteBuffer<Word = RxW> + 'static,
[src]Full duplex DMA transfer.
Transmits the given tx_buffer
while simultaneously receiving data
into the given rx_buffer
until it is filled.
The buffers must be located in RAM.
Returns a value that represents the in-progress DMA transfer.
Auto Trait Implementations
impl<T> Send for Spis<T> where
T: Send,
T: Send,
impl<T> Sync for Spis<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Spis<T> where
T: Unpin,
T: Unpin,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> CheckedAs for T
[src]
impl<T> CheckedAs for T
[src]pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]
pub fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
[src]Casts the value.
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
[src]pub fn lossless_try_into(self) -> Option<Dst>
[src]
pub fn lossless_try_into(self) -> Option<Dst>
[src]Performs the conversion.
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
[src]pub fn lossy_into(self) -> Dst
[src]
pub fn lossy_into(self) -> Dst
[src]Performs the conversion.
impl<T> OverflowingAs for T
[src]
impl<T> OverflowingAs for T
[src]pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]
pub fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
[src]Casts the value.
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> SaturatingAs for T
[src]
impl<T> SaturatingAs for T
[src]pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]
pub fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
[src]Casts the value.
impl<T> UnwrappedAs for T
[src]
impl<T> UnwrappedAs for T
[src]pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]
pub fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
[src]Casts the value.
impl<T> WrappingAs for T
[src]
impl<T> WrappingAs for T
[src]pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]
pub fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
[src]Casts the value.