#ifndef AVR_HOSTLIB_H
#define AVR_HOSTLIB_H

#define AVR_INFRA_BUFFER_EMPTY 1
#define AVR_INFRA_GET_CODE     2
#define AVR_DDR_SET            3
#define AVR_DDR_GET            4
#define AVR_PORT_SET           5
#define AVR_PORT_GET           6
#define AVR_PIN_GET            7
#define AVR_EEPROM_READ        8
#define AVR_EEPROM_WRITE       9
#define AVR_RS232_WRITE        10
#define AVR_RS232_READ         11
#define AVR_RS232_BAUD_SET     12
#define AVR_RS232_BAUD_GET     13
#define AVR_SPI                14
#define AVR_SPI4               15

#ifdef __cplusplus
extern "C" {
#endif

typedef void *avr_device_t;

avr_device_t avr_open();
void         avr_close(avr_device_t dev);
void         avr_set_debug(int level);
void         avr_send_command(avr_device_t dev, int cmd, int val);
void         avr_send_command_idx(avr_device_t dev, int cmd, int val, int idx);
int          avr_get_response(avr_device_t dev, int cmd, int val, char *buf, int len);
int          avr_get_response_idx(avr_device_t dev, int cmd, int idx, int val, char *buf, int len);
#ifdef __cplusplus
}
#endif

#endif

