it works!
Dependencies: mbed-dev-f303 FastPWM3
PreferenceWriter/PreferenceWriter.h@52:b81f50f83054, 2020-12-30 (annotated)
- Committer:
- supremelyy001
- Date:
- Wed Dec 30 08:49:45 2020 +0000
- Revision:
- 52:b81f50f83054
- Parent:
- 23:2adf23ee0305
first commit
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 |