diff options
author | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-08 21:23:53 +0000 |
---|---|---|
committer | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-08 21:23:53 +0000 |
commit | e4dbcc414b4b91ceb6b5e80a4ad49e4270fee096 (patch) | |
tree | 3165e08718b10840ac466821664852be8ba6d784 /firmware/export/ata-driver.h | |
parent | d09818d745835653c2f7ff24547101c0833800d4 (diff) | |
download | rockbox-e4dbcc414b4b91ceb6b5e80a4ad49e4270fee096.tar.gz rockbox-e4dbcc414b4b91ceb6b5e80a4ad49e4270fee096.zip |
FS#12418 - Merge prototypes from ata-target.h files into new file ata-driver.h. After this change:
- ata.h is for users of ata.c
- ata-driver.h is for functions implemented by target-specific code and used by ata.c
- ata-target.h is for target-specific defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31182 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/ata-driver.h')
-rw-r--r-- | firmware/export/ata-driver.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/firmware/export/ata-driver.h b/firmware/export/ata-driver.h new file mode 100644 index 0000000000..8711b2145f --- /dev/null +++ b/firmware/export/ata-driver.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2011 by Boris Gjenero | ||
11 | * | ||
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. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __ATA_DRIVER_H__ | ||
23 | #define __ATA_DRIVER_H__ | ||
24 | |||
25 | #include "config.h" /* for HAVE_ATA_DMA */ | ||
26 | #include "ata-target.h" /* for other target-specific defines */ | ||
27 | |||
28 | /* Returns true if the interface hasn't been initialised yet */ | ||
29 | bool ata_is_coldstart(void); | ||
30 | /* Initializes the interface */ | ||
31 | void ata_device_init(void); | ||
32 | /* ata_enable(true) is used after ata_device_init() to enable the interface | ||
33 | * ata_enable(false) is used to disable the interface so | ||
34 | * an ATA to USB bridge chip can use it instead.*/ | ||
35 | void ata_enable(bool on); | ||
36 | /* ATA hard reset: pulse the RESET pin */ | ||
37 | void ata_reset(void); | ||
38 | |||
39 | /* Optional optimized target-specific PIO transfer */ | ||
40 | #ifdef ATA_OPTIMIZED_READING | ||
41 | void copy_read_sectors(unsigned char* buf, int wordcount); | ||
42 | #endif | ||
43 | #ifdef ATA_OPTIMIZED_WRITING | ||
44 | void copy_write_sectors(const unsigned char* buf, int wordcount); | ||
45 | #endif | ||
46 | |||
47 | /* Optional target-specific waiting */ | ||
48 | #ifdef ATA_TARGET_POLLING | ||
49 | int ata_wait_for_bsy(void); | ||
50 | int ata_wait_for_rdy(void); | ||
51 | #endif | ||
52 | |||
53 | /* Optional setting of controller timings for PIO mode */ | ||
54 | #ifdef ATA_SET_PIO_TIMING | ||
55 | void ata_set_pio_timings(int mode); | ||
56 | #endif | ||
57 | |||
58 | #ifdef HAVE_ATA_DMA | ||
59 | /* Used to update last disk activity time while waiting for DMA */ | ||
60 | void ata_keep_active(void); | ||
61 | /* Set DMA mode for ATA interface */ | ||
62 | void ata_dma_set_mode(unsigned char mode); | ||
63 | /* Sets up DMA transfer */ | ||
64 | bool ata_dma_setup(void *addr, unsigned long bytes, bool write); | ||
65 | /* Waits for DMA transfer completion */ | ||
66 | bool ata_dma_finish(void); | ||
67 | #endif /* HAVE_ATA_DMA */ | ||
68 | |||
69 | #endif /* __ATA_DRIVER_H__ */ | ||