Fork and fix for mwork
Dependencies: mbed-dev-f303 FastPWM3 millis
PreferenceWriter/PreferenceWriter.h@23:2adf23ee0305, 2017-04-05 (annotated)
- Committer:
- benkatz
- Date:
- Wed Apr 05 20:54:16 2017 +0000
- Revision:
- 23:2adf23ee0305
Added bayley's flash writer
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
benkatz | 23:2adf23ee0305 | 1 | #ifndef __PREFERENCE_WRITER_H |
benkatz | 23:2adf23ee0305 | 2 | #define __PREFERENCE_WRITER_H |
benkatz | 23:2adf23ee0305 | 3 | |
benkatz | 23:2adf23ee0305 | 4 | #include "mbed.h" |
benkatz | 23:2adf23ee0305 | 5 | #include "FlashWriter.h" |
benkatz | 23:2adf23ee0305 | 6 | |
benkatz | 23:2adf23ee0305 | 7 | class PreferenceWriter { |
benkatz | 23:2adf23ee0305 | 8 | public: |
benkatz | 23:2adf23ee0305 | 9 | PreferenceWriter(uint32_t sector); |
benkatz | 23:2adf23ee0305 | 10 | void open(); |
benkatz | 23:2adf23ee0305 | 11 | bool ready(); |
benkatz | 23:2adf23ee0305 | 12 | void write(int x, int index); |
benkatz | 23:2adf23ee0305 | 13 | void write(float x, int index); |
benkatz | 23:2adf23ee0305 | 14 | void flush(); |
benkatz | 23:2adf23ee0305 | 15 | void load(); |
benkatz | 23:2adf23ee0305 | 16 | void close(); |
benkatz | 23:2adf23ee0305 | 17 | private: |
benkatz | 23:2adf23ee0305 | 18 | FlashWriter *writer; |
benkatz | 23:2adf23ee0305 | 19 | uint32_t __sector; |
benkatz | 23:2adf23ee0305 | 20 | bool __ready; |
benkatz | 23:2adf23ee0305 | 21 | }; |
benkatz | 23:2adf23ee0305 | 22 | |
benkatz | 23:2adf23ee0305 | 23 | #endif |