Landtiger LPC1768 C BigLib 1
A self made, custom C library for the LandTiger board.
 
Loading...
Searching...
No Matches
touch.h
Go to the documentation of this file.
1#ifndef __TOUCH_H
2#define __TOUCH_H
3
4#include "glcd_types.h"
5#include "types.h"
6
7// TYPES
8
9typedef struct
10{
11 u16 x, y;
13
14typedef struct
15{
17 u16 width, height;
19
20// FUNCTIONS
21
25void TP_Init(bool skip_calibration);
26
27bool TP_IsInitialized(void);
28
29bool TP_IsCalibrated(void);
30
33void TP_Calibrate(void);
34
39
43const LCD_Coordinate *TP_GetLCDCoordinateFor(const TP_Coordinate *const tp_point);
44
45// TOUCH BUTTON FUNCTIONS
46
52
56
62bool TP_HasButtonBeenPressed(TP_ButtonArea button, const TP_Coordinate *const touch_point);
63
64#endif
LCD_Coordinate pos
Definition touch.h:16
u16 height
Definition touch.h:17
bool TP_IsCalibrated(void)
Definition touch.c:394
bool TP_IsInitialized(void)
Definition touch.c:389
TP_ButtonArea TP_AssignButtonArea(LCD_Button button, LCD_Coordinate pos)
Assigns a button area to the given button.
Definition touch.c:436
const TP_Coordinate * TP_WaitForTouch(void)
Blocks until a touch event is detected.
Definition touch.c:408
bool TP_HasButtonBeenPressed(TP_ButtonArea button, const TP_Coordinate *const touch_point)
Checks if the given button area has been pressed during the touch event which occurred at the given t...
Definition touch.c:475
void TP_WaitForButtonPress(TP_ButtonArea button)
Blocks until the given button area is pressed.
Definition touch.c:463
void TP_Calibrate(void)
Blocks until calibration is completed successfully.
Definition touch.c:399
const LCD_Coordinate * TP_GetLCDCoordinateFor(const TP_Coordinate *const tp_point)
Converts the touch panel coordinates to LCD coordinates.
Definition touch.c:419
void TP_Init(bool skip_calibration)
Initializes the touch panel.
Definition touch.c:373
uint16_t u16
Definition types.h:7