00001 // This file has been prepared for Doxygen automatic documentation generation. 00002 00003 #ifndef _RTOUCH_H_ 00004 #define _RTOUCH_H_ 00005 00006 00007 00008 /*============================ INCLUDES ======================================*/ 00009 #include <stdint.h> 00010 #include <stdbool.h> 00011 00012 00013 00014 /*============================ TYPES =========================================*/ 00015 00017 typedef struct rtouch_calibration_point_struct 00018 { 00019 uint16_t panelX; 00020 uint16_t panelY; 00021 uint16_t rawX; 00022 uint16_t rawY; 00023 } rtouch_calibration_point_t; 00024 00026 typedef struct rtouch_calibration_points_struct 00027 { 00028 rtouch_calibration_point_t point1; 00029 rtouch_calibration_point_t point2; 00030 rtouch_calibration_point_t point3; 00031 } rtouch_calibration_points_t; 00032 00034 typedef struct rtouch_calibration_matrix_struct 00035 { 00036 int32_t A; 00037 int32_t B; 00038 int32_t C; 00039 int32_t D; 00040 int32_t E; 00041 int32_t F; 00042 int32_t K; 00043 } rtouch_calibration_matrix_t; 00044 00046 typedef enum rtouch_event_type_enum 00047 { 00048 RTOUCH_NO_EVENT, 00049 RTOUCH_PRESS, 00050 RTOUCH_MOVE, 00051 RTOUCH_RELEASE 00052 } rtouch_event_type_t; 00053 00054 00056 typedef struct rtouch_event_struct 00057 { 00058 rtouch_event_type_t type; 00059 int16_t rawX; 00060 int16_t rawY; 00061 int16_t panelX; 00062 int16_t panelY; 00063 } rtouch_event_t; 00064 00065 00066 typedef void (* rtouch_event_handler_t)( rtouch_event_t const * event ); 00067 00068 00069 00070 /*============================ PROTOTYPES ====================================*/ 00071 00072 #ifdef __cplusplus 00073 extern "C" { 00074 #endif 00075 00076 00078 void rtouch_init(void); 00080 void rtouch_disable(void); 00082 void rtouch_enable(void); 00083 00085 void rtouch_get_event(rtouch_event_t * event); 00087 bool rtouch_is_touched(void); 00088 00090 void rtouch_compute_calibration_matrix( 00091 rtouch_calibration_points_t const * points, 00092 rtouch_calibration_matrix_t * matrix ); 00094 void rtouch_set_calibration_matrix(rtouch_calibration_matrix_t const *source); 00096 void rtouch_get_calibration_matrix(rtouch_calibration_matrix_t *destination); 00097 00099 void rtouch_set_event_handler(rtouch_event_handler_t handler); 00101 rtouch_event_handler_t rtouch_get_event_handler(void); 00102 00103 00104 #ifdef __cplusplus 00105 } /* extern "C" */ 00106 #endif 00107 00108 00109 #endif 00110 /* EOF */