changeset 656:9c42614e0a5e

Luna R2D: support D-Sample B&W mode too
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 07 May 2020 23:19:27 +0000
parents ba32dc03f550
children b36733f14177
files src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_i_bw.c src/cs/drivers/drv_app/r2d/r2d_inits.c src/cs/drivers/drv_app/r2d/r2d_refresh.c
diffstat 3 files changed, 72 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cs/drivers/drv_app/r2d/lcds/luna/r2d_task_i_bw.c	Thu May 07 23:19:27 2020 +0000
@@ -0,0 +1,62 @@
+#include "r2d/lcds/luna/r2d_luna_lcd.h" 
+
+void r2d_lcd_power_on(void)
+{
+}
+
+void r2d_lcd_power_off(void)
+{
+}
+
+void r2d_refresh(void)
+{
+	UINT16 i, j, k;
+	UINT32 v;
+	UINT32 *p;
+	INT16 y1, y2;
+
+	p=r2d_g_framebuffer->p_memory_words;
+    
+	y1=r2d_update_ul_y; //0
+	y2=r2d_update_br_y; //219
+
+	/* set window area */
+	LCD_REG_WR(0x36, 175);
+	LCD_REG_WR(0x37, 0);
+	LCD_REG_WR(0x38, y2);
+	LCD_REG_WR(0x39, y1);
+	/* set current write address */
+	LCD_REG_WR(0x20, 0);
+	LCD_REG_WR(0x21, y1);
+	/* set up for GRAM write */
+	LCD_IR = 0x22;
+
+	p=p+y1*R2D_MWWIDTH;
+
+	for (i=y1;i<=y2;i++)
+	{
+		for (j = 0; j < R2D_MWWIDTH-1; j++)
+		{
+			v=*p++;
+			for (k=0;k<32;k++)
+			{
+				if (v&1)
+					LCD_DR = 0x0000;
+				else
+					LCD_DR = 0xFFFF;
+				v=v>>1;
+			}
+		}	    
+		v=*p++;
+		for (k=0;k<16;k++)
+		{
+			if (v&1)
+				LCD_DR = 0x0000;
+			else
+				LCD_DR = 0xFFFF;
+			v=v>>1;
+		}
+	} 
+
+	r2d_reinit_update_region();
+}
--- a/src/cs/drivers/drv_app/r2d/r2d_inits.c	Thu May 07 22:39:59 2020 +0000
+++ b/src/cs/drivers/drv_app/r2d/r2d_inits.c	Thu May 07 23:19:27 2020 +0000
@@ -133,7 +133,11 @@
 #endif
 
 #if (R2D_EMBEDDED_LCD == R2D_BOARD_BW_DSAMPLE)
-#include "r2d/lcds/BW_D_Sample/r2d_task_init_i.c"
+  #ifdef CONFIG_TARGET_LUNA
+    #include "r2d/lcds/luna/r2d_task_init_i.c"
+  #else
+    #include "r2d/lcds/BW_D_Sample/r2d_task_init_i.c"
+  #endif
 #endif
 
 UINT32 r2d_get_memory_bank_size()
--- a/src/cs/drivers/drv_app/r2d/r2d_refresh.c	Thu May 07 22:39:59 2020 +0000
+++ b/src/cs/drivers/drv_app/r2d/r2d_refresh.c	Thu May 07 23:19:27 2020 +0000
@@ -110,6 +110,10 @@
 #endif
 
 #if (R2D_EMBEDDED_LCD == R2D_BOARD_BW_DSAMPLE)
-#include "lcds/BW_D_Sample/r2d_task_i.c"
+  #ifdef CONFIG_TARGET_LUNA
+    #include "lcds/luna/r2d_task_i_bw.c"
+  #else
+    #include "lcds/BW_D_Sample/r2d_task_i.c"
+  #endif
 #endif