Iím working with SPI GLCD EADOGM128-6 http://www.lcd-module.com/eng/pdf/grafik/dogm128e.pdf
I want to make it compatible with PDS GLCD commands, similar to what I did with their SPI Alfa LCD (see http://www.protonbasic.co.uk/content...-Print-command). With the Alphanumeric SPI it was easy: once the redirected Print function distinguished between data or command ($FE), all its derivatives such as Cls, Cursor and Print At x,y automatically functioned correctly. Unfortunately, with GLCD itís more complicated. I followed a similar concept. I got it to work with the Print command but I have to get to the x, y coordinates in separate functions and I have no idea how to include coordinates in comands such as Print At x,y,..., Cursor x,y, Plot x,y, etc.
Here is what I got now:
The above allow me to use the Print command with the benefits of string formatting etc.Code:LCD_Type = GRAPHIC #Disable Print ' "hack" the Print command '===[Print command redirect]===================== @Print ' ASM Print redirect WREG_BYTE LCDBYTE ' load LCDBYTE to the W Register GoTo GLCD_WriteAscii ' executed in GLCD_WriteAscii '================================================ GLCD_WriteAscii: High A0 ' send as Data Low CS1B ' CSN For lcd_indx = 0 To 5 font_indx = LCDBYTE * 6 + lcd_indx ' pointer to font table lcd_temp = CRead8 Font[font_indx] ' get font bytes GoSub SPI_GLOBAL[lcd_temp] ' SPI to GLCD Next High CS1B Return GoPageCol: lcd_temp = (y & 0x0F) | 0xB0 ' page address + 110000 GoSub GlcdCmd[lcd_temp] GoSub GoColumn Return GoLineCol: lcd_temp = (~linepos & 0x3F) | 0x40 ' inverted line number + 1000000 so 0 is the top of the screen GoSub GlcdCmd[lcd_temp] GoSub GoColumn Return GoColumn: lcd_temp = (x >> 4)| 0x10 ' column address high nibble + 010000 GoSub GlcdCmd[lcd_temp] lcd_temp = x & 0x0F ' column address low nibble GoSub GlcdCmd[lcd_temp] Return
For example,this code works fine:
Can anyone point me in the right direction for ďhackingĒ PDS's GLCD commands which include coordinates (Print At, x, y, Plot x,y etc.) ?Code:Y = 3 X = 63 Gosub GoPageCol Print ďABCĒ, Hex2 Var1