FreeCalypso > hg > fc-magnetite
comparison src/cs/drivers/drv_app/r2d/lcds/D_Sample/r2d_task_i.c @ 0:945cf7f506b2
src/cs: chipsetsw import from tcs211-fcmodem
binary blobs and LCD demo files have been excluded,
all line endings are LF only
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 25 Sep 2016 22:50:11 +0000 |
parents | |
children | f9e7fac0b437 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:945cf7f506b2 |
---|---|
1 #include "r2d/lcds/d_sample/r2d_tfd_lcd.h" | |
2 #include "rvm/rvm_use_id_list.h" | |
3 | |
4 #define RGB(R, G, B) ( (((unsigned char)(R) & 0xf8) << 8) | (((unsigned char)(G) & 0xfc) << 3) | (((unsigned char)(B) & 0xf8) >> 3) ) | |
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 UINT16 i,j; | |
17 | |
18 #ifndef _WINDOWS | |
19 | |
20 UINT32 v; | |
21 UINT32 *p; | |
22 INT16 x1,x2,y1,y2,de,ds; | |
23 UINT32 a,b,c,d,e,f; | |
24 | |
25 p=r2d_g_framebuffer->p_memory_words; | |
26 | |
27 #if (R2D_REFRESH == R2D_HORIZONTAL) | |
28 | |
29 LCD_activate; | |
30 | |
31 x1=(r2d_update_ul_x>>1)<<1; //0 | |
32 x2=((r2d_update_br_x>>1)<<1)+1; //174; | |
33 | |
34 ds=(x1>>1); | |
35 de=R2D_MWWIDTH-(x2>>1)-1; // WHY -1, is formula right ???? | |
36 | |
37 y1=r2d_update_ul_y; //0 | |
38 y2=r2d_update_br_y; //219 | |
39 | |
40 //sprintf(debug,"%d,%d,%d,%d",x1,y1,x2,y2); | |
41 //rvf_send_trace(debug,strlen(debug), NULL_PARAM, | |
42 // RV_TRACE_LEVEL_DEBUG_HIGH, R2D_USE_ID ); | |
43 | |
44 LCD_cmd (LCD_SD_PSET); // set area devoted to MPU interface | |
45 LCD_data (y1 & 0xff); | |
46 LCD_data (y1 >> 8); | |
47 LCD_data (y2 & 0xff); | |
48 LCD_data (y2 >> 8); | |
49 | |
50 LCD_cmd (LCD_SD_CSET); // set area devoted to MPU interface | |
51 LCD_data ((x1+2) & 0xff); | |
52 LCD_data ((x1+2) >> 8); | |
53 LCD_data ((x2+2) & 0xff); | |
54 LCD_data ((x2+2) >> 8); | |
55 | |
56 | |
57 LCD_cmd(LCD_RAMWR); | |
58 p=p+y1*R2D_MWWIDTH; | |
59 | |
60 for(i=y1;i<=y2;i++) | |
61 { | |
62 p+=ds; | |
63 for(j=(x1>>1);j<=(x2>>1);j++) | |
64 { | |
65 v=*p++; | |
66 v=~v; | |
67 | |
68 /*white*/ | |
69 /*v=0xffffffff*/ | |
70 | |
71 /*black*/ | |
72 /*v = 0x00000000*/ | |
73 | |
74 /* The code below is a temporary fix for a problem with the LCD drivers. | |
75 * Currently, the LCD can only display colors in the range 0x0000 - 0xad55 | |
76 * The code below maps pixel values into this range (divide by 2) | |
77 * Ideally, Epsom should provide a new GCP64 array to allow display of all | |
78 * colors. a-hill@ti.com*/ | |
79 | |
80 /*if(v!=0xffffffff) | |
81 { | |
82 | |
83 a = ((v&0xf8000000)>>1)&0xf8000000; | |
84 b = ((v&0x07e00000)>>1)&0x07e00000; | |
85 c= ((v&0x001f0000)>>1)&0x001f0000; | |
86 | |
87 d = ((v&0x0000f800)>>1)&0x0000f800; | |
88 e = ((v&0x000007e0)>>1)&0x000007e0; | |
89 f= ((v&0x0000001f)>>1)&0x0000001f; | |
90 | |
91 v = a|b|c|d|e|f; | |
92 }*/ | |
93 | |
94 LCD_data(v&0x0FFFF); | |
95 LCD_data(v>>16); | |
96 | |
97 | |
98 } | |
99 p+=de; | |
100 | |
101 | |
102 | |
103 } | |
104 | |
105 LCD_deactivate; | |
106 #endif | |
107 #endif | |
108 | |
109 r2d_check_and_send_event(r2d_g_framebuffer); | |
110 r2d_reinit_update_region(); | |
111 | |
112 } |