?? ata.h
字號:
/***********************************************
module: ata.h
notice: copyright(c)2001 Mike
***********************************************/
#ifndef ATA_H
#define ATA_H
/*CONTROL WORD: */
#define DEVICE0 0x00
#define DEVICE1 0x01
#define PIO_MODE0 0x00
#define PIO_MODE1 0x02
#define ATA_RESET 0x04
#define CHIP_SRST 0x88
#define DMA_STOP 0x80
#define DMA_WRITE 0x01
#define DMA_READ 0x00
#define PIO_STOP 0x80
#define PIO_WRITE 0x01
#define PIO_READ 0x00
#define CHIP_MODE_DEFAULT 0x00
/* data sructure definition */
typedef struct {
unsigned char feature;
unsigned char sector_count;
unsigned char sector_number;
unsigned char cylinder_high;
unsigned char cylinder_low;
unsigned char device_head;
unsigned char command;
} device_reg_set_t;
/* function declare */
void set_pio_write(void);
void set_pio_read(void);
unsigned char read_ata_reg(unsigned char);
void write_ata_reg(unsigned char,unsigned char);
void wait_pio_ready(void);
void wait_device_int();
void ata_select_dev(void);
int ata_pio_in(device_reg_set_t *);
int ata_pio_out(device_reg_set_t *,unsigned int);
int pio_block_in(device_reg_set_t *);
int pio_block_out(volatile device_reg_set_t *);
int non_data_com(device_reg_set_t *);
void init_chip_param();
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -