FreeCalypso > hg > fc-magnetite
comparison src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_i.c @ 650:7d6878435c85
R2D: Luna LCD driver implemented
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 07 May 2020 07:32:27 +0000 |
parents | |
children | 8c0bd0b6447c |
comparison
equal
deleted
inserted
replaced
649:37396b85f3f7 | 650:7d6878435c85 |
---|---|
1 #include "r2d/lcds/luna/r2d_luna_lcd.h" | |
2 #include "rvm/rvm_use_id_list.h" | |
3 | |
4 void r2d_lcd_power_on(void) | |
5 { | |
6 } | |
7 | |
8 void r2d_lcd_power_off(void) | |
9 { | |
10 } | |
11 | |
12 void r2d_refresh(void) | |
13 { | |
14 UINT16 i,j; | |
15 UINT32 v; | |
16 UINT32 *p; | |
17 INT16 x1,x2,y1,y2,de,ds; | |
18 | |
19 p=r2d_g_framebuffer->p_memory_words; | |
20 | |
21 x1=(r2d_update_ul_x>>1)<<1; //0 | |
22 x2=((r2d_update_br_x>>1)<<1)+1; //174; | |
23 | |
24 ds=(x1>>1); | |
25 de=R2D_MWWIDTH-(x2>>1)-1; // WHY -1, is formula right ???? | |
26 | |
27 y1=r2d_update_ul_y; //0 | |
28 y2=r2d_update_br_y; //219 | |
29 | |
30 /* set window area */ | |
31 LCD_REG_WR(0x36, x2); | |
32 LCD_REG_WR(0x37, x1); | |
33 LCD_REG_WR(0x38, y2); | |
34 LCD_REG_WR(0x39, y1); | |
35 /* set current write address */ | |
36 LCD_REG_WR(0x20, x1); | |
37 LCD_REG_WR(0x21, y1); | |
38 /* set up for GRAM write */ | |
39 LCD_IR = 0x22; | |
40 | |
41 p=p+y1*R2D_MWWIDTH; | |
42 | |
43 for(i=y1;i<=y2;i++) | |
44 { | |
45 p+=ds; | |
46 for(j=(x1>>1);j<=(x2>>1);j++) | |
47 { | |
48 v=*p++; | |
49 v=~v; | |
50 | |
51 /*white*/ | |
52 /*v=0xffffffff*/ | |
53 /*black*/ | |
54 /*v=0x00000000*/ | |
55 | |
56 LCD_DR = v&0x0FFFF; | |
57 LCD_DR = v>>16; | |
58 } | |
59 p+=de; | |
60 } | |
61 | |
62 r2d_check_and_send_event(r2d_g_framebuffer); | |
63 r2d_reinit_update_region(); | |
64 } |