‎2019-03-12 01:07 AM
Due to popular demand, here's the information we have on interfacing with peripherals on an STM32F769-DISCO board in a TouchGFX Application.
I have two resources for this:
Disclaimer: The examples in the article are not maintained throughout new versions of TouchGFX.
Feel free to comment if you have any issues. Thank you!
Best regards,
Martin
‎2020-08-05 11:57 PM
Hello everyone, I've started developing a custom board based on stm32f767IGTX MCU with LDTC display (800*480), it's now two months since I've started. so far so good...I just want help on how to had more buttons via the buttoncontroller class and how to add them into the touchgfx application (touchgfx template). bellow you will find the class for buttoncontroller that handle the physical button too...but I am stuck on How to add more physical buttons. If you gotta time, your help will be great.
thank you....
class F767ButtonController : public touchgfx::ButtonController
{
virtual void init() { }
/**
* Implement all the hardware buttons handlers by the defining the port address and carrier name
*/
void delay(int d)
{
int i;
/**for loop counter for the timer, if your using crusial Real time application please implement
* find a better to implement this delay function for more accuraccy.
*/
for (i= 0; i < (d*10000); i++)
{
float a = 0.0f; // local variable a for the for custom time to monitor the tigger state
a += (i / 0.1f);
}
}
virtual bool debounce(bool last)
{
bool current = HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13); //Read the button state
if (last != current) //if it's different…
{
delay(1000);
current = HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13); //read it again
}
return current; //return the current value
}
virtual bool sample(uint8_t& key)
{
bool lastButton = false;
bool currentButton = false;
currentButton = debounce(lastButton); //read deboucned state
if (lastButton == false && currentButton == true) //if it was pressed...
{
key = 1; //toggle the state of the button
return true;
}
lastButton = currentButton; //reset button value
return false;
}
private:
};
‎2020-08-06 01:24 AM
Hi,
I would recommend creating a new topic with maybe a link to this one. This question might otherwise be lost in the older comments.
/Romain
‎2020-08-06 02:57 AM
Thank you very much Romain, I am really a "newbie"....do you mind to tell =) me how to create a new topic?
‎2020-08-10 01:58 AM
Go to https://community.st.com/s/topic/0TO0X0000003iw6WAA/touchgfx
and press the "Ask a question" button =) Also, maybe clarify what you mean by "adding more physical buttons". Do you mean in hardware or in software?
/Martin