RV32 SoC DS UG
High-Perf RV32 SoC DS UG
RV64 SoC DS UG API and Examples
Embedded IDE UG
Loading...
Searching...
No Matches
SPI Flash Driver

Overview

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,
.inst = &(spi_instance_t){
.hwreg = SPI,
.cpol = LOW,
.clkDivider = 15,
.ssSetup = 5,
.ssHold = 2,
.ssDisable = 7
},
@ FULL_DUPLEX_SINGLE_LINE
Full-duplex mode using single data lin.
Definition spi.h:142
@ LOW
Clock is low when id.
Definition spi.h:149
@ DATA_SAMPLED_RISE_EDGE
Data sampled on rising clock ed.
Definition spi.h:155
spiFlash_status_t spiFlash_probe(spiFlash_instance_t *flash)
Main wrapper function to initialize the SPI Flash.
Definition spiFlash.c:62
SPI Flash driver API definitions.
SPI instance. Holds the software registers and hardware pointer.
Definition spi.h:236
SPI Flash instance structure.
Definition spiFlash.h:232
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.

Topics

 API Functions
 Function definitions for SPI Flash driver.
 Data Structures
 Main Structs used by the SPI Flash driver.
 Data Types
 Enums used by the driver.
 Flash Device Database
 Database for supported flash device.
 Register Definitions
 Standard SPI Flash command definitions.