35#define CMD_ERASE_PAGE (0X81)
36#define CMD_ERASE_SECTOR (0X20)
37#define CMD_ERASE_32K (0X52)
38#define CMD_ERASE_64K (0Xd8)
39#define CMD_ERASE_CHIP (0xc7)
45#define CMD_READ_STATUS_L (0x05)
46#define CMD_READ_STATUS_H (0x35)
47#define CMD_WRITE_STATUS (0x01)
53#define OPS_WR_STU_REG_NOR (0x00)
54#define OPS_WR_STU_REG_ALL (0x01)
60#define CMD_FAST_READ (0x0b)
61#define CMD_NORM_READ (0x03)
62#define CMD_DREAD (0x3B)
63#define CMD_2READ (0xBB)
64#define CMD_QREAD (0x6B)
65#define CMD_4READ (0xEB)
71#define CMD_BURST_READ (0x77)
72#define BURST_READ_MODE_8 (0x00)
73#define BURST_READ_MODE_16 (0x01)
74#define BURST_READ_MODE_32 (0x02)
75#define BURST_READ_MODE_64 (0x03)
79#define CMD_TRIG (0x01)
80#define CMD_WRITE_ENABLE (0x06)
85#define FLASH_X1_MODE 0
86#define FLASH_X2_MODE 1
87#define FLASH_X4_MODE 2
90#define QUAD_ENABLE_Pos (9)
91#define QUAD_ENABLE_Msk (0x1ul << QUAD_ENABLE_Pos)
92#define Write_Enable_Latch_Pos (1)
93#define Write_Enable_Latch_Msk (0x1ul << Write_Enable_Latch_Pos)
94#define Write_In_Process_Pos (0)
95#define Write_In_Process_Msk (0x1ul << Write_In_Process_Pos)
96#define Long_Time_Op_Pos (17)
98#define PAGE_SIZE (256)
99#define SECTOR_SIZE (4096)
132 fmc->X_FL_CTL = (0<<8) | (0x01<<0);
133 fmc->X_FL_WD[0] = 0xB9;
135 while(fmc->X_FL_TRIG){};
149 fmc->X_FL_CTL = (0<<8) | (0x01<<0);
150 fmc->X_FL_WD[0] = 0xAB;
152 while(fmc->X_FL_TRIG){};
272extern int32_t
FMC_GetCrc32Sum(FLCTL_T *fmc,uint32_t addr, uint32_t count, uint32_t *chksum);
282extern int BlankCheck (FLCTL_T *fmc,
unsigned long adr,
unsigned long sz);
293extern unsigned long Verify(FLCTL_T *fmc,
unsigned long adr,
unsigned long sz,
unsigned char *buf);
304extern int ProgramPage (FLCTL_T *fmc,
unsigned long adr,
unsigned long sz,
unsigned char *buf);
341extern unsigned char FMC_ReadByte(FLCTL_T *fmc,
unsigned int Addr,
unsigned char cmd);
350extern void FMC_WriteByte(FLCTL_T *fmc,
unsigned int addr,
unsigned char data);
368extern unsigned int FMC_ReadWord(FLCTL_T *fmc,
unsigned int Addr,
unsigned char cmd);
377extern unsigned char *
FMC_ReadPage(FLCTL_T *fmc,
unsigned int Addr,
unsigned char cmd);
388extern int FMC_ReadStream(FLCTL_T *fmc,
unsigned int Addr,
unsigned char cmd,
unsigned char *buf,
unsigned int len);
398extern int FMC_WriteStream(FLCTL_T *fmc,
unsigned int Addr,
unsigned char *buf,
unsigned int len);
409extern int FMC_ReadInfoArea(FLCTL_T *fmc,
unsigned int Addr,
unsigned char cmd,
unsigned char *buf,
unsigned int len);
419extern int FMC_WriteInfoArea(FLCTL_T *fmc,
unsigned int Addr,
unsigned char *buf,
unsigned int len);
__STATIC_FORCEINLINE void FMC_ExitDeepPowerDownMode(FLCTL_T *fmc)
Exit flash deep power down mode.
Definition: pan_fmc.h:146
void FMC_SetFlashMode(FLCTL_T *fmc, uint32_t mode, bool enhance)
This function is used to set flash work mode.
__STATIC_FORCEINLINE void FMC_EnterDeepPowerDownMode(FLCTL_T *fmc)
Enter flash deep power down mode.
Definition: pan_fmc.h:129
void FMC_GetFlashUniqueId(FLCTL_T *fmc)
This function is used to get flash unique id,.
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.
unsigned long Verify(FLCTL_T *fmc, unsigned long adr, unsigned long sz, unsigned char *buf)
Verify in flash memory.
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.
void FMC_WriteHalfWord(FLCTL_T *fmc, unsigned int addr, unsigned short data)
This function is used to write halfword to flash memory.
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.
uint32_t FMC_GetFlashCodeAreaSize(FLCTL_T *fmc)
Get Size of Flash in Bytes.
struct _flash_ids FLASH_IDS_T
Structure with flash id.
void FMC_GetFlashJedecId(FLCTL_T *fmc)
This function is used to get flash jedec id,.
void FMC_WriteByte(FLCTL_T *fmc, unsigned int addr, unsigned char data)
This function is used to write one byte to flash memory.
void FMC_SetRdpWaitCount(FLCTL_T *fmc, uint32_t cnt)
This function is used to set wait count for release from Deep Power-down mode.
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.
int FMC_EraseBlock32k(FLCTL_T *fmc, unsigned long addr)
Erase a 32KB Block in Flash Memory.
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.
int FMC_EraseCodeArea(FLCTL_T *fmc, uint32_t addr, uint32_t len)
Erase specific data in flash code area.
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.
unsigned int FMC_ReadWord(FLCTL_T *fmc, unsigned int Addr, unsigned char cmd)
This function is used to read flash.
int FMC_EraseSector(FLCTL_T *fmc, unsigned long adr)
Erase a 4KB Sector in Flash Memory.
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.
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.
int FMC_EraseBlock64k(FLCTL_T *fmc, unsigned long addr)
Erase a 64KB Block in Flash Memory.
#define CMD_TRIG
Definition: pan_fmc.h:79
void FMC_DisableAutoDp(FLCTL_T *fmc)
This function is used to disable auto enter deep power down function.
int FMC_EraseChip(FLCTL_T *fmc)
Erase the whole flash memory.
int FMC_EraseInfoArea(FLCTL_T *fmc)
This function is used to erase the flash 4KB INFO area.
void FMC_ExitEnhanceMode(FLCTL_T *fmc)
This function is used to exit flash enhanced read mode.
unsigned char FMC_ReadByte(FLCTL_T *fmc, unsigned int Addr, unsigned char cmd)
This function is used to read flash,.
unsigned char FMC_WriteEnable(FLCTL_T *fmc)
This function is used to enable write function,.
int ProgramPage(FLCTL_T *fmc, unsigned long adr, unsigned long sz, unsigned char *buf)
Program page in flash memory.
int BlankCheck(FLCTL_T *fmc, unsigned long adr, unsigned long sz)
Blank check checks if memory is blank.
void FMC_EnableAutoDp(FLCTL_T *fmc)
This function is used to enable auto enter deep power down function.
void InitIcache(FLCTL_T *fmc, uint32_t mode)
This function is used to init Icache,.
void FMC_EnterEnhanceMode(FLCTL_T *fmc, uint32_t mode)
This function is used to enter flash enhanced read mode.
Structure with flash id.
Definition: pan_fmc.h:110
uint8_t memory_type_id
Definition: pan_fmc.h:115
uint8_t uid[16]
Definition: pan_fmc.h:119
uint8_t memory_density_id
Definition: pan_fmc.h:116
uint8_t manufacturer_id
Definition: pan_fmc.h:111
uint8_t d[2]
Definition: pan_fmc.h:113