?? def.h
字號:
/*------------------------------------------------------------------------------------------*
1.The Structure of the flash memory:
Offset and layout:
|----------------------|<-0x000000
| Program Blocks |
|----------------------|<-0x080000
| Config Blocks |
|----------------------|<-0x0C0000
| Record Blocks |
|----------------------|<-0x100000
| Video Blocks |
|----------------------|<-0x200000
*------------------------------------------------------------------------------------------*/
//Note:here,we use a symbol,$,to tell users that the
//DEFINITION which is labeled by it can be changed by you.
//Global Definitions
//-----------------------------------------------------------------------------------------//
#ifndef __FDEF_H__ //Flash definations
#define __FDEF_H__
#define BUFFER_SIZE 0x30//$
#define FLASH_FLAG 0x10101010//$
#define TWO_BYTES 4
#define BF533_FLASH_SECTOR_NUM 40
#define FLASH_BASE_ADDRESS 0x20000000
#define BF533_FLASH_SECTOR_SIZE 0x10000
//-----------------------------------------------------------------------------------------//
//Led delay loop num
#define TOGGLE_LOOP_NUM 0xa //$
#define BLINK_LOOP_NUM 0x8 //$
#define ERROR_LOOP_NUM 0x1c//$
//-----------------------------------------------------------------------------------------//
//Reset Type Selection
#define ONE_WRITE_CYCLE 0
#define TWO_WRITE_CYCLES 1
//-----------------------------------------------------------------------------------------//
//Flash partition
//Question:How do you know how big your application program is?
#define PROGRAM_PARTITION_OFFSET_ADDRESS 0x000000//$:-0x07FFFF:0.5M bytes(8 BLOCKS)
#define CONFIG_PARTITION_OFFSET_ADDRESS 0x080000//$:-0x0BFFFF:0.25M bytes(4 BLOCKS)
#define RECORD_PARTITION_OFFSET_ADDRESS 0x0C0000//$:-0xFFFFFF:0.25M bytes(4 BLOCKS)
#define VIDEO_PARTITION_OFFSET_ADDRESS 0x100000//$:-0x1FFFFF:1.0M bytes(16 BLOCKS)
#define RESERVED_PARTITION_OFFSET_ADDRESS 0x200000//$:-0x1FFFFF:1.0M bytes(16 BLOCKS)
//The left address that can be used ranges from 0x20200000-2020FFFF and 0x20290000-2028FFFF ...
//-----------------------------------------------------------------------------------------//
//Data segment Size
#define CONFIG_PARAM_SIZE 0x0000400//$:1k per strip(must be less than a block size)
#define RECORD_STRIP_SIZE 0x0000400//$:1k per strip(must be less than a block size)
#define VIDEO_IMAGE_SIZE 0x0040000//$:256k per image(must be divided exactly by a block size)
//-----------------------------------------------------------------------------------------//
//Maximum number
#define CONFIG_PARAM_NUM (unsigned long)((RECORD_PARTITION_OFFSET_ADDRESS-CONFIG_PARTITION_OFFSET_ADDRESS)/CONFIG_PARAM_SIZE)
#define RECORD_STRIP_NUM (unsigned long)((VIDEO_PARTITION_OFFSET_ADDRESS-RECORD_PARTITION_OFFSET_ADDRESS)/RECORD_STRIP_SIZE)
#define VIDEO_IMAGE_NUM (unsigned long)((RESERVED_PARTITION_OFFSET_ADDRESS-VIDEO_PARTITION_OFFSET_ADDRESS)/VIDEO_IMAGE_SIZE)
//-----------------------------------------------------------------------------------------//
//Stuff Num
#define STUFF_ITEM_NUM 3//$
#define FLASH_ITEM_NUM 5//$
//-----------------------------------------------------------------------------------------//
//Stuff
#define STUFF_CONFIG_PARAM 0//$
#define STUFF_RECORD_STRIP 1//$
#define STUFF_VIDEO_IMAGE 2//$
#define STUFF_PROGRAM_CODE 3//$
//-----------------------------------------------------------------------------------------//
//Erase Stride
//Description:Considering their diffent stuff size which has great
// influence on the way of writing and erasing data,it's
// suggested to use ERASE STRIDE.
//Note: The erase stride of Video image stuff is a little
// different from that of Config param or Record strip stuff
// due to their different stuff size.
#define CONFIG_PARAM_ERASE_STRIDE ((int)(CONFIG_PARAM_SIZE/BF533_FLASH_SECTOR_SIZE)+1)*BF533_FLASH_SECTOR_SIZE
#define RECORD_STRIP_ERASE_STRIDE ((int)(RECORD_STRIP_SIZE/BF533_FLASH_SECTOR_SIZE)+1)*BF533_FLASH_SECTOR_SIZE
#define VIDEO_IMAGE_ERASE_STRIDE ((int)(VIDEO_IMAGE_SIZE/BF533_FLASH_SECTOR_SIZE))*BF533_FLASH_SECTOR_SIZE
//-----------------------------------------------------------------------------------------//
#endif //__FDEF_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -