FreeCalypso > hg > fc-selenite
comparison src/cs/drivers/drv_app/r2d/lcds/PC_CSAMPLE/r2d_task_i.c @ 0:b6a5e36de839
src/cs: initial import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 15 Jul 2018 04:39:26 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b6a5e36de839 |
---|---|
1 | |
2 #ifndef _WINDOWS | |
3 #include "r2d/uwire.h" | |
4 #endif | |
5 | |
6 | |
7 | |
8 //value to transmit in order to set the x position on the lcd | |
9 static const char x_position[DISP_PIXELWIDTH] ={0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, | |
10 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f, | |
11 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf, | |
12 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf, | |
13 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf, | |
14 0xd0,0xd1,0xd2,0xd3}; | |
15 | |
16 //value to transmit in order to set the y position on the lcd | |
17 static const char y_position[DISP_PAGEHEIGHT] ={0x40,0x41,0x42,0x43,0x44,0x45}; | |
18 | |
19 | |
20 UINT32 r2d_p_refresh_buffer[4*R2D_WIDTH*R2D_MWHEIGHT]; | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 /********************************************************************/ | |
27 /* set the DC input to high for data transmission */ | |
28 /* */ | |
29 /********************************************************************/ | |
30 | |
31 | |
32 void r2d_lcd_power_on(void) | |
33 { | |
34 } | |
35 | |
36 void r2d_lcd_power_off(void) | |
37 { | |
38 } | |
39 | |
40 void r2d_refresh(void) | |
41 { | |
42 UINT16 i,j,k; | |
43 | |
44 UINT32 v; | |
45 UINT32 *p; | |
46 | |
47 HDC bm; | |
48 | |
49 bm=lcd_get_dc(); | |
50 | |
51 | |
52 //rvf_send_trace("R2D REFRESH",strlen("R2D REFRESH"), NULL_PARAM, | |
53 // RV_TRACE_LEVEL_DEBUG_HIGH, TRACE_XXX ); | |
54 | |
55 p=r2d_g_framebuffer->p_memory_words; | |
56 | |
57 | |
58 | |
59 i=0; | |
60 while(i<R2D_WIDTH) | |
61 { | |
62 j=0; | |
63 while(j<R2D_MWHEIGHT*32) | |
64 { | |
65 // If can read a new word from framebuffer | |
66 // and write it to refresh buffer | |
67 //if (r2d_p_refresh_state[i]+4<=R2D_MWHEIGHT*4) | |
68 v=*p++; | |
69 for(k=0;k<32;k++) | |
70 { | |
71 //r2d_p_refresh_state[i]+=4; | |
72 | |
73 if (v & 1) | |
74 SetPixelV(bm,i,j+k , | |
75 0); | |
76 else | |
77 SetPixelV(bm,i,j+k , | |
78 RGB(197,210,216)); | |
79 v=v>>1; | |
80 | |
81 } | |
82 | |
83 j+=32; | |
84 | |
85 | |
86 } | |
87 i++; | |
88 | |
89 } | |
90 | |
91 r2d_reinit_update_region(); | |
92 | |
93 | |
94 lcd_refresh(); | |
95 | |
96 | |
97 | |
98 } | |
99 | |
100 | |
101 |