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

📄 efd_hal.h

📁 intel p33上层驱动程序实例
💻 H
字号:
/*###########################################################################
###  Intel Confidential
###  Copyright (c) Intel Corporation 2007
###  All Rights Reserved.
###  ----------------------------------------------------------------------
###  Project: Intel Flash Driver
###
###  Module: efd_hal.h - The low-level code requires hardware specific 
###     Read and Write Bus operations in C in order to communicate
###     with the flash. The implementation of these operations is 
###     hardware platform dependent as it depends on the microprocessor 
###     on which the C code runs and on the location of the memory in the 
###     microprocessor's address space
###
###  $Archive: $
###  $Revision: $
###  $Date: $
###
###  $NoKeywords: $
##############################################################################
###
###  NOTICE OF LICENSE AGREEMENT
###
###  This code is provided by Intel Corp., and the use is governed
###  under the terms of a license agreement. See license agreement
###  for complete terms of license.
###
###  YOU MAY ONLY USE THE SOFTWARE SUBJECT TO THE TERMS OF THE
###  INTEL SOFTWARE LICENSE AGREEMENT.
###
########################################################################### */

#ifndef _EFD_HAL_H_
#define _EFD_HAL_H_


#ifdef __cplusplus
extern "C" {
#endif


/*
 * Describe the hardware configuration
 */
#define TIMEOUT_PROGRAM    10
#define TIMEOUT_BUFFER     60          /* max J3D-2ms; C3-n/a; P3x/A33-1.024ms */
#define TIMEOUT_ERASE      17000       /* max J3D-16sec; C3-8sec; P3x/A33-4sec*/          

#define TICKS_PER_SECOND   3250000     /* Clock frequency is 3.25 MHz */

#define DISABLE_INTERRUPTS       0xC0
#define ENABLE_INTERRUPTS        0x00

   
/*****************************************************************************
*
*  PLATFORM_TYPE
*
* DESCRIPTION:
*    Target platform - Big endian or Little endian.
*
* USAGE:
*    Set to 'BIGENDIAN' for bigendian platforms
*    Big endian format
*        In Big Endian format, the most significant byte of a word is stored at the lowest
*        numbered byte and the least significant byte at the highest numbered byte.
*    Set to 'LITTLEENDIAN' for littleendian platforms 
*    Little endian format
*        In Little Endian format, the lowest numbered byte in a word is considered the word抯
*        least significant byte, and the highest numbered byte the most significant.
*****************************************************************************/
#define BIGENDIAN            1
#define LITTLEENDIAN         2

#ifndef PLATFORM_TYPE
#define PLATFORM_TYPE      LITTLEENDIAN
#endif /* PLATFORM_TYPE */


/*
 * Describe access methods to the flash chip
 */

/****************************************************************************
 * EFD_HAL_WriteFlash
 *
 * DESCRIPTION:
 *    This function is used to write data to a flash.
 *    This method should be customized for use on the target hardware it can be
 *    replaced with macro definition to increase performance if it is possible.
 *    A function is used here instead to allow the user to expand it if necessary.
 *
 * PARAMETERS:
 *    IN       offset        Offset from the device base address
 *    IN       value         Data
 *
 * RETURNS:
 *      
 ***************************************************************************/
void EFD_HAL_WriteFlash( UINT32 offset,
                         UINT32 value );


/****************************************************************************
 * EFD_HAL_ReadFlash
 *
 * DESCRIPTION:
 *    This function is used to read data from a flash.
 *    This method should be customized for use on the target hardware it can be
 *    replaced with macro definition to increase performance if it is possible.
 *    A function is used here instead to allow the user to expand it if necessary.
 *
 * PARAMETERS:
 *    IN       offset        Offset from the device base address
 *
 * RETURNS:
 *      
 ***************************************************************************/
UINT32 EFD_HAL_ReadFlash( UINT32  offset );


/****************************************************************************
 * EFD_HAL_TimeOut
 *
 * DESCRIPTION:
 *    This function is used to check Time-Out value set for different flash
 *     operations.
 *
 * PARAMETERS:
 *    IN       usec        Time-Out value in millisecond
 *
 * RETURNS:
 *      
 ***************************************************************************/
FLASH_ERROR EFD_HAL_TimeOut( UINT32 usec );


/****************************************************************************
 * EFD_HAL_ControlInterrupt
 *
 * DESCRIPTION:
 *    This function is used to set interrupt level
 *
 * PARAMETERS:
 *
 * RETURNS:
 *      
 ***************************************************************************/
UINT32 EFD_HAL_ControlInterrupt( UINT32 irq_level );


/****************************************************************************
 * EFD_HAL_PendingInterrupt
 *
 * DESCRIPTION:
 *    This function is used to check if there is pending interrupt
 *
 * PARAMETERS:
 *
 * RETURNS:
 *      
 ***************************************************************************/
UINT32 EFD_HAL_PendingInterrupt( void );


#ifdef __cplusplus
}
#endif


#endif /* _EFD_HAL_H_ */

⌨️ 快捷键说明

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