Microchip® Advanced Software Framework

wilc/driver/source/spi_flash.c File Reference

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)
 Get size of SPI Flash. More...
 
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*/

static sint8 spi_flash_probe ( uint32 u32FlashId)
static

uint32 gu32InernalFlashSize = 0
static

Referenced by spi_flash_get_size().