Function definitions for SPI Flash driver.
SPI Flash (Public API -Initialization) | |
Used to initialize SPI Flash. | |
| void | spiFlash_wake (spiFlash_instance_t *flash) |
| Select spi and wake up SPI Flash. | |
| void | spiFlash_applyConfig (spiFlash_instance_t *flash) |
| Apply stored SPI Flash configuration to hardware. | |
| void | spiFlash_registerFlash (const spiFlash_info_t *table, size_t count) |
| Register Custom Flash to the driver. | |
| void | spiFlash_initController (spiFlash_instance_t *flash) |
| Initialize SPI setting. | |
| spiFlash_status_t | spiFlash_probe (spiFlash_instance_t *flash) |
| Main wrapper function to initialize the SPI Flash. | |
| #define | spiFlash_register(table) |
| High level Wrapper to register Custom Flash to the driver. | |
SPI Flash (Public API - Identification) | |
Used to identify SPI Flash. | |
| u8 | spiFlash_readId (spiFlash_instance_t *flash) |
| Select and Read Device ID from spiFlash. | |
| u32 | spiFlash_readJedecId (spiFlash_instance_t *flash) |
| Select and read JEDEC ID from spiFlash. | |
| const spiFlash_info_t * | spiFlash_lookup (u32 detected_id) |
| Identify SPI Flash by looking up User Flash Table and known flash table. | |
| spiFlash_status_t | spiFlash_verify (spiFlash_instance_t *flash) |
| Verify spiFlash. | |
| void | spiFlash_applyQuirks (spiFlash_instance_t *flash) |
| Handle those spiFlash that have unique register/way. | |
SPI Flash (Public API - Read/Write Operation) | |
Used for read/write SPI Flash. | |
| u8 | spiFlash_readStatusReg (spiFlash_instance_t *flash) |
| Read Status Register. | |
| void | spiFlash_writeStatusReg (spiFlash_instance_t *flash, u8 data) |
| Write Status Register. | |
| u8 | spiFlash_write_single (spiFlash_instance_t *flash, u32 flashAddress, u8 *src, u32 len) |
| Write N byte to Flash using standard write mode via single Data Line. | |
| void | spiFlash_read_single (spiFlash_instance_t *flash, u32 flashAddress, u8 *buffer, u32 len) |
| Read N byte from Flash using standard read mode via single Data Line. | |
| void | spiFlash_f2m_single (spiFlash_instance_t *flash, u32 flashAddress, uintptr_t memoryAddress, u32 size) |
| This function read data from FlashAddress and copy to memoryAddress of specific size with single data line. | |
| void | spiFlash_f2m_dual (spiFlash_instance_t *flash, u32 flashAddress, uintptr_t memoryAddress, u32 size) |
| This function read data from FlashAddress and copy to memoryAddress of specific size with dual data line. | |
| void | spiFlash_f2m_quad (spiFlash_instance_t *flash, u32 flashAddress, uintptr_t memoryAddress, u32 size) |
| This function read data from FlashAddress and copy to memoryAddress of specific size with quad data line. | |
SPI Flash (Public API - Configuration) | |
Used to configure SPI Flash setting. | |
| spiFlash_status_t | spiFlash_waitBusy (spiFlash_instance_t *flash) |
| Wait for spiFlash to be free. | |
| u8 | spiFlash_exit4ByteAddr (spiFlash_instance_t *flash) |
| Exit 4-byte addressing. | |
| void | spiFlash_lockGlobal (spiFlash_instance_t *flash) |
| Globally locks the SPI flash. | |
| void | spiFlash_enableWrite (spiFlash_instance_t *flash) |
| Set Write Enable Latch (WEL) to 1. | |
| void | spiFlash_unlockGlobal (spiFlash_instance_t *flash) |
| Globally unlocks the SPI flash. | |
| void | spiFlash_enableQuadMode (spiFlash_instance_t *flash) |
| Set Write Enable Latch and set Quad Enable bit to enable Quad Mode. | |
| void | spiFlash_enableQPI (spiFlash_instance_t *flash) |
| Set Write Enable Latch and send CMD 0x38 to enable QPI Mode. | |
| void | spiFlash_eraseSector (spiFlash_instance_t *flash, u32 flashAddress) |
| Erases a sector of the SPI flash given an address. | |
| #define spiFlash_register | ( | table | ) |
#include <spiFlash.h>
High level Wrapper to register Custom Flash to the driver.
| table | Pointer to SPI Flash Info Instance. |
| count | The number of entry in the table. |
Definition at line 285 of file spiFlash.h.
| void spiFlash_applyConfig | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Apply stored SPI Flash configuration to hardware.
| inst | Pointer to SPI Flash instance. |
Definition at line 94 of file spiFlash.c.
| void spiFlash_applyQuirks | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Handle those spiFlash that have unique register/way.
| flash | Pointer to SPI Flash Instance. |
Definition at line 189 of file spiFlash.c.
| void spiFlash_enableQPI | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Set Write Enable Latch and send CMD 0x38 to enable QPI Mode.
| flash | Pointer to SPI Flash Instance. |
Definition at line 373 of file spiFlash.c.
| void spiFlash_enableQuadMode | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Set Write Enable Latch and set Quad Enable bit to enable Quad Mode.
| flash | Pointer to SPI Flash Instance. |
Definition at line 349 of file spiFlash.c.
| void spiFlash_enableWrite | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Set Write Enable Latch (WEL) to 1.
| flash | Pointer to SPI Flash Instance. |
Definition at line 392 of file spiFlash.c.
| void spiFlash_eraseSector | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress ) |
#include <spiFlash.h>
Erases a sector of the SPI flash given an address.
| flash | Pointer to SPI Flash Instance. |
| flashAddress | The flash address to read the data |
Definition at line 455 of file spiFlash.c.
| u8 spiFlash_exit4ByteAddr | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Exit 4-byte addressing.
| flash | Pointer to SPI Flash Instance. |
Definition at line 400 of file spiFlash.c.
| void spiFlash_f2m_dual | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| uintptr_t | memoryAddress, | ||
| u32 | size ) |
#include <spiFlash.h>
This function read data from FlashAddress and copy to memoryAddress of specific size with dual data line.
| spi | SPI port base address |
| flashAddress | The flash address to read the data |
| memoryAddress | The RAM address to write the data |
| size | The size of data to copy |
Definition at line 329 of file spiFlash.c.
| void spiFlash_f2m_quad | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| uintptr_t | memoryAddress, | ||
| u32 | size ) |
#include <spiFlash.h>
This function read data from FlashAddress and copy to memoryAddress of specific size with quad data line.
| spi | SPI port base address |
| flashAddress | The flash address to read the data |
| memoryAddress | The RAM address to write the data |
| size | The size of data to copy |
Definition at line 336 of file spiFlash.c.
| void spiFlash_f2m_single | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| uintptr_t | memoryAddress, | ||
| u32 | size ) |
#include <spiFlash.h>
This function read data from FlashAddress and copy to memoryAddress of specific size with single data line.
| spi | SPI port base address |
| flashAddress | The flash address to read the data |
| memoryAddress | The RAM address to write the data |
| size | The size of data to copy |
Definition at line 322 of file spiFlash.c.
| void spiFlash_initController | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Initialize SPI setting.
| flash | Pointer to SPI Flash Instance. |
Definition at line 33 of file spiFlash.c.
| void spiFlash_lockGlobal | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Globally locks the SPI flash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 418 of file spiFlash.c.
| const spiFlash_info_t * spiFlash_lookup | ( | u32 | detected_id | ) |
#include <spiFlash.h>
Identify SPI Flash by looking up User Flash Table and known flash table.
| detected_id | Detected JEDEC ID. |
| table | Pointer to SPI Flash Info Instance. |
Definition at line 143 of file spiFlash.c.
| spiFlash_status_t spiFlash_probe | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Main wrapper function to initialize the SPI Flash.
| flash | Pointer to the SPI Flash instance. |
Definition at line 62 of file spiFlash.c.
| void spiFlash_read_single | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| u8 * | buffer, | ||
| u32 | len ) |
#include <spiFlash.h>
Read N byte from Flash using standard read mode via single Data Line.
| flash | Pointer to SPI Flash Instance. |
| flashAddress | The Flash address to read the data |
| buffer | The variable that stored the data. |
| len | The length of data to be read. |
Definition at line 270 of file spiFlash.c.
| u8 spiFlash_readId | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Select and Read Device ID from spiFlash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 125 of file spiFlash.c.
| u32 spiFlash_readJedecId | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Select and read JEDEC ID from spiFlash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 134 of file spiFlash.c.
| u8 spiFlash_readStatusReg | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Read Status Register.
| flash | Pointer to SPI Flash Instance. |
Definition at line 294 of file spiFlash.c.
| void spiFlash_registerFlash | ( | const spiFlash_info_t * | table, |
| size_t | count ) |
#include <spiFlash.h>
Register Custom Flash to the driver.
| table | Pointer to SPI Flash Info Instance. |
| count | The number of entry in the table. |
Definition at line 27 of file spiFlash.c.
| void spiFlash_unlockGlobal | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Globally unlocks the SPI flash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 427 of file spiFlash.c.
| spiFlash_status_t spiFlash_verify | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Verify spiFlash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 164 of file spiFlash.c.
| spiFlash_status_t spiFlash_waitBusy | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Wait for spiFlash to be free.
| flash | Pointer to SPI Flash Instance. |
Definition at line 436 of file spiFlash.c.
| void spiFlash_wake | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Select spi and wake up SPI Flash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 100 of file spiFlash.c.
| u8 spiFlash_write_single | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| u8 * | src, | ||
| u32 | len ) |
#include <spiFlash.h>
Write N byte to Flash using standard write mode via single Data Line.
| flash | Pointer to SPI Flash Instance. |
| flashAddress | The Flash address to read the data |
| src | The source of data to be written. |
| len | The length of data to be written. |
Definition at line 249 of file spiFlash.c.
| void spiFlash_writeStatusReg | ( | spiFlash_instance_t * | flash, |
| u8 | data ) |
#include <spiFlash.h>
Write Status Register.
| flash | Pointer to SPI Flash Instance. |
| data | 8-bit data. |
Definition at line 313 of file spiFlash.c.