#pragma sfr
#pragma DI
#pragma EI
#pragma NOP
#pragma STOP
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "pfdl.h"
/* Start user code for include. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
pfdl_descriptor_t my_pfdl_descriptor_t;
pfdl_status_t my_pfdl_status_t;
pfdl_request_t my_pfdl_request_t;
void ERROR_Handler(void);
void PFDL_Init(void);
void PFDL_Write(unsigned int Flash_index,unsigned int Data_Count);
unsigned char PFDL_BlankCheck(unsigned int Flash_index,unsigned int Length);
void PFDL_Erase(unsigned int Flash_index);
unsigned char PFDL_Iverify(unsigned int Flash_index,unsigned int Length);
void PFDL_Read(unsigned int Flash_index,unsigned int Data_Count);
unsigned char Execute_status;
signed char W_DataFla_buff[100] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,27,28,29,30,
31,32,33,34,35,36,37,38,39,40,
41,42,43,44,45,46,47,48,49,50,
51,52,53,54,55,56,57,58,59,60,
61,62,63,64,65,66,67,68,69,70,
71,72,73,74,75,76,77,78,79,80,
81,82,83,84,85,86,87,88,89,90,
91,92,93,94,95,96,97,98,99,100
};
signed char R_DataFla_buff[100];
unsigned int dat=0;
/***********************************************************************************************************************
Global variables and functions
***********************************************************************************************************************/
/* Start user code for global. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
* Function Name: main
* Description : This function implements main function.
* Arguments : None
* Return Value : None
***********************************************************************************************************************/
void main(void)
{
/* Start user code. Do not edit comment generated here */
DI();
PFDL_Init(); //使用前的初始化
Execute_status = PFDL_BlankCheck(0x0000,1024);//空白检测
if (Execute_status == 0x1b)
{
PFDL_Erase(0x0000); //擦除
}
PFDL_Write(0x0000,100); //写数据
Execute_status = PFDL_Iverify(0x0000,1024);//校验
if (Execute_status == 0x1b)
{
return;
}
//PFDL_Read(0x0010,100); //读数据
PFDL_Close(); //在不使用这个库的时候,需要关闭