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

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

?? skyeye_ts_drv.h

?? 一個模擬可種嵌入開發環境的模擬軟件.能模擬ARM系列等.
?? H
字號:
/*----------------------------------------------------------------------------*//* $Id: mc68328digi.h,v 1.1 2003/03/06 10:37:43 davidm Exp $ * * linux/drivers/char/mc68328digi.h - Touch screen driver. *                                    Header file. * * Author: Philippe Ney <philippe.ney@smartdata.ch> * Copyright (C) 2001 SMARTDATA <www.smartdata.ch> * * 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. * * Thanks to: *   Kenneth Albanowski for is first work on a touch screen driver. *   Alessandro Rubini for is "Linux device drivers" book. *   Ori Pomerantz for is "Linux Kernel Module Programming" guide. * * Updates: *   2001-03-12 Pascal bauermeister *              - Modified the semantics of ts_drv_params; *              - Added check for version in ioctl() *              - included a sample code in the end of this file as comment * *---------------------------------------------------------------------------- * Known bugs: *   - read() returns zero * *---------------------------------------------------------------------------- * HOW TO SETUP THE PARAMETERS FOR COORDINATES SCALING * * The driver does scaling as follows, in this order: *   o for x and y raw samples: *       - raw position is multiplied by ratio_num *       - result is divided by ratio_den *       - offset is added to the result *       - result is bounded by min and max *   o x and y results are swapped if xy_swap is non-zero * * Appropriate parameter combinations allow things like: *   o rotations in multiples of 90 degrees *   o coordinate mirroring *   o negative coordinates *   o etc. * * How to calculate the parameters: *   o Depending on your hardware, you may need to have x and y swapped. If *     so, set xy_swap to 1, always. *   o Calibration phase: *     choose two physical points, preferrably diagonally opposite corners of *     the touch panel. Measure one first time with num=den=1 and offset=0, *     i.e. do an ioctl() to set these parameters, and some read() to read *     these points. * *   o Let mx1 be the value measured at the left edge of your touchscreen *         mx2 be the value measured at the right edge of your touchscreen *         ux1 be the value you want your userland programs to see for mx1 *         ux2 be the value you want your userland programs to see for mx2 *   o For X, calculate: *         x_ratio_num = ux1 - ux2 *         x_ratio_den = mx1 - mx2 *         x_offset = ux1 - mx1*x_ratio_num/x_ratio_den  (or the same with x2) *   o Do the same for Y *   o Then set the min and max according to the bounds you desire for userland *     values * * Notes: *   o We assume linearity between the touchscreen coordinates space and the *     userland coordinate space *   o During calibration, the points may be any pair of points, but best *     results are obtained if they are as distant as possible *   * *---------------------------------------------------------------------------- * * Event generated: *                __________      ______________ *   1) /PENIRQ            |     | *                         ------- * *                         |     | *                         |     +-> generate PEN_UP *                         | *                         +-------> generate PEN_DOWN * *                __________               ______________ *   2) /PENIRQ            |              | *                         ------#####----- * *                         |     |||||    | *                         |     |||||    +-> generate PEN_UP *                         |     ||||| *                         |     ||||+------> generate PEN_MOVE *                         |     |||+-------> generate PEN_MOVE *                         |     ||+--------> generate PEN_MOVE *                         |     |+---------> generate PEN_MOVE *                         |     +----------> generate PEN_MOVE *                         | *                         -----------------> generate PEN_DOWN * *//*----------------------------------------------------------------------------*/#ifndef _MC68328DIGI_H#define _MC68328DIGI_H#ifdef __KERNEL__#include <linux/time.h>   /* for timeval struct */#include <linux/ioctl.h>  /* for the _IOR macro to define the ioctl commands  */#endif/*----------------------------------------------------------------------------*//* Used to check the driver vs. userland program. * * If they have the same number, it means that 'struct ts_pen_info' and * 'struct ts_drv_params' have compatible semantics on both side. Otherwise * one side is outdated. * * The number has to be incremented if and only if updates in the driver lead * to any change in the semantics of these interface data structures (and not * if some internal mechanism of the driver are changed). */#define MC68328DIGI_VERSION 2/* Userland programs can get this version number in params.version after * ioctl(fd, TS_PARAMS_GET, &params). Userland programs must specify their * version compatibility by setting version_req to MC68328DIGI_VERSION before * doing  ioctl(fd, TS_PARAMS_SET, &params). * * If version_req does not match, ioctl(fd, TS_PARAMS_SET, &params) would return * EBADRQC ('Invalid request code'). * * Note: *   it is not possible to check the compatibility for 'struct ts_pen_info' *   without doing an ioctl(fd, TS_PARAMS_SET, &params). So, please, do an *   ioctl(fd, TS_PARAMS_SET, &params)! *//*----------------------------------------------------------------------------*//* Pen events */#define EV_PEN_DOWN    0#define EV_PEN_UP      1#define EV_PEN_MOVE    2/* Pen states *//* defined through the 2 lsb of an integer variable. If an error occure, * the driver will recover the state PEN_UP and the error bit will be set. */#define ST_PEN_DOWN    (0<<0)   /* bit 0 at 0 = the pen is down            */#define ST_PEN_UP      (1<<0)   /* bit 0 at 1 = the pen is up              */#define ST_PEN_ERROR   (1<<1)   /* bit 1 at 1 means that an error occure   *//* Definition for the ioctl of the driver *//* Device is type misc then major=10 */#define MC68328DIGI_MAJOR  10#define TS_PARAMS_GET _IOR(MC68328DIGI_MAJOR, 0, struct ts_drv_params)#define TS_PARAMS_SET _IOR(MC68328DIGI_MAJOR, 1, struct ts_drv_params) /*----------------------------------------------------------------------------*//* Available info from pen position and status */struct ts_pen_info {  int x,y;    /* pen position                                      */  int dx,dy;  /* delta move from last position                     */  int event;  /* event from pen (DOWN,UP,CLICK,MOVE)               */  int state;  /* state of pen (DOWN,UP,ERROR)                      */  int ev_no;  /* no of the event                                   */  unsigned long ev_time;  /* time of the event (ms) since ts_open  */};/* Structure that define touch screen parameters */struct ts_drv_params {  int version;     /* version number for check, returned by TS_PARAMS_GET		    */  int version_req; /* version number for check, that MUST be set to		    * MC68328DIGI_VERSION prior to do TS_PARAMS_SET,		    * or to -1 to bypass checking (do not do this usually)		    */  int x_ratio_num; /*                        */  int x_ratio_den; /*                        */  int y_ratio_num; /*                        */  int y_ratio_den; /*                        */  int x_offset;    /*                        */  int y_offset;    /*                        */  int xy_swap;     /*                        */  int x_min;       /*                        */  int y_min;       /*                        */  int x_max;       /*                        */  int y_max;       /*                        */  int mv_thrs;     /* minimum delta move to considere the pen start to move */  int follow_thrs; /* minimum delta move to follow the pen move when the pen                    * is moving		    */  int sample_ms;   /* time between sampling (ms) */  int deglitch_on; /* whether to filter glitches at pen down */  int event_queue_on; /* switch on and off the event queue */};/*------------------------------------------------------------------------------** The following sample code illustrates the usage of the ts driver:** ** #include <string.h>** #include <errno.h>** #include <fcntl.h>** #include <stdio.h>** #include <linux/mc68328digi.h>** ** **** ** const char *ts_device_name = "/dev/ts";** ******** ** ** void tsdrv_params_fprint(FILE *f, struct ts_drv_params *p)** {**   fprintf(f, "version     : %d\n",    p->version);**   fprintf(f, "version_req : %d\n",    p->version_req);**   fprintf(f, "x ratio     : %d/%d\n", p->x_ratio_num, p->x_ratio_den);**   fprintf(f, "y ratio     : %d/%d\n", p->y_ratio_num, p->y_ratio_den);**   fprintf(f, "x limits    : %d/%d\n", p->x_min, p->x_max);**   fprintf(f, "y limits    : %d/%d\n", p->y_min, p->y_max);**   fprintf(f, "x offset    : %d\n",    p->x_offset);**   fprintf(f, "y offset    : %d\n",    p->y_offset);**   fprintf(f, "invert xy   : %d\n",    p->xy_swap);**   fprintf(f, "mv thrs     : %d\n",    p->mv_thrs);**   fprintf(f, "follow thrs : %d\n",    p->follow_thrs);**   fprintf(f, "sample ms   : %d\n",    p->sample_ms);**   fprintf(f, "dglitch on  : %d\n",    p->deglitch_on);**   fprintf(f, "evt Q on    : %d\n",    p->event_queue_on);** }** ** ** int tsdrv_init(int argc, char *argv[])** {**   int ts_fd;**   int err;**   struct ts_drv_params  drv_params;**   int mx1, mx2, my1, my2;**   int ux1, ux2, uy1, uy2;** **   ts_fd = open(ts_device_name, O_RDWR);**   if(ts_fd==0) {**     fprintf(stderr, "%s: error: could not open device %s\n",** 	    argv[0], ts_device_name);**     return 0;**   }** **   err = ioctl(ts_fd, TS_PARAMS_GET, &drv_params);**   if(err)  {**     fprintf(stderr, "%s: ioctl TS_PARAMS_GET error: %s\n",** 	    argv[0], strerror(errno));**     close(ts_fd);**     return 0;**   }** **   printf("\nDefault driver settings:\n");**   tsdrv_params_fprint(stdout, &drv_params);** ** **   drv_params.version_req    = MC68328DIGI_VERSION;**   drv_params.event_queue_on = 1;**   drv_params.deglitch_on    = 0;**   drv_params.sample_ms      = 10;**   drv_params.follow_thrs    = 0;**   drv_params.mv_thrs        = 2;**   drv_params.y_max          = 159 + 66; **   drv_params.y_min          = 0;**   drv_params.x_max          = 159;**   drv_params.x_min          = 0;**   drv_params.xy_swap        = 0;** **  **  **   mx1 = 508; ux1 =   0;**   my1 = 508; uy1 =   0;**   mx2 = 188; ux2 = 159;**   my2 = 188; uy2 = 159;** **  **   drv_params.x_ratio_num    = ux1 - ux2;**   drv_params.x_ratio_den    = mx1 - mx2;**   drv_params.x_offset       =**     ux1 - mx1 * drv_params.x_ratio_num / drv_params.x_ratio_den;** **   drv_params.y_ratio_num    = uy1 - uy2;**   drv_params.y_ratio_den    = my1 - my2;**   drv_params.y_offset       =**     uy1 - my1 * drv_params.y_ratio_num / drv_params.y_ratio_den;** ** **   printf("\nNew driver settings:\n");**   tsdrv_params_fprint(stdout, &drv_params);** **   err = ioctl(ts_fd, TS_PARAMS_SET, &drv_params);**   if(err)  {**     fprintf(stderr, "%s: ioctl TS_PARAMS_SET error: %s\n",** 	    argv[0], strerror(errno));**     close(ts_fd);**     return 0;**   }** **   return ts_fd;** }** ******** ** main(int argc, char *argv[])** {**   int                   ts_fd = 0;**   struct ts_pen_info    pen_info;**   int                   bytes_transfered = 0;** ** **   ts_fd = tsdrv_init(argc, argv);**   if(ts_fd==0)**     exit(1);** ** **   while(1) {**     char whats_up;**     int x, y;**     bytes_transfered = read(ts_fd, (void*)&pen_info, sizeof(pen_info));**     x = pen_info.x;**     y = pen_info.y;** **     switch(pen_info.event) {** **     case EV_PEN_UP:**       whats_up = 'U';**       break;** **     case EV_PEN_DOWN:**       whats_up = 'D';**       break;** **     case EV_PEN_MOVE:**       whats_up = 'M';**       break;** **     default:**       whats_up = '?';**     }** **     printf("%c(%i,%i) ", whats_up, x, y);**     printf("ev_no:%d ", pen_info.ev_no);**     printf("ev_usec:%ld ", pen_info.ev_time);**     printf("bytes_transfered:%d ", bytes_transfered);**     printf("\n");**   }** **  **   close(ts_fd);**   exit(0);** }** **** ** <<< End of example ----------------------------------------------------------*/#endif /* _MC68328DIGI_H */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区在线看麻豆| 中文字幕一区二区5566日韩| 美女性感视频久久| 日韩一区二区免费在线观看| 九色|91porny| 亚洲国产激情av| 91免费看视频| 三级久久三级久久久| 欧美一区二区在线播放| 国产资源在线一区| 国产精品福利在线播放| 在线看不卡av| 九九精品一区二区| 国产精品欧美综合在线| 欧美日韩国产三级| 狠狠色丁香婷综合久久| 中文字幕亚洲成人| 欧美猛男gaygay网站| 国产一区在线看| 亚洲青青青在线视频| 欧美一级艳片视频免费观看| 国产伦精品一区二区三区在线观看| 久久精品视频网| 欧美日韩在线播| 国产麻豆精品久久一二三| 亚洲日本在线天堂| 欧美一区二区三区四区高清| 波波电影院一区二区三区| 日韩中文字幕av电影| 国产精品妹子av| 日韩视频免费观看高清完整版 | 欧洲精品视频在线观看| 免费在线欧美视频| 亚洲女与黑人做爰| 久久综合久久综合亚洲| 欧美在线三级电影| 丁香婷婷综合激情五月色| 亚洲国产一区二区三区| 国产精品每日更新| 精品1区2区在线观看| 欧美综合一区二区| 99在线视频精品| 精品午夜久久福利影院| 午夜激情综合网| 日韩久久一区二区| 久久久久亚洲蜜桃| 日韩欧美在线1卡| 91福利视频网站| 97aⅴ精品视频一二三区| 国产在线播精品第三| 日韩国产在线一| 亚洲激情校园春色| 综合久久久久久久| 中文乱码免费一区二区| www国产成人免费观看视频 深夜成人网| 欧美在线综合视频| 色婷婷av一区二区三区大白胸| 成人一区二区三区| 国产一区二区三区四区五区美女| 轻轻草成人在线| 午夜精品久久久久久久久久久| 亚洲激情五月婷婷| 亚洲精品中文在线观看| 国产精品久久福利| 国产精品污www在线观看| 国产日韩欧美一区二区三区综合| 宅男噜噜噜66一区二区66| 欧美日韩免费不卡视频一区二区三区 | 日韩精品成人一区二区三区| 亚洲综合一二三区| 亚洲女同ⅹxx女同tv| 亚洲女同ⅹxx女同tv| 亚洲色图在线播放| 亚洲女性喷水在线观看一区| 日韩美女精品在线| 亚洲三级免费观看| 亚洲免费在线播放| 亚洲综合丁香婷婷六月香| 亚洲免费观看高清完整版在线观看 | 日本成人在线网站| 美女视频一区二区三区| 蜜臀av国产精品久久久久| 欧美aaaaaa午夜精品| 精品一区二区三区免费观看| 久久不见久久见免费视频7 | 成人精品视频一区二区三区| av在线一区二区| 在线免费观看不卡av| 欧美肥妇毛茸茸| 欧美www视频| 国产亚洲一区字幕| 国产精品成人免费精品自在线观看| 最新欧美精品一区二区三区| 一区二区成人在线视频 | 亚洲人亚洲人成电影网站色| 亚洲影院久久精品| 日韩av在线播放中文字幕| 激情五月激情综合网| 国产91精品精华液一区二区三区 | 色综合视频在线观看| 欧美日韩一区视频| 精品少妇一区二区三区在线播放| 久久精品亚洲乱码伦伦中文 | 成人开心网精品视频| 欧美在线观看一区二区| 日韩女同互慰一区二区| 欧美激情资源网| 亚洲不卡av一区二区三区| 国产在线国偷精品产拍免费yy| jiyouzz国产精品久久| 欧美巨大另类极品videosbest| 欧美精品一区二区高清在线观看 | 精品视频1区2区| 欧美va日韩va| 亚洲精品欧美综合四区| 麻豆精品久久久| 99久久精品国产麻豆演员表| 51精品视频一区二区三区| 中文字幕欧美日本乱码一线二线| 亚洲一区二区美女| 国产成人aaaa| 欧美肥大bbwbbw高潮| 国产精品久久久久久久久免费桃花 | 91色婷婷久久久久合中文| 91精品久久久久久久99蜜桃| 中文字幕成人网| 日韩激情中文字幕| 一本色道a无线码一区v| 精品国产123| 亚洲午夜视频在线观看| 成人福利视频网站| 日韩欧美中文一区| 亚洲一区二区视频在线| 成人免费的视频| 在线成人午夜影院| 一区二区三区四区中文字幕| 国产精品一区二区x88av| 欧美日韩高清一区二区| 成人免费一区二区三区视频 | 亚洲国产精品久久人人爱| 国产成人在线看| 欧美成人性战久久| 婷婷开心激情综合| 欧美做爰猛烈大尺度电影无法无天| 国产片一区二区三区| 极品尤物av久久免费看| 欧美美女bb生活片| 午夜精品免费在线观看| 在线免费观看不卡av| 中文字幕视频一区二区三区久| 国产精品一区二区久激情瑜伽| 精品国产一区二区在线观看| 日本三级亚洲精品| 3atv一区二区三区| 天堂在线亚洲视频| 欧美精品高清视频| 日本亚洲电影天堂| 日韩一区二区三区视频在线| 视频一区在线播放| 欧美日韩国产综合久久| 亚洲国产成人av网| 欧美日韩一区不卡| 视频在线观看国产精品| 538prom精品视频线放| 蜜桃视频在线一区| 日韩免费视频线观看| 久久草av在线| 久久精品亚洲乱码伦伦中文| 国产高清不卡一区| 国产精品久线在线观看| 97se亚洲国产综合在线| 一区二区三区欧美日| 色狠狠一区二区| 图片区小说区区亚洲影院| 欧美一区二区视频观看视频| 久久精品久久综合| 国产婷婷色一区二区三区在线| 大尺度一区二区| 中文字幕亚洲一区二区av在线| 色婷婷综合中文久久一本| 亚洲一区二区三区免费视频| 欧美一区二区人人喊爽| 国产自产高清不卡| 亚洲三级小视频| 678五月天丁香亚洲综合网| 久久97超碰国产精品超碰| 国产精品三级电影| 欧美在线制服丝袜| 久久精品久久久精品美女| 国产欧美日韩麻豆91| 色狠狠av一区二区三区| 丝瓜av网站精品一区二区| 精品国产成人在线影院| gogogo免费视频观看亚洲一| 亚洲免费观看高清在线观看| 日韩欧美国产综合一区 | 国产欧美日韩在线观看| 92精品国产成人观看免费| 亚洲午夜三级在线| 国产网站一区二区三区|