XPT2046 is a touch controller used by several cheap displays - often in combination with the ILI9341 display controller.
The module is built based on the libraries of [spapadim](https://github.com/spapadim/XPT2046/) and [PaulStoffregen](https://github.com/PaulStoffregen/XPT2046_Touchscreen).
## xpt2046.init()
Initiates the XPT2046 module to read touch values from the display. It is required to call [`spi.setup()`](spi.md#spisetup) before calling `xpt2046.init` (see example).
As the ucg lib also requires [`spi.setup()`](spi.md#spisetup) to be called before it is important to only call it once in total and to activate `spi.FULLDUPLEX`.
The `clock_div` used in [`spi.setup()`](spi.md#spisetup) should be 16 or higher, as lower values might produces inaccurate results.
#### Syntax
`xpt2046.init(cs_pin, irq_pin, height, width)`
#### Parameters
-`cs_pin` GPIO pin for cs
-`irq_pin` GPIO pin for irq
-`height` display height in pixel
-`width` display width in pixel
#### Returns
`nil`
#### Example
```lua
-- Setup spi with `clock_div` of 16 and spi.FULLDUPLEX
Sets the calibration of the display. Calibration values can be obtained by using [`xpt2046.getRaw()`](#xpt2046getraw) and read the values in the edges.