ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts  1.0
ESP8266ILI9341DisplayProject
Data Structures | Macros | Typedefs | Functions
xpt2046.h File Reference

Go to the source code of this file.

Data Structures

struct  xpt2046_win
 initial calibration values for your display Note: these values are not rotated More...
 
struct  _xpt2046
 
struct  _sdev
 

Macros

#define XPT2046_SAMPLES   8 /* number of samples to take */
 number of time to read and average results More...
 
#define XPT2046_DEBOUNCE   5 /* Debound value in mS */
 
#define XPT2046_EVENTS   10 /* Number of queued touch events */
 
#define XPT2046_READ_Y   0x91 /* Read Y position*/
 only need 4 commands for reading position or touch information More...
 
#define XPT2046_READ_Z1   0xb1 /* Read Z1 */
 
#define XPT2046_READ_Z2   0xc1 /* read Z2 */
 
#define XPT2046_READ_X   0xd1 /* Read X position */
 

Typedefs

typedef struct xpt2046_win xpt2046_win_t
 initial calibration values for your display Note: these values are not rotated More...
 
typedef struct _xpt2046 xpt2046_t
 
typedef struct _sdev sdev_t
 

Functions

MEMSPACE void XPT2046_spi_init (void)
 
MEMSPACE void XPT2046_key_flush (void)
 
uint16_t XPT2046_read (uint8_t cmd)
 
int XPT2046_xy_raw (uint16_t *X, uint16_t *Y)
 
MEMSPACE int XPT2046_xy_filtered (uint16_t *X, uint16_t *Y)
 
MEMSPACE int nearest_run (int *v, int size, int minsamples, int *count)
 
MEMSPACE int XPT2046_xy_filtered_test (uint16_t *X, uint16_t *Y)
 
MEMSPACE void XPT2046_task (void)
 
MEMSPACE int XPT2046_key (uint16_t *X, uint16_t *Y)
 
MEMSPACE int sdev (uint16_t *samples, int size, sdev_t *Z)
 

Macro Definition Documentation

#define XPT2046_DEBOUNCE   5 /* Debound value in mS */

Definition at line 30 of file xpt2046.h.

#define XPT2046_EVENTS   10 /* Number of queued touch events */

Definition at line 31 of file xpt2046.h.

#define XPT2046_READ_X   0xd1 /* Read X position */

Definition at line 37 of file xpt2046.h.

#define XPT2046_READ_Y   0x91 /* Read Y position*/

only need 4 commands for reading position or touch information

Definition at line 34 of file xpt2046.h.

#define XPT2046_READ_Z1   0xb1 /* Read Z1 */

Definition at line 35 of file xpt2046.h.

#define XPT2046_READ_Z2   0xc1 /* read Z2 */

Definition at line 36 of file xpt2046.h.

#define XPT2046_SAMPLES   8 /* number of samples to take */

number of time to read and average results

Definition at line 29 of file xpt2046.h.

Typedef Documentation

typedef struct _sdev sdev_t
typedef struct _xpt2046 xpt2046_t
typedef struct xpt2046_win xpt2046_win_t

initial calibration values for your display Note: these values are not rotated

  • rotations are applied dynamically based on the display state and data structures

Function Documentation

MEMSPACE int nearest_run ( int *  v,
int  size,
int  minsamples,
int *  count 
)
MEMSPACE int sdev ( uint16_t samples,
int  size,
sdev_t Z 
)
MEMSPACE int XPT2046_key ( uint16_t X,
uint16_t Y 
)
MEMSPACE void XPT2046_key_flush ( void  )
uint16_t XPT2046_read ( uint8_t  cmd)
MEMSPACE void XPT2046_spi_init ( void  )

Referenced by setup().

MEMSPACE void XPT2046_task ( void  )

Referenced by user_loop().

MEMSPACE int XPT2046_xy_filtered ( uint16_t X,
uint16_t Y 
)
MEMSPACE int XPT2046_xy_filtered_test ( uint16_t X,
uint16_t Y 
)
int XPT2046_xy_raw ( uint16_t X,
uint16_t Y 
)