日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁 > 單片機(jī) > 單片機(jī)
[導(dǎo)讀]在 linux2.6.14/drivers/input/touchscreen 目錄下建立新的文件s3c2410_ts.c 文件,驅(qū)動(dòng)文件我們可以參考類似的觸摸屏驅(qū)動(dòng),具體的內(nèi)容參看網(wǎng)站或者光盤提供的源代碼。 首先:修改 linux2.6.14/drivers/input/touchs

在 linux2.6.14/drivers/input/touchscreen 目錄下建立新的文件s3c2410_ts.c 文件,驅(qū)動(dòng)文件我們可以參考類似的觸摸屏驅(qū)動(dòng),具體的內(nèi)容參看網(wǎng)站或者光盤提供的源代碼。

首先:修改 linux2.6.14/drivers/input/touchscreen 目錄下的 makefile 文件,在文件的最后 添加 :

obj-$(CONFIG_TOUCHSCREEN_S3C2410) += hfrk_s3c2410_ts.o

第二:在 linux2.6.14/ drivers/input/touchscreen/Kconfig 中添加:

config TOUCHSCREEN_S

tristate "Samsung S3C2410 touchscreen input driver"

depends on ARCH_SMDK2410 && INPUT && INPUT_TOUCHSCREEN

select SERIO

help

Say Y here if you have the s3c2410 touchscreen.

If unsure, say N.

To compile this driver as a module, choose M here: the

module will be called s3c2410_ts.

config TOUCHSCREEN_S3C2410_DEBUG

boolean "Samsung S3C2410 touchscreen debug messages"

depends on TOUCHSCREEN_S3C2410

help

Select this if you want debug messages

配置內(nèi)核,選擇上這些配置

Device drivers - à

Input device support à

Touchscreens à

<*>Samsung S3C2410 touchscreen input driver

[]Samsung s3c2410 touchscreen debug message

第三:在 /linux-2.6.14/arch/arm/mach-s3c2410/mach-smdk2410.c, 中增加如下內(nèi)容:

static struct s3c2410_ts_mach_info sbc2410_ts_cfg __initdata = {

.delay = 10000,

.presc = 49,

.oversampling_shift = 2,

};

在smdk2410_devices結(jié)構(gòu)中,添加:

&s3c_device_ts,

在smdk2410_map_io函數(shù)中添加:

set_s3c2410ts_info(&sbc2410_ts_cfg);

第四:在 /linux-2.6.14/ arch/arm/mach-s3c2410/devs.h 文件中添加:

extern struct platform_device s3c_device_ts;

第五:在arch/arm/mach-s3c2410/devs.c文件中添加如下幾行:

/* Touchscreen */

static struct s3c2410_ts_mach_info s3c2410ts_info;

void __init set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)
{

memcpy(&s3c2410ts_info,hard_s3c2410ts_info,sizeof(struct s3c2410_ts_mach_info));

}

EXPORT_SYMBOL(set_s3c2410ts_info);

struct platform_device s3c_device_ts = {

.name = "s3c2410-ts",

.id = -1,

.dev = {

.platform_data = &s3c2410ts_info,

}

};

EXPORT_SYMBOL(s3c_device_ts);

編譯觸摸屏驅(qū)動(dòng),在內(nèi)核注冊(cè)為 /dev/input/mouse0


本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