pub struct SPI2 { /* private fields */ }

Implementations§

source§

impl SPI2

source

pub unsafe fn steal() -> SPI2

Unsafely create an instance of this peripheral out of thin air.

Safety

You must ensure that you’re only using one instance of this type at a time.

source

pub const PTR: *const <SPI2 as Deref>::Target = {0x60024000 as *const <esp32c3::SPI2 as core::ops::Deref>::Target}

Pointer to the register block

source

pub const fn ptr() -> *const <SPI2 as Deref>::Target

Return the pointer to the register block

Trait Implementations§

source§

impl Debug for SPI2

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for SPI2

§

type Target = <SPI2 as Deref>::Target

The resulting type after dereferencing.
source§

fn deref(&self) -> &<SPI2 as Deref>::Target

Dereferences the value.
source§

impl DerefMut for SPI2

source§

fn deref_mut(&mut self) -> &mut <SPI2 as Deref>::Target

Mutably dereferences the value.
source§

impl Instance for SPI2

source§

fn register_block(&self) -> &RegisterBlock

source§

fn sclk_signal(&self) -> OutputSignal

source§

fn mosi_signal(&self) -> OutputSignal

source§

fn miso_signal(&self) -> InputSignal

source§

fn cs_signal(&self) -> OutputSignal

source§

fn enable_peripheral( &self, peripheral_clock_control: &mut PeripheralClockControl )

source§

fn spi_num(&self) -> u8

source§

fn init(&mut self)

source§

fn setup(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks<'_>)

source§

fn set_data_mode(&mut self, data_mode: SpiMode) -> &mut Self

source§

fn ch_bus_freq(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks<'_>)

source§

fn read_byte(&mut self) -> Result<u8, Error<Error>>

source§

fn write_byte(&mut self, word: u8) -> Result<(), Error<Error>>

source§

fn write_bytes(&mut self, words: &[u8]) -> Result<(), Error>

Write bytes to SPI. Read more
source§

fn read_bytes(&mut self, words: &mut [u8]) -> Result<(), Error>

Read bytes from SPI. Read more
source§

fn read_bytes_from_fifo(&mut self, words: &mut [u8]) -> Result<(), Error>

Read received bytes from SPI FIFO. Read more
source§

fn flush(&mut self) -> Result<(), Error>

source§

fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Error>

source§

fn update(&self)

source§

fn configure_datalen(&self, len: u32)

source§

impl<TX, RX> InstanceDma<TX, RX> for SPI2where TX: Tx, RX: Rx,

source§

fn transfer_in_place_dma<'w>( &mut self, words: &'w mut [u8], tx: &mut TX, rx: &mut RX ) -> Result<&'w [u8], Error>

source§

fn transfer_dma<'w>( &mut self, write_buffer: &'w [u8], read_buffer: &'w mut [u8], tx: &mut TX, rx: &mut RX ) -> Result<&'w [u8], Error>

source§

fn start_transfer_dma<'w>( &mut self, write_buffer_ptr: *const u8, write_buffer_len: usize, read_buffer_ptr: *mut u8, read_buffer_len: usize, tx: &mut TX, rx: &mut RX ) -> Result<(), Error>

source§

fn write_bytes_dma<'w>( &mut self, words: &'w [u8], tx: &mut TX ) -> Result<&'w [u8], Error>

source§

fn start_write_bytes_dma<'w>( &mut self, ptr: *const u8, len: usize, tx: &mut TX ) -> Result<(), Error>

source§

fn start_read_bytes_dma<'w>( &mut self, ptr: *mut u8, len: usize, rx: &mut RX ) -> Result<(), Error>

source§

fn dma_peripheral(&self) -> DmaPeripheral

source§

fn enable_dma(&self)

source§

fn clear_dma_interrupts(&self)

source§

impl Peripheral for &mut SPI2

§

type P = SPI2

Peripheral singleton type
source§

unsafe fn clone_unchecked(&mut self) -> <&mut SPI2 as Peripheral>::P

Unsafely clone (duplicate) a peripheral singleton. Read more
source§

fn into_ref<'a>(self) -> PeripheralRef<'a, Self::P>where Self: 'a,

Convert a value into a PeripheralRef. Read more
source§

impl Peripheral for SPI2

§

type P = SPI2

Peripheral singleton type
source§

unsafe fn clone_unchecked(&mut self) -> <SPI2 as Peripheral>::P

Unsafely clone (duplicate) a peripheral singleton. Read more
source§

fn into_ref<'a>(self) -> PeripheralRef<'a, Self::P>where Self: 'a,

Convert a value into a PeripheralRef. Read more
source§

impl Spi2Instance for SPI2

Auto Trait Implementations§

§

impl RefUnwindSafe for SPI2

§

impl Send for SPI2

§

impl Sync for SPI2

§

impl Unpin for SPI2

§

impl UnwindSafe for SPI2

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.