-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathavrdis.h
53 lines (42 loc) · 1.36 KB
/
avrdis.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
52
53
/*****************************************************************************
*
* Description:
* Header for the avrdis project, contains type definitions and prototypes
* used across the modules.
*
* Author:
* Imre Horvath <imi [dot] horvath [at] gmail [dot] com> (c) 2023
*
* License:
* GNU GPLv3
*
*****************************************************************************/
#ifndef _AVRDIS_H_
#define _AVRDIS_H_
#include <stdint.h>
struct wordlist {
struct wordlist *next;
uint32_t wordaddress;
uint16_t word;
};
struct region {
struct region *next;
uint32_t begin;
uint32_t end;
};
struct regionstruct {
struct region *first;
struct region *last;
};
void freewordlist(struct wordlist *wl);
struct regionstruct *allocregions(void);
void freeregions(struct regionstruct *rs);
int addregion(struct regionstruct *rs, uint32_t begin, uint32_t end);
struct region *inregionswithprev(struct regionstruct *rs, uint32_t wordaddress, struct region **prev);
struct region *inregions(struct regionstruct *rs, uint32_t wordaddress);
void printregions(struct regionstruct *rs);
int strcmpnocase(const char *lhs, const char *rhs);
int ihexfile(const char *filename);
struct wordlist *parseihexfile(const char *filename);
void emitavrasm(struct wordlist *wl, struct regionstruct *enaregs, int listing);
#endif /* _AVRDIS_H_ */