포럼 회원으로 등록하신분만 다운로드가 가능합니다. 최대 업로드 가능한 용량은 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
번호 제목 글쓴이 날짜 조회 수
42 페도라 5에 이솝보드 개발환경 만들기 따라하기 문서입니다. file [6] 진태영 2006-11-30 5985
» S3C2410/2440 2.4.x용 touch test program 고현철 2006-11-28 5675
40 Serial 통신 프로그램입니다. file [4] 양용현 2006-11-28 5940
39 sound App(wave_player) 입니다. file [5] 이종창 2006-11-22 5775
38 리셋회로입니다. file [1] 박영학 2006-11-16 5704
37 aesoptool을 이용한 SDL cross compile환경 file 고현철 2006-11-15 5642
36 iMX21 ADS용 Ext_uart 드라이버.. 커널 2.4 file 김경호 2006-11-14 5694
35 DM9000A 관련 문서 file [1] 이제현 2006-11-12 5983
34 Linux serial programming howto & example by godori file [1] 고현철 2006-10-27 6225
33 aesop-2440 2.6.13 kernel sound driver & App. file [1] 고현철 2006-10-18 5886
32 touchscreen library - tslib file [1] 고현철 2006-10-14 5647
31 임베디드 리눅스 공부에 대해서 [4] 고현철 2006-10-14 6860
30 리눅스커널2.6 포팅자료 .... file [3] 장석원 2006-09-25 5692
29 usb mass storage 관련 예전 spec문서 file 고현철 2006-09-09 6047
28 Aesop-2442 회로도 (미검증 버전) file [10] 이제현 2006-09-05 5829
27 aesop2440 dnw용 usb monitoring software file [1] 고현철 2006-08-16 5820
26 [gcalc] 레지스터값 분석이나 변경시 유용한 Hex<->Binary ... file [4] 고현철 2006-08-06 5804
25 aesop-2440 inetd telnetd howto file [1] 고도리 2006-07-28 5977
24 Embedded Linux Reference Guide - 예전에썼던글 [1] 고현철 2006-07-18 5996
23 aesop에 쓰인 삼성 4" 480x272 LCD datasheet file 고현철 2006-06-24 5701

사용자 로그인