Microchip® Advanced Software Framework

services/resistive_touch/example/rtouch_calibrate.c File Reference

Resistive Touch driver.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "rtouch.h"
#include "rtouch_calibrate.h"
#include "resistive_touch_board.h"

Macros

#define POINTS_SIZE   4
 Size in pixels of calibration points. More...
 

Functions

static void clear_calibration_point (const rtouch_point_t *p_point)
 Clears a calibration point from the given buffer. More...
 
static void draw_calibration_point (const rtouch_point_t *p_point)
 Display a calibration point on the given buffer. More...
 
uint32_t rtouch_calibrate (void)
 Starts the calibration routines and displays user instructions on screen. More...
 

Variables

static rtouch_calibration_point_t gs_calibration_points []
 Calibration points. More...
 

#define POINTS_SIZE   4

Size in pixels of calibration points.

Referenced by clear_calibration_point(), and draw_calibration_point().

static void clear_calibration_point ( const rtouch_point_t p_point)
static

Clears a calibration point from the given buffer.

Parameters
p_pointCalibration point to clear.

References POINTS_SIZE, rtouch_point_struct::x, and rtouch_point_struct::y.

Referenced by rtouch_calibrate().

static void draw_calibration_point ( const rtouch_point_t p_point)
static

Display a calibration point on the given buffer.

Parameters
p_pointCalibration point to display.

References POINTS_SIZE, rtouch_point_struct::x, and rtouch_point_struct::y.

Referenced by rtouch_calibrate().

rtouch_calibration_point_t gs_calibration_points[]
static
Initial value:
= {
{
{LCD_WIDTH / 10,LCD_HEIGHT / 10},
{0, 0}
},
{
{LCD_WIDTH - LCD_WIDTH / 10, LCD_HEIGHT / 10},
{0, 0}
},
{
{LCD_WIDTH - LCD_WIDTH / 10, LCD_HEIGHT - LCD_HEIGHT / 10},
{0, 0}
},
{
{LCD_WIDTH / 10, LCD_HEIGHT - LCD_HEIGHT / 10},
{0, 0}
},
{
{LCD_WIDTH / 2, LCD_HEIGHT / 2},
{0, 0}
}
}

Calibration points.