Support MJPEG Video

Dependencies:   sd-driver-hs

Fork of SDBlockDevice_GR_PEACH by Daiki Kato

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDBlockDevice_GR_PEACH.h Source File

SDBlockDevice_GR_PEACH.h

00001 #ifndef MBED_SDFILESYSTEM_GR_PEACH_H
00002 #define MBED_SDFILESYSTEM_GR_PEACH_H
00003 
00004 #include "SDBlockDevice.h"
00005 
00006 /**
00007  * A class to communicate a SD
00008  */
00009 class SDBlockDevice_GR_PEACH : public SDBlockDevice {
00010 public:
00011 
00012     /**
00013     * Constructor
00014     *
00015     * @param rootdir mount name
00016     */
00017     SDBlockDevice_GR_PEACH() : SDBlockDevice(P8_5, P8_6, P8_3, P8_4), _sd_cd(P7_8), _connect(false) {
00018         // Set SPI clock rate to 20MHz for data transfer
00019         _transfer_sck = 30000000;
00020     }
00021 
00022     /**
00023     * Check if a SD is connected
00024     *
00025     * @return true if a SD is connected
00026     */
00027     bool connected() {
00028         if (_sd_cd.read() != 0) {
00029             _connect = false;
00030         }
00031         return _connect;
00032     }
00033 
00034     /**
00035      * Try to connect to a SD
00036      *
00037      * @return true if connection was successful
00038      */
00039     bool connect() {
00040         if (_sd_cd.read() == 0) {
00041             _connect = true;
00042         } else {
00043             _connect = false;
00044         }
00045         return _connect;
00046     }
00047 
00048 
00049 private:
00050     DigitalIn   _sd_cd;
00051     bool        _connect;
00052 };
00053 
00054 #endif