PAN1080 Peripheral API
Data Structures | Macros | Typedefs | Functions
pan_fmc.h File Reference

Panchip series fmc driver header file. More...

Go to the source code of this file.

Data Structures

struct  _flash_ids
 Structure with flash id. More...
 

Macros

#define CMD_ERASE_PAGE   (0X81)
 
#define CMD_ERASE_SECTOR   (0X20)
 
#define CMD_ERASE_32K   (0X52)
 
#define CMD_ERASE_64K   (0Xd8)
 
#define CMD_ERASE_CHIP   (0xc7)
 
#define CMD_READ_STATUS_L   (0x05)
 
#define CMD_READ_STATUS_H   (0x35)
 
#define CMD_WRITE_STATUS   (0x01)
 
#define OPS_WR_STU_REG_NOR   (0x00)
 
#define OPS_WR_STU_REG_ALL   (0x01)
 
#define CMD_FAST_READ   (0x0b)
 
#define CMD_NORM_READ   (0x03)
 
#define CMD_DREAD   (0x3B)
 
#define CMD_2READ   (0xBB)
 
#define CMD_QREAD   (0x6B)
 
#define CMD_4READ   (0xEB)
 
#define CMD_BURST_READ   (0x77)
 
#define BURST_READ_MODE_8   (0x00)
 
#define BURST_READ_MODE_16   (0x01)
 
#define BURST_READ_MODE_32   (0x02)
 
#define BURST_READ_MODE_64   (0x03)
 
#define CMD_TRIG   (0x01)
 
#define CMD_WRITE_ENABLE   (0x06)
 
#define FLASH_X1_MODE   0
 
#define FLASH_X2_MODE   1
 
#define FLASH_X4_MODE   2
 
#define QUAD_ENABLE_Pos   (9)
 
#define QUAD_ENABLE_Msk   (0x1ul << QUAD_ENABLE_Pos)
 
#define Write_Enable_Latch_Pos   (1)
 
#define Write_Enable_Latch_Msk   (0x1ul << Write_Enable_Latch_Pos)
 
#define Write_In_Process_Pos   (0)
 
#define Write_In_Process_Msk   (0x1ul << Write_In_Process_Pos)
 
#define Long_Time_Op_Pos   (17)
 
#define PAGE_SIZE   (256)
 
#define SECTOR_SIZE   (4096)
 

Typedefs

typedef struct _flash_ids FLASH_IDS_T
 Structure with flash id. More...
 

Functions

__STATIC_FORCEINLINE void FMC_EnterDeepPowerDownMode (FLCTL_T *fmc)
 Enter flash deep power down mode. More...
 
__STATIC_FORCEINLINE void FMC_ExitDeepPowerDownMode (FLCTL_T *fmc)
 Exit flash deep power down mode. More...
 
void FMC_GetFlashUniqueId (FLCTL_T *fmc)
 This function is used to get flash unique id,. More...
 
void FMC_GetFlashJedecId (FLCTL_T *fmc)
 This function is used to get flash jedec id,. More...
 
uint32_t FMC_GetFlashCodeAreaSize (FLCTL_T *fmc)
 Get Size of Flash in Bytes. More...
 
int FMC_EraseSector (FLCTL_T *fmc, unsigned long adr)
 Erase a 4KB Sector in Flash Memory. More...
 
int FMC_EraseBlock32k (FLCTL_T *fmc, unsigned long addr)
 Erase a 32KB Block in Flash Memory. More...
 
int FMC_EraseBlock64k (FLCTL_T *fmc, unsigned long addr)
 Erase a 64KB Block in Flash Memory. More...
 
int FMC_EraseChip (FLCTL_T *fmc)
 Erase the whole flash memory. More...
 
int FMC_EraseCodeArea (FLCTL_T *fmc, uint32_t addr, uint32_t len)
 Erase specific data in flash code area. More...
 
