cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX on Low Cost Hardware

Al-E-Bags
Associate III

Hi all.

There is very little documentation, example code or tutorial information online other than this: https://support.touchgfx.com/docs/development/scenarios/touchgfx-on-lowcost-hardware that would lead to a fully working example of either of these two display expansion boards.  The situation is so extraordinary that my own posts in this forum show up top of the list/first in any google search on the above subject. 

Interfacing either of these displays to a supported Nucleo board is not the issue here.  TouchGFX makes it very easy to achieve working graphical elements on the display.  However, information for enabling the attached Joystick is scant and nowhere near thorough enough for a new user to gain the required knowledge to actually make it work.  Ironically,  low cost hardware would seem like the ideal place to start your STM learning experience and is the sole reason that I invested in them.        

I'm guessing that the reason for this is that neither of these boards have a touch interface and this somehow places them outside of the realm of TouchGFX itself and therefore the 'donkey work' should be the users domain...not the developers. I may be wrong, however, I am part way through projects using both the GFX01M2 and GFX02Z1 but I have come to a grinding halt whilst trying to flip screens from screen1 to screen2 using the joystick. I am missing something in either TouchGFX, CubeIDE or both.  Can someone offer some support here?  Thanks (and apologies for what might seem like a bit of a rant).  It's not a rant, I've just become desperate for the correct information.   

 

    

 

1 ACCEPTED SOLUTION

Accepted Solutions

Yay! Finally! @SofLit After nearly chewing off my own right arm in frustration I finally managed to decipher the thread that you suggest I read.  It was a matter of trial and error...the best way to learn I guess.  Happily, I can report a functioning hardware joystick on my GFX02Z1 display expansion board.  

I now have left to right and right to left navigation between two screens on the display,  which is - initially - all I wanted to achieve at this stage. 

void Screen2View::handleKeyEvent(uint8_t Key)
{
    if (Key == '4')
    {
        application().gotoScreen1ScreenNoTransition();
    }
}

 

class Screen2View : public Screen2ViewBase
{
public:
    Screen2View();
    virtual ~Screen2View() {}
    virtual void setupScreen();
    virtual void tearDownScreen();
    virtual void handleKeyEvent(uint8_t key);

protected:
};

#endif // SCREEN2VIEW_HPP

And, of course, the appropriate modifications to Screen1View .cpp and .hpp files needed to be made.   Looking at it now, it was a simple task but, for a user new to the STM environment without a 'step-by-step' guide to hand, I found it quite challenging.  Hopefully, this solution may be useful to another newcomer to the fold. 

View solution in original post

5 REPLIES 5
Andrew Neil
Evangelist III

Not sure I'm quite clear what you're asking here?

 


@Al-E-Bags wrote:

information for enabling the attached Joystick is scant and nowhere near thorough enough for a new user to gain the required knowledge to actually make it work.   


Is what you really want a simple "how to interface to other hardware" guide?

SofLit
ST Employee

Hello @Al-E-Bags,

Check out this thread as it may help you.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi Andrew.   Yes, a simple step-through guide is all I really need but, in this case, the joystick is physically hard-wired to the device so I would be reluctant to use 'other hardware' in my searches for a solution to implement its use.  I was hoping that there would be sufficient ST derived example code out there.

I have so far mapped the Joystick buttons to the appropriate keys in TouchGFX Designer (as suggested in the supporting documentation,  the mapped keys are available to select as interactions within the Designer. 

On screen1, I have assigned a Change screen action to KEY_RIGHT (which is '6') to change the screen to screen2.  I also assigned a similar action on screen2 using KEY_LEFT  ('4') to switch back to screen1.  

If I run a project simulation (F5) I should be able to navigate between the screens by using '4' and '6' on my keyboards numeric keypad.  I can't,  nothing happens so I am missing some steps.    

From here-on-in the article offers very little information on how to implement the code in order to make the joysick function.  This is where I have come to a halt.  I simply can not find the supporting documentation I need.

Thanks for your response.

GFX02Z1 JoystickGFX02Z1 Joystick

 

 

 

  

Hi SofLit and thanks for the heads-up on this thread.  I will be sure to have an in-depth look at it.

Yay! Finally! @SofLit After nearly chewing off my own right arm in frustration I finally managed to decipher the thread that you suggest I read.  It was a matter of trial and error...the best way to learn I guess.  Happily, I can report a functioning hardware joystick on my GFX02Z1 display expansion board.  

I now have left to right and right to left navigation between two screens on the display,  which is - initially - all I wanted to achieve at this stage. 

void Screen2View::handleKeyEvent(uint8_t Key)
{
    if (Key == '4')
    {
        application().gotoScreen1ScreenNoTransition();
    }
}

 

class Screen2View : public Screen2ViewBase
{
public:
    Screen2View();
    virtual ~Screen2View() {}
    virtual void setupScreen();
    virtual void tearDownScreen();
    virtual void handleKeyEvent(uint8_t key);

protected:
};

#endif // SCREEN2VIEW_HPP

And, of course, the appropriate modifications to Screen1View .cpp and .hpp files needed to be made.   Looking at it now, it was a simple task but, for a user new to the STM environment without a 'step-by-step' guide to hand, I found it quite challenging.  Hopefully, this solution may be useful to another newcomer to the fold.