TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
TM_STMPE811_Functions

Library Functions. More...

Macros

#define TM_STMPE811_TouchInRectangle(sd, xPos, yPos, w, h)   (((sd)->x >= (xPos)) && ((sd)->x < (xPos + w)) && ((sd)->y >= (yPos)) && ((sd)->y < (yPos + h)))
 Checks if touch data is inside specific rectangle coordinates. More...
 

Functions

TM_STMPE811_State_t TM_STMPE811_Init (void)
 Initializes STMPE811 Touch driver. More...
 
TM_STMPE811_State_t TM_STMPE811_ReadTouch (TM_STMPE811_t *structdata)
 Reads touch coordinates. More...
 

Detailed Description

Library Functions.

Macro Definition Documentation

#define TM_STMPE811_TouchInRectangle (   sd,
  xPos,
  yPos,
  w,
 
)    (((sd)->x >= (xPos)) && ((sd)->x < (xPos + w)) && ((sd)->y >= (yPos)) && ((sd)->y < (yPos + h)))

Checks if touch data is inside specific rectangle coordinates.

Parameters
sdPointer to TM_STMPE811_t to get data from
xPosTop-left X position of rectangle
yPosTop-left Y position of rectangle
wRectangle width
hRectangle height:
Return values
Touchinside rectangle status:
  • 0: Touch is outside rectangle
  • > 0: Touch is inside rectangle
Note
Defined as macro for faster execution

Function Documentation

TM_STMPE811_State_t TM_STMPE811_Init ( void  )

Initializes STMPE811 Touch driver.

Parameters
None
Return values
Memberof TM_STMPE811_State_t
TM_STMPE811_State_t TM_STMPE811_ReadTouch ( TM_STMPE811_t structdata)

Reads touch coordinates.

Parameters
*structdataPointer to TM_STMPE811_t to store data into
Return values
Touchstatus:
  • TM_STMPE811_State_Pressed: Touch detected as pressed, coordinates valid
  • TM_STMPE811_State_Released: Touch detected as not pressed, coordinates not valid