drivers/touch/resistive/touch.c File Reference

4-wire resistive touch driver general implementation. More...

#include <assert.h>
#include <interrupt.h>
#include <pmic.h>
#include <intc.h>
#include <touch/touch.h>
#include <cpu/touch/resistive/touch.h>

Go to the source code of this file.

Enumerations

enum  touch_states {
  TOUCH_DISABLED, TOUCH_NOT_TOUCHED, TOUCH_READING_X, TOUCH_READING_Y,
  TOUCH_PROCESSING, TOUCH_TOUCHED
}
 

Driver state names.

More...

Functions

static void touch_priv_port_handler (void *int_data)
 Interrupt handler for touch detection.
static void touch_priv_adc_handler (void *int_data)
 Interrupt handler for AD conversions.
static void touch_priv_process_samples (void *int_data)
 Process touch samples.
void touch_init (void)
 Initialize the touch driver.
void touch_enable (void)
 Enable touch detection and sampling.
void touch_disable (void)
 Disable touch detection and sampling.
void touch_get_event (struct touch_event *buffer)
 Get last detected touch event from driver to buffer.
bool touch_is_touched (void)
 Return current state of touch driver.
void touch_set_event_handler (touch_event_handler_t handler)
 Set touch event handler for driver.
touch_event_handler_t touch_get_event_handler (void)
 Get current touch event handler from driver.
void touch_set_calibration_matrix (const struct touch_calibration_matrix *matrix)
 Assign a calibration matrix to the driver.
void touch_get_calibration_matrix (struct touch_calibration_matrix *buffer)
 Copy calibration matrix from driver to a buffer.
void touch_compute_calibration_matrix (const touch_calibration_points_t points, struct touch_calibration_matrix *matrix)
 Compute a calibration matrix.
Definition of interrupt handlers for touch detection and reading

 INTC_DEFINE_HANDLER (CONFIG_TOUCH_PORT_IRQ_ID, touch_priv_port_handler, CONFIG_TOUCH_PORT_INTLVL)
 INTC_DEFINE_HANDLER (CONFIG_TOUCH_ADC_IRQ_ID, touch_priv_adc_handler, CONFIG_TOUCH_ADC_INTLVL)

Variables

static enum touch_states touch_state
 Current driver state.
static struct touch_event touch_last_event
 Last detected touch event.
static uint16_t touch_raw_x
 Temporary raw sample value for X surface.
static uint16_t touch_raw_y
 Temporary raw sample value for Y surface.
static struct
touch_calibration_matrix 
touch_matrix
 Calibration matrix for the driver.
touch_event_handler_t touch_event_handler
 Current touch event handler (set to NULL if no handler should be called).

Detailed Description

4-wire resistive touch driver general implementation.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file touch.c.

Generated on Thu Apr 29 15:18:22 2010 for display-training by  doxygen 1.6.3