Skip to main content
Ebun.1
Senior
February 13, 2020
Solved

TouchController::sampleTouch

  • February 13, 2020
  • 3 replies
  • 1491 views

Hello

I use STM32F769I-DISCO.

Touch the screen to jump to the following functions.

bool OTM8009TouchController :: sampleTouch (int32_t & x, int32_t & y)

{

  / * USER CODE BEGIN OTM8009TouchController_sampleTouch * /

  TS_StateTypeDef state;

  BSP_TS_GetState (& state);

  if (state.touchDetected)

  {

    x = state.touchX [0];

    y = state.touchY [0];

    return true;

  }

  return false;

  / * USER CODE END OTM8009TouchController_sampleTouch * /

}

I want to know where this function is called from, so when I step through it, I can't see the source.

Where does this function come from?

I want to use another touch controller

  if (state.touchDetected)

  {

    x = state.touchX [0];

    y = state.touchY [0];

    return true;

  }

Must write the process to get the coordinates for that controller.

Please let me know if it takes time to process it.

For that reason, I also want to know where this function is called from.

Thank you.

This topic has been closed for replies.
Best answer by LTimm.1

As far as I know the sampleTouch is called from inside the TouchGFX library in the task context that executed touchgfx::HAL::getInstance()->taskEntry().

The touchGFX::Hal::setTouchSampleRate method can be used to set how often the sampleTouch should be called, every tick, every second and so forth.

How to actually interface with your chosen touch driver is up to you I think. The interface is very simple, return true or false depending on whether there is touch or not, and then fill out the x and x coordinate.

Hope that helps :)

3 replies

LTimm.1
LTimm.1Best answer
Associate
February 13, 2020

As far as I know the sampleTouch is called from inside the TouchGFX library in the task context that executed touchgfx::HAL::getInstance()->taskEntry().

The touchGFX::Hal::setTouchSampleRate method can be used to set how often the sampleTouch should be called, every tick, every second and so forth.

How to actually interface with your chosen touch driver is up to you I think. The interface is very simple, return true or false depending on whether there is touch or not, and then fill out the x and x coordinate.

Hope that helps :)

Ebun.1
Ebun.1Author
Senior
February 13, 2020

LTimm.1's Hello

That's how it works.

I understood it with easy-to-understand explanations.

Thank you for your reply.

Ebun.1
Ebun.1Author
Senior
February 13, 2020

LTimm.1's Hello

That's how it works.

I understood it with easy-to-understand explanations.

Thank you for your reply.