chapter names
[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 APINS 7
10 #define DPINS 14
11 #define STACKSIZE 1024
12 #define MEMSIZE 1024
13 #define HAVELED 1
14 #define HAVEAIO 1
15 #define HAVEDIO 1
16 #elif defined STM
17 ...
18 #endif
19
20 /* Communication */
21 bool input_available(void);
22 uint8_t read_byte(void);
23 void write_byte(uint8_t b);
24
25 /* Analog and digital pins */
26 #if HAVEDIO == 1
27 void write_dpin(uint8_t i, bool b);
28 bool read_dpin(uint8_t i);
29 #endif
30 #if HAVEAIO == 1
31 void write_apin(uint8_t i, uint8_t a);
32 uint8_t read_apin(uint8_t i);
33 #endif
34
35 /* UserLED */
36 #if HAVELED == 1
37 void led_on(uint8_t i);
38 void led_off(uint8_t i);
39 #endif
40
41 /* Delay and communication */
42 unsigned long getmillis(void);
43 void msdelay(unsigned long ms);
44
45 /* Auxilliary */
46 void real_setup(void);
47 void debug(char *fmt, ...);
48 void pdie(char *s);
49 void die(char *fmt, ...);
50
51 #endif