Using eGUI screen

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using eGUI screen

1,508件の閲覧回数
garylynch
Contributor IV

I have inherited a design from a long-departed engineer that uses the eGUI/D4D  library to drive a color graphic LCD. It runs on an MK70 processor that uses MQX. Development is on IAR's Embedded Workbench.

I am trying to locate the code that puts together a screen before writing it to the display. To simplify things, let's focus on the title bar, which must be filled with an application-specific string.

I stopped the debugger in function D4D_RedrawScreenObject(), which is getting ready to dispatch a message to output the new screen. I single-step down to the line before function call:
  D4D_SendMessage(&msg);

Structure msg has a member: pScreen, which holds address 0x300FC, which is  visible in the Locals window. It has a member: textBuff, which has a member: pText, which holds 0x300D4.

According to a comment in header file d4d_screen.h (the most explicit  documentation I have found so far on this subject), pText should be a pointer to the text string I am looking for. But when I bring up 0x300D4 in the memory window, it contains 4 bytes of 0s.

However, when I single step over function call:
  D4D_SendMessage(&msg);

the desired text appears in the title bar of my LCD.

Does the field get filled later, or am I looking in the wrong place?

I have located an eGUI pointer page at:
- https://community.nxp.com/docs/DOC-330064

searched the library guide at:
- http://gargy007.github.io/egui_doc/

downloaded and parsed the "Freescale Embedded GUI (D4D)" (DRM116), and the PowerPoint  presentation at:
- https://www.nxp.com/docs/en/supporting-information/EGUIPRE.ppt

but find no answer to the question above.

Advance thanks for your insights.

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

1,348件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

Hi Gary,

 

I am sorry for my delayed reply. Do you see the drawing right after D4D_SendMessage(&msg); is executed? I will test this on my side and let you know my results.

 

Best regards,

Felipe

0 件の賞賛
返信

1,348件の閲覧回数
garylynch
Contributor IV

Felipe,

Thanks for your interest.

I don't know what you mean by 'drawing', but if you are talking about a new screen appearing--yes, it pops up immediately after I step over the call to D4D_SendMessage(&msg).

I have continued to test after I wrote that and have learned a little more. The comment is wrong.  The text which winds up on my title bar is not in  pScreen->pText, as I originally thought.  The string is pointed to by a deeply nested structure member (at least 5 levels of indirection below pScreen). The final pointer is called pTxtArr.  When I can describe it more precisely I will post that.

My ultimate goal is to find the code that GENERATES the screen in the first place.  From what I have seen so far, it communicates with the code that writes to the LCD via functions whose names contain the string 'Message'. I originally thought that 'Message' was a form of communication in the OS sense, but in D4D it appears to mean something completely different and I haven't figured out what that is yet.

Anything you can add is still welcome. I am far from done.

0 件の賞賛
返信

1,348件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

Hello Gary,

 

I am sorry for my late reply, I was debugging on my side the eGUI library.

 

Regarding your question I will recommend you two things:

 

1. Please check function D4DLCDHW_Init_K70LCDC().

 

This function include all the initial configuration for the K70 LCD driver. There you can set the configuration of the cursor position, color and more settings. After all the configurations are set you enable the LCD by enabling the following register SIM_MCR|=SIM_MCR_LCDSTART_MASK;

 

2. Check the D4D_DrawTextXY API. This function draw the initial message to the LCD, if you step into this function you will find that each charater is printed in the screen with the following loop.

for (ch_ix=0; ch_ix<str_len; ++ch_ix)        // For each character in the string          
    {
      if(longText)
      {
        tmp_Len = D4D_GetCharWidth(p_StrDes->pFontType->ix_font, *pText);
        if(p_StrDes->maxWidth < tmp_Len)
          break; 
       
        p_StrDes->maxWidth -= tmp_Len;
      }
      p_StrDes->x += D4D_LCD_PrintChr(*pText++, p_StrDes); // print the char and automatically update the coordintaion of next char        
    }

This loop is find in D4D_LCD_PrintStr() function.

 

Finally, I recommend you to check the below link with AN4588, there you will find more information regarding this topic.

https://www.nxp.com/docs/en/application-note/AN4588.pdf

 

I hope this helps!

 

Best regards,

Felipe

0 件の賞賛
返信