Seiji Ainoguchi / SerialFlash

Dependents:   SerialFlashTest

Fork of SerialFlash by Seiji Ainoguchi

Revision:
0:d0117f54a7ee
Child:
2:6f8ab876b516
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/M25PDevice.cpp	Tue Mar 01 15:44:13 2011 +0000
@@ -0,0 +1,50 @@
+#include "mbed.h"
+#include "M25PDeviceImpl.h"
+#include "M25PDevice.h"
+
+bool M25PDevice::IsSupported(ISPI* pSPI)
+{
+    return M25PDeviceImpl::IsSupported(pSPI);
+}
+
+M25PDevice* M25PDevice::Create(ISPI* pSPI)
+{
+    M25PDeviceImpl* pImpl = M25PDeviceImpl::Create(pSPI);
+    if (pImpl == NULL)
+    {
+        return NULL;
+    }
+    return new M25PDevice(pImpl);
+}
+
+
+M25PDevice::M25PDevice(M25PDeviceImpl* pImpl)
+ : _pImpl(pImpl)
+{
+
+}
+
+string M25PDevice::GetDeviceName(void) const
+{
+    return _pImpl->GetDeviceName();
+}
+
+int M25PDevice::GetCapacity(void) const
+{
+    return _pImpl->GetCapacity();
+}
+
+void M25PDevice::ChipErase(void)
+{
+    _pImpl->BulkErase();
+}
+
+int M25PDevice::Read(int address, void* buffer, int length)
+{
+    return _pImpl->Read(address, buffer, length);
+}
+
+int M25PDevice::Write(int address, const void* buffer, int length)
+{
+    return _pImpl->Write(address, buffer, length);
+}