Namespace: DadDrivers::cIS25LP064A Files: IS25LP064A.h / IS25LP064A.cpp Directory: DAD_FORGE/Drivers/ Inheritance: iQSPI_FlashMemory Description: Implementation of the ISSI IS25LP064A QSPI Flash memory management. This class provides memory access via indirect mode (QSPI commands) or memory-mapped mode (direct CPU access), with Quad I/O mode support.
📋 Class Description
The cIS25LP064A class implements the iQSPI_FlashMemory interface for the ISSI IS25LP064A component. It handles read/write operations in Quad I/O mode, erase cycles (sector, block, chip) and allows switching between indirect command mode and Memory-Mapped Mode for direct processor access. It also supports “Dual Flash” mode to double capacity and read speed.
🔗 External Dependencies
File Inclusions
Included File
Source
Role
"iQSPI_FLashMemory.h"
DAD_FORGE/Drivers
Base interface for QSPI Flash memory
External Functions Called
Function
Source
Usage
HAL_QSPI_Command
HAL
Sending QSPI commands
HAL_QSPI_Transmit
HAL
Transmitting data via QSPI
HAL_QSPI_Receive
HAL
Receiving data via QSPI
HAL_QSPI_Abort
HAL
Aborting the current QSPI operation
HAL_QSPI_MemoryMapped
HAL
Configuring memory-mapped mode
HAL_GetTick
HAL
Retrieving system time for timeouts
HAL_Delay
HAL
System wait
🎯 Associated Enumerations and Structures
IS25LP064A_Commands
Set of commands specific to the ISSI IS25LP064A component’s instruction set.
Returns the total memory size in bytes (takes Dual mode into account).
Return
uint32_t : Total size in bytes
getFlashID
Element
Details
Method
HAL_StatusTypeDef getFlashID(FlashID* pID)
Description
Retrieves the JEDEC identifier of the Flash memory.
Parameter(s)
pID
FlashID* : Structure to store the ID
Return
HAL_StatusTypeDef : Read status
🔒 Protected / Private Methods
WriteEnable
Element
Details
Method
HAL_StatusTypeDef WriteEnable()
Description
Enables writing on the component via the WREN command.
Return
HAL_StatusTypeDef : Operation status
WaitWhileBusy
Element
Details
Method
HAL_StatusTypeDef WaitWhileBusy(uint32_t Timeout)
Description
Waits for the BUSY bit in the status register to be cleared (within a given timeout).
Parameter(s)
Timeout
uint32_t : Maximum wait time in ms
Return
HAL_StatusTypeDef : HAL_OK if completed, HAL_TIMEOUT if timeout exceeded
📦 Data
Private Variables
Member
Type
Description
m_pQSPI
QSPI_HandleTypeDef*
HAL QSPI handle used for communication
m_MemoryMappedBaseAddress
uint32_t
Base address for memory-mapped access
m_DualMode
bool
Flag indicating whether Dual Flash mode is active
m_MappedMode
bool
Flag indicating whether the memory is currently in mapped mode
💡 Usage Example
#include"IS25LP064A.h"usingnamespaceDadDrivers;intmain(){QSPI_HandleTypeDefhqspi;// Configured by HAL_QSPI_Init// cIS25LP064A flash initializationcIS25LP064Aflash;if(flash.Init(&hqspi,false,0x90000000)!=HAL_OK){Error_Handler();}// Identification verificationFlashIDid;if(flash.getFlashID(&id)==HAL_OK){printf("Manufacturer: 0x%02X\n",id.ManufactuerID);// 0xEF = Winbondprintf("Device ID: 0x%02X %02X\n",id.MemoryType,id.Capacity);// 0x4018 or 0x7018}// Data write (page size = 256 bytes)uint8_tdata[256]={0xAA,0x55,0x88,0x00};// Test patternif(flash.Write(data,0x90000000,256)==HAL_OK){printf("Write completed\n");}// Data read from flashuint8_tbuffer[256];if(flash.Read(buffer,0x90000000,256)==HAL_OK){printf("Read: %02X %02X %02X %02X\n",buffer[0],buffer[1],buffer[2],buffer[3]);}// 32K block eraseif(flash.EraseBlock32K(0x90000000)==HAL_OK){printf("32K block erased\n");}// Memory mapping for fast CPU accessif(flash.ModeMemoryMap()==HAL_OK){// Direct read from mapped address (as if it were RAM)uint8_t*mappedAddr=(uint8_t*)0x90000000;*mappedAddr=0xDEADBEEF;// Direct writeprintf("Read value: %02X\n",*mappedAddr);// Return to indirect mode before erase/programmingflash.ModeIndirect();}return0;}
DAD_FORGE/DSP - Dad Design DSP Library Copyright (c) 2024-2026 Dad Design.