annotate src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_i_96x64.c @ 45:c905daaff834

implemented 96x64 BW framebuffer config, compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 17 Oct 2020 21:30:59 +0000
parents
children 4221c724c664
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 /* set window area */
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 LCD_REG_WR(0x36, 135);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 LCD_REG_WR(0x37, 40);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 LCD_REG_WR(0x38, y2 + 78);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 LCD_REG_WR(0x39, y1 + 78);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 /* set current write address */
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 LCD_REG_WR(0x20, 40);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 LCD_REG_WR(0x21, y1 + 78);
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 /* set up for GRAM write */
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 LCD_IR = 0x22;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 p=p+y1*R2D_MWWIDTH;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 for (i=y1;i<=y2;i++)
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 for (j = 0; j < R2D_MWWIDTH-1; j++)
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 v=*p++;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 for (k=0;k<32;k++)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 {
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 if (v&1)
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 LCD_DR = LCD16_COLOR_BLACK;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 else
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 LCD_DR = LCD16_COLOR_WHITE;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 v=v>>1;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 }
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 }
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 p++;
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 }
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 r2d_reinit_update_region();
c905daaff834 implemented 96x64 BW framebuffer config, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 }