flash.h

来自「bootloader源代码」· C头文件 代码 · 共 64 行

H
64
字号
/***************************************** Copyright (c) 2001-2002  Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************//* This file is part of the boot loader *//* * flash.h * * flash driver from scratch * following CFI (Common Flash Memory Interface) Specification 2.0 * support multiple flashes * * first revision by Ho Lee 10/31/2002 * code cleanup by Ho Lee 11/08/2002 */#ifndef __BOOTLOADER_FLASH_H#define __BOOTLOADER_FLASH_H#include "config.h"#ifdef SUPPORT_FLASH// error codesenum { FLASH_OK, FLASH_NOTEXIST, FLASH_NOREGION, FLASH_NOTREADY, FLASH_VERIFY_FAIL, FLASH_WRITE_FAULT };// constant definitions#define FLASH_MAX_CHIPSET				2#define FLASH_MAX_ERASE_REGIONS			8//// function prototypes//// init & basicint flash_found(void);int flash_addr_found(unsigned int addr);int flash_init(unsigned int base, int force);// eraseint flash_erase_all(void);int flash_erase_oneblock(unsigned int addr);int flash_erase_region(unsigned int addr, unsigned int len);// read / writeint flash_read_data(unsigned int addr, void *data, int len);int flash_writable(unsigned int addr, int len);int flash_write_onebyte(unsigned int addr, unsigned int data);int flash_write_oneword(unsigned int addr, unsigned int data);int flash_write_data(unsigned int addr, unsigned char *data, int len);// miscellaneousvoid flash_list(void *vpcfi);int flash_calcblock(unsigned int addr, unsigned int *pstart, unsigned int *plen);#endif	// SUPPORT_FLASH#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?