cancel
Showing results for 
Search instead for 
Did you mean: 

Are there any example for interfacing external buttons ?

TomJJJ
Associate II

I'm not able to implement in the right way following this guide.

 https://support.touchgfx.com/docs/development/board-bring-up/example-gpio/

Thank you

5 REPLIES 5
Romain DIELEMAN
ST Employee

Hi,

In the backend communication article in the documentation you can download projects on different boards using external buttons.

/Romain

TomJJJ
Associate II

Thank you very much

MM..1
Chief III

Add next key ...

if (HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13) != GPIO_PIN_RESET)

{

key = 1;

return true;

}

if (HAL_GPIO_ReadPin(GPIOXX, GPIO_PIN_XX) != GPIO_PIN_RESET)

{

key = 2;

return true;

}

and to project

"PhysicalButtons": [

{

"Key": 1,

"Name": "BTN_USER"

},

{

"Key": 2,

"Name": "BTN_USERXX"

}

],

...

MM..1
Chief III

Too you can aliasing gpio to keyboard keys ... and simply in model tick use

if (HAL_GPIO_ReadPin(SW_PWR_GPIO_Port, SW_PWR_Pin) == GPIO_PIN_RESET && filter == false )

 {

  filter = true;

  static_cast<FrontendApplication*>(Application::getInstance())->handleKeyEvent(85);

 }

85 is defined as key "U" in trigger designer...

TomJJJ
Associate II

Thank you everyone.

i solved my issue