X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Farm.git;a=blobdiff_plain;f=betty%2Fdisplay.c;h=71791fc0449fd97013c6d7b14ea7b43e3272b278;hp=1d6af1a0eb2ae2785a9af75d7e1bbfed9f990a4c;hb=ec21607f7dc421c6a474d93b90e9045ec465a222;hpb=be9286b8103eef7df95506c831b48ec5c1d6f32f diff --git a/betty/display.c b/betty/display.c index 1d6af1a..71791fc 100644 --- a/betty/display.c +++ b/betty/display.c @@ -6,6 +6,9 @@ */ #include "display.h" +#include "system.h" +#include "default_logo.h" +#include "uart.h" /* * functions @@ -24,18 +27,39 @@ void display_clear_screen(void) { void display_init(void) { - /* configure the ext mem bank interface */ - BCFG1=0x00000c42; - DISPLAY_EXIT_POWER_SAVE; - /* reset the display, wait until its up again */ DISPLAY_SOFT_RESET; pause(0xffffff); DISPLAY_START_OSCILLATOR; - DISPLAY_SET_POWER(DISPLAY_V_BOOST|DISPLAY_REGULATOR); + DISPLAY_SET_REGULATOR(7); + + DISPLAY_SET_CONTRAST(0x38); + + DISPLAY_SET_CONV_FACTOR(0x01); + + DISPLAY_SET_UW_CORNER(0x1c,0x0a); + DISPLAY_SET_LW_CORNER(0x75,0x81); + + DISPLAY_SET_PWM_FRC(0,0); + + DISPLAY_SET_WHITE(0,0,0,0); + DISPLAY_SET_LGRAY(4,4,4,4); + DISPLAY_SET_DGRAY(6,6,6,6); + DISPLAY_SET_BLACK(9,9,9,9); + + DISPLAY_SET_SEGMENT_REMAP_00H; + DISPLAY_SET_COM_ODIR_REMAPPED; + + DISPLAY_SET_POWER(DISPLAY_REGULATOR|DISPLAY_OPAMP); + pause(0xffffff); + DISPLAY_SET_POWER(DISPLAY_V_BOOST|DISPLAY_REGULATOR|DISPLAY_OPAMP); + + DISPLAY_RAM_CONTENTS_ON; + + DISPLAY_NORMAL; display_clear_screen(); @@ -45,18 +69,23 @@ void display_init(void) { void display_load_logo(u8 *src) { u32 cnt; + u8 *s; + + s=src; + if(s==0) + s=default_logo; DISPLAY_SET_PAGE_ADDR(0); DISPLAY_SET_C_ADDR(0); for(cnt=0;cnt