MicrOS
|
#include "harddisk_header.h"
Functions | |
int8_t | __harddisk_soft_reset_port (uint16_t control_port) |
Perform soft reset for given control_port. More... | |
void | __harddisk_400ns_delay (uint16_t control_port) |
Makes 400ns delay. More... | |
int8_t | __harddisk_bsy_poll (uint16_t control_port) |
Pools BSY bit until clears. More... | |
void | __harddisk_get_pointers (HARDDISK_ATA_MASTER_SLAVE type, HARDDISK_ATA_BUS_TYPE bus, const HARDDISK_STATE **state, const harddisk_identify_device_data **data) |
Gets pointers to hard disk data. More... | |
Variables | |
harddisk_states | harddisk_current_states |
Current states of all hard drives. More... | |
harddisk_configuration | harddisk_current_configuration |
Current configuration of harddisk. More... | |
void __harddisk_400ns_delay | ( | uint16_t | control_port | ) |
Makes 400ns delay.
Makes 400ns delay by checking drive status 15 times. User after switching type of drive in bus.
port | Port for do delay. |
int8_t __harddisk_bsy_poll | ( | uint16_t | control_port | ) |
Pools BSY bit until clears.
Pools BSY bit until clears, if pooling takes too long exits with error.
port | Port for pooling. |
void __harddisk_get_pointers | ( | HARDDISK_ATA_MASTER_SLAVE | type, |
HARDDISK_ATA_BUS_TYPE | bus, | ||
const HARDDISK_STATE ** | state, | ||
const harddisk_identify_device_data ** | data | ||
) |
Gets pointers to hard disk data.
Sets state to proper state and data from harddisk_states structure to proper values for given harddisk and bus type.
type | Type of harddisk. |
bus | Type of bus. |
state | Pointer to state. |
bus | Pointer to data. |
int8_t __harddisk_soft_reset_port | ( | uint16_t | control_port | ) |
Perform soft reset for given control_port.
Soft reset should set bit SRST in Device Control Register for 5 us.
control_port | Control port to perform reset |
harddisk_configuration harddisk_current_configuration |
Current configuration of harddisk.
harddisk_states harddisk_current_states |
Current states of all hard drives.