Dependents:
09_BC2_encoder
SDFileSystem.h@0:b65664229800, 2012-04-10 (annotated)
- Committer:
- apm_litoral
- Date:
- Tue Apr 10 03:33:35 2012 +0000
- Revision:
- 0:b65664229800
Who changed what in which revision?
User | Revision | Line number | New contents of line |
apm_litoral |
0:b65664229800
|
1
|
#ifndef MBED_SDFILESYSTEM_H
|
apm_litoral |
0:b65664229800
|
2
|
#define MBED_SDFILESYSTEM_H
|
apm_litoral |
0:b65664229800
|
3
|
|
apm_litoral |
0:b65664229800
|
4
|
#include "mbed.h"
|
apm_litoral |
0:b65664229800
|
5
|
#include "FATFileSystem.h"
|
apm_litoral |
0:b65664229800
|
6
|
|
apm_litoral |
0:b65664229800
|
7
|
extern "C" void mbed_reset();
|
apm_litoral |
0:b65664229800
|
8
|
|
apm_litoral |
0:b65664229800
|
9
|
class SDFileSystem : public FATFileSystem {
|
apm_litoral |
0:b65664229800
|
10
|
public:
|
apm_litoral |
0:b65664229800
|
11
|
|
apm_litoral |
0:b65664229800
|
12
|
SDFileSystem(PinName mosi, PinName miso, PinName sclk, PinName cs, const char* name);
|
apm_litoral |
0:b65664229800
|
13
|
virtual int disk_initialize();
|
apm_litoral |
0:b65664229800
|
14
|
void init_bios();
|
apm_litoral |
0:b65664229800
|
15
|
virtual int disk_write(const char *buffer, int block_number);
|
apm_litoral |
0:b65664229800
|
16
|
virtual int disk_read(char *buffer, int block_number);
|
apm_litoral |
0:b65664229800
|
17
|
virtual int disk_status();
|
apm_litoral |
0:b65664229800
|
18
|
virtual int disk_sync();
|
apm_litoral |
0:b65664229800
|
19
|
virtual int disk_sectors();
|
apm_litoral |
0:b65664229800
|
20
|
|
apm_litoral |
0:b65664229800
|
21
|
protected:
|
apm_litoral |
0:b65664229800
|
22
|
|
apm_litoral |
0:b65664229800
|
23
|
int _cmd(int cmd, int arg);
|
apm_litoral |
0:b65664229800
|
24
|
int _cmdx(int cmd, int arg);
|
apm_litoral |
0:b65664229800
|
25
|
int _cmd8();
|
apm_litoral |
0:b65664229800
|
26
|
int _cmd58();
|
apm_litoral |
0:b65664229800
|
27
|
int initialise_card();
|
apm_litoral |
0:b65664229800
|
28
|
int initialise_card_v1();
|
apm_litoral |
0:b65664229800
|
29
|
int initialise_card_v2();
|
apm_litoral |
0:b65664229800
|
30
|
|
apm_litoral |
0:b65664229800
|
31
|
int _read(char *buffer, int length);
|
apm_litoral |
0:b65664229800
|
32
|
int _write(const char *buffer, int length);
|
apm_litoral |
0:b65664229800
|
33
|
int _sd_sectors();
|
apm_litoral |
0:b65664229800
|
34
|
int _sectors;
|
apm_litoral |
0:b65664229800
|
35
|
|
apm_litoral |
0:b65664229800
|
36
|
SPI _spi;
|
apm_litoral |
0:b65664229800
|
37
|
DigitalOut _cs;
|
apm_litoral |
0:b65664229800
|
38
|
};
|
apm_litoral |
0:b65664229800
|
39
|
|
apm_litoral |
0:b65664229800
|
40
|
#endif
|