Class daisy::QSPIHandle¶
ClassList > daisy > QSPIHandle
#include <qspi.h>
Classes¶
Type | Name |
---|---|
struct | Config |
Public Types¶
Type | Name |
---|---|
enum | Result |
enum | Status |
Public Functions¶
Type | Name |
---|---|
Result | DeInit () |
Result | Erase (uint32_t start_addr, uint32_t end_addr) |
Result | EraseSector (uint32_t address) |
const Config & | GetConfig () const |
void * | GetData (uint32_t offset=0) |
Status | GetStatus () |
Result | Init (const Config & config) |
QSPIHandle () |
|
QSPIHandle (const QSPIHandle & other) = default |
|
Result | Write (uint32_t address, uint32_t size, uint8_t * buffer) |
Result | WritePage (uint32_t address, uint32_t size, uint8_t * buffer) |
QSPIHandle & | operator= (const QSPIHandle & other) = default |
Detailed Description¶
Driver for QSPI peripheral to interface with external flash memory. Currently supported QSPI Devices: IS25LP080D
Public Types Documentation¶
enum Result¶
enum Status¶
Indicates the current status of the module. Warnings are indicated by a leading W. Errors are indicated by a leading E and cause an immediate exit.
Parameters:
GOOD
- No errors have been reported.E_HAL_ERROR
- HAL code did not return HAL_OK.E_SWITCHING_MODES
- An error was encountered while switching QSPI peripheral mode.E_INVALID_MODE
- QSPI should not be written to while the program is executing from it.
Public Functions Documentation¶
function DeInit¶
Deinitializes the peripheral This should be called before reinitializing QSPI in a different mode.
Returns:
Result::OK or Result::ERR
function Erase¶
Erases the area specified on the chip. Erasures will happen by 4K, 32K or 64K increments. Smallest erase possible is 4kB at a time. (on IS25LP*)
Parameters:
start_addr
Address to begin erasing fromend_addr
Address to stop erasing at
Returns:
Result::OK or Result::ERR
function EraseSector¶
Erases a single sector of the chip. TODO: Document the size of this function.
Parameters:
address
Address of sector to erase
Returns:
Result::OK or Result::ERR
function GetConfig¶
Returns the current config.
function GetData¶
Returns a pointer to the actual memory used The memory at this address is read-only to write to it use the Write function.
Parameters:
offset
returns the pointer starting this many bytes into the memory
function GetStatus¶
Returns the current class status. Useful for debugging.
Returns:
Status
function Init¶
Initializes QSPI peripheral, and Resets, and prepares memory for access.
Parameters:
config
should be populated with the mode, device and pin_config before calling this function.
Returns:
Result::OK or Result::ERR
function QSPIHandle [½]¶
function QSPIHandle [2/2]¶
function Write¶
Writes data in buffer to to the QSPI. Starting at address to address+size
Parameters:
address
Address to write tosize
Buffer sizebuffer
Buffer to write
Returns:
Result::OK or Result::ERR
function WritePage¶
Writes a single page to to the specified address on the QSPI chip. For IS25LP*, page size is 256 bytes.
Parameters:
address
Address to write tosize
Buffer sizebuffer
Buffer to write
Returns:
Result::OK or Result::ERR
function operator=¶
The documentation for this class was generated from the following file external-docs/libDaisy/src/per/qspi.h