-
Notifications
You must be signed in to change notification settings - Fork 0
/
hex_parser.h
51 lines (45 loc) · 1.19 KB
/
hex_parser.h
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
#ifndef HEX_PARSER_H
#define HEX_PARSER_H
#include <QString>
// supported hex formats
typedef enum mcu_type {
MCU_16F88 = 1,
MCU_16F886,
}hex_format;
// types of hex records
typedef enum {
DATA,
END_OF_FILE,
EXTENDED_SEGMENT_ADR,
START_SEGMENT_ADR,
EXTENDED_LINEAR_ADR,
START_LINEAR_ADR
}hex_type;
// hex parser class definition
class hex_parser{
public:
hex_parser();
~hex_parser();
bool read_file(hex_format format);
unsigned char app_eeprom[320];
unsigned char usr_eeprom[64];
unsigned char flash[2048];
unsigned int app_eeprom_size;
unsigned int usr_eeprom_size;
unsigned int flash_size;
QString hexfile;
private:
unsigned int USR_EEPROM_MAX_SIZE;
unsigned int APP_EEPROM_MAX_SIZE;
unsigned int FLASH_MAX_SIZE;
unsigned int FLASH_START_ADR;
unsigned int FLASH_END_ADR;
unsigned int USR_EEPROM_START_ADR;
unsigned int USR_EEPROM_END_ADR;
unsigned int APP_EEPROM_START_ADR;
unsigned int APP_EEPROM_END_ADR;
bool set_hex_format(hex_format format);
};
//extern int verbose;
//int verbose = 1;
#endif // HEX_PARSER_H