MIT Motor FOC Control
PreferenceWriter/PreferenceWriter.h@57:7b3dec9349db, 2021-10-05 (annotated)
- Committer:
- jianghan1913
- Date:
- Tue Oct 05 07:18:13 2021 +0000
- Revision:
- 57:7b3dec9349db
- Parent:
- 23:2adf23ee0305
motor
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 |