Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

atadev.h

Go to the documentation of this file.
00001 /*! \file atadev.h \brief IDE-ATA interface device driver. */
00002 //*****************************************************************************
00003 //
00004 // File Name    : 'atadev.h'
00005 // Title        : IDE-ATA interface device driver
00006 // Author       : Pascal Stang
00007 // Date         : 8/15/2004
00008 // Revised      : 8/15/2004
00009 // Version      : 0.1
00010 // Target MCU   : ARMmini LPC210x
00011 // Editor Tabs  : 4
00012 //
00013 // NOTE: This code is currently below version 1.0, and therefore is considered
00014 // to be lacking in some functionality or documentation, or may not be fully
00015 // tested.  Nonetheless, you can expect most functions to work.
00016 //
00017 // This code is distributed under the GNU Public License
00018 //      which can be found at http://www.gnu.org/licenses/gpl.txt
00019 //
00020 //*****************************************************************************
00021 
00022 
00023 #ifndef ATADEV_H
00024 #define ATADEV_H
00025 
00026 #include "global.h"
00027 #include "membus.h"
00028 #include "device.h"
00029 #include "atadevconf.h"
00030 
00031 // constants
00032 // ATA register offsets
00033 #define ATA_REG_DATA            0x00
00034 #define ATA_REG_ERROR           0x01
00035 #define ATA_REG_SECCOUNT        0x02
00036 #define ATA_REG_STARTSEC        0x03
00037 #define ATA_REG_CYLLO           0x04
00038 #define ATA_REG_CYLHI           0x05
00039 #define ATA_REG_HDDEVSEL        0x06
00040 #define ATA_REG_CMDSTATUS1      0x07
00041 #define ATA_REG_CMDSTATUS2      0x08
00042 #define ATA_REG_ACTSTATUS       0x09
00043 
00044 // typedefs and structures
00045 
00046 // ATA block device
00047 extern const DevBlock_t DevBlockAta;
00048 
00049 // Prototypes
00050 int atadevInit(void);
00051 int atadevReset(void);
00052 
00053 u08  atadevReadReg(u16 reg);
00054 void atadevWriteReg(u16 reg, u08 data);
00055 
00056 int atadevReadData(u08 *buffer, int numBytes);
00057 int atadevWriteData(u08 *buffer, int numBytes);
00058 
00059 #endif

Generated on Mon Nov 6 23:36:58 2006 for Procyon ARMlib by  doxygen 1.4.2