X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=client%2Finterface.h;h=9e818104dc94fdfd639fbf2b442ca1e24bbc1671;hb=59c7c761163b0cc5215563644ca60e2a47b9c9a9;hp=f3920eb60bb45b1b815af6f8523bba6d3baef90f;hpb=6c8939998c64aafb8cdfa40e52a227bf72767648;p=mTask.git diff --git a/client/interface.h b/client/interface.h index f3920eb..9e81810 100644 --- a/client/interface.h +++ b/client/interface.h @@ -5,30 +5,57 @@ #include #include -#ifndef STM +#ifdef LINUX +#define MAXTASKS 5 +#define MAXSDSS 100 +#define HAVELED 1 +#define HAVEAIO 1 +#define HAVEDIO 1 + extern int gargc; extern char **gargv; + +#elif defined STM +#define MAXTASKS 5 +#define MAXSDSS 100 +#define HAVELED 1 +#define HAVEAIO 1 +#define HAVEDIO 1 + +#else +//Add you device here #endif #define read16() 256*(uint8_t)read_byte() + (uint8_t)read_byte() #define from16(a, b) 256*a+b #define write16(i) { write_byte((uint8_t)i/256); write_byte((uint8_t)i%256); } + +/* Communication */ +bool input_available(void); uint8_t read_byte(void); void write_byte(uint8_t b); +/* Analog and digital pins */ +#if HAVEDIO == 1 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); uint8_t read_apin(uint8_t i); +#endif +/* UserLED */ +#if HAVELED == 1 void led_on(uint8_t i); void led_off(uint8_t i); +#endif +/* Delay and communication */ long millis(void); -bool input_available(void); void delay(long ms); +/* Auxilliary */ void setup(void); void debug(char *fmt, ...); void pdie(char *s);