void InitIcache (FLCTL_T *fmc, uint32_t mode)
 This function is used to init Icache,. More...
 
int32_t FMC_GetCrc32Sum (FLCTL_T *fmc, uint32_t addr, uint32_t count, uint32_t *chksum)
 Calculate and read the CRC32 checksum of a specified flash area. More...
 
int BlankCheck (FLCTL_T *fmc, unsigned long adr, unsigned long sz)
 Blank check checks if memory is blank. More...
 
unsigned long Verify (FLCTL_T *fmc, unsigned long adr, unsigned long sz, unsigned char *buf)
 Verify in flash memory. More...
 
int ProgramPage (FLCTL_T *fmc, unsigned long adr, unsigned long sz, unsigned char *buf)
 Program page in flash memory. More...
 
unsigned char FMC_ReadStatusReg (FLCTL_T *fmc, unsigned char cmd)
 This function is used to read status, The Read Status Register can be read at any time. More...
 
unsigned char FMC_WriteEnable (FLCTL_T *fmc)
 This function is used to enable write function,. More...
 
void FMC_WriteStatusReg (FLCTL_T *fmc, unsigned char ops, unsigned int buf)
 This function is used to write status, The Read Status Register can be read at any time. More...
 
unsigned char FMC_ReadByte (FLCTL_T *fmc, unsigned int Addr, unsigned char cmd)
 This function is used to read flash,. More...
 
void FMC_WriteByte (FLCTL_T *fmc, unsigned int addr, unsigned char data)
 This function is used to write one byte to flash memory. More...
 
void FMC_WriteHalfWord (FLCTL_T *fmc, unsigned int addr, unsigned short data)
 This function is used to write halfword to flash memory. More...
 
unsigned int FMC_ReadWord (FLCTL_T *fmc, unsigned int Addr, unsigned char cmd)
 This function is used to read flash. More...
 
unsigned char * FMC_ReadPage (FLCTL_T *fmc, unsigned int Addr, unsigned char cmd)
 This function is used to read a page size (256 bytes) of data from flash. More...
 
int FMC_ReadStream (FLCTL_T *fmc, unsigned int Addr, unsigned char cmd, unsigned char *buf, unsigned int len)
 This function is used to read data stream from flash. More...
 
int FMC_WriteStream (FLCTL_T *fmc, unsigned int Addr, unsigned char *buf, unsigned int len)
 This function is used to write data stream to flash. More...
 
int FMC_ReadInfoArea (FLCTL_T *fmc, unsigned int Addr, unsigned char cmd, unsigned char *buf, unsigned int len)
 This function is used to read data from the flash 4KB INFO area. More...
 
int FMC_WriteInfoArea (FLCTL_T *fmc, unsigned int Addr, unsigned char *buf, unsigned int len)
 This function is used to write data to the flash 4KB INFO area. More...
 
int FMC_EraseInfoArea (FLCTL_T *fmc)
 This function is used to erase the flash 4KB INFO area. More...
 
void FMC_SetFlashMode (FLCTL_T *fmc, uint32_t mode, bool enhance)
 This function is used to set flash work mode. More...
 
void FMC_ExitEnhanceMode (FLCTL_T *fmc)
 This function is used to exit flash enhanced read mode. More...
 
void FMC_EnterEnhanceMode (FLCTL_T *fmc, uint32_t mode)
 This function is used to enter flash enhanced read mode. More...
 
void FMC_EnableAutoDp (FLCTL_T *fmc)
 This function is used to enable auto enter deep power down function. More...
 
void FMC_DisableAutoDp (FLCTL_T *fmc)
 This function is used to disable auto enter deep power down function. More...
 
void FMC_SetRdpWaitCount (FLCTL_T *fmc, uint32_t cnt)
 This function is used to set wait count for release from Deep Power-down mode. More...
 

Detailed Description

Panchip series fmc driver header file.

Version
V1.00
Revision
3
Date
21/11/12 18:33