#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef uint64_t avr_cycle_count_t;
typedef uint16_t avr_io_addr_t;
uint8_t signature[3];
uint8_t fuse[4];
avr_io_addr_t rampz; // optional, only for ELPM/SPM on >64Kb cores
+ avr_io_addr_t eind; // optional, only for EIJMP/EICALL on >64Kb cores
// filled by the ELF data, this allow tracking of invalid jumps
uint32_t codeend;
int state; // stopped, running, sleeping
uint32_t frequency; // frequency we are running at
+ // mostly used by the ADC for now
+ uint32_t vcc,avcc,aref; // (optional) voltages in millivolts
// cycles gets incremented when sleeping and when running; it corresponds
// not only to "cycles that runs" but also "cycles that might have run"
// set an IO register to receive commands from the AVR firmware
// it's optional, and uses the ELF tags
void avr_set_command_register(avr_t * avr, avr_io_addr_t addr);
+
+// specify the "console register" -- output sent to this register
+// is printed on the simulator console, without using a UART
+void avr_set_console_register(avr_t * avr, avr_io_addr_t addr);
+
// load code in the "flash"
void avr_loadcode(avr_t * avr, uint8_t * code, uint32_t size, uint32_t address);
// this might activate gdb server
void avr_sadly_crashed(avr_t *avr, uint8_t signal);
+#ifdef __cplusplus
+};
+#endif
+
#include "sim_io.h"
#include "sim_regbit.h"
#include "sim_interrupts.h"