work driver pcf8812

ugfx_release_2.6
root 2014-07-03 18:13:49 +03:00
parent fd17106f99
commit d8d47f804e
1 changed files with 19 additions and 16 deletions

View File

@ -54,7 +54,7 @@
* As this controller can't update on a pixel boundary we need to maintain the
* the entire display surface in memory so that we can do the necessary bit
* operations. Fortunately it is a small display in monochrome.
* 65 * 102 / 8 = 829 bytes.
* 102 * 65 / 8 = 828,75 bytes.
*/
LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
@ -81,9 +81,9 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
write_cmd(g, PCF8812_SET_X); // X = 0
write_cmd(g, PCF8812_SET_Y); // Y = 0
unsigned int i;
for (i = 0; i < (GDISP_SCREEN_WIDTH * (GDISP_SCREEN_HEIGHT / 8)); i++) {
for (i = 0; i < (GDISP_SCREEN_WIDTH * (GDISP_SCREEN_HEIGHT / 8)); ++i) {
write_data(g, 0x00, 1);
}
@ -93,6 +93,9 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
// Release the bus
release_bus(g);
/* Turn on the back-light */
set_backlight(g, GDISP_INITIAL_BACKLIGHT);
/* Initialise the GDISP structure */
g->g.Width = GDISP_SCREEN_WIDTH;
g->g.Height = GDISP_SCREEN_HEIGHT;
@ -114,12 +117,12 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
acquire_bus(g);
write_cmd(g, PCF8812_SET_X);
write_cmd(g, PCF8812_SET_Y);
write_cmd(g, PCF8812_SET_X); // X = 0
write_cmd(g, PCF8812_SET_Y); // Y = 0
unsigned int i;
for (i = 0; i < (GDISP_SCREEN_WIDTH * (GDISP_SCREEN_HEIGHT / 8)); i++) {
for (i = 0; i < (GDISP_SCREEN_WIDTH * (GDISP_SCREEN_HEIGHT / 8)); ++i) {
write_data(g, RAM(g)[i], 1);
}