📄 eeprom.h
字号:
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
// Copyright (C) 2004-2006, Freescale Semiconductor, Inc. All Rights Reserved.
// THIS SOURCE CODE, AND ITS USE AND DISTRIBUTION, IS SUBJECT TO THE TERMS
// AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENT
//
//------------------------------------------------------------------------------
//
// Header: eeprom.h
//
// Provides definitions for EEPROM attached to CS8900 on ADS main board.
//
//------------------------------------------------------------------------------
#ifndef __EEPROM_H__
#define __EEPROM_H__
#if __cplusplus
extern "C" {
#endif
//------------------------------------------------------------------------------
// GENERAL MODULE CONSTANTS
//------------------------------------------------------------------------------
// Supported EEPROMs:
// 1 - Non sequential (eg. Cxx)
// 0 - Sequential (eg. CSxx)
//
// C46, CS46 64 words
// C56, CS56 128 words
// C66, CS66 256 words
#define EEPROM_SIZE_WORDS 64
// A valid reset configuration in a EEPROM connected to the CS8900
// allows the CS8900 to be configured via the EEPROM. The reset
// configuration can vary based on manufacturing needs. The default
// allows BOOT PROM ADDRESS, BOOT PROM MASK to be configured.
// The reset configuration must start from address 0 of the EEPROM.
// It's format is detailed in the CS8900 specification.
// Note: Since the EEPROM is accessed via the CS8900, the EEPROM data
// access width is restricted to word access only.
// Ethernet driver will configure CS8900 with all necessary parameters. Provide
// a minimal reset configuration block that satisfies the CS8900 EEPROM interface.
// Format of reset control block is described in CS8900 datasheet.
//
// 0xA002 - Configuration Block Header:
// EEPROM present (0xA << 12)
// Sequential EEPROM (0x0 << 8)
// 2 bytes in block (0x02 << 0)
//
// 0x5E00 - Checksum value
// Checksum byte (0x5E << 8)
//
#define EEPROM_DEFAULT_RESET_CFG { 0xA002, 0x5E00 }
#define EEPPOM_RESET_CFG_WORDS 2
#define EEPROM_USER_DATA_MAX_WORDS (EEPROM_SIZE_WORDS - EEPPOM_RESET_CFG_WORDS)
#define EEPROM_USER_DATA_START_WORD EEPPOM_RESET_CFG_WORDS
//------------------------------------------------------------------------------
// FUNCTION PROTOTYPES
//------------------------------------------------------------------------------
BOOL BSPEEPROMInit(BYTE *pAddress);
BOOL BSPEEPROMWriteUserData(UINT16 offset, UINT16 *pwData, UINT32 numWords);
BOOL BSPEEPROMReadUserData(UINT16 offset, UINT16 *pwData, UINT32 numWords);
#ifdef __cplusplus
}
#endif
#endif // __EEPROM_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -