process notes in first sections
[msc-thesis1617.git] / listings / interface.h
1 #ifndef INTERFACE_H
2 #define INTERFACE_H
3
4 #include <stdbool.h>
5 #include <stdint.h>
6 #include <stdarg.h>
7
8 #ifdef LINUX
9 #define STACKSIZE 1024
10 #define MEMSIZE 1024
11 #define HAVELED 1
12 #define HAVEAIO 1
13 #define HAVEDIO 1
14 #elif defined STM
15 ...
16 #endif
17
18 /* Communication */
19 bool input_available(void);
20 uint8_t read_byte(void);
21 void write_byte(uint8_t b);
22
23 /* Analog and digital pins */
24 #if HAVEDIO == 1
25 void write_dpin(uint8_t i, bool b);
26 bool read_dpin(uint8_t i);
27 #endif
28 #if HAVEAIO == 1
29 void write_apin(uint8_t i, uint8_t a);
30 uint8_t read_apin(uint8_t i);
31 #endif
32
33 /* UserLED */
34 #if HAVELED == 1
35 void led_on(uint8_t i);
36 void led_off(uint8_t i);
37 #endif
38
39 /* Delay and communication */
40 unsigned long getmillis(void);
41 void msdelay(unsigned long ms);
42
43 /* Auxilliary */
44 void real_setup(void);
45 void debug(char *fmt, ...);
46 void pdie(char *s);
47 void die(char *fmt, ...);
48
49 #endif