cancel
Showing results for 
Search instead for 
Did you mean: 

TouchController::sampleTouch

Ebun.1
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
LTimm.1
Associate III

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 🙂

View solution in original post

3 REPLIES 3
LTimm.1
Associate III

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
Senior

LTimm.1's Hello

That's how it works.

I understood it with easy-to-understand explanations.

Thank you for your reply.

Ebun.1
Senior

LTimm.1's Hello

That's how it works.

I understood it with easy-to-understand explanations.

Thank you for your reply.