1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
/***************************************************
* EPD frame buffer device content manager (4 bits).
*
* Author : Gallen Lin
* Data : 2011/01/20
* Revision : 1.0
* File Name : epdfb_dc.h
*
****************************************************/
#ifndef __epdfb_dc_h//[
#define __epdfb_dc_h
typedef enum {
EPDFB_DC_SUCCESS = 0,
EPDFB_DC_PARAMERR = -1,
EPDFB_DC_MEMMALLOCFAIL = -2,
EPDFB_DC_OBJECTERR = -3, // dc object content error .
EPDFB_DC_PIXELBITSNOTSUPPORT = -4,
} EPDFB_DC_RET;
typedef enum {
EPDFB_R_0 = 0,
EPDFB_R_90 = 1,
EPDFB_R_180 = 2,
EPDFB_R_270 = 3,
} EPDFB_ROTATE_T;
typedef struct tagEPDFB_IMG {
unsigned long dwX,dwY;
unsigned long dwW,dwH;
unsigned char bPixelBits,bReserve;
unsigned char *pbImgBuf;
} EPDFB_IMG;
typedef void (*fnVcomEnable)(int iIsEnable);
typedef void (*fnPwrOnOff)(int iIsOn);
typedef void (*fnPwrAutoOffIntervalMax)(int iIsEnable);
typedef void (*fnAutoOffEnable)(int iIsEnable);
typedef int (*fnGetWaveformBpp)(void);
typedef int (*fnSetPartialUpdate)(int iIsPartial);
typedef unsigned char *(*fnGetRealFrameBuf)(void);
typedef unsigned char *(*fnGetRealFrameBufEx)(unsigned long *O_pdwFBSize);
typedef void (*fnDispStart)(int iIsStart);
typedef int (*fnGetWaveformMode)(void);
typedef void (*fnSetWaveformMode)(int iWaveformMode);
typedef int (*fnIsUpdating)(void);
typedef int (*fnWaitUpdateComplete)(void);
typedef int (*fnSetUpdateRect)(unsigned short wX,unsigned short wY,
unsigned short wW,unsigned short wH);
typedef int (*fnPutImg)(EPDFB_IMG *I_ptPutImage,EPDFB_ROTATE_T I_tRotate);
typedef int (*fnSetVCOM)(int iVCOM_set_mV);
typedef int (*fnSetVCOMToFlash)(int iVCOM_set_mV);
typedef int (*fnGetVCOM)(int *O_piVCOM_get_mV);
// epd framebuffer device content ...
typedef struct tagEPDFB_DC {
// public :
unsigned long dwWidth;// visible DC width .
unsigned long dwHeight;// visible DC height .
unsigned long dwFBWExtra; // frame buffer width extra width .
unsigned long dwFBHExtra; // frame buffer height extra height .
unsigned long dwFBXOffset; // frame buffer X offset .
unsigned long dwFBYOffset; // frame buffer Y offset .
unsigned char bPixelBits;
unsigned char bReservedA[1];
volatile unsigned char *pbDCbuf;// DC buffer .
fnGetWaveformBpp pfnGetWaveformBpp;
fnVcomEnable pfnVcomEnable;
fnSetPartialUpdate pfnSetPartialUpdate;
fnGetRealFrameBuf pfnGetRealFrameBuf;
fnGetRealFrameBufEx pfnGetRealFrameBufEx;
fnDispStart pfnDispStart;
fnGetWaveformMode pfnGetWaveformMode;
fnSetWaveformMode pfnSetWaveformMode;
fnIsUpdating pfnIsUpdating;
fnWaitUpdateComplete pfnWaitUpdateComplete;
fnSetUpdateRect pfnSetUpdateRect;
fnPwrAutoOffIntervalMax pfnPwrAutoOffIntervalMax;
fnPwrOnOff pfnPwrOnOff;
fnAutoOffEnable pfnAutoOffEnable;
fnPutImg pfnPutImg;
fnSetVCOM pfnSetVCOM;
fnSetVCOMToFlash pfnSetVCOMToFlash;
fnGetVCOM pfnGetVCOM;
// private : do not modify these member var .
// only for epdfbdc manager .
unsigned long dwMagicPrivateBegin;
unsigned long dwDCSize; // visible dc size .
unsigned long dwBufSize; // dc buffer real size .
unsigned long dwDCWidthBytes;
unsigned long dwFlags;
int iWFMode,iLastWFMode;
int iIsForceWaitUpdateFinished;
unsigned long dwDirtyOffsetStart,dwDirtyOffsetEnd;
unsigned long dwMagicPrivateEnd;
int dither8[16][16];
} EPDFB_DC;
#define epdfbdc_create_e60mt2() epdfbdc_create(800,600,4,0)
EPDFB_DC *epdfbdc_create(unsigned long dwW,unsigned long dwH,\
unsigned char bPixelBits,unsigned char *pbDCbuf);
#define EPDFB_DC_FLAG_DEFAUT (0x0)
#define EPDFB_DC_FLAG_REVERSEDRVDATA 0x00000001 // reverse drive data -> pixel 3,pixel 4,pixel 1,pixel 2 .
#define EPDFB_DC_FLAG_REVERSEINPDATA 0x00000002 // reverse input data -> pixel 3,pixel 4,pixel 1,pixel 2 .
#define EPDFB_DC_FLAG_SKIPLEFTPIXEL 0x00000004 // shift input image data (skip 1 pixel in image left side).
#define EPDFB_DC_FLAG_SKIPRIGHTPIXEL 0x00000008 // shift input image data (skip 1 pixel in image right side).
#define EPDFB_DC_FLAG_DITHER8 0x00000100 //
#define EPDFB_DC_FLAG_OFB_RGB565 0x00010000 // output framebuffer data format is rgb565 .
#define EPDFB_DC_FLAG_FLASHDIRTY 0x00020000 // only flash dirty image .
EPDFB_DC *epdfbdc_create_ex(unsigned long dwW,unsigned long dwH,\
unsigned char bPixelBits,unsigned char *pbDCbuf,unsigned long dwCreateFlag);
EPDFB_DC *epdfbdc_create_ex2(unsigned long dwFBW,unsigned long dwFBH,\
unsigned long dwW,unsigned long dwH,\
unsigned char bPixelBits,unsigned char *pbDCbuf,unsigned long dwCreateFlag);
EPDFB_DC_RET epdfbdc_delete(EPDFB_DC *I_pEPD_dc);
EPDFB_DC_RET epdfbdc_fbimg_normallize(EPDFB_DC *I_pEPD_dc,\
EPDFB_IMG *IO_pEPD_img);
EPDFB_DC_RET epdfbdc_put_fbimg(EPDFB_DC *I_pEPD_dc,\
EPDFB_IMG *I_pEPD_img,EPDFB_ROTATE_T I_tRotateDegree);
EPDFB_DC_RET epdfbdc_put_dcimg(EPDFB_DC *pEPD_dc,
EPDFB_DC *pEPD_dcimg,EPDFB_ROTATE_T tRotateDegree,
unsigned long I_dwDCimgX,unsigned long I_dwDCimgY,
unsigned long I_dwDCimgW,unsigned long I_dwDCimgH,
unsigned long I_dwDCPutX,unsigned long I_dwDCPutY);
EPDFB_DC_RET epdfbdc_get_dirty_region(EPDFB_DC *I_pEPD_dc,\
unsigned long *O_pdwDirtyOffsetStart,unsigned long *O_pdwDirtyOffsetEnd);
EPDFB_DC_RET epdfbdc_set_pixel(EPDFB_DC *I_pEPD_dc,\
unsigned long I_dwX,unsigned long I_dwY,unsigned long I_dwPVal);
EPDFB_DC_RET epdfbdc_dcbuf_to_RGB565(EPDFB_DC *I_pEPD_dc,\
unsigned char *O_pbRGB565Buf,unsigned long I_dwRGB565BufSize);
EPDFB_DC_RET epdfbdc_rotate(EPDFB_DC *I_pEPD_dc,EPDFB_ROTATE_T I_tRotate);
EPDFB_DC_RET epdfbdc_set_host_dataswap(EPDFB_DC *I_pEPD_dc,int I_isSet);
EPDFB_DC_RET epdfbdc_set_drive_dataswap(EPDFB_DC *I_pEPD_dc,int I_isSet);
EPDFB_DC_RET epdfbdc_set_skip_pixel(EPDFB_DC *I_pEPD_dc,int iIsSet,int iIsSkipRight);
EPDFB_DC_RET epdfbdc_get_rotate_active(EPDFB_DC *I_pEPD_dc,
unsigned long *IO_pdwX,unsigned long *IO_pdwY,
unsigned long *IO_pdwW,unsigned long *IO_pdwH,
EPDFB_ROTATE_T I_tRotate);
EPDFB_DC_RET epdfbdc_set_width_height(EPDFB_DC *I_pEPD_dc,
unsigned long dwFBW,unsigned long dwFBH,
unsigned long dwW,unsigned long dwH);
EPDFB_DC_RET epdfbdc_set_fbxyoffset(EPDFB_DC *I_pEPD_dc,
unsigned long dwFBXOffset,unsigned long dwFBYOffset);
EPDFB_DC_RET epdfbdc_set_flags(EPDFB_DC *I_pEPD_dc,unsigned long *pIO_dwFlags);
EPDFB_DC_RET epdfbdc_get_flags(EPDFB_DC *I_pEPD_dc,unsigned long *pO_dwFlags);
#endif //]__epdfb_dc_h
|