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_init_controller (spiFlash_instance_t *flash) |
| Initialize SPI setting. | |
| spiFlash_status_t | spiFlash_probe (spiFlash_instance_t *flash, const spiFlash_info_t *user_flash) |
| The main wrapper for initialize SPI Flash. | |
SPI Flash (Public API - Identification) | |
Used to identify SPI Flash. | |
| u8 | spiFlash_read_id (spiFlash_instance_t *flash) |
| Select and Read Device ID from spiFlash. | |
| u32 | spiFlash_jedec_id (spiFlash_instance_t *flash) |
| Select and read JEDEC ID from spiFlash. | |
| spiFlash_status_t | spiFlash_verify (spiFlash_instance_t *flash, const spiFlash_info_t *user_flash) |
| Verify spiFlash. | |
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 (spiFlash_instance_t *flash, u32 flashAddress, u8 *src, u32 len) |
| Write N byte to Flash using standard write mode. | |
| u8 | spiFlash_write_quad (spiFlash_instance_t *flash, u32 flashAddress, u8 *src, u32 len) |
| Write N byte to Flash using quad write mode. | |
| void | spiFlash_read (spiFlash_instance_t *flash, u32 flashAddress, u8 *buffer, u32 len) |
| Read N byte from Flash using standard read mode. | |
| void | spiFlash_read_quad (spiFlash_instance_t *flash, u32 flashAddress, u8 *buffer, u32 len) |
| Read N byte from Flash using quad read mode. | |
| void | spiFlash_f2m (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_dual_f2m (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_quad_f2m (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_globalLock (spiFlash_instance_t *flash) |
| Globally locks the SPI flash. | |
| void | spiFlash_writeEnable (spiFlash_instance_t *flash) |
| Set Write Enable Latch. | |
| void | spiFlash_globalUnlock (spiFlash_instance_t *flash) |
| Globally unlocks the SPI flash. | |
| void | spiFlash_enable_quad_access (spiFlash_instance_t *flash) |
| Set Write Enable Latch and set Quad Enable bit to enable Quad SPI. | |
| void | spiFlash_sectorErase (spiFlash_instance_t *flash, u32 flashAddress) |
| Erases a sector of the SPI flash given an address. | |
| void spiFlash_dual_f2m | ( | 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 |
| void spiFlash_enable_quad_access | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Set Write Enable Latch and set Quad Enable bit to enable Quad SPI.
| flash | Pointer to SPI Flash Instance. |
Definition at line 375 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 413 of file spiFlash.c.
| void spiFlash_f2m | ( | 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 349 of file spiFlash.c.
| void spiFlash_globalLock | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Globally locks the SPI flash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 431 of file spiFlash.c.
| void spiFlash_globalUnlock | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Globally unlocks the SPI flash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 440 of file spiFlash.c.
| void spiFlash_init_controller | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Initialize SPI setting.
| flash | Pointer to SPI Flash Instance. |
Definition at line 24 of file spiFlash.c.
| u32 spiFlash_jedec_id | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Select and read JEDEC ID from spiFlash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 181 of file spiFlash.c.
| spiFlash_status_t spiFlash_probe | ( | spiFlash_instance_t * | flash, |
| const spiFlash_info_t * | user_flash ) |
#include <spiFlash.h>
The main wrapper for initialize SPI Flash.
| flash | Pointer to SPI Flash Instance. |
| user_flash | Pointer to SPI Flash Info Instance. |
Definition at line 44 of file spiFlash.c.
| void spiFlash_quad_f2m | ( | 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 |
| void spiFlash_read | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| u8 * | buffer, | ||
| u32 | len ) |
#include <spiFlash.h>
Read N byte from Flash using standard read mode.
| 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 279 of file spiFlash.c.
| u8 spiFlash_read_id | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Select and Read Device ID from spiFlash.
| flash | Pointer to SPI Flash Instance. |
Definition at line 172 of file spiFlash.c.
| void spiFlash_read_quad | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| u8 * | buffer, | ||
| u32 | len ) |
#include <spiFlash.h>
Read N byte from Flash using quad read mode.
| 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 294 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 320 of file spiFlash.c.
| void spiFlash_sectorErase | ( | 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 468 of file spiFlash.c.
| spiFlash_status_t spiFlash_verify | ( | spiFlash_instance_t * | flash, |
| const spiFlash_info_t * | user_flash ) |
#include <spiFlash.h>
Verify spiFlash.
| flash | Pointer to SPI Flash Instance. |
| user_flash | Pointer to Flash Info Instance. |
Definition at line 136 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 449 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 76 of file spiFlash.c.
| u8 spiFlash_write | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| u8 * | src, | ||
| u32 | len ) |
#include <spiFlash.h>
Write N byte to Flash using standard write mode.
| 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 236 of file spiFlash.c.
| u8 spiFlash_write_quad | ( | spiFlash_instance_t * | flash, |
| u32 | flashAddress, | ||
| u8 * | src, | ||
| u32 | len ) |
#include <spiFlash.h>
Write N byte to Flash using quad write mode.
| 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 258 of file spiFlash.c.
| void spiFlash_writeEnable | ( | spiFlash_instance_t * | flash | ) |
#include <spiFlash.h>
Set Write Enable Latch.
| flash | Pointer to SPI Flash Instance. |
Definition at line 405 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 339 of file spiFlash.c.