You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.2 KiB

#ifndef _app_paraid_H
#define _app_paraid_H
#include "../bsp/bsp_paraid.h"
#include "../bsp/bsp_relay.h"
#include "../app/app_common.h"
#define D_page_max 127 ///128page * 512byte = 64K
#define FLASH_PARAM_PAGE_0 (0) //127page写入不成功,0可以
#define FLASH_PARAM_PAGE_1 (1) //127page写入不成功,0可以
#define D_flash_Addr_start(page) (0x0 + 512*(page))
#define D_flash_Addr_end(page) (0x0 + 512*(page + 1)-1)
#define FLASH_PARAM_PAGE_FILTER0 0xAA
#define FLASH_PARAM_PAGE_FILTER1 0x55
struct _s_flash_page0
{
U8 page;
U8 filter0;
U8 filter1;
U8 relay_status[RELAY_NUM];
TS_PaperCalib ts_paper_calib[PAPER_BOX_NUM];
U8 crc[2];
};
struct _s_flash_page1
{
U8 page;
U8 filter0;
U8 filter1;
U32 relay_oper_max_time[RELAY_NUM];
U8 crc[2];
};
struct _s_flash_data
{
U8 page0;
struct _s_flash_page0 f_page0;
U8 page0_ok;
U8 page1;
struct _s_flash_page1 f_page1;
U8 page1_ok;
};
extern struct _s_flash_data s_flash_data;
extern void L3_flash_init();
extern void L3_flash_read_param();
extern void L3_flash_erase_page0();
extern void L3_flash_read_page0();
extern void L3_flash_write_page0();
extern void L3_flash_erase_page1();
extern void L3_flash_read_page1();
extern void L3_flash_write_page1();
#endif //_app_paraid_H calib