1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 by Alan Korr
11 * Copyright (C) 2008 by Frank Gevaerts
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
21 ****************************************************************************/
26 #include "mv.h" /* for HAVE_MULTIVOLUME or not */
30 void sd_enable(bool on
);
31 void sd_spindown(int seconds
);
33 bool sd_disk_is_active(void);
34 int sd_soft_reset(void);
37 int sd_read_sectors(IF_MV2(int drive
,) unsigned long start
, int count
, void* buf
);
38 int sd_write_sectors(IF_MV2(int drive
,) unsigned long start
, int count
, const void* buf
);
41 #ifdef STORAGE_GET_INFO
42 void sd_get_info(IF_MV2(int drive
,) struct storage_info
*info
);
45 bool sd_removable(IF_MV_NONVOID(int drive
));
46 bool sd_present(IF_MV_NONVOID(int drive
));
49 long sd_last_disk_activity(void);
63 #define SD_GO_IDLE_STATE 0
64 #define SD_ALL_SEND_CID 2
65 #define SD_SEND_RELATIVE_ADDR 3
67 #define SD_SWITCH_FUNC 6
68 #define SD_SELECT_CARD 7
69 #define SD_DESELECT_CARD 7
70 #define SD_SEND_IF_COND 8
72 #define SD_SEND_CID 10
73 #define SD_STOP_TRANSMISSION 12
74 #define SD_SEND_STATUS 13
75 #define SD_GO_INACTIVE_STATE 15
76 #define SD_SET_BLOCKLEN 16
77 #define SD_READ_SINGLE_BLOCK 17
78 #define SD_READ_MULTIPLE_BLOCK 18
79 #define SD_SEND_NUM_WR_BLOCKS 22
80 #define SD_WRITE_BLOCK 24
81 #define SD_WRITE_MULTIPLE_BLOCK 25
82 #define SD_ERASE_WR_BLK_START 32
83 #define SD_ERASE_WR_BLK_END 33
87 /* Application Specific commands */
88 #define SD_SET_BUS_WIDTH 6
89 #define SD_APP_OP_COND 41