FreeCalypso > hg > fc-tourmaline
annotate src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_i_96x64.c @ 276:4221c724c664
R2D: preparations for adding LCD hardware suspend handling
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 07 Sep 2021 21:05:38 +0000 |
parents | c905daaff834 |
children |
rev | line source |
---|---|
45
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include "r2d/lcds/luna/r2d_luna_lcd.h" |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 #include "r2d/lcds/luna/colormap.h" |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 void r2d_lcd_power_on(void) |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 { |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 } |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 void r2d_lcd_power_off(void) |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 { |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 } |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 void r2d_refresh(void) |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 { |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 UINT16 i, j, k; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 UINT32 v; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 UINT32 *p; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 INT16 y1, y2; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 p=r2d_g_framebuffer->p_memory_words; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 y1=r2d_update_ul_y; //0 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 y2=r2d_update_br_y; //63 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 |
276
4221c724c664
R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
24 if (y1 > y2) |
4221c724c664
R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
25 return; |
4221c724c664
R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
26 r2d_reinit_update_region(); |
4221c724c664
R2D: preparations for adding LCD hardware suspend handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
45
diff
changeset
|
27 |
45
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 /* set window area */ |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 LCD_REG_WR(0x36, 135); |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 LCD_REG_WR(0x37, 40); |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 LCD_REG_WR(0x38, y2 + 78); |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 LCD_REG_WR(0x39, y1 + 78); |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 /* set current write address */ |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 LCD_REG_WR(0x20, 40); |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 LCD_REG_WR(0x21, y1 + 78); |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 /* set up for GRAM write */ |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 LCD_IR = 0x22; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 p=p+y1*R2D_MWWIDTH; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 for (i=y1;i<=y2;i++) |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 { |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 for (j = 0; j < R2D_MWWIDTH-1; j++) |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 { |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 v=*p++; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 for (k=0;k<32;k++) |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 { |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 if (v&1) |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 LCD_DR = LCD16_COLOR_BLACK; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 else |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 LCD_DR = LCD16_COLOR_WHITE; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 v=v>>1; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 } |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 } |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 p++; |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 } |
c905daaff834
implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 } |