esp_hal::peripherals

Struct SPI2

Source
pub struct SPI2 { /* private fields */ }
Expand description

Represents a virtual peripheral with no associated hardware.

This struct is generated by the create_peripheral! macro when the peripheral is defined as virtual.

Implementations§

Source§

impl SPI2

Source

pub unsafe fn steal() -> Self

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§

impl SPI2

Source

pub const PTR: *const <SPI2 as Deref>::Target = {0x60081000 as *const <esp32c6::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

Source§

impl SPI2

Source

pub fn bind_spi2_interrupt(&mut self, handler: unsafe extern "C" fn())

Binds an interrupt handler to the corresponding interrupt for this peripheral.

Methods from Deref<Target = RegisterBlock>§

Source

pub fn cmd(&self) -> &Reg<CMD_SPEC>

0x00 - Command control register

Source

pub fn addr(&self) -> &Reg<ADDR_SPEC>

0x04 - Address value register

Source

pub fn ctrl(&self) -> &Reg<CTRL_SPEC>

0x08 - SPI control register

Source

pub fn clock(&self) -> &Reg<CLOCK_SPEC>

0x0c - SPI clock control register

Source

pub fn user(&self) -> &Reg<USER_SPEC>

0x10 - SPI USER control register

Source

pub fn user1(&self) -> &Reg<USER1_SPEC>

0x14 - SPI USER control register 1

Source

pub fn user2(&self) -> &Reg<USER2_SPEC>

0x18 - SPI USER control register 2

Source

pub fn ms_dlen(&self) -> &Reg<MS_DLEN_SPEC>

0x1c - SPI data bit length control register

Source

pub fn misc(&self) -> &Reg<MISC_SPEC>

0x20 - SPI misc register

Source

pub fn din_mode(&self) -> &Reg<DIN_MODE_SPEC>

0x24 - SPI input delay mode configuration

Source

pub fn din_num(&self) -> &Reg<DIN_NUM_SPEC>

0x28 - SPI input delay number configuration

Source

pub fn dout_mode(&self) -> &Reg<DOUT_MODE_SPEC>

0x2c - SPI output delay mode configuration

Source

pub fn dma_conf(&self) -> &Reg<DMA_CONF_SPEC>

0x30 - SPI DMA control register

Source

pub fn dma_int_ena(&self) -> &Reg<DMA_INT_ENA_SPEC>

0x34 - SPI interrupt enable register

Source

pub fn dma_int_clr(&self) -> &Reg<DMA_INT_CLR_SPEC>

0x38 - SPI interrupt clear register

Source

pub fn dma_int_raw(&self) -> &Reg<DMA_INT_RAW_SPEC>

0x3c - SPI interrupt raw register

Source

pub fn dma_int_st(&self) -> &Reg<DMA_INT_ST_SPEC>

0x40 - SPI interrupt status register

Source

pub fn dma_int_set(&self) -> &Reg<DMA_INT_SET_SPEC>

0x44 - SPI interrupt software set register

Source

pub fn w(&self, n: usize) -> &Reg<W_SPEC>

0x98..0xd8 - SPI CPU-controlled buffer%s

Source

pub fn w_iter(&self) -> impl Iterator<Item = &Reg<W_SPEC>>

Iterator for array of: 0x98..0xd8 - SPI CPU-controlled buffer%s

Source

pub fn slave(&self) -> &Reg<SLAVE_SPEC>

0xe0 - SPI slave control register

Source

pub fn slave1(&self) -> &Reg<SLAVE1_SPEC>

0xe4 - SPI slave control register 1

Source

pub fn clk_gate(&self) -> &Reg<CLK_GATE_SPEC>

0xe8 - SPI module clock and register clock control

Source

pub fn date(&self) -> &Reg<DATE_SPEC>

0xf0 - Version control

Trait Implementations§

Source§

impl Debug for SPI2

Source§

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

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

impl Deref for SPI2

Source§

type Target = <SPI2 as Deref>::Target

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for SPI2

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<SPI2> for AnySpi

Source§

fn from(inner: SPI2) -> Self

Converts to this type from the input type.
Source§

impl Instance for SPI2

Source§

fn info(&self) -> &'static Info

Returns the peripheral data describing this SPI instance.
Source§

impl Instance for SPI2

Source§

fn info(&self) -> &'static Info

Returns the peripheral data describing this SPI instance.
Source§

impl Peripheral for SPI2

Source§

type P = SPI2

Peripheral singleton type
Source§

unsafe fn clone_unchecked(&self) -> Self::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§

fn map_into<U>(self) -> U
where Self::P: Into<U>, U: Peripheral<P = U>,

Map the peripheral using Into. Read more
Source§

impl InstanceDma for SPI2

Source§

impl QspiInstance for SPI2

Auto Trait Implementations§

§

impl Freeze for SPI2

§

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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.