WILC stack SPI Flash internal APIs implementation.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
#include "common/include/nm_common.h"
#include "driver/source/nmbus.h"
#include "bsp/include/nm_bsp.h"
#include "driver/source/nmdrv.h"
Macros | |
#define | DUMMY_REGISTER (0x1084) |
#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 10000 /*MS*/ |
Functions | |
uint32 | spi_flash_get_size (void) |
static sint8 | spi_flash_probe (uint32 *u32FlashId) |
static uint32 | spi_flash_rdid (void) |
Variables | |
static uint32 | gu32InernalFlashSize = 0 |
#define DUMMY_REGISTER (0x1084) |
Referenced by spi_flash_rdid().
#define SPI_FLASH_BASE (0x10200) |
#define SPI_FLASH_BUF1 (SPI_FLASH_BASE + 0x0c) |
Referenced by spi_flash_rdid().
#define SPI_FLASH_BUF2 (SPI_FLASH_BASE + 0x10) |
#define SPI_FLASH_BUF_DIR (SPI_FLASH_BASE + 0x14) |
Referenced by spi_flash_rdid().
#define SPI_FLASH_CMD_CNT (SPI_FLASH_BASE + 0x04) |
Referenced by spi_flash_rdid().
#define SPI_FLASH_DATA_CNT (SPI_FLASH_BASE + 0x08) |
Referenced by spi_flash_rdid().
#define SPI_FLASH_DMA_ADDR (SPI_FLASH_BASE + 0x1c) |
Referenced by spi_flash_rdid().
#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) |
Referenced by spi_flash_rdid().
#define SPI_FLASH_TX_CTL (SPI_FLASH_BASE + 0x24) |
#define TIMEOUT 10000 /*MS*/ |
uint32 spi_flash_get_size | ( | void | ) |
References gu32InernalFlashSize, M2M_ERR, M2M_INFO, M2M_SUCCESS, and spi_flash_probe().
References M2M_SUCCESS, nm_read_reg(), nm_write_reg(), and spi_flash_rdid().
Referenced by spi_flash_get_size().
|
static |
References DUMMY_REGISTER, M2M_PRINT, nm_read_reg(), nm_write_reg(), SPI_FLASH_BUF1, SPI_FLASH_BUF_DIR, SPI_FLASH_CMD_CNT, SPI_FLASH_DATA_CNT, SPI_FLASH_DMA_ADDR, and SPI_FLASH_TR_DONE.
Referenced by spi_flash_probe().
|
static |
Referenced by spi_flash_get_size().