/* liblcd.h -- Copyright 1999 by Nathan Anderson, ALL RIGHTS RESERVED See the comments in liblcd.c for more information about your rights under the license that this code has been placed under. */ #ifndef LIBLCD_H # define LIBLCD_H # include # include # include # include # include # include # include # include /* constants */ # define ON 1 # define OFF 0 # define BLACK 1 # define WHITE 0 # define ROW1 1 # define ROW2 2 # define ROW3 4 # define ROW4 8 /* init possible settings */ # define BACKLIGHT 1 # define INVERSETXT 2 # define CLEARSCR 4 typedef struct termios termios; /* error codes */ # define NUM_ERR 7 # define ELCDBAUD 1 # define ELCDOPEN 2 # define ELCDNOPN 3 # define ELCDNINI 4 # define ELCDINIT 5 # define ELCDWRIT 6 # define ELCDVOOB 7 # define ELCDFAKE 8 /* status codes */ # define SLCDOPEN 1 /* port has been opened */ # define SLCDINIT 2 /* LCD has been init'd */ # ifdef LIBLCD_C # define BUFSIZE 80 const int _liblcd_majorv = 1; const int _liblcd_minorv = 0; const int _liblcd_revv = 0; const char * err_str[ NUM_ERR + 1 ] = { "speed set fail", /* ELCDBAUD */ "open port fail", /* ELCDOPEN */ "LCD port not open fail", /* ELCDNOPN */ "LCD not initialized fail", /* ELCDNINI */ "initialization fail", /* ELCDINIT */ "write to port fail", /* ELCDWRIT */ "values out-of-bounds fail", /* ELCDLPOS */ "false error non-fail" /* ELCDFAKE */ }; int status = 0; int fd_com; termios oldtio; char buf[ BUFSIZE + 1 ]; # endif /* LCD port control functions */ int lcd_open( const char *, const speed_t ); int lcd_init( char ); int lcd_reopen( const char * ); int lcd_close( ); int lcd_err( int, const char * ); /* LCD text manipulation functions */ int lcd_clear( ); int lcd_gotoxy( int, int ); int lcd_write( const char * ); int lcd_flush( ); /* LCD feature control functions */ int lcd_backlight( int ); int lcd_inversetxt( int ); /* LCD graphics manipulation functions */ int lcd_g_setcolor( int ); int lcd_g_loadimg( int ); int lcd_g_drawline( int, int, int, int ); int lcd_g_drawbox( int, int, int, int ); int lcd_g_plotdot( int, int ); int lcd_g_revline( int ); #endif