diff 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
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_96x64.c	Sat Oct 17 21:30:59 2020 +0000
@@ -0,0 +1,55 @@
+#include "r2d/lcds/luna/r2d_luna_lcd.h"
+#include "r2d/lcds/luna/colormap.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; //63
+
+	/* set window area */
+	LCD_REG_WR(0x36, 135);
+	LCD_REG_WR(0x37, 40);
+	LCD_REG_WR(0x38, y2 + 78);
+	LCD_REG_WR(0x39, y1 + 78);
+	/* set current write address */
+	LCD_REG_WR(0x20, 40);
+	LCD_REG_WR(0x21, y1 + 78);
+	/* 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 = LCD16_COLOR_BLACK;
+				else
+					LCD_DR = LCD16_COLOR_WHITE;
+				v=v>>1;
+			}
+		}	    
+		p++;
+	} 
+
+	r2d_reinit_update_region();
+}