comparison chipsetsw/drivers/drv_app/r2d/lcds/ColorBoard/r2d_task_i.c @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 #define MASTER_CMD(data) *(volatile unsigned char*)0x2000005 = (data)
2 #define MASTER_DATA(data) *(volatile unsigned char*)0x2000004 = (data)
3 #define SLAVE_CMD(data) *(volatile unsigned char*)0x2000003 = (data)
4 #define SLAVE_DATA(data) *(volatile unsigned char*)0x2000002 = (data)
5
6 void r2d_lcd_power_on(void)
7 {
8 }
9
10 void r2d_lcd_power_off(void)
11 {
12 }
13
14 void r2d_refresh(void)
15 {
16 INT16 x,y;
17
18 UINT32 v;
19
20 UINT32 *mp,*sp;
21 UINT32 mtmp,stmp;
22
23
24
25 #ifndef _WINDOWS
26 MASTER_CMD(0xF0); // RE register set
27 MASTER_CMD(0xA3); // Auto incremnent
28 MASTER_CMD(0x00); // X Address set (lower)
29 MASTER_CMD(0x10); // X Address set (upper)
30 MASTER_CMD(0x20); // Y Address set (lower)
31 MASTER_CMD(0x30); // Y Address set (upper)
32 MASTER_CMD(0x97); // Display control
33
34 //position slave
35 SLAVE_CMD(0xF0); // RE register set
36 SLAVE_CMD(0xA3); // Auto incremnent
37 SLAVE_CMD(0x00); // X Address set (lower)
38 SLAVE_CMD(0x10); // X Address set (upper)
39 SLAVE_CMD(0x20); // Y Address set (lower)
40 SLAVE_CMD(0x30); // Y Address set (upper)
41 SLAVE_CMD(0x96); // Display control
42 #endif
43
44 // rvf_send_trace("R2D REFRESH",strlen("R2D REFRESH"), NULL_PARAM,
45 // RV_TRACE_LEVEL_DEBUG_HIGH, TRACE_XXX );
46
47 mp=r2d_g_framebuffer->p_memory_words;
48
49 // One word added by computation of R2D_MWWIDTH
50 // so 49 used instead of 48
51 sp=mp+(64*49);
52
53
54
55
56 for (y=0;y<64;y++)
57 {
58 for (x=0; x<48;x++)
59 {
60
61 mtmp=~(*mp++);
62 stmp=~(*sp++);
63
64 MASTER_DATA(mtmp&0xFF);
65 SLAVE_DATA(stmp&0xFF);
66 #ifndef _WINDOWS
67 mtmp>>=16;
68 stmp>>=16;
69 MASTER_DATA(mtmp&0xFF);
70 SLAVE_DATA(stmp&0xFF);
71
72 #endif
73 }
74 // R2D_MWWIDTH is one word larger than the real LCD size
75 // so when refreshing that must be taken into account
76 *mp++;
77 *sp++;
78 }
79
80 // Finish sending datas to LCD
81
82 r2d_reinit_update_region();
83 #ifdef _WINDOWS
84 lcd_refresh();
85 #endif
86 }