#ifndef _util_h_ #define _util_h_ #include #include #include #include /* MISC */ extern void wait_100mues(unsigned char Multiplikator); extern void wait_10ms(unsigned char Multiplikator); /*LCD - FUNCS*/ #define CS_LCD 0x08C000 #define CSLCDINS_W MVAR(unsigned char,CS_LCD + 0x0) #define CSLCDDATA_W MVAR(unsigned char,CS_LCD + 0x1) #define CSLCDINS_R MVAR(unsigned char,CS_LCD + 0x2) #define CSLCDDATA_R MVAR(unsigned char,CS_LCD + 0x3) #define lcd_ready while((CSLCDINS_R & 0x80)!=0) extern void init_lcd(void); extern void lcd_clear(void); /* sets cursor to position z = 0 .. 3 ( row 1 - 4 ) s = 0 .. 15 ( pos 1 - 16 ) */ extern void lcd_setcursor(unsigned char z, unsigned char s); extern void lcd_putchar(unsigned char zeichen); /* sets cursor to position z = 0 .. 3 ( row 1 - 4 ) s = 0 .. 15 ( pos 1 - 16 ) and then sets text a */ extern void lcd_puts(unsigned char z, unsigned char s, char *a); /* key-input */ extern unsigned char testkey( void ); /* reads keyinput. if a key is pressed, tests ist for three times, with a difference of 10 ms between every test. If same key pressed after this tests, function waits till key is released, then it returns the key. Otherwise 0 is returned. */ extern unsigned char readkey( void ); extern void setDaysOfMonth( int month, int year ); #define NOKEY 0 #define KEY_UP 'U' #define KEY_DOWN 'D' #define KEY_LEFT 'L' #define KEY_RIGHT 'R' #define KEY_0 '0' #define KEY_1 '1' #define KEY_2 '2' #define KEY_3 '3' #define KEY_4 '4' #define KEY_5 '5' #define KEY_6 '6' #define KEY_7 '7' #define KEY_8 '8' #define KEY_9 '9' #define KEY_E 'E' #define KEY_C 'C' #endif