MY TRAIAL (1)

Dependencies:   FATFileSystem GR-PEACH_video GraphicsFramework LCD_shield_config R_BSP mbed-rtos mbed

Fork of GR-PEACH_NTSC_in_2ch_MOD_try by Hirofumi Inomata

I put an OVERVIEW in the blow URL. https://developer.mbed.org/users/digiponta/notebook/my-trial-ar--vr-2-eyes-display-goes-by-a-gr-peach/

Revision:
1:fa4f4543bcdd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SD/SDFileSystem_GR_PEACH.h	Mon Sep 05 11:01:11 2016 +0000
@@ -0,0 +1,54 @@
+#ifndef MBED_SDFILESYSTEM_GR_PEACH_H
+#define MBED_SDFILESYSTEM_GR_PEACH_H
+
+#include "SDFileSystem.h"
+
+/**
+ * A class to communicate a SD
+ */
+class SDFileSystem_GR_PEACH : public SDFileSystem {
+public:
+
+    /**
+    * Constructor
+    *
+    * @param rootdir mount name
+    */
+    SDFileSystem_GR_PEACH(const char* name) : SDFileSystem(P8_5, P8_6, P8_3, P8_4, name), _sd_cd(P7_8), _connect(false) {
+        // Set SPI clock rate to 20MHz for data transfer
+        set_transfer_sck(20000000);
+    }
+
+    /**
+    * Check if a SD is connected
+    *
+    * @return true if a SD is connected
+    */
+    bool connected() {
+        if (_sd_cd.read() != 0) {
+            _connect = false;
+        }
+        return _connect;
+    }
+
+    /**
+     * Try to connect to a SD
+     *
+     * @return true if connection was successful
+     */
+    bool connect() {
+        if (_sd_cd.read() == 0) {
+            _connect = true;
+        } else {
+            _connect = false;
+        }
+        return _connect;
+    }
+
+
+private:
+    DigitalIn   _sd_cd;
+    bool        _connect;
+};
+
+#endif