00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if !defined(__LCD_H__)
00022 #define __LCD_H__
00023
00024
00025
00026
00027
00028 #include <stdio.h>
00029 #include <stdlib.h>
00030
00031 #if defined(_WIN32)
00032 # define WIN32_LEAN_AND_MEAN
00033 # include <windows.h>
00034 # include "pthread_w32.h"
00035 #else
00036 # include <unistd.h>
00037 # include <pthread.h>
00038 #endif
00039
00040
00041
00042
00043
00044 #if defined(_WIN32)
00045 # if defined(__cplusplus)
00046 # define LCD_API extern "C" _declspec(dllexport)
00047 # else
00048 # define LCD_API _declspec(dllexport)
00049 # endif
00050 #else
00051 # if defined(__cplusplus)
00052 # define LCD_API extern "C"
00053 # else
00054 # define LCD_API
00055 # endif
00056 #endif
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 typedef struct _tag_colour
00070 {
00071 unsigned char red;
00072 unsigned char green;
00073 unsigned char blue;
00074
00075 } COLOUR, * LPCOLOUR;
00076
00077 #define SET_COLOUR(c,r,g,b) c->red = (r); c->green = (g); c->blue = (b);
00078
00079
00080
00081
00082
00083
00084 #if defined(_WIN32)
00085 # define SLEEP(x) Sleep(x)
00086 #else
00087 # define SLEEP(x) usleep((x) * 1000)
00088 #endif
00089
00090
00091
00092 #define IILC_ASSERT(x) if (!(x)) { \
00093 printf("Assertion '%s' failed in file %s:%d\n", #x, __FILE__, __LINE__); \
00094 abort(); }
00095
00096
00097 #define ERR_MEM_ALLOC_FAILED 0x01
00098 #define ERR_MEM_FREE_FAILED 0x02
00099 #define ERR_END_OF_PACKET 0x03
00100 #define ERR_PACKET_FULL 0x04
00101 #define ERR_BAD_PARAMETER 0x05
00102 #define ERR_INVALID_DEVICE 0x06
00103 #define ERR_INSUFFICIENT_DATA 0x07
00104 #define ERR_BUFFER_TOO_SMALL 0x08
00105 #define ERR_INVALID_CONFIG 0x09
00106 #define ERR_OBJECT_NOT_FOUND 0x0A
00107 #define ERR_NOT_IMPLEMENTED 0x0B
00108 #define ERR_MUTEX_LOCK_FAILED 0x0C
00109 #define ERR_MUTEX_UNLOCK_FAILED 0x0D
00110
00111
00112
00113 #endif