-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelfProgram.h
More file actions
53 lines (32 loc) · 850 Bytes
/
SelfProgram.h
File metadata and controls
53 lines (32 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* SelfProgram.h
*
* Created: 11/12/2015 10:23:28 AM
* Author: ekt
*/
#ifndef SELFPROGRAM_H_
#define SELFPROGRAM_H_
#include <inttypes.h>
class SelfProgram {
public:
SelfProgram();
void setSafeMode(bool safeMode);
void loadDeviceID();
uint16_t getDeviceID();
void storeDeviceID(uint16_t deviceID);
uint32_t getSignature();
void readEEPROM(uint16_t address, uint8_t *data, uint8_t eeLen);
void writeEEPROM(uint16_t address, uint8_t *data, uint8_t len);
void setLED(bool on);
int getPageSize();
void erasePage(uint32_t address);
int readPage(uint32_t address, uint8_t *data, uint8_t len);
void writePage(uint32_t address, uint8_t *data, uint8_t len);
void startApplication();
void checkBootMode();
void jumpToApplication();
private:
uint16_t _deviceID;
bool _safeMode;
};
#endif /* SELFPROGRAM_H_ */