Memory Devices Punch Out configuration on STM32F769I-DISCO

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

    • Memory Devices Punch Out configuration on STM32F769I-DISCO

      Hi

      Can you advise on the correct configuration to ensure memory devices & punch out work on the STM32F769I-DISCO? I get the area that should be punched out showing the background gradient, and what should be the background is black.

      I am using:
      Library: STemWin_CM7_wc32_ARGB.a
      #define GUI_USE_ARGB (1) in GUIConf.h
      #define COLOR_MODE_0 CMS_ARGB8888 which results in COLOR_CONVERSION_0 GUICC_M8888I and GUIDRV_LIN_32 being used in LCDConf.c

      The code is pretty much the example, with me adding some bitmaps for testing ?( :
      GUI_MEMDEV_Handle hMemData;
      GUI_MEMDEV_Handle hMemMask;
      GUI_RECT Rect;
      hMemMask = GUI_MEMDEV_CreateFixed(0, 0, 99, 49, GUI_MEMDEV_NOTRANS, GUI_MEMDEV_APILIST_8, GUICC_8);
      hMemData = GUI_MEMDEV_CreateFixed(0, 0, 99, 49, GUI_MEMDEV_NOTRANS, GUI_MEMDEV_APILIST_32, GUICC_M8888I);


      volatile uint32_t maskPtr, dataPtr;

      maskPtr = GUI_MEMDEV_GetDataPtr(hMemMask);
      dataPtr = GUI_MEMDEV_GetDataPtr(hMemData);

      maskPtr++;
      dataPtr++;

      //
      // Background
      //
      GUI_SetBkColor(GUI_DARKBLUE);
      GUI_Clear();
      GUI_DrawGradientV(0, 0, 399, 49, GUI_DARKGRAY, GUI_DARKBLUE);
      GUI_SetColor(GUI_WHITE);
      //
      // Mask device
      //

      GUI_SetDrawMode(GUI_DM_TRANS);
      GUI_MEMDEV_Select(hMemMask);
      GUI_SetBkColor(GUI_BLACK);
      GUI_Clear();
      GUI_AA_FillCircle(49, 24, 20);

      GUI_SetPenSize(8);
      GUI_DrawLine(0, 0, 99, 49);
      //
      // Data Device
      //

      GUI_MEMDEV_Select(hMemData);
      GUI_SetBkColor(GUI_LIGHTGRAY);
      GUI_Clear();
      Rect.x0 = 6;
      Rect.y0 = 0;
      Rect.x1 = 99;
      Rect.y1 = 49;
      GUI_SetColor(GUI_DARKGRAY);
      GUI_DrawBitmap(&bmARGBRBswpAlphaInv,0,0);
      GUI_DrawBitmap(&bmARGBnoswpNoInv,50,20);
      GUI_DispStringInRectEx("Punch\r\nme\r\nout!", &Rect,
      GUI_TA_HCENTER | GUI_TA_VCENTER, 20, GUI_ROTATE_0);
      //
      // Result
      //
      GUI_MEMDEV_Select(0);
      GUI_MEMDEV_PunchOutDevice(hMemData, hMemMask);
      memDevMode = 1;
      GUI_MEMDEV_Write(hMemData);
      memDevMode = 0;

      GUI_DrawBitmap(&bmARGBRBswpAlphaInv,200,200);
      GUI_DrawBitmap(&bmARGBnoswpNoInv,250,220);
      while (1) {
      GUI_Delay(100);
      }
    • Hi,

      The sample you are using hasn't been updated and would only work with the old ABGR color format. One of the differences between the ABGR and ARGB formats is that the alpha values are inverted.

      You are using the new ARGB format since you defined GUI_USE_ARGB to be 1. The sample creates a memory device using the GUICC_8888 color conversion, but it should be GUICC_M8888I when using the ARGB format.
      You can easily fix this by creating the data device as follows:

      C Source Code

      1. hMemData = GUI_MEMDEV_CreateFixed32(0, 0, 99, 49);
      The routine GUI_MEMDEV_CreateFixed32() automatically picks the correct color conversion based on the currently used color format.We have fixed this error in the user manual.

      Best regards,
      Florian
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.