Fork of Smoothie to port to mbed non-LPC targets.

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers disk.h Source File

disk.h

00001 #ifndef _DISK_H
00002 #define _DISK_H
00003 
00004 #include <stdint.h>
00005 
00006 class MSD_Disk {
00007 public:
00008     /*
00009      * read a block on a storage chip
00010      *
00011      * @param data pointer where will be stored read data
00012      * @param block block number
00013      * @returns 0 if successful
00014      */
00015     virtual int disk_read(char * data, uint32_t block) { return 0; };
00016 
00017     /*
00018      * write a block on a storage chip
00019      *
00020      * @param data data to write
00021      * @param block block number
00022      * @returns 0 if successful
00023      */
00024     virtual int disk_write(const char * data, uint32_t block) { return 0; };
00025 
00026     /*
00027      * Disk initilization
00028      */
00029     virtual int disk_initialize() { return 0; };
00030 
00031     /*
00032      * Return the number of blocks
00033      *
00034      * @returns number of blocks
00035      */
00036     virtual uint32_t disk_sectors() { return 0; };
00037 
00038     /*
00039      * Return memory size
00040      *
00041      * @returns memory size
00042      */
00043     virtual uint64_t disk_size() { return 0; };
00044 
00045     virtual uint32_t disk_blocksize() { return 0; };
00046 
00047     /*
00048      * To check the status of the storage chip
00049      *
00050      * @returns status: 0: OK, 1: disk not initialized, 2: no medium in the drive, 4: write protected
00051      */
00052     virtual int disk_status() { return 0; };
00053 
00054     /*
00055      * check if this disk can do DMA operations
00056      */
00057     virtual bool disk_canDMA() { return 0; };
00058 
00059     virtual int disk_sync() { return 0; };
00060 
00061     virtual bool busy() = 0;
00062 };
00063 
00064 #endif /* _DISK_H */