#ifndef __def_dflash__
#define __def_dflash__


enum	FLASH_BLK
{
	DFLSH=0,					
	CFLSH					
};

#define	DFLASH_BASE		0x0x00800000

#define FLASH_BLOCK_B0F1 0x02	//0x08000 -- 0x0BFFF  16KB
#define FLASH_BLOCK_B0F2 0x04	//0x0C000 -- 0x0FFFF  16KB
#define FLASH_BLOCK_B0F3 0x08	//0x10000 -- 0x17FFF  32KB
#define FLASH_BLOCK_B0F4 0x10	//0x18000 -- 0x1FFFF  32KB
#define FLASH_BLOCK_B0F5 0x20	//0x20000 -- 0x3FFFF 128KB
#define FLASH_BLOCK_B0F6 0x40	//0x40000 -- 0x5FFFF 128KB
#define FLASH_BLOCK_B0F7 0x80	//0x60000 -- 0x7FFFF 128KB

#define ADD_OFFSET_DATA_FLASH_0	0x800000
#define ADD_OFFSET_DATA_FLASH_1	0x804000
#define ADD_OFFSET_DATA_FLASH_2	0x808000
#define ADD_OFFSET_DATA_FLASH_3	0x80C000

#define DATA_FLASH_BLOCK_LEN			0x4000


#define DFLASH_DATA_ADDRESS				ADD_OFFSET_DATA_FLASH_0		
#define DFLASH_DATA_BLOCK					1	
#define DFLASH_SIGN_ADDRESS				(ADD_OFFSET_DATA_FLASH_0+0x10)		


#define DFLASH_DTC_ADDRESS				(ADD_OFFSET_DATA_FLASH_2+0x10)		
#define DFLASH_DTC_SIGN_ADDRESS		(ADD_OFFSET_DATA_FLASH_2 + 0x80)
#define DFLASH_DTC_BLOCK						4
#define V_DTC_SIGN									(10002)



#define NSETUP_DATA	250		// SETUP저장 갯수.

//#define ENABLE_SETUP_EEPROM		// SETUP 을 EEPROM 에서 읽는것이 가능하다.

#define V_c_log_disable_10ms			6000		// 60 sec

#define V_c_setup_write_lag_10ms		200		// 8sec


typedef struct
{
	uint32_t mask0;
	uint32_t mask1;
	uint32_t mask2;
	uint32_t addrStart;
	uint32_t addrLast;
} FLASH_MAP_TYPE;

#define FLASH_SIZE_QPAGE		128		/* 128 byte for quad page */
#define FLASH_SIZE_PAGE			32		/* 32 byte for page */
#define FLASH_SIZE_DWORD		8		/* 16 byte for double word */
#define FLASH_PROGRAM_SIZE		FLASH_SIZE_QPAGE

#define FLASH_BLOCK_L0		0x00010000	/* DFLASH 0x00800000 - 0x00803FFF */
#define FLASH_BLOCK_L1		0x00010000	/* DFLASH 0x00804000 - 0x00807FFF */
#define FLASH_BLOCK_M0		0x00000001	/* DFLASH 0x00808000 - 0x0080FFFF */
#define FLASH_BLOCK_M1		0x00000002	/* DFLASH 0x00810000 - 0x00817FFF */

#define FLASH_MAPPING_NUM		5


enum	
{
	NDTC_0,
	NDTC_OLD_0,
	NDTC_1,
	NDTC_OLD_1,
	NDTC_NEW,
	NDTC_END
};		


#endif

