Resistive touch calibration for SAM toolkit demo.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#include "compiler.h"
#include "rtouch.h"
#include "rtouch_calibrate.h"
#include <asf.h>
#include "demo_parameters.h"
#include "demo.h"
Macros | |
#define | BGCOLOR GFX_COLOR_WHITE |
#define | DOTCOLOR GFX_COLOR_RED |
#define | NUM_TOUCH_POINTS 5 |
Number of touch points for the calibration. More... | |
#define | POINTS_SIZE 4 |
Size in pixels of calibration points. More... | |
#define | TXTCOLOR GFX_COLOR_BLUE |
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... | |
const char | string_calib_done [] ="Calibration done." |
const char | string_calib_failed [] = "Calibration failed!" |
const char | string_calib_instruction [] = "Touch the dots to\ncalibrate the screen" |
const char | string_calib_name [] = "LCD calibration" |
const char | string_calib_retry [] = "Please try again..." |
#define BGCOLOR GFX_COLOR_WHITE |
Referenced by clear_calibration_point(), and rtouch_calibrate().
#define DOTCOLOR GFX_COLOR_RED |
Referenced by draw_calibration_point().
#define NUM_TOUCH_POINTS 5 |
Number of touch points for the calibration.
Referenced by rtouch_calibrate().
#define POINTS_SIZE 4 |
Size in pixels of calibration points.
Referenced by clear_calibration_point(), and draw_calibration_point().
#define TXTCOLOR GFX_COLOR_BLUE |
Referenced by rtouch_calibrate().
|
static |
Clears a calibration point from the given buffer.
p_point | Calibration point to clear. |
References BGCOLOR, gfx_draw_filled_rect, POINTS_SIZE, rtouch_point_struct::x, and rtouch_point_struct::y.
Referenced by rtouch_calibrate().
|
static |
Display a calibration point on the given buffer.
p_point | Calibration point to display. |
References DOTCOLOR, gfx_draw_filled_rect, POINTS_SIZE, rtouch_point_struct::x, and rtouch_point_struct::y.
Referenced by rtouch_calibrate().
uint32_t rtouch_calibrate | ( | void | ) |
Starts the calibration routines and displays user instructions on screen.
References BGCOLOR, demo_param_t::calib_points, clear_calibration_point(), demo_parameters_commit_changes(), draw_calibration_point(), g_demo_parameters, GFX_COLOR_WHITE, gfx_draw_filled_rect, gfx_draw_string_aligned(), gfx_get_height(), gfx_get_width(), NUM_TOUCH_POINTS, rtouch_calibration_point_struct::raw, rtouch_compute_calibration(), rtouch_get_raw_point, rtouch_wait_pressed(), rtouch_wait_released(), string_calib_done, string_calib_failed, string_calib_instruction, string_calib_name, string_calib_retry, sysfont, TEXT_ALIGN_LEFT, TEXT_POS_CENTER, TXTCOLOR, rtouch_point_struct::x, and rtouch_point_struct::y.
Referenced by main(), and task_win().
|
static |
Calibration points.
const char string_calib_done[] ="Calibration done." |
Referenced by rtouch_calibrate().
const char string_calib_failed[] = "Calibration failed!" |
Referenced by rtouch_calibrate().
const char string_calib_instruction[] = "Touch the dots to\ncalibrate the screen" |
Referenced by rtouch_calibrate().
const char string_calib_name[] = "LCD calibration" |
Referenced by rtouch_calibrate().
const char string_calib_retry[] = "Please try again..." |
Referenced by rtouch_calibrate().