Struct nrf52810_hal::spis::Spis[][src]

pub struct Spis<T> where
    T: Instance
{ /* fields omitted */ }

Interface to a SPIS instance.

Implementations

impl<T> Spis<T> where
    T: Instance
[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]

Sets the ´default´ character (character clocked out in case of an ignored transaction).

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_order(&self, order: Order) -> &Spis<T>[src]

Sets bit order.

pub fn set_polarity(&self, polarity: Polarity) -> &Spis<T>[src]

Sets serial clock (SCK) polarity.

pub fn set_phase(&self, phase: Phase) -> &Spis<T>[src]

Sets serial clock (SCK) phase.

pub fn set_mode(&self, mode: Mode) -> &Spis<T>[src]

Sets SPI mode.

pub fn enable(&self) -> &Spis<T>[src]

Enables the SPIS instance.

pub fn disable(&self) -> &Spis<T>[src]

Disables the SPIS module.

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]

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 release(&self) -> &Spis<T>[src]

Releases the SPIS semaphore, enabling the SPIS to acquire it.

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]

Disables interrupt for specified event.

pub fn auto_acquire(&self, enabled: bool) -> &Spis<T>[src]

Automatically acquire the semaphore after transfer has ended.

pub fn reset_events(&self)[src]

Resets all events.

pub fn reset_event(&self, event: SpisEvent)[src]

Resets specified event.

pub fn is_event_triggered(&self, event: SpisEvent) -> bool[src]

Checks if specified event has been triggered.

pub fn is_done(&self) -> bool[src]

Checks if the granted transfer is done.

pub fn is_acquired(&self) -> bool[src]

Checks if the semaphore is acquired.

pub fn is_overread(&self) -> bool[src]

Checks if last transaction overread.

pub fn is_overflow(&self) -> bool[src]

Checks if last transaction overflowed.

pub fn amount(&self) -> u32[src]

Returns number of bytes received in last granted transaction.

pub fn semaphore_status(&self) -> SemaphoreStatus[src]

Returns the semaphore status.

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]

Returns reference to End event endpoint for PPI.

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]

Returns reference to Acquire task endpoint for PPI.

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]

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]

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.

pub fn free(self) -> (T, Pins)[src]

Returns the raw interface to the underlying SPIS peripheral.

Auto Trait Implementations

impl<T> Send for Spis<T> where
    T: Send

impl<T> Sync for Spis<T> where
    T: Sync

impl<T> Unpin for Spis<T> where
    T: Unpin

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<Src, Dst> LosslessTryInto<Dst> for Src where
    Dst: LosslessTryFrom<Src>, 
[src]

impl<Src, Dst> LossyInto<Dst> for Src where
    Dst: LossyFrom<Src>, 
[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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.