836 views
in System Integration by

HI,

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?

Greetings

1 Answer

0 votes
by

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 - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...