projects
/
my-code
/
arm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
basic lcd control (must get improved!)
[my-code/arm.git]
/
betty
/
display.c
diff --git
a/betty/display.c
b/betty/display.c
index
71791fc
..
e102141
100644
(file)
--- a/
betty/display.c
+++ b/
betty/display.c
@@
-16,13
+16,16
@@
void display_clear_screen(void) {
void display_clear_screen(void) {
- u32 cnt;
-
- DISPLAY_SET_PAGE_ADDR(0);
- DISPLAY_SET_C_ADDR(0);
-
- for(cnt=0;cnt<DISPLAY_RAM_CONTENT;cnt++)
- DISPLAY_DATA=0x00;
+ u8 page,width;
+
+ for(page=0;page<DISPLAY_PAGE_MAX;page++) {
+ DISPLAY_SET_C_ADDR(0);
+ DISPLAY_SET_PAGE_ADDR(page);
+ for(width=0;width<DISPLAY_DIMX;width++) {
+ DISPLAY_DATA=0x00;
+ DISPLAY_DATA=0x00;
+ }
+ }
}
void display_init(void) {
}
void display_init(void) {
@@
-40,19
+43,14
@@
void display_init(void) {
DISPLAY_SET_CONV_FACTOR(0x01);
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_PWM_FRC(0,0);
+ // gray scale palette
DISPLAY_SET_WHITE(0,0,0,0);
DISPLAY_SET_WHITE(0,0,0,0);
- DISPLAY_SET_LGRAY(
4,4,4,4
);
+ DISPLAY_SET_LGRAY(
2,2,2,2
);
DISPLAY_SET_DGRAY(6,6,6,6);
DISPLAY_SET_BLACK(9,9,9,9);
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_SET_POWER(DISPLAY_REGULATOR|DISPLAY_OPAMP);
pause(0xffffff);
DISPLAY_SET_POWER(DISPLAY_V_BOOST|DISPLAY_REGULATOR|DISPLAY_OPAMP);
@@
-68,18
+66,24
@@
void display_init(void) {
void display_load_logo(u8 *src) {
void display_load_logo(u8 *src) {
- u32 cnt;
u8 *s;
u8 *s;
+ u8 page,width;
+ u32 cnt;
s=src;
if(s==0)
s=default_logo;
s=src;
if(s==0)
s=default_logo;
- DISPLAY_SET_PAGE_ADDR(0);
- DISPLAY_SET_C_ADDR(0);
-
- for(cnt=0;cnt<DISPLAY_RAM_CONTENT;cnt++)
- DISPLAY_DATA=s[cnt];
+ cnt=0;
+ for(page=0;page<DISPLAY_PAGE_MAX;page++) {
+ DISPLAY_SET_C_ADDR(0);
+ DISPLAY_SET_PAGE_ADDR(page);
+ for(width=0;width<DISPLAY_DIMX;width++) {
+ DISPLAY_DATA=s[cnt];
+ DISPLAY_DATA=s[cnt+1];
+ cnt+=2;
+ }
+ }
}
void display_bl_init(void) {
}
void display_bl_init(void) {