#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum {
AVR_MMCU_TAG = 0,
AVR_MMCU_TAG_NAME,
#endif /* __AVR__ */
+#ifdef __cplusplus
+};
+#endif
#endif
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef uint64_t avr_cycle_count_t;
typedef uint16_t avr_io_addr_t;
// 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"
#ifndef SIM_CORE_H_
#define SIM_CORE_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Instruction decoder, run ONE instruction
*/
#endif
+#ifdef __cplusplus
+};
+#endif
+
#endif /* SIM_CORE_H_ */
#include "sim_avr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// converts a number of usec to a number of machine cycles, at current speed
static inline avr_cycle_count_t avr_usec_to_cycles(avr_t * avr, uint32_t usec)
{
//
avr_cycle_count_t avr_cycle_timer_process(avr_t * avr);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* __SIM_CYCLE_TIMERS_H___ */
#include "avr_mcu_section.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef ELF_SYMBOLS
#define ELF_SYMBOLS 1
#endif
void avr_load_firmware(avr_t * avr, elf_firmware_t * firmware);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* ELF_H_ */
#ifndef __SIM_GDB_H__
#define __SIM_GDB_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int avr_gdb_init(avr_t * avr);
// call from the main AVR decoder thread
int avr_gdb_processor(avr_t * avr, uint32_t sleep);
+#ifdef __cplusplus
+};
+#endif
+
#endif
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// parses a hex text string 'src' of at max 'maxlen' characters, decodes it into 'buffer'
int read_hex_string(const char * src, uint8_t * buffer, int maxlen);
// hex dump from pointer 'b' for 'l' bytes with string prefix 'w'
void hdump(const char *w, uint8_t *b, size_t l);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* __SIM_HEX_H___ */
#include "sim_avr.h"
#include "sim_irq.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// interrupt vector for the IO modules
typedef struct avr_int_vector_t {
uint8_t vector; // vector number, zero (reset) is reserved
// this allows tracing of pending interupts
avr_irq_t * avr_get_interupt_irq(avr_t * avr, uint8_t v);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* __SIM_INTERUPTS_H__ */
#include "sim_avr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* used by the ioports to implement their own features
* see avr_eeprom.* for an example, and avr_ioctl().
#define AVR_IOMEM_IRQ_ALL 8
struct avr_irq_t * avr_iomem_getirq(avr_t * avr, avr_io_addr_t addr, int index);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* __SIM_IO_H__ */
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Internal IRQ system
*
// register a notification 'hook' for 'irq' -- 'param' is anything that your want passed back as argument
void avr_irq_register_notify(avr_irq_t * irq, avr_irq_notify_t notify, void * param);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* __SIM_IRQ_H__ */
#include "sim_avr.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define ARRAY_SIZE(_aa) (sizeof(_aa) / sizeof((_aa)[0]))
/*
#define AVR_IO_REGBIT(_io, _bit) { . reg = (_io), .bit = (_bit), .mask = 1 }
#define AVR_IO_REGBITS(_io, _bit, _mask) { . reg = (_io), .bit = (_bit), .mask = (_mask) }
+#ifdef __cplusplus
+};
+#endif
#endif /* __SIM_REGBIT_H__ */
#include <stdint.h>
#include "sim_irq.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* The TWI system is designed to be representing the same state as
* a TWI/i2c bus itself. So each "state" of the bus is an IRQ sent
void twi_slave_init(twi_slave_t * slave, uint8_t address, void * param);
void twi_slave_detach(twi_slave_t * slave);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* SIM_TWI_H_ */
#include <stdio.h>
#include "sim_irq.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Value Change dump module for simavr.
*
// stops recording signal values into the file
int avr_vcd_stop(avr_vcd_t * vcd);
+#ifdef __cplusplus
+};
+#endif
+
#endif /* __SIM_VCD_FILE_H__ */