Problems with emWin 5.22 and ILI9481 in 16BPP mode

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Problems with emWin 5.22 and ILI9481 in 16BPP mode

    Hi,

    I'm using STemWin 5.22 and the display based on ILI9481 controller in 16BPP mode.

    Here is the part of my init sequence:

    Source Code

    1. #define XSIZE_PHYS 480#define YSIZE_PHYS 320#define ORIENTATION GUI_SWAP_XY#define COLOR_CONVERSION GUICC_565#define DISPLAY_DRIVER GUIDRV_FLEXCOLOR#define NUM_BUFFERS 1 // Number of multiple buffers to be used#define NUM_VSCREENS 1 // Number of virtual screens to be used
    2. void LCD_X_Config(void) {{
    3. GUI_DEVICE * pDevice; CONFIG_FLEXCOLOR Config = {0}; pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
    4. Config.Orientation = ORIENTATION;Config.NumDummyReads = 1;Config.RegEntryMode = 0;GUIDRV_FlexColor_Config(pDevice, &Config);
    5. PortAPI.pfWrite16_A0 = LCD_X_8080_16_Write00_16;PortAPI.pfWrite16_A1 = LCD_X_8080_16_Write01_16;PortAPI.pfWriteM16_A1 = LCD_X_8080_16_WriteM01_16;PortAPI.pfReadM16_A1 = LCD_X_8080_16_ReadM01_16;GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B16);



    Everything's perfectly fine as far as I don't try to move cursor (which tries to read back pixels).
    When I move it, the multicolor traces appear.

    By reading the documentation I found the following:

    GUIDRV_FlexColor_SetReadFunc66709_B16()
    Description
    Sets the function(s) to be used for reading back pixel data.
    Prototype
    void GUIDRV_FlexColor_SetReadFunc66709_B16(GUI_DEVICE * pDevice, int Func);
    Permitted values for parameter Func
    GUIDRV_FLEXCOLOR_READ_FUNC_I
    3 cycles and data conversion required.
    (default)
    GUIDRV_FLEXCOLOR_READ_FUNC_II 2 cycles and no conversion required.

    So emWin uses 3 cycle read by default for my controller. I can't switch the controller to this mode as it has single selection of interface mode for both read and write. It would be nonsense to slow down draw operations 2 times. So the only option I have is to switch emWin.

    I tried

    Source Code

    1. GUIDRV_FlexColor_SetReadFunc66709_B16(pDevice,GUIDRV_FLEXCOLOR_READ_FUNC_II);


    with no success. The only consequence of this call is the change of multicolor cursor traces into black...

    I tried to set breakpoint at my LCD_X_8080_16_Write00_16 and LCD_X_8080_16_ReadM01_16 functions to determine what's happening...

    The result is:
    1. If I don't make

    Source Code

    1. GUIDRV_FlexColor_SetReadFunc66709_B16(pDevice,GUIDRV_FLEXCOLOR_READ_FUNC_II)
    call (or if I do

    Source Code

    1. GUIDRV_FlexColor_SetReadFunc66709_B16(pDevice,GUIDRV_FLEXCOLOR_READ_FUNC_I - it does not matter)
    ), emWin follows ILI9481 spec: it sends read command then reads



    2.
    If I make

    Source Code

    1. GUIDRV_FlexColor_SetReadFunc66709_B16(pDevice,GUIDRV_FLEXCOLOR_READ_FUNC_II)
    call , emWin stops following the spec: it skips read command and just reads (which seems like a emWin bug)