Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SerialFlash by
M25PDevice.h@0:d0117f54a7ee, 2011-03-01 (annotated)
- Committer:
- s_ain
- Date:
- Tue Mar 01 15:44:13 2011 +0000
- Revision:
- 0:d0117f54a7ee
- Child:
- 2:6f8ab876b516
initial version
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| s_ain | 0:d0117f54a7ee | 1 | #pragma once |
| s_ain | 0:d0117f54a7ee | 2 | |
| s_ain | 0:d0117f54a7ee | 3 | #include <memory> |
| s_ain | 0:d0117f54a7ee | 4 | #include <string> |
| s_ain | 0:d0117f54a7ee | 5 | #include "ISerialFlashDevice.h" |
| s_ain | 0:d0117f54a7ee | 6 | |
| s_ain | 0:d0117f54a7ee | 7 | class ISPI; |
| s_ain | 0:d0117f54a7ee | 8 | class M25PDeviceImpl; |
| s_ain | 0:d0117f54a7ee | 9 | |
| s_ain | 0:d0117f54a7ee | 10 | class M25PDevice : public ISerialFlashDevice |
| s_ain | 0:d0117f54a7ee | 11 | { |
| s_ain | 0:d0117f54a7ee | 12 | public: |
| s_ain | 0:d0117f54a7ee | 13 | static M25PDevice* Create(ISPI* pSPI); |
| s_ain | 0:d0117f54a7ee | 14 | static bool IsSupported(ISPI* pSPI); |
| s_ain | 0:d0117f54a7ee | 15 | |
| s_ain | 0:d0117f54a7ee | 16 | virtual std::string GetDeviceName(void) const; |
| s_ain | 0:d0117f54a7ee | 17 | virtual int GetCapacity(void) const; |
| s_ain | 0:d0117f54a7ee | 18 | virtual void ChipErase(void); |
| s_ain | 0:d0117f54a7ee | 19 | virtual int Read(int address, void* buffer, int length); |
| s_ain | 0:d0117f54a7ee | 20 | virtual int Write(int address, const void* buffer, int length); |
| s_ain | 0:d0117f54a7ee | 21 | |
| s_ain | 0:d0117f54a7ee | 22 | private: |
| s_ain | 0:d0117f54a7ee | 23 | std::auto_ptr<M25PDeviceImpl> _pImpl; |
| s_ain | 0:d0117f54a7ee | 24 | M25PDevice(M25PDeviceImpl* pImpl); |
| s_ain | 0:d0117f54a7ee | 25 | }; |
