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
M25PDeviceImpl.h
- Committer:
- s_ain
- Date:
- 2011-03-01
- Revision:
- 0:d0117f54a7ee
- Child:
- 2:6f8ab876b516
File content as of revision 0:d0117f54a7ee:
#pragma once #include <string> class ISPI; class M25PDeviceImpl { public: static bool IsSupported(ISPI* pSPI); static M25PDeviceImpl* Create(ISPI* pSPI); ~M25PDeviceImpl(void); std::string GetDeviceName() const; int GetCapacity() const; int Read(int address, void* buffer, int length); int Write(int address, const void* buffer, int length); void BulkErase(void); private: ISPI* _pSPI; int _operationFrequency; struct DeviceProperty { std::string deviceName; int capacity; int blockProtectionMask; } const& _property; static const DeviceProperty* findMatchDevice(ISPI* pSPI); M25PDeviceImpl(ISPI* pSPI, const DeviceProperty& property); void writeAddress(int address); static void readId(ISPI* pSPI, int& manufacturerId, int& memoryType, int& memoryCapacity); int readStatusRegister(void); void clearBlockProtection(void); void writeStatusRegister(int value); void writeEnable(void); void writeDisable(void); void pageProgram(int address, const void* buffer); };