Serial Peripheral Interface (SPI) Flash driver.
This module provides functions to configure and control SPI Flash input/output and interrupt behavior.
Usage & Initialization
This is an example show how to instantiate SPI Flash Driver with spiFlash_instance_t.
- Note
- Instead of using spiFlash_applyConfig, Efinix recommends users to call spiFlash_probe which will do the following sequence:
- Initialize the SPI driver with the user configuration (falls back to default settings if input is invalid).
- Release the flash from Deep Power-Down mode.
- Read the JEDEC ID.
- Identify the SPI Flash by cross-referencing the detected ID with the User Flash Table and Known Flash Table.
- Load default commands for 4-byte exit, status read, and status write.
- Check for and apply hardware quirks for special handling.
- Ensure the device returns to 3-Byte Addressing Mode.
- Execute the user-provided custom setup function (post_init_hook).
.cs = 0,
.hwreg = SPI,
.clkDivider = 15,
.ssSetup = 5,
.ssHold = 2,
.ssDisable = 7
},
@ FULL_DUPLEX_SINGLE_LINE
Full-duplex mode using single data lin.
@ LOW
Clock is low when id.
@ DATA_SAMPLED_RISE_EDGE
Data sampled on rising clock ed.
spiFlash_status_t spiFlash_probe(spiFlash_instance_t *flash)
Main wrapper function to initialize the SPI Flash.
SPI Flash driver API definitions.
SPI instance. Holds the software registers and hardware pointer.
SPI Flash instance structure.
- See also
- Example SPI Flash Demo - Learn how to use the driver for interacting with Flash devices
-
Example of Creating Custom Flash Descriptor - Learn how to register a custom flash chip via spiFlash_register.
-
Flash Device Database - Learn about the known flash database and Capability flags.
-
Known Flash Table - Learn about the supported flash list.
-
API Functions - Learn about the available Flash API functions.