pub struct Hspi<'d, T: Instance, M: PeriMode> { /* private fields */ }
Expand description
HSPI driver.
Implementations§
Source§impl<'d, T: Instance, M: PeriMode> Hspi<'d, T, M>
impl<'d, T: Instance, M: PeriMode> Hspi<'d, T, M>
Sourcepub fn enable_memory_mapped_mode(
&mut self,
read_config: TransferConfig,
write_config: TransferConfig,
) -> Result<(), HspiError>
pub fn enable_memory_mapped_mode( &mut self, read_config: TransferConfig, write_config: TransferConfig, ) -> Result<(), HspiError>
Enter memory mode.
The Input read_config
is used to configure the read operation in memory mode
Sourcepub fn disable_memory_mapped_mode(&mut self)
pub fn disable_memory_mapped_mode(&mut self)
Quit from memory mapped mode
Sourcepub fn blocking_command(
&mut self,
command: &TransferConfig,
) -> Result<(), HspiError>
pub fn blocking_command( &mut self, command: &TransferConfig, ) -> Result<(), HspiError>
Function used to control or configure the target device without data transfer
Sourcepub fn blocking_read<W: Word>(
&mut self,
buf: &mut [W],
transaction: TransferConfig,
) -> Result<(), HspiError>
pub fn blocking_read<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig, ) -> Result<(), HspiError>
Blocking read with byte by byte data transfer
Sourcepub fn blocking_write<W: Word>(
&mut self,
buf: &[W],
transaction: TransferConfig,
) -> Result<(), HspiError>
pub fn blocking_write<W: Word>( &mut self, buf: &[W], transaction: TransferConfig, ) -> Result<(), HspiError>
Blocking write with byte by byte data transfer
Sourcepub fn set_config(&mut self, config: &Config)
pub fn set_config(&mut self, config: &Config)
Set new bus configuration
Sourcepub fn get_config(&self) -> Config
pub fn get_config(&self) -> Config
Get current configuration
Source§impl<'d, T: Instance> Hspi<'d, T, Blocking>
impl<'d, T: Instance> Hspi<'d, T, Blocking>
Sourcepub fn new_blocking_singlespi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
config: Config,
) -> Self
pub fn new_blocking_singlespi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, config: Config, ) -> Self
Create new blocking HSPI driver for single spi external chip
Sourcepub fn new_blocking_octospi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
d4: impl Peripheral<P = impl D4Pin<T>> + 'd,
d5: impl Peripheral<P = impl D5Pin<T>> + 'd,
d6: impl Peripheral<P = impl D6Pin<T>> + 'd,
d7: impl Peripheral<P = impl D7Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dqs0: impl Peripheral<P = impl DQS0Pin<T>> + 'd,
config: Config,
) -> Self
pub fn new_blocking_octospi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, d4: impl Peripheral<P = impl D4Pin<T>> + 'd, d5: impl Peripheral<P = impl D5Pin<T>> + 'd, d6: impl Peripheral<P = impl D6Pin<T>> + 'd, d7: impl Peripheral<P = impl D7Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dqs0: impl Peripheral<P = impl DQS0Pin<T>> + 'd, config: Config, ) -> Self
Create new blocking HSPI driver for octospi external chip
Source§impl<'d, T: Instance> Hspi<'d, T, Async>
impl<'d, T: Instance> Hspi<'d, T, Async>
Sourcepub fn new_singlespi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dma: impl Peripheral<P = impl HspiDma<T>> + 'd,
config: Config,
) -> Self
pub fn new_singlespi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dma: impl Peripheral<P = impl HspiDma<T>> + 'd, config: Config, ) -> Self
Create new HSPI driver for a single spi external chip
Sourcepub fn new_octospi(
peri: impl Peripheral<P = T> + 'd,
sck: impl Peripheral<P = impl SckPin<T>> + 'd,
d0: impl Peripheral<P = impl D0Pin<T>> + 'd,
d1: impl Peripheral<P = impl D1Pin<T>> + 'd,
d2: impl Peripheral<P = impl D2Pin<T>> + 'd,
d3: impl Peripheral<P = impl D3Pin<T>> + 'd,
d4: impl Peripheral<P = impl D4Pin<T>> + 'd,
d5: impl Peripheral<P = impl D5Pin<T>> + 'd,
d6: impl Peripheral<P = impl D6Pin<T>> + 'd,
d7: impl Peripheral<P = impl D7Pin<T>> + 'd,
nss: impl Peripheral<P = impl NSSPin<T>> + 'd,
dqs0: impl Peripheral<P = impl DQS0Pin<T>> + 'd,
dma: impl Peripheral<P = impl HspiDma<T>> + 'd,
config: Config,
) -> Self
pub fn new_octospi( peri: impl Peripheral<P = T> + 'd, sck: impl Peripheral<P = impl SckPin<T>> + 'd, d0: impl Peripheral<P = impl D0Pin<T>> + 'd, d1: impl Peripheral<P = impl D1Pin<T>> + 'd, d2: impl Peripheral<P = impl D2Pin<T>> + 'd, d3: impl Peripheral<P = impl D3Pin<T>> + 'd, d4: impl Peripheral<P = impl D4Pin<T>> + 'd, d5: impl Peripheral<P = impl D5Pin<T>> + 'd, d6: impl Peripheral<P = impl D6Pin<T>> + 'd, d7: impl Peripheral<P = impl D7Pin<T>> + 'd, nss: impl Peripheral<P = impl NSSPin<T>> + 'd, dqs0: impl Peripheral<P = impl DQS0Pin<T>> + 'd, dma: impl Peripheral<P = impl HspiDma<T>> + 'd, config: Config, ) -> Self
Create new HSPI driver for octospi external chip
Sourcepub fn blocking_read_dma<W: Word>(
&mut self,
buf: &mut [W],
transaction: TransferConfig,
) -> Result<(), HspiError>
pub fn blocking_read_dma<W: Word>( &mut self, buf: &mut [W], transaction: TransferConfig, ) -> Result<(), HspiError>
Blocking read with DMA transfer
Sourcepub fn blocking_write_dma<W: Word>(
&mut self,
buf: &[W],
transaction: TransferConfig,
) -> Result<(), HspiError>
pub fn blocking_write_dma<W: Word>( &mut self, buf: &[W], transaction: TransferConfig, ) -> Result<(), HspiError>
Blocking write with DMA transfer
Trait Implementations§
Auto Trait Implementations§
impl<'d, T, M> Freeze for Hspi<'d, T, M>where
T: Freeze,
impl<'d, T, M> RefUnwindSafe for Hspi<'d, T, M>where
T: RefUnwindSafe,
M: RefUnwindSafe,
impl<'d, T, M> Send for Hspi<'d, T, M>
impl<'d, T, M> Sync for Hspi<'d, T, M>
impl<'d, T, M> Unpin for Hspi<'d, T, M>
impl<'d, T, M> !UnwindSafe for Hspi<'d, T, M>
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