📄 sdk7a404_cf_driver.h
字号:
/***********************************************************************
* $Workfile: sdk7a404_cf_driver.h $
* $Revision: 1.1 $
* $Author: WellsK $
* $Date: Apr 15 2004 15:07:08 $
*
* Project: SDK7A404 CompactFlash driver
*
* Description:
* This file contains driver support for the IDE mode CompactFlash
* interface on the SDK7A404 EVB.
*
* Revision History:
* $Log: //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/csps/lh7a404/bsps/sdk7a404/include/sdk7a404_cf_driver.h-arc $
*
* Rev 1.1 Apr 15 2004 15:07:08 WellsK
* Updated CF driver to allow multiple sector reads and writes.
*
* Rev 1.0 Jul 18 2003 11:45:26 WellsK
* Initial revision.
*
*
***********************************************************************
* SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
* OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
* AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
* SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
*
* SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
* FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
* SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
* FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
*
* COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
* CAMAS, WA
**********************************************************************/
#ifndef SDK7A404_CF_DRIVER_H
#define SDK7A404_CF_DRIVER_H
#ifdef __cplusplus
extern "C" {
#endif
#include "abl_types.h"
#include "sdk7a404_board.h"
/***********************************************************************
* SDK7A400 CompactFlash configuration commands (IOCTL commands and
* arguments)
**********************************************************************/
/* CompactFlash device commands (IOCTL commands) */
typedef enum {
CF_READ_BLOCKS, /* Issue command to read a series of sectors, use
arg = pointer to structure of CF_BLOCKS_T */
CF_WRITE_BLOCKS, /* Issue command to write a series of sectors, use
arg = pointer to structure of CF_BLOCKS_T */
CF_ERASE_SECTOR, /* Erase a single sector, use arg = sector number
to erase */
CF_GET_STATUS /* Return a CF interface status, use arg as a
value of type CF_IOCTL_STS_T */
} CF_IOCTL_CMD_T;
/* CompactFlash device arguments for CF_GET_STATUS command (IOCTL
arguments) */
typedef enum {
CF_CARD_DETECT, /* Returns 1 if a CF card is inserted in the EVB,
otherwise 0 */
CF_CARD_READY, /* Returns 1 if the card is ready for a new
command, otherwise 0 */
CF_CARD_BUSY /* Returns 1 if the card is busy, otherwise 0 */
} CF_IOCTL_STS_T;
/* Pointer to a sector block(s) read/write structure */
typedef struct
{
INT_32 sector; /* First sector to read */
INT_32 num_blocks; /* Number of sectors to read */
} CF_BLOCKS_T;
/***********************************************************************
* SDK7A400 CompactFlash API functions
**********************************************************************/
/* Open the CompactFlash device */
INT_32 cf_open(void *ipbase,
INT_32 arg);
/* Close the CompactFlash device */
STATUS cf_close(INT_32 devid);
/* CompactFlash device configuration block */
STATUS cf_ioctl(INT_32 devid,
INT_32 cmd,
INT_32 arg);
/* CompactFlash device read function */
INT_32 cf_read(INT_32 devid,
void *buffer,
INT_32 max_bytes);
/* CompactFlash device write function */
INT_32 cf_write(INT_32 devid,
void *buffer,
INT_32 n_bytes);
#ifdef __cplusplus
}
#endif
#endif /* SDK7A404_CF_DRIVER_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -