cancel
Showing results for 
Search instead for 
Did you mean: 

How to display string by calling function outside the touchGFX

Paco
Associate III

Hi all.

I'm using STM32H747I-DISCO bord, and I am working on displaying string on LCD by using touchGFX.

By the way I want to display string by calling function which exists outside of touchGFX.

For example, the function is exists in GPIO interrupt handler or main function. When the function is called, touchGFX action react and display string. The action is configured to display string in response to the function call in advence.

In TouchGFX Tutorials, trigger example for LCD touch operation(click button,etc) is provided, but trigger example that is not related to touchGFX is not provided.

Please tell me how to display string by calling function outside the touchGFX.

Thank you in advance.

4 REPLIES 4
LouisB
ST Employee

Hello @Paco,

By "When the function is called, touchGFX action react and display string", you mean that this function is called by another task that should then update the string ?

BR,

Louis BOUDO
ST Software Engineer | TouchGFX
Paco
Associate III

Hello, @LouisB 

Thank you for your reply.

Yes, It's exactly as you said.

I explain in detail below.

For example, when GPIO IRQ occur, it goes to EXTI15_10_IRQHandler().

UpdateDisplay() is called in it. This function is implemented by user, and used when updating minite string on LCD.

After UpdateDisplay() is called, it goese to Screen1ViewBase::updateMinuteString(). This function is generated by TouchGFX as an action. When it is called, update minute digit string.

Paco_5-1752727682328.png

Paco_7-1752727867091.png

Is the above operation possible by using touchGFX?

If TouchGFX can't do such a operation, is there other way to update string (stemWin, etc)?

Thank you.

LouisB
ST Employee

Hello @Paco,

You can achieve this easier by have a boolean volatile var as a flag.
In the file containing EXTI15_10_IRQHandler() :

extern boolean flagIRDisplay;

[...]

void EXTI15_10_IRQHandler(...)
{
...
flagIRDisplay = true;
...
}

 

and in your screen's code :

volatile boolean flagIRDisplay = false;

void handleTickEvent(...)
{
...
if (flagIRDisplay)
   {
   updateMinute();
   }
...
}

 

BR,

Louis BOUDO
ST Software Engineer | TouchGFX
Paco
Associate III

Hello, @LouisB 

Thank you for your instruction.

I tried as you instruct, and it went to screen's code properly.

By the way, I'm afraid  it seems to have delay between setting flag in EXTI15_10_IRQHandler() and calling updateMinute(). I think the delay may be up to tick interval.

I would appreciate it if you could teach me the way to avoid this delay, if there is.

For example, when updateDisplay() is called, it becomes touchGFX trigger, and the trigger invokes updateMinute().

Thank you.