TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle

Touch library for touch screen controllers - More...


 Library defines.
 Library Typedefs.
 Library Functions.

Detailed Description

Touch library for touch screen controllers -

This library is a "high" level library for working with touch screens. It needs low level drivers (read/write functions) specially for your touch controller.

When you have your driver written, 2 functions are needed:

When you call TM_TOUCH_Init function, you also have to specify some parameters for low level functions.

Set built-in driver
If you follow my description in TM_DISCO library on how to select your used board, then this library will automatically select your "target".
//Use touch driver on STM32F7-Discovery, FT5336 controller
//Use touch driver on STM32F439-Eval board, TS3510 controller
#define TOUCH_USE_STM32F439_EVAL
When selecting "built-in" drivers, you also have to include some libs.
Set custom driver

Setting custom driver needs special structure where you pass pointers to your low level driver functions.

You can see example on how to do that.

//Create variable with structure
//Working touch screen structure
//Create functions for custom TOUCH driver
//Init function
uint8_t MYDRIVER_Init(TM_TOUCH_t* TS) {
//Initialize your custom driver here.
//Set max X and Y location for touch
//Read function
uint8_t MYDRIVER_Read(TM_TOUCH_t* TS) {
//Read coordinates and check if pressed here
TS->NumPresses = NumberOfFingersDetected
//Save coordinates
TS->X[0] = Finger1_X_Location;
TS->Y[0] = Finger1_Y_Location;
//In main function for example:
int main() {
//Pass init and read functions
MyDriver.Init = MYDRIVER_Init;
MyDriver.Read = MYDRIVER_Read;
//Init touch library
TM_TOUCH_Init(&MyDriver, &TS);
while (1) {
//Read touch and process
//Check presses
if (TS.NumPresses > 0) {
//At least one touch detected
 Version 1.0
  - First release
 - STM32Fxxx HAL
 - defines.h
 - TM TOUCH TS3510
 - TM TOUCH FT5336
 - TM I2C