⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flash_16x4.h

📁 at91系列通过串口烧写源程序
💻 H
字号:
//*-----------------------------------------------------------------------------//*      ATMEL Microcontroller Software Support  -  ROUSSET  -//*-----------------------------------------------------------------------------//* The software is delivered "AS IS" without warranty or condition of any//* kind, either express, implied or statutory. This includes without//* limitation any warranty or condition with respect to merchantability or//* fitness for any particular purpose, or against the infringements of//* intellectual property rights of others.//*-----------------------------------------------------------------------------//* File Name               : flash_16x4.h//* Object                  : FLASH definition file ://*                             AT49BV1604/AT49BV1604T//*                             AT49BV1614/AT49BV1604T//*//* 1.0 17/04/99 JPP        : Creation//* 1.1 26/04/00 EL         : Clean up//*-----------------------------------------------------------------------------#include "periph/stdc/std_c.h"#ifndef flash_16x4_h#define flash_16x4_h#define TRUE    1#define FALSE   0/* Define Flash Codes */#define FLASH_MANUFACTURER_CODE     0x001F#define KILO_BYTES          (1024)#define FLASH_SEQ_ADD1      (0x5555)#define FLASH_SEQ_ADD2      (0x2AAA)#define FLASH_CODE1         ((flash_word)(0xAA))#define FLASH_CODE2         ((flash_word)(0x55))#define ID_IN_CODE          ((flash_word)(0x90))#define ID_OUT_CODE         ((flash_word)(0xF0))#define WRITE_CODE          ((flash_word)(0xA0))#define ERASE_CODE          ((flash_word)(0x80))#define CHIP_ERASE_CODE     ((flash_word)(0x10))#define ERASE_SECTOR_CODE   ((flash_word)(0x30))#define ERASE_SECTOR_CODE1  ((flash_word)(0x80))#define ERASE_SECTOR_CODE2  ((flash_word)(0x30))/* Timeout loop count */#define TIME_OUT            0x07FFFFFF/* Error message */#define FLASH_OK                0x00#define FLASH_WRITE_TIME_OUT    0x81#define FLASH_WRITE_ERROR       0x82#define FLASH_SECTOR_ERROR      -1#define ERASED_SECTOR           0xFF#define UNERASED_SECTOR         0x00/* Defines organization structure */typedef struct OrgDef{    unsigned int    sector_number ;    unsigned int    sector_size ;} OrgDef ;/* Defines organization structure */typedef struct SectorDef{    unsigned int    sector ;} SectorDef ;/* Defines Flash device definition structure */typedef struct FlashDef{    unsigned int    flash_mask;    unsigned int    flash_sector_nb;    OrgDef          *flash_org;    SectorDef       *erase_sector ;}FlashDef;/* Function Prototyping File */extern void at91_flash_identify ( flash_word *base_addr, flash_word *manuf_code,flash_word *device_code );extern int  at91_erase_sector ( flash_word *base_addr, flash_word *sector_addr);extern int  at91_write_flash ( flash_word *base_addr, flash_word *load_addr,flash_word data );#endif /* flash_16x4_h */

⌨️ 快捷键说明

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