亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? helio.c

?? ARM9-2410教學實驗系統下Linux下minigui程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** $Id: helio.c,v 1.17 2003/11/21 12:15:37 weiym Exp $**** helio.c: Low Level Input Engine for Helio Touch Panel** ** Copyright (C) 2000, Wei YongMing ** Copyright (C) 2000, BluePoint Software.**** Created by Wei YongMing, 2001/01/17*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/#include <stdio.h>#include <errno.h>#include <unistd.h>#include <fcntl.h>#include "common.h"#ifdef _HELIO_IAL#include <sys/ioctl.h>#include <sys/poll.h>#include "misc.h"#include "ial.h"#include "helio.h"static unsigned char state [NR_KEYS];static int tp_fd = -1;static int btn_fd;static char btn_state=0;static int tp_px=0, tp_py=0, tp_pz=0, tp_pb=0;static int enable_coor_transf = 1;#define TPH_DEV_FILE "/dev/tpanel"#define BTN_DEV_FILE "/dev/buttons"/* define if have helio buttons */#define _HELIO_BUTTONS  1#define _TP_HELIO       1#undef  _TP_TSBREF#define TRANS_PER_PIXEL 4#define BUTTON_L        4#define DATACHANGELIMIT 50typedef struct{    /*     * Coefficients for the transformation formulas:     *     *     m = (ax + by + c) / s     *     n = (dx + ey + f) / s     *     * These formulas will transform a device point (x, y) to a     * screen point (m, n) in fractional pixels.  The fraction     * is 1 / TRANS_PER_PIXEL.     */    int a, b, c, d, e, f, s;} TRANSF_COEF;    static TRANSF_COEF tc;static int GetPointerCalibrationData(void){    /*     * Read the calibration data from the calibration file.     * Calibration file format is seven coefficients separated by spaces.     */    /* Get pointer calibration data from this file */    const char cal_filename[] = "/etc/pointercal";    int items;    FILE* f = fopen(cal_filename, "r");    if ( f == NULL ) {        /* now if we can't open /etc/pointercal, we should launch an application         * to calibrate touch panel. so we should disable enable_coor_transf         * so that the application could get raw data from touch panel          */        enable_coor_transf = 0;        return 0;    }    items = fscanf(f, "%d %d %d %d %d %d %d",        &tc.a, &tc.b, &tc.c, &tc.d, &tc.e, &tc.f, &tc.s);    if ( items != 7 ) {    	fprintf(stderr, "Improperly formatted pointer calibration file %s.\n", cal_filename);        return -1;    }    return 0;}static POINT DeviceToScreen(POINT p){    /*     * Transform device coordinates to screen coordinates.     * Take a point p in device coordinates and return the corresponding     * point in screen coodinates.     * This can scale, translate, rotate and/or skew, based on the     * coefficients calculated above based on the list of screen     * vs. device coordinates.     */    static POINT prev;    /* set slop at 3/4 pixel */    const short slop = TRANS_PER_PIXEL * 3 / 4;    POINT new, out;    /* transform */    new.x = (tc.a * p.x + tc.b * p.y + tc.c) / tc.s;    new.y = (tc.d * p.x + tc.e * p.y + tc.f) / tc.s;    /* hysteresis (thanks to John Siau) */    if ( abs(new.x - prev.x) >= slop )        out.x = (new.x | 0x3) ^ 0x3;    else        out.x = prev.x;    if ( abs(new.y - prev.y) >= slop )        out.y = (new.y | 0x3) ^ 0x3;    else        out.y = prev.y;    prev = out;    return out;}static int PD_Open(void){     /*     * open up the touch-panel device.     * Return the fd if successful, or negative if unsuccessful.     */#ifndef _TP_HELIO    struct scanparam s;    int settle_upper_limit;    int result;#endif    tp_fd = open(TPH_DEV_FILE, O_RDONLY);    if (tp_fd < 0) {    	fprintf(stderr, "Error %d opening touch panel\n", errno);        return -1;    }#ifdef _TP_TSBREF    return tp_fd;#endif#ifndef _TP_HELIO    /* set interval to 5000us (200Hz) */    s.interval = 1000;    /*     * Upper limit on settle time is approximately (scan_interval / 5) - 60     * (5 conversions and some fixed overhead)     * The opmtimal value is the lowest that doesn't cause significant     * distortion.     * 50% of upper limit works well on my Clio.  25% gets into distortion.     */    settle_upper_limit = (s.interval / 5) - 60;    s.settletime = settle_upper_limit * 50 / 100;    result = ioctl(tp_fd, TPSETSCANPARM, &s);    if ( result < 0 )    	fprintf(stderr, "Error %d, result %d setting scan parameters.\n", result, errno);#endif    if (enable_coor_transf) {         if (GetPointerCalibrationData() < 0) {            close (tp_fd);            return -1;        }    }    return tp_fd;}static void PD_Close(void){     /* Close the touch panel device. */    if (tp_fd > 0)        close(tp_fd);    tp_fd = -1;}static int PD_Read(int *px, int *py, int *pz, int *pb){    /*     * Read the tpanel state and position.     * Returns the position data in x, y, and button data in b.     * Returns -1 on error.     * Returns 0 if no new data is available.     * Returns 1 if position data is relative (i.e. mice).     * Returns 2 if position data is absolute (i.e. touch panels).     * Returns 3 if position data is not available, but button data is.     * This routine does not block.     *     * Unlike a mouse, this driver returns absolute postions, not deltas.     */    /* If z is below this value, ignore the data. */    /* const int low_z_limit = 900; EVEREX*/#ifndef _TP_HELIO    const int low_z_limit = 815;#endif    /*     * I do some error masking by tossing out really wild data points.     * Lower data_change_limit value means pointer get's "left behind"     * more easily.  Higher value means less errors caught.     * The right setting of this value is just slightly higher than     * the number of units traversed per sample during a "quick" stroke.     */#ifndef _TP_HELIO    const int data_change_limit = DATACHANGELIMIT;#endif    static int have_last_data = 0;    static int last_data_x = 0;    static int last_data_y = 0;    /*     * Thanks to John Siau <jsiau@benchmarkmedia.com> for help with the     * noise filter.  I use an infinite impulse response low-pass filter     * on the data to filter out high-frequency noise.  Results look     * better than a finite impulse response filter.     * If I understand it right, the nice thing is that the noise now     * acts as a dither signal that effectively increases the resolution     * of the a/d converter by a few bits and drops the noise level by     * about 10db.     * Please don't quote me on those db numbers however. :-)     * The end result is that the pointer goes from very fuzzy to much     * more steady.  Hysteresis really calms it down in the end (elsewhere).     *     * iir_shift_bits effectively sets the number of samples used by     * the filter * (number of samples is 2^iir_shift_bits).     * Lower iir_width means less pointer lag, higher iir_width means     * steadier pointer.     */#ifndef _TP_HELIO    const int iir_shift_bits = 3;    const int iir_sample_depth = (1 << iir_shift_bits);#endif    static int iir_accum_x = 0;    static int iir_accum_y = 0;    static int iir_accum_z = 0;    static int iir_count = 0;    int data_x, data_y, data_z;    /* read a data point */#ifdef _TP_HELIO    short data[3];#else    short data[6];#endif    int bytes_read;    bytes_read = read(tp_fd, data, sizeof(data));    if (bytes_read != sizeof(data)) {        if (errno == EINTR || errno == EAGAIN) {            return 0;        }        return -1;    }#ifdef _TP_TSBREF    if(data[0]&0x8000) {        *px = data[2] - data[1];        *py = data[4] - data[3];        *pz = 0;        *pb = BUTTON_L;        return 2;    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一卡二卡三卡四卡五卡| 亚洲色大成网站www久久九九| 国产一区二区女| 欧美成人精品1314www| 亚洲国产欧美在线| 日韩精品一区二区三区视频| 欧美久久久久久久久| av一区二区不卡| 精品欧美乱码久久久久久| 九色综合狠狠综合久久| 麻豆久久一区二区| 国产欧美精品一区二区色综合朱莉| 欧美日韩亚洲丝袜制服| 粉嫩高潮美女一区二区三区| 狠狠色丁香久久婷婷综合_中| 另类专区欧美蜜桃臀第一页| 日韩精品欧美精品| 久久精品二区亚洲w码| 狠狠色狠狠色综合日日91app| 国产一区在线观看视频| 国产一区二区三区久久久| 国产精品综合av一区二区国产馆| 国产成人精品影院| 97精品超碰一区二区三区| 色呦呦国产精品| 欧美影视一区二区三区| 91精品免费在线观看| 26uuu亚洲| 国产精品嫩草99a| 一区二区三区在线观看动漫| 亚洲第一成年网| 久久99久久久欧美国产| 国产精品一区在线观看你懂的| 成人午夜视频网站| 精品视频一区二区不卡| 欧美精品一区二区三区高清aⅴ | 色中色一区二区| 欧美日韩一区视频| 精品久久久网站| 亚洲国产激情av| 一区二区三区不卡在线观看| 日本aⅴ精品一区二区三区| 国产乱码字幕精品高清av | 欧美一级日韩一级| 国产午夜三级一区二区三| 亚洲欧美另类图片小说| 日韩高清欧美激情| 成人一区二区三区| 欧美日韩中文字幕一区二区| 日韩免费视频线观看| 一区在线中文字幕| 天天色综合成人网| 成人综合婷婷国产精品久久免费| 欧美三区在线视频| 国产欧美日韩不卡免费| 亚洲成人综合网站| 处破女av一区二区| 日韩一区二区影院| 亚洲人成网站色在线观看| 久久精品72免费观看| 91视频免费看| 久久婷婷国产综合精品青草| 亚洲午夜在线电影| 粉嫩一区二区三区在线看 | 同产精品九九九| 成人视屏免费看| 日韩女优制服丝袜电影| 亚洲美女免费在线| 国产激情精品久久久第一区二区| 欧美老年两性高潮| 亚洲色图丝袜美腿| 国产精品中文欧美| 日韩一区二区高清| 夜夜嗨av一区二区三区| 成人激情免费网站| 欧美mv日韩mv国产网站app| 亚洲一区在线视频观看| 成人黄动漫网站免费app| 日韩美女视频一区二区在线观看| 亚洲一区二区三区中文字幕在线 | 久久―日本道色综合久久| 性欧美大战久久久久久久久| www.久久久久久久久| 久久这里都是精品| 美女脱光内衣内裤视频久久网站| 在线影院国内精品| 国产精品国产三级国产三级人妇 | 欧美精品xxxxbbbb| 亚洲靠逼com| 成年人国产精品| 久久久精品2019中文字幕之3| 日韩av网站免费在线| 欧美日韩一区中文字幕| 亚洲一区二区不卡免费| 91女人视频在线观看| 亚洲国产成人午夜在线一区| 国产一区二区三区日韩| 精品国产一区二区三区av性色| 视频在线观看国产精品| 欧美日韩亚洲综合| 亚洲va在线va天堂| 精品视频1区2区3区| 亚洲一级二级三级在线免费观看| 91在线视频在线| 亚洲色图清纯唯美| 91久久线看在观草草青青| 亚洲欧洲中文日韩久久av乱码| 99久久精品费精品国产一区二区| 国产精品久久久久久久久免费相片| 国产成人免费视频网站高清观看视频 | 国产精品91一区二区| 丰满亚洲少妇av| 欧美美女直播网站| 亚洲综合清纯丝袜自拍| 欧日韩精品视频| 亚洲一区中文在线| 7777精品伊人久久久大香线蕉经典版下载 | 欧美一区二区三区在线电影| 亚洲国产成人va在线观看天堂 | 亚洲三级电影全部在线观看高清| 成人免费高清在线观看| 国产精品久久国产精麻豆99网站 | 久久久九九九九| 不卡视频免费播放| 亚洲美女免费在线| 欧美高清dvd| 麻豆成人91精品二区三区| 精品成人在线观看| 国产成人啪免费观看软件| 国产精品视频看| 在线观看免费亚洲| 香港成人在线视频| 精品人伦一区二区色婷婷| 国产久卡久卡久卡久卡视频精品| 国产精品白丝在线| 欧日韩精品视频| 久久超级碰视频| 欧美亚洲动漫制服丝袜| 天堂资源在线中文精品| 久久一区二区视频| 91久久奴性调教| 久久国产精品99精品国产| 亚洲国产成人在线| 欧美日本韩国一区二区三区视频| 美女视频黄a大片欧美| 国产精品婷婷午夜在线观看| 欧美日韩精品专区| 丁香婷婷综合激情五月色| 亚洲综合一区二区| 久久综合久色欧美综合狠狠| 91视频免费观看| 国产一区二区美女| 亚洲成a人在线观看| 久久久久国产一区二区三区四区| 美国欧美日韩国产在线播放| 美脚の诱脚舐め脚责91 | 黄网站免费久久| 国产自产视频一区二区三区| 国产精品一区二区在线播放 | 国产麻豆91精品| 色婷婷综合在线| 亚洲国产岛国毛片在线| 欧美性大战久久久久久久蜜臀| 美女精品一区二区| 亚洲精品v日韩精品| 日韩免费视频一区| 欧美视频完全免费看| 国产成人精品网址| 日韩电影在线免费| 一区二区三区在线免费播放| 国产亚洲精品资源在线26u| 欧美性高清videossexo| 波多野结衣在线一区| 久久丁香综合五月国产三级网站 | 看片的网站亚洲| 蜜臀久久久久久久| 一级日本不卡的影视| 国产色产综合产在线视频| 91精品国产色综合久久不卡电影| 91丝袜美女网| 不卡欧美aaaaa| 国产高清不卡一区二区| 日本免费新一区视频| 欧美中文字幕一区| 国产激情精品久久久第一区二区 | 欧美国产成人在线| 欧美大白屁股肥臀xxxxxx| 国产精品护士白丝一区av| 91在线国产观看| 亚洲一区在线视频| 日韩码欧中文字| 亚洲国产激情av| 国产日韩欧美精品一区| 精品国产精品一区二区夜夜嗨| 欧美一区二区高清| 欧美精品久久一区二区三区| 欧美体内she精高潮| 在线观看91精品国产入口| 91麻豆国产福利精品| av不卡免费电影|