Struct esp32c2_hal::pac::SPI2
pub struct SPI2 { /* private fields */ }
Expand description
SPI (Serial Peripheral Interface) Controller
Implementations
impl SPI2
impl SPI2
pub const PTR: *const RegisterBlock = {0x60024000 as *const esp_hal_common::esp32c2::spi2::RegisterBlock}
pub const PTR: *const RegisterBlock = {0x60024000 as *const esp_hal_common::esp32c2::spi2::RegisterBlock}
Pointer to the register block
pub const fn ptr() -> *const RegisterBlock
pub const fn ptr() -> *const RegisterBlock
Return the pointer to the register block
Trait Implementations
sourceimpl Instance for SPI2
impl Instance for SPI2
fn register_block(&self) -> &RegisterBlock
fn sclk_signal(&self) -> OutputSignal
fn mosi_signal(&self) -> OutputSignal
fn miso_signal(&self) -> InputSignal
fn cs_signal(&self) -> OutputSignal
fn enable_peripheral(
&self,
peripheral_clock_control: &mut PeripheralClockControl
)
fn spi_num(&self) -> u8
fn init(&mut self)
fn setup(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks)
fn set_data_mode(&mut self, data_mode: SpiMode) -> &mut Self
fn ch_bus_freq(&mut self, frequency: Rate<u32, 1, 1>, clocks: &Clocks)
fn read_byte(&mut self) -> Result<u8, Error<Error>>
fn write_byte(&mut self, word: u8) -> Result<(), Error<Error>>
sourcefn read_bytes_from_fifo(&mut self, words: &mut [u8]) -> Result<(), Error>
fn read_bytes_from_fifo(&mut self, words: &mut [u8]) -> Result<(), Error>
Read received bytes from SPI FIFO. Read more
fn flush(&mut self) -> Result<(), Error>
fn transfer<'w>(&mut self, words: &'w mut [u8]) -> Result<&'w [u8], Error>
fn update(&self)
fn configure_datalen(&self, len: u32)
sourceimpl<TX, RX> InstanceDma<TX, RX> for SPI2where
TX: Tx,
RX: Rx,
impl<TX, RX> InstanceDma<TX, RX> for SPI2where
TX: Tx,
RX: Rx,
fn transfer_in_place_dma<'w>(
&mut self,
words: &'w mut [u8],
tx: &mut TX,
rx: &mut RX
) -> Result<&'w [u8], Error>
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>
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>
fn write_bytes_dma<'w>(
&mut self,
words: &'w [u8],
tx: &mut TX
) -> Result<&'w [u8], Error>
fn start_write_bytes_dma<'w>(
&mut self,
ptr: *const u8,
len: usize,
tx: &mut TX
) -> Result<(), Error>
fn start_read_bytes_dma<'w>(
&mut self,
ptr: *mut u8,
len: usize,
rx: &mut RX
) -> Result<(), Error>
fn dma_peripheral(&self) -> DmaPeripheral
fn enable_dma(&self)
fn clear_dma_interrupts(&self)
impl Send for SPI2
impl Spi2Instance for SPI2
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more