USBMSD SD card Hello World for Mbed platforms
Dependencies: mbed USBMSD_SD USBDevice
Diff: USBDevice/USBMSD/USBMSD.h
- Revision:
- 19:148a0b8d23bc
- Parent:
- 18:08b207d10056
- Child:
- 20:50bf1cd2e2fe
--- a/USBDevice/USBMSD/USBMSD.h Sun Dec 11 15:22:50 2011 +0000 +++ b/USBDevice/USBMSD/USBMSD.h Sun Dec 11 15:42:23 2011 +0000 @@ -30,9 +30,11 @@ * - virtual int disk_initialize(): function to initialize the memory * - virtual int disk_sectors(): return the number of blocks * - virtual int disk_size(): return the memory size + * - virtual int disk_status(): return the status of the storage chip * - * All functions names are compatible with the fat filesystem library. So you can imagine using your own class with either - * USBMSD or a fat filesystem library. + * All functions names are compatible with the fat filesystem library. So you can imagine using your own class with + * USBMSD and the fat filesystem library in the same program. Just be careful because there are two different parts which + * will access the sd card. You can do a master/slave system using the disk_status method. * * Once these functions have been defined, you can call connect() (at the end of the constructor of your class for instance) * of USBMSD to connect your mass storage device ;) @@ -128,6 +130,14 @@ * @returns memory size */ virtual int disk_size() = 0; + + + /* + * To check the status of the storage chip + * + * @returns status: 0: OK, 1: disk not initialized, 2: no medium in the drive, 4: write protected + */ + virtual int disk_status() = 0; /* * Connect the USB MSD device. Establish disk initialization before really connect the device.