Skip to content

Commit 08f921c

Browse files
committed
Add basic docs for octospi indirect mode
1 parent 8a4cc19 commit 08f921c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/xspi/mod.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,37 @@
3333
//! qspi.write(0x00, &[0xAB, 0xCD]).unwrap();
3434
//! ```
3535
//!
36+
//! For OCTOSPI there are two peripherals, which can be initialised separately.
37+
//!
38+
//! ```
39+
//! use stm32h7xx_hal::{xspi, xspi::OctospiWord as XW};
40+
//!
41+
//! // Get the device peripherals and instantiate IO pins.
42+
//! let dp = ...;
43+
//! let _ = ...;
44+
//!
45+
//! let mut octospi = dp.OCTOSPI1.octospi_unchecked(12.mhz(), &ccdr.clocks,
46+
//! ccdr.peripheral.OCTOSPI1);
47+
//!
48+
//! // Configure OCTOSPI to operate in 8-bit mode.
49+
//! octospi.configure_mode(xspi::OctospiMode::EightBit).unwrap();
50+
//!
51+
//! // Example RDID Read Indentification
52+
//! let mut read: [u8; 3] = [0; 3];
53+
//! octospi
54+
//! .read_extended(XW::U16(0x9F60), XW::U32(0), XW::None, 4, &mut read)
55+
//! .unwrap();
56+
//! ```
57+
//!
58+
//! # Configuration
59+
//!
60+
//! A [`Config`](#struct.Config) struct is used to configure the xSPI.
61+
//!
62+
//! ```
63+
//! use stm32h7xx_hal::xspi;
64+
//! let config = xspi::Config::new(12.mhz()).fifo_threshold(16);
65+
//! ```
66+
//!
3667
//! # Limitations
3768
//!
3869
//! This driver currently only supports indirect operation mode of the xSPI

0 commit comments

Comments
 (0)