포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 1GB 입니다.

#include <stdio.h>
#include <stdlib.h>

#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>

typedef struct {
    unsigned short pressure;  // touch pressure
    unsigned short x;         // calibrated X
    unsigned short y;         // calibrated Y
    unsigned short millisecs; // timestamp of this event
} TS_EVENT;

int tsfd = -1;

int main(void)
{
    TS_EVENT te;
    
    tsfd = open("/dev/touchscreen/0", O_RDONLY);
    if( tsfd < 0 )
    {
        printf("touch driver open errorn");
        return -1;
    }
    
    while(1)
    {
        if (read(tsfd, (void *)&te, sizeof(TS_EVENT)) < 0)
        {
            printf("ts read error");
            return -1;
        }
        
        printf("%d, %d, %d, %dn", te.pressure, te.x, te.y, te.millisecs);
    }
    
    close(tsfd);
}


예전에 aesop 2.4.20으로 배포할때 테스트하던 프로그램입니다.
2.6은 틀린 방식으로 동작하는데, 다른 방법으로 읽어야 하니...이 프로그램으로는
안 읽힐 듯 합니다...^^
List of Articles
번호 제목 글쓴이 날짜 조회 수sort
62 RTEMS 4.6.99.3 설치 문서 file [3] 김정한 2006-05-16 6017
61 linux용 opengl(mesa3d) library compiling howto(x86용) 고현철 2007-02-15 6018
60 SDL 혹은 linux 상에서의 한글처리(iconv이용) - 원본:이제현님의 ... [5] 고현철 2007-04-27 6039
59 aesop hw에 대한 부품 구매 [2] 고현철 2007-01-12 6040
58 [howto] D:My Embedded Linux - S3C2410-2440SMDK2410 2440 Li... file 이재훈 2006-04-06 6041
57 iconv install howto with aesop-2440 toolchain 고현철 2007-05-01 6043
56 aEsop JTAG(Byte Blaster MV) 로도 잘되네요 file [3] 윤광윤 2007-05-24 6046
55 2.4 Kernel Logo 변환 소스입니다.(코어벨참조) file [2] 김현기 2007-05-24 6047
54 S3C2440 24bpp framebuffer driver source file [1] 고현철 2007-06-21 6047
53 [howto] OPIE TSLIB porting to aESOP2440/ SMDK2410 file 이재훈 2006-04-06 6053
52 SPI 자료 file [2] 이재훈 2007-09-20 6053
51 usb mass storage 관련 예전 spec문서 file 고현철 2006-09-09 6059
50 [howto] touch지원 SDL-1.2.11 <== 김경복님 글중발췌 [5] 고현철 2007-01-23 6059
49 [howto] SMDK2410 보드의 aESOP Jtag Cable 을 이용한 플래시메... file 이재훈 2006-04-06 6083
48 [howto] aesop2440 2.6.13 ramdisk howto file [11] 고현철 2006-04-06 6089
47 root file system 실습자료 file 이재훈 2006-04-07 6095
46 [HowTo] USB slave 모드 동작 [2] 성진호 2007-01-19 6096
45 uCOS-2 용 샘플 프로그램(터치,폰트,이미지,키) file [2] 서혁준 2007-02-13 6101
44 Linux 2.4.18 S3C2410용 ramdisk file 고현철 2006-06-21 6109
43 troll-ftpd cross compiling howto file 고현철 2007-01-13 6157

사용자 로그인