?? ata.h
字號:
/*H**************************************************************************
* NAME: ata.h
*----------------------------------------------------------------------------
* Copyright (c) 2002 Atmel.
*----------------------------------------------------------------------------
* RELEASE: snd1c-demo-hdd-0_2_0
* REVISION: 1.1
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the ATA/IDE norm definitions for ATA
*****************************************************************************/
#ifndef _ATA_H_
#define _ATA_H_
/*_____ I N C L U D E S ____________________________________________________*/
/*_____ M A C R O S ________________________________________________________*/
#define ATA_CMD_READ_SECTOR ((Byte)0x20)
#define ATA_CMD_READ_LONG ((Byte)0x22)
#define ATA_CMD_WRITE_SECTOR ((Byte)0x30)
#define ATA_CMD_WRITE_LONG ((Byte)0x32)
#define ATA_CMD_EXECUTE_DEVICE_DIAGNOSTIC ((Byte)0x90)
#define ATA_CMD_IDENTIFY_DRIVE ((Byte)0xEC)
#define ATA_CMD_READ_MULTIPLE ((Byte)0xC4)
#define ATA_CMD_WRITE_MULTIPLE ((Byte)0xC5)
#define ATA_CMD_SET_FEATURES ((Byte)0xEF)
#define ATA_RESET_CMD ((Byte)0xFC)
#define ATA_LBA_MODE ((Byte)0xE0)
/* LBA : B6 = 1 -> LBA mode
B5 = 1
B4 = 1 -> Drive number */
#define ATA_CHS_MODE ((Byte)0xA0)
/* Chip Detect Pin definition */
#define Hdd_disk_size() ((Uint32)(hdd_mem_size))
#define Hdd_disk_size_0() (((Byte *)&hdd_mem_size)[0])
#define Hdd_disk_size_1() (((Byte *)&hdd_mem_size)[1])
#define Hdd_disk_size_2() (((Byte *)&hdd_mem_size)[2])
#define Hdd_disk_size_3() (((Byte *)&hdd_mem_size)[3])
/* Size of a block = one sector = 512 bytes */
#define Hdd_block_size() ((Uint32)512)
#define Hdd_block_size_0() ((Byte)(Hdd_block_size() >> 24))
#define Hdd_block_size_1() ((Byte)(Hdd_block_size() >> 16))
#define Hdd_block_size_2() ((Byte)(Hdd_block_size() >> 8))
#define Hdd_block_size_3() ((Byte)Hdd_block_size())
/*_____ D E F I N I T I O N ________________________________________________*/
extern xdata Uint32 ata_mem_size;
/*_____ D E C L A R A T I O N ______________________________________________*/
bit hdd_init(void); /* init media */
Uint16 ata_identify_device(); /* give information about media */
bit hdd_read_sector(Uint16); /* read n sectors from media to usb */
bit hdd_write_sector(Uint16); /* write n sectors to media from usb */
bit hdd_read_open(Uint32, Byte); /* write open function */
bit hdd_write_open(Uint32, Byte); /* read open function */
void hdd_read_close(); /* read close function */
void hdd_write_close(); /* write close function */
Byte hdd_read_byte(void); /* read one byte from media */
Uint32 hdd_read_long_big_endian(void); /* read one long big endian coded data */
bit hdd_write_byte(Byte); /* write one byte to media */
bit hdd_check_presence(); /* check disk presence */
void hdd_read_one_sector(); /* read one sector in global buffer */
void hdd_write_one_sector(); /* read one sector in global buffer */
s_format xdata *hdd_format(void); /* give format information about media */
extern void hdd_download_data_usb(void); /* optimized download data from usb */
extern void ata_load_sector(void); /* optimized load data */
extern void ata_download_sector(void); /* optimized download data */
#endif /* _ATA_H_ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -