📄 epromdat.h
字号:
//****************************************************************************
//
// EpromData.h - the file contains the data to be burned into EEPROM.
//
// Copyright (c) 2001 Cirrus Logic, Inc.
//
//****************************************************************************
#ifndef EpromData
#define EpromData
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#define IN 1
#define OUT 0
typedef struct {
unsigned short int ee_addr;
unsigned short int w_count;
} BLOCK;
int EepromTest( void );
void parse_lines(char *StrArray[]);
int burn_it(void);
unsigned short int get_ee_addr(char *);
void process_directive(char *s);
char get_chksum_type(char *);
unsigned short int get_ee_addr(char *);
unsigned short int chksum(unsigned short int, unsigned short int);
unsigned char LFSR_chksum(unsigned short int, unsigned short int);
unsigned short int word_chksum(unsigned short int, unsigned short int);
void PnP_chksum(unsigned short int, unsigned short int);
unsigned short int byte_swap(unsigned short int );
void readBack(void);
int initEEPROM(void);
unsigned short int writeEE(unsigned short int , unsigned short int );
unsigned short int readEE(unsigned short int);
//
// Individual Address to be stored in EEPROM
//
unsigned short int ia_word[3]={0x0102,0x0304,0x0506};
//
// Serial Number to be stored in EEPROM
//
unsigned short int sn_word[2]={0x1234,0x5678};
unsigned short int chksum_base, crnt_word, EE_data[80], line_cnt;
unsigned char blk_count, chksum_state, ee_size;
BLOCK blocks[3];
//***************************************************************************
//
// EepromData contains the data to be burned into EEPROM.
//
//***************************************************************************
char *EepromData[] = {
"$addr=0",
"$chksum",
"A10E ; 14 bytes follow",
"2158",
"$ieee ; 3 words of individual address",
"0020 ; 1 word at PP_020",
"0300 ; IO base = 300h",
"$chksum=b ; 8-bit checksum on config data",
"$addr=1C",
"$chksum",
"$ieee ; 3 words of ieee address",
"11B0 ; ISA flags (IO Mode,IOCHRDY,UseSA,DMA disable,DMA burst,IRQ10)",
"0000 ; PacketPage Memory base",
"0000 ; Boot PROM base",
"0000 ; Boot PROM mask",
"0040 ; Transmission Control (ignore missing media)",
"0021 ; Adapter config (10Base-T circuitry only)",
"0000 ; Reserved - set to 0",
"0000 ; Product ID",
"BF0F ; Mfg Date - 8.15.95",
"$ieee ; 3 words of ieee address",
"0000 ; Reserved - set to 0",
"0000 ; Reserved - set to 0",
"0000 ; Reserved - set to 0",
"0000 ; Reserved - set to 0",
"$chksum=w",
"$chksum",
"630E ; EISA ID (low word)",
"4000 ; EISA ID (high word)",
"$snum ; 2 words of serial number",
"$chksum=L",
0
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -