Colour targets: Revert an optimisation from almost 18 months ago that actually turned...
[Rockbox.git] / firmware / export / ata.h
blob164261a40ae7a78863a446855395c444cb87d5d6
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Alan Korr
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #ifndef __ATA_H__
22 #define __ATA_H__
24 #include <stdbool.h>
25 #include "config.h" /* for HAVE_MULTIVOLUME or not */
27 /* FixMe: These macros are a bit nasty and perhaps misplaced here.
28 We'll get rid of them once decided on how to proceed with multivolume. */
29 #ifdef HAVE_MULTIVOLUME
30 #define IF_MV(x) x /* optional volume/drive parameter */
31 #define IF_MV2(x,y) x,y /* same, for a list of arguments */
32 #define IF_MV_NONVOID(x) x /* for prototype with sole volume parameter */
33 #define NUM_VOLUMES 2
34 #else /* empty definitions if no multi-volume */
35 #define IF_MV(x)
36 #define IF_MV2(x,y)
37 #define IF_MV_NONVOID(x) void
38 #define NUM_VOLUMES 1
39 #endif
41 extern void ata_enable(bool on);
42 extern void ata_spindown(int seconds);
43 extern void ata_sleep(void);
44 extern void ata_sleepnow(void);
45 /* NOTE: DO NOT use this to poll for disk activity.
46 If you are waiting for the disk to become active before
47 doing something use ata_idle_notify.h
49 extern bool ata_disk_is_active(void);
50 extern int ata_hard_reset(void);
51 extern int ata_soft_reset(void);
52 extern int ata_init(void);
53 extern void ata_close(void);
54 extern int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf);
55 extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf);
56 extern void ata_spin(void);
57 #if (CONFIG_LED == LED_REAL)
58 extern void ata_set_led_enabled(bool enabled);
59 #endif
60 extern unsigned short* ata_get_identify(void);
62 extern long last_disk_activity;
63 extern int ata_spinup_time; /* ticks */
65 #endif