KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Macros
ATA device definitions

Macros

#define G1_ATA_MASTER   0x00
 ATA master device. More...
 
#define G1_ATA_MASTER_ALT   0x90
 ATA master device (compatible with old drives). More...
 
#define G1_ATA_SLAVE   0xB0
 ATA slave device. More...
 
#define G1_ATA_LBA_MODE   0x40
 Select LBA addressing mode. More...
 

Detailed Description

The constants here represent the valid values that can be set as the active device on the ATA bus. You should pass one of these values to the g1_ata_select_device() function to select the appropriate device.

Note
Many times, the value returned by the g1_ata_select_device() function will have other bits set than the constants below. You should AND the value returned from that function with 0x10 if you really need to know what device is actually selected. If the value returned is true when ANDed with 0x10, then the slave device was selected, otherwise the master device was. The other bits are either command-specific or are reserved for compatibility sake.

Macro Definition Documentation

#define G1_ATA_LBA_MODE   0x40

Select LBA addressing mode.

OR this constant with one of the device constants (G1_ATA_MASTER or G1_ATA_SLAVE) to select LBA addressing mode. The various g1_ata_* functions all do this as appropriate already, so you shouldn't have to worry about this one at all. This bit is irrelevant for packet devices.

#define G1_ATA_MASTER   0x00

ATA master device.

This constant selects the master device on the ATA bus. This is normally the GD-ROM drive.

Note
The GD-ROM really does not like the reserved bits being set in the device select register, hence why this constant doesn't select them. Some hard drives may require them, however. If you find one that does, then you should use the G1_ATA_MASTER_ALT constant to access it if it is the master device on the bus.
#define G1_ATA_MASTER_ALT   0x90

ATA master device (compatible with old drives).

This constant selects the master device on the ATA bus, with the old reserved bits set to 1. If you have a drive that predates ATA-2, then this will probably be the constant you want to access it as the master device.

Note
Do not use this constant to access the GD-ROM. It will not work. Use G1_ATA_MASTER instead.
#define G1_ATA_SLAVE   0xB0

ATA slave device.

This constant selects the slave device on the ATA bus. This is where you would find a hard drive, if the user has an adapter installed.