FS#8961 - Anti-Aliased Fonts.
[kugel-rb.git] / firmware / export / hotswap.h
blob455dee6bccfdc409f4b2db142c30beca0465613e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2004 by Jens Arnold
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 __HOTSWAP_H__
22 #define __HOTSWAP_H__
24 #include <stdbool.h>
26 typedef struct
28 bool initialized;
30 unsigned long read_timeout; /* n * 8 clock cycles */
31 unsigned long write_timeout; /* n * 8 clock cycles */
33 unsigned long ocr; /* OCR register */
34 unsigned long csd[4]; /* CSD register, 16 bytes */
35 unsigned long cid[4]; /* CID register, 16 bytes */
36 unsigned long speed; /* bit/s */
37 unsigned int nsac; /* clock cycles */
38 unsigned long taac; /* n * 0.1 ns */
39 unsigned int r2w_factor;
40 unsigned long numblocks; /* size in flash blocks */
41 unsigned int blocksize; /* block size in bytes */
43 #if (CONFIG_STORAGE & STORAGE_MMC)
44 unsigned char bitrate_register;
45 #endif
47 #if (CONFIG_STORAGE & STORAGE_SD)
48 unsigned long rca; /* RCA register */
49 unsigned int current_bank;
50 #endif
51 } tCardInfo;
53 #if (CONFIG_STORAGE & STORAGE_SD)
55 #include "sd.h"
56 #define card_detect card_detect_target
57 #define card_get_info card_get_info_target
58 tCardInfo *card_get_info_target(int card_no);
59 void sd_parse_csd(tCardInfo *card);
61 #ifdef HAVE_HOTSWAP
62 #define card_enable_monitoring card_enable_monitoring_target
63 #endif
65 #else /* STORAGE_MMC */
67 #include "ata_mmc.h"
68 #define card_detect mmc_detect
69 #define card_get_info mmc_card_info
70 tCardInfo *mmc_card_info(int card_no);
71 #define card_touched mmc_touched
72 #define card_enable_monitoring mmc_enable_monitoring
74 #endif
76 /* helper function to extract n (<=32) bits from an arbitrary position.
77 counting from MSB to LSB */
78 unsigned long card_extract_bits(
79 const unsigned long *p, /* the start of the bitfield array */
80 unsigned int start, /* bit no. to start reading */
81 unsigned int size); /* how many bits to read */
82 #endif