source: rtems/c/src/lib/libbsp/arm/nds/libfat/source/disc_io/disc_io.h @ 9a85541

4.104.114.95
Last change on this file since 9a85541 was 9a85541, checked in by Joel Sherrill <joel.sherrill@…>, on 08/20/08 at 16:31:41

2008-08-20 Joel Sherrill <joel.sherrill@…>

  • block/block.c, console/console.c, dswifi/arm9/source/sgIP.h, dswifi/arm9/source/sgIP_ARP.h, dswifi/arm9/source/sgIP_Config.h, dswifi/arm9/source/sgIP_DHCP.h, dswifi/arm9/source/sgIP_DNS.h, dswifi/arm9/source/sgIP_Hub.h, dswifi/arm9/source/sgIP_ICMP.h, dswifi/arm9/source/sgIP_IP.h, dswifi/arm9/source/sgIP_TCP.h, dswifi/arm9/source/sgIP_UDP.h, dswifi/arm9/source/sgIP_memblock.h, dswifi/arm9/source/wifi_arm9.c, dswifi/arm9/source/wifi_arm9.h, dswifi/include/dswifi7.h, dswifi/include/dswifi9.h, fb/fb.c, include/my_ipc.h, libfat/source/disc_io/disc_io.h, libfat/source/disc_io/io_nmmc.c, libnds/include/nds/arm9/exceptions.h, libnds/include/nds/arm9/input.h, libnds/include/nds/arm9/ndsmotion.h, libnds/include/nds/arm9/videoGL.h, libnds/source/arm9/console.c, libnds/source/arm9/gurumeditation.c, libnds/source/arm9/ndsmotion.c, libnds/source/common/card.c, libnds/source/common/interrupts.c, sound/sound.c, startup/start.c, touchscreen/reco.h, wifi/compat.c, wifi/compat.h: Fix most warnings.
  • Property mode set to 100644
File size: 3.1 KB
Line 
1/*
2 disc_io.h
3 Interface template for low level disc functions.
4
5 Copyright (c) 2006 Michael "Chishm" Chisholm
6       
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9
10  1. Redistributions of source code must retain the above copyright notice,
11     this list of conditions and the following disclaimer.
12  2. Redistributions in binary form must reproduce the above copyright notice,
13     this list of conditions and the following disclaimer in the documentation and/or
14     other materials provided with the distribution.
15  3. The name of the author may not be used to endorse or promote products derived
16     from this software without specific prior written permission.
17
18 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
19 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
26 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28        2006-07-11 - Chishm
29                * Original release
30               
31        2006-07-16 - Chishm
32                * Renamed _CF_USE_DMA to _IO_USE_DMA
33                * Renamed _CF_ALLOW_UNALIGNED to _IO_ALLOW_UNALIGNED
34*/
35
36#ifndef _DISC_IO_H
37#define _DISC_IO_H
38
39#include "../common.h"
40
41//----------------------------------------------------------------------
42// Customisable features
43
44// Use DMA to read the card, remove this line to use normal reads/writes
45// #define _IO_USE_DMA
46
47// Allow buffers not alligned to 16 bits when reading files.
48// Note that this will slow down access speed, so only use if you have to.
49// It is also incompatible with DMA
50#define _IO_ALLOW_UNALIGNED
51
52#if defined _IO_USE_DMA && defined _IO_ALLOW_UNALIGNED
53 #error "You cannot use both DMA and unaligned memory"
54#endif
55
56#define FEATURE_MEDIUM_CANREAD          0x00000001
57#define FEATURE_MEDIUM_CANWRITE         0x00000002
58#define FEATURE_SLOT_GBA                        0x00000010
59#define FEATURE_SLOT_NDS                        0x00000020
60
61typedef bool (* FN_MEDIUM_STARTUP)(void) ;
62typedef bool (* FN_MEDIUM_ISINSERTED)(void) ;
63typedef bool (* FN_MEDIUM_READSECTORS)(u32 sector, u32 numSectors, void* buffer) ;
64typedef bool (* FN_MEDIUM_WRITESECTORS)(u32 sector, u32 numSectors, const void* buffer) ;
65typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ;
66typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ;
67
68struct IO_INTERFACE_STRUCT {
69        unsigned long                   ioType ;
70        unsigned long                   features ;
71        FN_MEDIUM_STARTUP               fn_startup ;
72        FN_MEDIUM_ISINSERTED    fn_isInserted ;
73        FN_MEDIUM_READSECTORS   fn_readSectors ;
74        FN_MEDIUM_WRITESECTORS  fn_writeSectors ;
75        FN_MEDIUM_CLEARSTATUS   fn_clearStatus ;
76        FN_MEDIUM_SHUTDOWN              fn_shutdown ;
77} ;
78
79typedef struct IO_INTERFACE_STRUCT IO_INTERFACE ;
80
81#endif  // define _DISC_IO_H
Note: See TracBrowser for help on using the repository browser.