summaryrefslogtreecommitdiffstats
path: root/emulator/avr8emu.h
blob: 104c9e37c3f0b6f03c0b2209cea536d0a621e28b (plain)
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
#ifndef AVR8EMU_LIBRARY_H_
#define AVR8EMU_LIBRARY_H_

#include <stdlib.h>


/* Type of an emulator instance. */
struct avr8emu;



struct avr8emu_callbacks {
	void (*status_message)(struct avr8emu *emu, const char *msg);
};

/* Create a new emulator instance. */
struct avr8emu * avr8emu_create(enum avr_setup_type type,
				const struct avr8emu_callbacks *cb);
/* Delete an emulator instance. */
void avr8emu_remove(struct avr8emu *emu);

/* Initialize the microcontroller. */
int avr8emu_initialize(struct avr8emu *emu, const char *code,
		       size_t code_size);

/* Reset the microcontroller. This will start execution of
 * the code if invoked for the first time. */
int avr8emu_reset(struct avr8emu *emu);

/* Call this on a regular basis to poll any messages from the
 * worker process. */
void avr8emu_poll_messages(struct avr8emu *emu);
/* Call this on a regular basis to poll any status messages
 * from the worker process. */
int avr8emu_poll_status(struct avr8emu *emu);


#endif /* AVR8EMU_LIBRARY_H_ */
bues.ch cgit interface