#ifndef INTERFACE_H
#define INTERFACE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdbool.h>
#include <stdint.h>
#include <stdarg.h>
#ifdef LINUX
-#define APINS 7
-#define DPINS 14
+#define APINS 128
+#define DPINS 128
#define STACKSIZE 1024
#define MEMSIZE 1024
#define HAVELED 1
-#define HAVEAIO 1
-#define HAVEDIO 1
+#define HAVEHB 1
#elif defined STM
...
#endif
/* Communication */
-bool input_available(void);
+bool input_available(void);
uint8_t read_byte(void);
-void write_byte(uint8_t b);
+void write_byte(uint8_t b);
/* Analog and digital pins */
-#if HAVEDIO == 1
+#if DPINS > 0
void write_dpin(uint8_t i, bool b);
bool read_dpin(uint8_t i);
#endif
-#if HAVEAIO == 1
-void write_apin(uint8_t i, uint8_t a);
+#if APINS > 0
+void write_apin(uint8_t i, uint8_t a);
uint8_t read_apin(uint8_t i);
#endif
void led_off(uint8_t i);
#endif
+#if HAVEHB == 1
+uint16_t get_hb();
+bool valid_hb();
+uint16_t get_spo2();
+bool valid_spo2();
+#endif
+
/* Delay and communication */
unsigned long getmillis(void);
void msdelay(unsigned long ms);
/* Auxilliary */
void real_setup(void);
-void debug(char *fmt, ...);
+void real_debug(char *fmt, ...);
void pdie(char *s);
void die(char *fmt, ...);
+void reset(void);
+#ifdef __cplusplus
+}
+#endif
#endif