embassy-stm32

Crates

git

Versions

stm32h523vc

Flavors

Module ospi

Module ospi 

Source
Expand description

OCTOSPI Serial Peripheral Interface

Notes on OCTOSPIM (OctoSPI manager / mux) Some chips have an OCTOSPIM peripheral, such chips, like the STM32H735, have a default mapping as follows:

RM0468 Rev 3: “In the default out-of-reset configuration, all the OCTOSPI1 and OCTOSPI2 signals are mapped, respectively, on Port 1 and on Port 2.”

This mapping is maintained by this implementation in that:

  • OCTOSPIM.P1CR is used for OCTOSPI1.
  • OCTOSPIM.P2CR is used for OCTOSPI2.

However, it is possible to have a bootloader which does not follow this convention and runs your code from memory-mapped flash, which will then break things when you use the functions in this module. In this very special case, use a function that resides in RAM to re-configure the OctoSPI.

Additionally, there are other issues when running code from memory-mapped mode, since the reference manual states:

“The OCTOSPIM configuration can be changed only when all OCTOSPIs are disabled”

this implementation does indeed disable both OCTOSPI peripherals before OCTOSPIM reconfiguration.

Finally, for simplicity, this implementation currently enforces that DQS, NCS and CLK are on the same physical group, however this is not a requirement of the hardware. i.e. using P1_NCS and P1_CLK is ok, but P1_NCS and P2_CLK is not and you will get a compile error if you try. PR’s welcome to change this as needed.

Re-exports§

pub use enums::*;

Modules§

enums
Enums used in Ospi configuration.

Structs§

Config
OPSI driver config.
Ospi
OSPI driver.
TransferConfig
OSPI transfer configuration.

Enums§

OspiError
Error used for Octospi implementation

Traits§

D0Pin
D0Pin pin trait
D1Pin
D1Pin pin trait
D2Pin
D2Pin pin trait
D3Pin
D3Pin pin trait
D4Pin
D4Pin pin trait
D5Pin
D5Pin pin trait
D6Pin
D6Pin pin trait
D7Pin
D7Pin pin trait
DQSPin
DQSPin pin trait
Instance
OSPI instance trait.
NSSPin
NSSPin pin trait
NckPin
NckPin pin trait
OctoDma
OctoDma DMA request trait
SckPin
SckPin pin trait
Word
Word sizes usable for OSPI.