diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2007-06-30 02:08:27 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2007-06-30 02:08:27 +0000 |
commit | 1167e3c72f5d0d581b81fd2cb8f2580a1524ca5a (patch) | |
tree | 501f9901636d5586271067d0c157204e500a2cfd /firmware/export/hotswap.h | |
parent | 189a5f812f47e43e5704a44c3abb85a4c37c8662 (diff) | |
download | rockbox-1167e3c72f5d0d581b81fd2cb8f2580a1524ca5a.tar.gz rockbox-1167e3c72f5d0d581b81fd2cb8f2580a1524ca5a.zip |
Accept FS#7134 - Sansa: external sd card support by Antonius Hellmann with some tweaks. All testers have given the green light. (Now for the RED ?? ;).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13741 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/hotswap.h')
-rw-r--r-- | firmware/export/hotswap.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/firmware/export/hotswap.h b/firmware/export/hotswap.h new file mode 100644 index 0000000000..c6a657d731 --- /dev/null +++ b/firmware/export/hotswap.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2004 by Jens Arnold | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #ifndef __HOTSWAP_H__ | ||
20 | #define __HOTSWAP_H__ | ||
21 | |||
22 | typedef struct | ||
23 | { | ||
24 | bool initialized; | ||
25 | unsigned char bitrate_register; | ||
26 | unsigned long read_timeout; /* n * 8 clock cycles */ | ||
27 | unsigned long write_timeout; /* n * 8 clock cycles */ | ||
28 | |||
29 | unsigned long ocr; /* OCR register */ | ||
30 | unsigned long csd[4]; /* CSD register, 16 bytes */ | ||
31 | unsigned long cid[4]; /* CID register, 16 bytes */ | ||
32 | unsigned long speed; /* bit/s */ | ||
33 | unsigned int nsac; /* clock cycles */ | ||
34 | unsigned long tsac; /* n * 0.1 ns */ | ||
35 | unsigned int r2w_factor; | ||
36 | unsigned long size; /* size in bytes */ | ||
37 | unsigned long numblocks; /* size in flash blocks */ | ||
38 | unsigned int blocksize; /* block size in bytes */ | ||
39 | unsigned int block_exp; /* block size exponent */ | ||
40 | } tCardInfo; | ||
41 | |||
42 | #ifdef TARGET_TREE | ||
43 | bool card_detect(void); | ||
44 | tCardInfo *card_get_info(int card_no); | ||
45 | #else /* HAVE_MMC */ | ||
46 | #include "ata_mmc.h" | ||
47 | #define card_detect mmc_detect | ||
48 | #define card_get_info mmc_card_info | ||
49 | #define card_touched mmc_touched | ||
50 | #define card_enable_monitoring mmc_enable_monitoring | ||
51 | #endif | ||
52 | |||
53 | /* helper function to extract n (<=32) bits from an arbitrary position. | ||
54 | counting from MSB to LSB */ | ||
55 | unsigned long card_extract_bits( | ||
56 | const unsigned long *p, /* the start of the bitfield array */ | ||
57 | unsigned int start, /* bit no. to start reading */ | ||
58 | unsigned int size); /* how many bits to read */ | ||
59 | #endif | ||