Struct esp32c2_hal::peripherals::SPI2
source · pub struct SPI2 { /* private fields */ }
Implementations§
source§impl SPI2
impl SPI2
sourcepub unsafe fn steal() -> SPI2
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.
Trait Implementations§
source§impl ExtendedInstance for SPI2
impl ExtendedInstance for SPI2
fn sio0_input_signal(&self) -> InputSignal
fn sio1_output_signal(&self) -> OutputSignal
fn sio2_output_signal(&self) -> OutputSignal
fn sio2_input_signal(&self) -> InputSignal
fn sio3_output_signal(&self) -> OutputSignal
fn sio3_input_signal(&self) -> InputSignal
source§impl Instance for SPI2
impl Instance for SPI2
fn register_block(&self) -> &RegisterBlock
fn sclk_signal(&self) -> InputSignal
fn mosi_signal(&self) -> InputSignal
fn miso_signal(&self) -> OutputSignal
fn cs_signal(&self) -> InputSignal
fn enable_peripheral(&self)
fn spi_num(&self) -> u8
fn set_data_mode(&mut self, data_mode: SpiMode) -> &mut Self
fn is_bus_busy(&self) -> bool
fn flush(&mut self) -> Result<(), Error>
fn setup_for_flush(&self)
source§impl 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)
fn spi_num(&self) -> u8
fn init_spi_data_mode( &mut self, cmd_mode: SpiDataMode, address_mode: SpiDataMode, data_mode: SpiDataMode )
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>>
source§fn read_bytes(&mut self, words: &mut [u8]) -> Result<(), Error>
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>
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 start_operation(&self)
fn init_half_duplex( &mut self, is_write: bool, command_state: bool, address_state: bool, dummy_idle: bool, dummy_state: bool, no_mosi_miso: bool )
fn write_bytes_half_duplex( &mut self, cmd: Command, address: Address, dummy: u8, buffer: &[u8] ) -> Result<(), Error>
fn read_bytes_half_duplex( &mut self, cmd: Command, address: Address, dummy: u8, buffer: &mut [u8] ) -> Result<(), Error>
fn update(&self)
fn configure_datalen(&self, len: u32)
source§impl<TX, RX> InstanceDma<TX, RX> for SPI2where
TX: Tx,
RX: Rx,
impl<TX, RX> InstanceDma<TX, RX> for SPI2where TX: Tx, RX: Rx,
fn start_transfer_dma( &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 start_write_bytes_dma( &mut self, ptr: *const u8, len: usize, tx: &mut TX ) -> Result<(), Error>
fn start_read_bytes_dma( &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)
source§impl<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, listen: bool ) -> 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, listen: bool ) -> Result<(), Error>
fn start_read_bytes_dma<'w>( &mut self, ptr: *mut u8, len: usize, rx: &mut RX, listen: bool ) -> Result<(), Error>
fn dma_peripheral(&self) -> DmaPeripheral
fn enable_dma(&self)
fn clear_dma_interrupts(&self)
source§impl Peripheral for SPI2
impl Peripheral 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more