in System Integration by


I am currently working with the STM32F7 Discovery Board and I want to add multitouch support. So I replaced the "CoreRoot__DriveCursorHitting" function with the "CoreRoot__DriveMultiTouchHitting" function and added the "aFinger" value in the main.c . Now I have to edit the BoardConfig.c , to evaluate the detected touchs so I used the BSP function "touchDetected==X" .  
Whats the correct way to get the position of each pressed finger?

I tried:

aPos->X = touchPadState.touchX[1];
aPos->Y = touchPadState.touchY[1];

but it seems to be wrong.

I want to add a two finger swipe animation. Sometime it works, sometime it stops randomly.
Is there a template for multitouch support?


1 Answer

0 votes

Great idea!

I just made a short experiment and it seems to work fine. The touch driver on the STM32F746 Discovery board provides everything that is needed. You can enhance the function GetTouchPosition() within the file BoardConfig.c in the following manner:

Add a second point parameter to the function GetTouchPosition(), so that it looks like

int GetTouchPosition( XPoint* aPos1, XPoint* aPos2 );

Within the function you should evaluate the content of touchPadState.touchDetected - it contains the number of detected fingers.

The position of the first finger is stored in touchPadState.touchX[ 0 ] and touchPadState.touchY[ 0 ]. This should be copied into the given parameter aPos1.

The position of the second finger is stored in touchPadState.touchX[ 1 ] and touchPadState.touchY[ 1 ]. This should be copied into the given parameter aPos2.

The return value of the function is the number of detected fingers.

Within your main loop, you can now use the return value and the position data of the function GetTouchPosition() to feed your UI application.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint