SPI Flash. More...
#include "spi_flash/include/spi_flash.h"
Go to the source code of this file.
Macros | |
#define | CORTUS_SHARE_MEM_BASE (0x60000000UL) |
#define | DUMMY_REGISTER (0x1084) |
#define | GET_UINT32(X, Y) (X[0+Y] + ((uint32)X[1+Y]<<8) + ((uint32)X[2+Y]<<16) +((uint32)X[3+Y]<<24)) |
#define | HOST_SHARE_MEM_BASE (0xd0000UL) |
#define | NMI_SPI_FLASH_ADDR (0x111c) |
#define | SPI_FLASH_BASE (0x10200) |
#define | SPI_FLASH_BUF1 (SPI_FLASH_BASE + 0x0c) |
#define | SPI_FLASH_BUF2 (SPI_FLASH_BASE + 0x10) |
#define | SPI_FLASH_BUF_DIR (SPI_FLASH_BASE + 0x14) |
#define | SPI_FLASH_CMD_CNT (SPI_FLASH_BASE + 0x04) |
#define | SPI_FLASH_DATA_CNT (SPI_FLASH_BASE + 0x08) |
#define | SPI_FLASH_DMA_ADDR (SPI_FLASH_BASE + 0x1c) |
#define | SPI_FLASH_MODE (SPI_FLASH_BASE + 0x00) |
#define | SPI_FLASH_MSB_CTL (SPI_FLASH_BASE + 0x20) |
#define | SPI_FLASH_TR_DONE (SPI_FLASH_BASE + 0x18) |
#define | SPI_FLASH_TX_CTL (SPI_FLASH_BASE + 0x24) |
#define | TIMEOUT (-1) /*MS*/ |
Functions | |
sint8 | spi_flash_erase (uint32 u32Offset, uint32 u32Sz) |
Erase a specified portion of SPI Flash. . More... | |
uint32 | spi_flash_get_size (void) |
Returns with uint32 value which is total flash size . More... | |
static sint8 | spi_flash_load_to_cortus_mem (uint32 u32MemAdr, uint32 u32FlashAdr, uint32 u32Sz) |
static sint8 | spi_flash_page_program (uint32 u32MemAdr, uint32 u32FlashAdr, uint32 u32Sz) |
static sint8 | spi_flash_pp (uint32 u32Offset, uint8 *pu8Buf, uint16 u16Sz) |
static uint32 | spi_flash_rdid (void) |
Read SPI Flash ID. More... | |
sint8 | spi_flash_read (uint8 *pu8Buf, uint32 u32offset, uint32 u32Sz) |
Read a specified portion of data from SPI Flash. . More... | |
static sint8 | spi_flash_read_internal (uint8 *pu8Buf, uint32 u32Addr, uint32 u32Sz) |
static sint8 | spi_flash_read_status_reg (uint8 *val) |
static sint8 | spi_flash_sector_erase (uint32 u32FlashAdr) |
sint8 | spi_flash_write (uint8 *pu8Buf, uint32 u32Offset, uint32 u32Sz) |
Write a specified portion of data to SPI Flash. . More... | |
static sint8 | spi_flash_write_disable (void) |
Send write disable command to SPI flash. More... | |
static sint8 | spi_flash_write_enable (void) |
Send write enable command to SPI flash. More... | |
SPI Flash.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
Definition in file spi_flash.c.
#define CORTUS_SHARE_MEM_BASE (0x60000000UL) |
Definition at line 46 of file spi_flash.c.
#define DUMMY_REGISTER (0x1084) |
Definition at line 39 of file spi_flash.c.
#define GET_UINT32 | ( | X, | |
Y | |||
) | (X[0+Y] + ((uint32)X[1+Y]<<8) + ((uint32)X[2+Y]<<16) +((uint32)X[3+Y]<<24)) |
Definition at line 51 of file spi_flash.c.
#define HOST_SHARE_MEM_BASE (0xd0000UL) |
Definition at line 45 of file spi_flash.c.
#define NMI_SPI_FLASH_ADDR (0x111c) |
Definition at line 47 of file spi_flash.c.
#define SPI_FLASH_BASE (0x10200) |
Definition at line 52 of file spi_flash.c.
#define SPI_FLASH_BUF1 (SPI_FLASH_BASE + 0x0c) |
Definition at line 56 of file spi_flash.c.
#define SPI_FLASH_BUF2 (SPI_FLASH_BASE + 0x10) |
Definition at line 57 of file spi_flash.c.
#define SPI_FLASH_BUF_DIR (SPI_FLASH_BASE + 0x14) |
Definition at line 58 of file spi_flash.c.
#define SPI_FLASH_CMD_CNT (SPI_FLASH_BASE + 0x04) |
Definition at line 54 of file spi_flash.c.
#define SPI_FLASH_DATA_CNT (SPI_FLASH_BASE + 0x08) |
Definition at line 55 of file spi_flash.c.
#define SPI_FLASH_DMA_ADDR (SPI_FLASH_BASE + 0x1c) |
Definition at line 60 of file spi_flash.c.
#define SPI_FLASH_MODE (SPI_FLASH_BASE + 0x00) |
Definition at line 53 of file spi_flash.c.
#define SPI_FLASH_MSB_CTL (SPI_FLASH_BASE + 0x20) |
Definition at line 61 of file spi_flash.c.
#define SPI_FLASH_TR_DONE (SPI_FLASH_BASE + 0x18) |
Definition at line 59 of file spi_flash.c.
#define SPI_FLASH_TX_CTL (SPI_FLASH_BASE + 0x24) |
Definition at line 62 of file spi_flash.c.
#define TIMEOUT (-1) /*MS*/ |
Definition at line 41 of file spi_flash.c.
|
static |
Definition at line 211 of file spi_flash.c.
Definition at line 348 of file spi_flash.c.
Definition at line 411 of file spi_flash.c.
|
static |
Definition at line 387 of file spi_flash.c.
Definition at line 78 of file spi_flash.c.
Definition at line 249 of file spi_flash.c.
|
static |
Send write disable command to SPI flash.
Definition at line 313 of file spi_flash.c.
|
static |
Send write enable command to SPI flash.
Definition at line 283 of file spi_flash.c.