LCDWIKI TOUCH Lib Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 6

LCDWIKI TOUCH lib Manual
1.Introduction
The LCDWIKI TOUCH lib is the hardware level lib of the touch screen modules ,it
need be paired with the KBV lib and the GUI lib for each display modules.
The LCDWIKI TOUCH lib use 4-wire spi to communicate.
Run the touch screen calibration program and put the calibration parameter
into the file of cali_para.h after the calibration has passed.
2.FUNCTIONS DECLARATION
definiens
LCDWIKI_TOUCH(int8_t tcs, int8_t tclk, int8_t tout, int8_t
tdin, int8_t tirq)
function
The class constructor when using display modules which has
touch screen
parameters
tcs : the touch screen chip selection pin in Development board
tclk : the clock pin of spi bus in Development board
tout : the read pin of spi bus in Development board
tdin : the write pin of spi bus in Development board rd
tirq : the interrupt pin of touch screen in Development board
rd
returned value
None
notes
None
definiens
void TP_Init(uint8_t r,uint16_t w, uint16_t h)
function
Initialize the touch screen modules
parameters
r : the display rotation of LCD screen
w : the width of LCD screen
h : the height of LCD screen
returned value
None
notes
None
definiens
uint8_t TP_Scan(uint8_t mode)
function
Scan the interrupt of touch screen
parameters
m:0- scan screen coordinate
1- scan physical coordinates
returned value
The state of touch screen
notes
None
definiens
void TP_Write_Byte(uint8_t data)
function
Write a byte data to the touch IC
parameters
data:the data to be writen
returned value
None
notes
None
definiens
uint16_t TP_Read_ADC(uint8_t cmd)
function
Read the ADC value from the touch IC
parameters
cmdthe command of read the ADC value
returned value
the ADC value of read
notes
None
definiens
uint16_t TP_Read_XY(uint8_t xy)
function
Read the ADC value of x coordinate or y coordinate from the
touch IC
parameters
xy: the command of read the ADC value
returned value
the ADC value of read
notes
None
definiens
uint8_t TP_Read_Coordinate(uint16_t *x, uint16_t *y)
function
Read the ADC value of x coordinate and y coordinate from the
touch IC
parameters
x: the address of touch x coordinate
y: the address of touch y coordinate
returned value
1-read successfully
0-read failed
notes
None
definiens
uint8_t TP_Read_Coordinate2(uint16_t *x, uint16_t *y)
function
Read the ADC value of x coordinate and y coordinate from the
touch IC for reducing error
parameters
x: the address of touch x coordinate
y: the address of touch y coordinate
returned value
1-read successfully
0-read failed
notes
None
definiens
void TP_Set_Rotation(uint8_t val)
function
Set the rotation of touch screen
parameters
val:the value of rotation
returned value
None
notes
None
definiens
uint8_t TP_Get_Rotation(void) const
function
get the rotation of touch screen
parameters
None
returned value
the value of rotation for reading
notes
None
definiens
void TP_Set_State(uint8_t val)
function
Set the state of touch screen
parameters
val: the state of touch screen
returned value
None
notes
None
definiens
uint8_t TP_Get_State(void) const
function
get the state of touch screen
parameters
None
returned value
the value of state for reading
notes
None

Navigation menu