2 * display.c - handling the display
4 * author: hackbard@hackdaworld.org
10 #include "default_logo.h"
17 void display_clear_screen(void) {
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_init(void) {
33 DISPLAY_EXIT_POWER_SAVE;
38 DISPLAY_START_OSCILLATOR;
40 DISPLAY_SET_REGULATOR(7);
42 DISPLAY_SET_CONTRAST(0x38);
44 DISPLAY_SET_CONV_FACTOR(0x01);
46 DISPLAY_SET_PWM_FRC(0,0);
49 DISPLAY_SET_WHITE(0,0,0,0);
50 DISPLAY_SET_LGRAY(2,2,2,2);
51 DISPLAY_SET_DGRAY(6,6,6,6);
52 DISPLAY_SET_BLACK(9,9,9,9);
54 DISPLAY_SET_POWER(DISPLAY_REGULATOR|DISPLAY_OPAMP);
56 DISPLAY_SET_POWER(DISPLAY_V_BOOST|DISPLAY_REGULATOR|DISPLAY_OPAMP);
58 DISPLAY_RAM_CONTENTS_ON;
62 display_clear_screen();
67 void display_load_logo(u8 *src) {
78 for(page=0;page<DISPLAY_PAGE_MAX;page++) {
79 DISPLAY_SET_C_ADDR(0);
80 DISPLAY_SET_PAGE_ADDR(page);
81 for(width=0;width<DISPLAY_DIMX;width++) {
83 DISPLAY_DATA=s[cnt+1];
89 void display_bl_init(void) {
92 IOSET0=(1<<4); // off by default
95 void display_bl_toggle(void) {
103 void display_bl_on(void) {
108 void display_bl_off(void) {