567d06494273dd46b0700e1a385ed290b0ed3119
[vuplus_dvbapp] / lib / gdi / lcd.h
1 #ifndef DISABLE_LCD
2
3 #ifndef __lcd_h
4 #define __lcd_h
5
6 #include <asm/types.h>
7 #include <lib/gdi/esize.h>
8 #include <lib/gdi/erect.h>
9
10 #define LCD_CONTRAST_MIN 0
11 #define LCD_CONTRAST_MAX 63
12 #define LCD_BRIGHTNESS_MIN 0
13 #define LCD_BRIGHTNESS_MAX 255
14
15 class eLCD
16 {
17 protected:
18         eSize res;
19         unsigned char *_buffer;
20         int lcdfd;
21         int _stride;
22         int locked;
23 public:
24         int lock();
25         void unlock();
26
27         eLCD(eSize size);
28         virtual ~eLCD();
29
30         __u8 *buffer() { return (__u8*)_buffer; }
31         int stride() { return _stride; }
32         eSize size() { return res; }
33         
34         virtual void update()=0;
35 };
36
37 class eDBoxLCD: public eLCD
38 {
39         static eDBoxLCD *instance;
40         unsigned char inverted;
41 public:
42         static eDBoxLCD *getInstance();
43         int switchLCD(int state);
44         int setLCDParameter(int brightness, int contrast);
45         void setInverted( unsigned char );
46         eDBoxLCD();
47         ~eDBoxLCD();
48         void update();
49 };
50
51 #endif
52
53 #endif //DISABLE_LCD