View Single Post
  #285 (permalink)  
Old 19th Sep 2009, 10:17 am
AleMaxx AleMaxx is offline
Member
Keen on MPx players
 
Join Date: Sep 2007
Posts: 68
Default

Here is what I got for the init code
(warning: may contain wrong values, this is an error-prone preocedure):
Code:
void KnobsLCD_PowerOnInit(void)
{
    Mcupanel_RegSet(0x600, 1);
    delay_nops(10);
    Mcupanel_RegSet(0x600, 0);
    delay_nops(10);
    Mcupanel_RegSet(0x606, 0);
    Mcupanel_RegSet(0x001, 0);
    Mcupanel_RegSet(0x003, 0x10B8);
    Mcupanel_RegSet(0x002, 0x100);
    Mcupanel_RegSet(0x006, 0);
    Mcupanel_RegSet(0x008, 0x808);
    Mcupanel_RegSet(0x009, 1);
    Mcupanel_RegSet(0x00B, 0x10);
    Mcupanel_RegSet(0x00C, 0);
    Mcupanel_RegSet(0x00F, 0);
    Mcupanel_RegSet(0x400, 0x3100);
    McuPanel_RegSet(0x401, 1);       // ORR     R0, R1, R1,LSL#10
    McuPanel_RegSet(0x404, 0);
    McuPanel_RegSet(0x500, 0);
    McuPanel_RegSet(0x501, 0);
    McuPanel_RegSet(0x502, 0x18F);
    McuPanel_RegSet(0x503, 0);
    McuPanel_RegSet(0x504, 0);
    McuPanel_RegSet(0x505, 0);
    McuPanel_RegSet(0x010, 0x11);
    delay_nops(10);
    McuPanel_RegSet(0x011, 0x202);
    McuPanel_RegSet(0x012, 0x300);
    delay_nops(10);
    McuPanel_RegSet(0x020, 0x21E);
    McuPanel_RegSet(0x021, 0x202);
    McuPanel_RegSet(0x022, 0x100);
    McuPanel_RegSet(0x090, 0);
    McuPanel_RegSet(0x092, 0);
    McuPanel_RegSet(0x300, 0x101);
    McuPanel_RegSet(0x301, 0);
    McuPanel_RegSet(0x302, 0x16);
    McuPanel_RegSet(0x303, 0x2913);
    McuPanel_RegSet(0x304, 0x260B);
    McuPanel_RegSet(0x305, 0x101);
    McuPanel_RegSet(0x306, 0x1204);
    McuPanel_RegSet(0x307, 0x415);
    McuPanel_RegSet(0x308, 0x205);
    McuPanel_RegSet(0x309, 0x303);
    McuPanel_RegSet(0x30A, 0xE05);
    McuPanel_RegSet(0x30B, 0xD01);
    McuPanel_RegSet(0x30C, 0x10D);
    McuPanel_RegSet(0x30D, 0x50E);
    McuPanel_RegSet(0x30E, 0x303);
    McuPanel_RegSet(0x30F, 0x502);
    McuPanel_RegSet(0x007, 1);
    McuPanel_RegSet(0x110, 1);
    McuPanel_RegSet(0x112, 0x60);
    delay_nops(50);
    McuPanel_RegSet(0x100, 0x16B0);
    delay_nops(10);
    McuPanel_RegSet(0x101, 0x147);
    delay_nops(10);
    McuPanel_RegSet(0x102, 0x119);
    delay_nops(10);
    McuPanel_RegSet(0x103, 0x3000);
    delay_nops(50);
    McuPanel_RegSet(0x282, 0x8F);
    delay_nops(10);
    McuPanel_RegSet(0x281, 0x15);
    McuPanel_RegSet(0x102, 0x1BE);
    delay_nops(10);
    McuPanel_RegSet(0x210, 0);
    McuPanel_RegSet(0x211, 0xEF);		// 239 (= 240 - 1)
    McuPanel_RegSet(0x212, 0);
    McuPanel_RegSet(0x213, 0x18F);		// 399 (= 400 - 1)
    McuPanel_RegSet(0x200, 0xEF);
    McuPanel_RegSet(0x201, 0x18F);
    McuPanel_RegSet(0x007, 0x21);
    delay_nops(40);
    McuPanel_RegSet(0x007, 0x61);
    delay_nops(100);
    McuPanel_RegSet(0x007, 0x173);
    delay_nops(300);
    McuPanel_Command(0x202);		// write to GRAM

    for (j = 0;j < 240;j++)
    for (i = 0;i < 320;i++) Mcupanel_Data(0x000000);	// pure black
}

// not sure if this is really a "ScanDirSet" - its a subroutine taking two arguments
void KnobsLCD_ScanDirSet(UINT16 XSize, UINT16 YSize)
{
    Mcupanel_RegSet(0x201, XSize);
    Mcupanel_RegSet(0x200, YSize);
    Mcupanel_Command(0x202);
}

// possibly data is of type struct { uint16_t x; uint16_t y, uint16_t w, uint16_t h; };
void KnobsLCD_Unknown(uint16_t *data)
{
    Mcupanel_RegSet(0x210, (short)data[1]);
    Mcupanel_RegSet(data[1] + data[3], data[1] - 1);
    Mcupanel_RegSet(0x212, data[0]);
    Mcupanel_RegSet(0x213, data[0] + data[2] - 1)
    KnobsLCD_ScanDirSet(data[0], data[1]);
}
in hw_define.h change
Code:
-#define     LCDPANEL        MCUIF_ILI9320_16B
+#define     LCDPANEL        MCUIF_KNOBSLCD_18B
#define      LCDTYPE         MCU18_PANEL  // make sure this is defined
in hw_mcupanel.c add these lines
Code:
void Mcupanel_PowerOnInit(void)
{
#if(LCDPANEL == MCUIF_KNOBSLCD_18B)
    KnobsLCD_PowerOnInit();
#endif
...
and some more things to change...

Last edited by AleMaxx; 19th Sep 2009 at 10:20 am.
Reply With Quote