2 * display.c - handling the display
4 * author: hackbard@hackdaworld.org
10 #include "default_logo.h"
17 void display_fill_screen(u8 fill) {
21 for(page=0;page<DISPLAY_PAGE_MAX;page++) {
22 DISPLAY_SET_C_ADDR(0);
23 DISPLAY_SET_PAGE_ADDR(page);
24 for(width=0;width<DISPLAY_DIMX;width++) {
31 void display_clear_screen(void) {
33 display_fill_screen(0x00);
36 void display_init(void) {
38 DISPLAY_EXIT_POWER_SAVE;
43 DISPLAY_START_OSCILLATOR;
45 DISPLAY_SET_REGULATOR(7);
47 DISPLAY_SET_CONTRAST(0x38);
49 DISPLAY_SET_CONV_FACTOR(0x01);
51 DISPLAY_SET_PWM_FRC(0,0);
54 DISPLAY_SET_WHITE(0,0,0,0);
55 DISPLAY_SET_LGRAY(2,2,2,2);
56 DISPLAY_SET_DGRAY(6,6,6,6);
57 DISPLAY_SET_BLACK(9,9,9,9);
59 DISPLAY_SET_POWER(DISPLAY_REGULATOR|DISPLAY_OPAMP);
61 DISPLAY_SET_POWER(DISPLAY_V_BOOST|DISPLAY_REGULATOR|DISPLAY_OPAMP);
63 DISPLAY_RAM_CONTENTS_ON;
67 display_clear_screen();
72 void display_load_logo(u8 *src) {
83 for(page=0;page<DISPLAY_PAGE_MAX;page++) {
84 DISPLAY_SET_C_ADDR(0);
85 DISPLAY_SET_PAGE_ADDR(page);
86 for(width=0;width<DISPLAY_DIMX;width++) {
88 DISPLAY_DATA=s[cnt+1];
94 void display_bl_init(void) {
97 IOSET0=(1<<4); // off by default
100 void display_bl_toggle(void) {
108 void display_bl_on(void) {
113 void display_bl_off(void) {