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.
Memory.h@2:5c70c0334ed0, 2016-06-23 (annotated)
- Committer:
- ThomasSonderDesign
- Date:
- Thu Jun 23 22:31:29 2016 +0000
- Revision:
- 2:5c70c0334ed0
- Parent:
- 1:9d8c932d26ae
- Child:
- 8:6af25b9563df
Same as before but reduced buffer size and blockErase now returns a value
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ThomasSonderDesign | 0:c2e41d203cdb | 1 | #ifndef _MEMORY_H |
| ThomasSonderDesign | 0:c2e41d203cdb | 2 | #define _MEMORY_H |
| ThomasSonderDesign | 0:c2e41d203cdb | 3 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 4 | #include "mbed.h" |
| ThomasSonderDesign | 0:c2e41d203cdb | 5 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 6 | #define dummy 1 //Set up a dummy byte to send to memory |
| ThomasSonderDesign | 2:5c70c0334ed0 | 7 | #define bufferSize 256 //The maximmum siz of data in the buffer |
| ThomasSonderDesign | 0:c2e41d203cdb | 8 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 9 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 10 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 11 | class Memory { |
| ThomasSonderDesign | 0:c2e41d203cdb | 12 | public: |
| ThomasSonderDesign | 0:c2e41d203cdb | 13 | Memory(PinName cs_mem); |
| ThomasSonderDesign | 0:c2e41d203cdb | 14 | int readData(SPI my_spi, char value [], int Address, int length); |
| ThomasSonderDesign | 0:c2e41d203cdb | 15 | void sectorErase(SPI my_spi, long Address); |
| ThomasSonderDesign | 2:5c70c0334ed0 | 16 | int blockErase(SPI my_spi, int Address); |
| ThomasSonderDesign | 0:c2e41d203cdb | 17 | int writeData(SPI my_spi, char buffer[], int address, int length); |
| ThomasSonderDesign | 0:c2e41d203cdb | 18 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 19 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 20 | private: |
| ThomasSonderDesign | 0:c2e41d203cdb | 21 | DigitalOut _cs_mem; |
| ThomasSonderDesign | 0:c2e41d203cdb | 22 | }; |
| ThomasSonderDesign | 0:c2e41d203cdb | 23 | |
| ThomasSonderDesign | 0:c2e41d203cdb | 24 | #endif |