aboutsummaryrefslogtreecommitdiff
path: root/sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.h
blob: 334a9bc108ec19c28d91c94803d58ebc1ca6ec6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef __IO_DS2_H__
#define __IO_DS2_H__

// 'DS2F'
#define DEVICE_TYPE_DS2_MMCF 0x46434D4D

#include "disc_io.h"
#include "ds2_mmc_api.h"

// export interface
extern const IO_INTERFACE _io_ds2_mmcf ;

/* initialize MMC/SD card */
static inline bool _MMC_StartUp(void)
{
	return MMC_Initialize();
}

/* read multi blocks from MMC/SD card */
/* read a single block from MMC/SD card */
static inline bool _MMC_ReadSectors(u32 sector, u32 numSectors, void* buffer)
{
	int flag;

	if(numSectors > 1)
		flag= MMC_ReadMultiBlock(sector, numSectors, (unsigned char*)buffer);
	else
		flag= MMC_ReadBlock(sector, (unsigned char*)buffer);
	return (flag==MMC_NO_ERROR);
}

/* write multi blocks from MMC/SD card */
/* write a single block from MMC/SD card */
static inline bool _MMC_WriteSectors(u32 sector, u32 numSectors, const void* buffer)
{
	int flag;

	if(numSectors > 1)
		flag= MMC_WriteMultiBlock(sector, numSectors, (unsigned char*)buffer);
	else
		flag= MMC_WriteBlock(sector, (unsigned char*)buffer);

	return (flag==MMC_NO_ERROR);
}

static inline bool _MMC_ClearStatus(void)
{
	return true;
}

static inline bool _MMC_ShutDown(void)
{
	return true;
}

static inline bool _MMC_IsInserted(void)
{
	return true;
}


#endif //__IO_DS2_H__