📄 flash.h
字号:
/***************************************************************************
* File: flash.h - Common definition for FLASH
*
* The content of this file or document is CONFIDENTIAL and PROPRIETARY
* to Jade Technologies Co., Ltd. It is subject to the terms of a
* License Agreement between Licensee and Jade Technologies Co., Ltd.
* restricting among other things, the use, reproduction, distribution
* and transfer. Each of the embodiments, including this information
* and any derivative work shall retain this copyright notice.
*
* Copyright (c) 2005 Jade Technologies Co., Ltd.
* All rights reserved.
****************************************************************************/
#ifndef _FLASH_H
#define _FLASH_H
#include <platform.h> // hardware information of arm 926 board
#include <windows.h>
#include <ceddk.h>
#include <types.h>
#include <excpt.h>
#include <tchar.h>
#include <devload.h>
#include <diskio.h>
#include <storemgr.h>
#include <pm.h>
#include <pkfuncs.h>
//---------------------------------------------------------------
// Common Macros
//---------------------------------------------------------------
#define MSG_SYS 0
#define MSG_FUNCS 0
#define MSG_DATA 0
#define MSG_DISK 0
#define TOTAL_FLASH_SIZE 0x200*0x400 // 512k
#define START_FLASH_ADDR 0xC4000000
#define FLASH_OFFSET 0x20000 //128k
#define BYTES_PER_SECTOR 0x1000
#define BYTES_PER_BLOCK 0x1000
#define CRC_SAVE_OFFSET 0x1C000
#define BASE_FLASH_ADDR (START_FLASH_ADDR + FLASH_OFFSET) //0xC4020000
#define USERDEF_SIZE (TOTAL_FLASH_SIZE - FLASH_OFFSET) //384k
#define SST_ID 0xBF /* SST Manufacturer's ID code */
#define SST_39VF040 0xD7 /* SST 39VF040 device code */
#define FLASH(address) (*(volatile unsigned char *)(address))
#define FLASH_COMMAND(base,cmd) (FLASH(base + dwBlockStartAddr) = (cmd))
#define FLASH_DATA(base,cmd) (FLASH(base) = (cmd))
#define CACHE_FLAG_NULL 0xFFFFFFFF
//-------------------------------------------------------------------------------
// Functions Declaration
//-------------------------------------------------------------------------------
#ifdef __cplusplus
extern "C"
{
#endif
int FLA_cfi_set_lock_bits (unsigned long address);
int FLA_cfi_clear_lock_bits (unsigned long address);
int FLA_cfi_write_byte (unsigned long address, unsigned char byte);
int FLA_cfi_read_byte (unsigned long address, unsigned char * pbyte);
int FLA_cfi_erase_block (unsigned long address);
void FLA_cfi_erase_chip (void);
int FLA_DoDiskIO(unsigned long Opcode, PSG_REQ pSgr);
BOOL FLA_GetFolderName(LPWSTR ActivePath, LPWSTR FolderName, unsigned long cBytes, unsigned long * pcBytes);
BOOL FLA_GetDeviceInfo(PSTORAGEDEVICEINFO pInfo);
unsigned short CRC_Calculate(unsigned char *pBuf, int length);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -