导航:首页 > 源码编译 > 鼠标驱动软件开发整套源码

鼠标驱动软件开发整套源码

发布时间:2024-07-09 09:36:00

⑴ 易语言后台模拟鼠标、键盘的模块或者源码

不能用是因为人家游戏用API把你的模拟按键功能和谐了...解决方法:网络 易语言 驱动键盘模拟(其实驱动级的模拟就是直接模拟你鼠标和键盘的操作,自然也无法和谐....超级模块里有不同的模拟按键方式,你也可以一个个的试过去-_-!)

⑵ 濡备綍鍐欎竴涓狝ndroid USB鎺ュ彛椹卞姩

璇村埌 android 椹卞姩鏄绂讳笉寮 linux 椹卞姩镄勚侫ndroid 鍐呮牳閲囩敤镄勬槸 Linux2.6 鍐呮牳 锛堟渶杩慙inux 3.3 宸茬粡鍖呭惈浜嗕竴浜 Android 浠g爜锛夈备絾 Android 骞舵病链夊畬鍏ㄧ収鎼 Linux 绯荤粺鍐呮牳锛岄櫎浜嗗筁inux 杩涜岄儴鍒嗕慨姝o纴杩桦炲姞浜嗕笉灏戝唴瀹广俛ndroid 椹卞姩 涓昏佸垎涓ょ岖被鍨嬶细Android 涓撶敤椹卞姩 鍜 Android 浣跨敤镄勮惧囬┍锷锛坙inux锛夈
Android 涓撴湁椹卞姩绋嫔簭锛
1锛堿ndroid Ashmem 鍖垮悕鍏变韩鍐呭瓨锛 涓虹敤鎴风┖闂寸▼搴忔彁渚涘垎閰嶅唴瀛樼殑链哄埗锛屼负杩涚▼闂存彁渚涘ぇ鍧楀叡浜鍐呭瓨锛屽悓镞朵负鍐呮牳鎻愪緵锲炴敹鍜岀$悊杩欎釜鍐呭瓨銆
2锛堿ndroid Logger 杞婚噺绾х殑LOG锛堟棩蹇楋级 椹卞姩锛
3锛堿ndroid Binder 锘轰簬 OpenBinder 妗嗘灦镄勪竴涓椹卞姩锛
4锛堿ndroid Power Management 鐢垫簮绠$悊妯″潡锛
5锛茔ow Memory Killer 浣庡唴瀛樼$悊鍣锛
6锛堿ndroid PMEM 鐗╃悊鍐呭瓨椹卞姩锛
7锛塙SB Gadget USB 椹卞姩锛埚熀浜 gaeget 妗嗘灦锛夛绂
8锛塕am Console 鐢ㄤ簬璋冭瘯鍐椤叆镞ュ织淇℃伅镄勮惧囷绂
9锛涂ime Device 瀹氭椂鎺у埗璁惧囷绂
10锛堿ndroid Alarm 纭浠舵椂阍燂绂

Android 涓婄殑璁惧囬┍锷锛
1锛塅ramebuff 鏄剧ず椹卞姩锛
2锛塃vent 杈揿叆璁惧囬┍锷锛
3锛堿LSA 阔抽戦┍锷锛
4锛塐SS 阔抽戦┍锷锛
5锛塿412鎽勫儚澶达细瑙嗛戦┍锷锛
6锛塎TD 椹卞姩锛
7锛夎掴鐗欓┍锷锛
8锛塛LAN 璁惧囬┍锷锛
Android 涓撴湁椹卞姩绋嫔簭

1.Android Ashmem
涓虹敤鎴风┖闂寸▼搴忔彁渚涘垎閰嶅唴瀛樼殑链哄埗锛屼负杩涚▼闂存彁渚涘ぇ鍧楀叡浜鍐呭瓨锛屽悓镞朵负鍐呮牳鎻愪緵锲炴敹鍜岀$悊杩欎釜鍐呭瓨銆
璁惧囱妭镣癸细/dev/ashmen .涓昏惧囧彿 10.
婧愮爜浣岖疆锛 include/linux/ashmen.h Kernel /mm/ashmen.c
鐩告瘆浜 malloc 鍜 anonymous/named mmap 绛変紶缁熺殑鍐呭瓨鍒嗛厤链哄埗锛屽叾浼桦娍鏄阃氲繃鍐呮牳椹卞姩鎻愪緵浜呜緟锷╁唴镙哥殑鍐呭瓨锲炴敹绠楁硶链哄埗锛坧in/unoin锛
2.Android Logger
镞犺烘槸搴曞眰镄勬簮浠g爜杩树笂灞傜殑搴旂敤锛屾垜浠閮藉彲浠ヤ娇鐢 logger 杩欎釜镞ュ织璁惧囩湅銆佹潵杩涜岃皟璇曘
璁惧囱妭镣癸细 /dev/log/main /dev/log/event /dev/log/radio
婧愮爜浣岖疆锛歩nclude/linux/logger.h include/linux/logger.c
3.Android Binder
IPC Binder 涓绉嶈繘绋嬮棿阃氢俊链哄埗銆备粬镄勮繘绋嬭兘澶熶负鍏跺畠杩涚▼鎻愪緵链嶅姟 ----- 阃氲繃镙囧嗳镄 Linux 绯荤粺璋幂敤 API銆
璁惧囱妭镣 锛/dev/binder
婧愮爜浣岖疆锛欿ernel/include/linux/binder.h Kernel/drivers/misc/binder.c
4.Android Power Management
涓涓锘轰簬镙囧嗳 linux 鐢垫簮绠$悊镄勮交閲忕骇 Android 鐢垫簮绠$悊绯荤粺锛屽湪 drivers/android/power.c kernel/power/
5.Low Memory Killer
瀹冨湪鐢ㄦ埛绌洪棿涓鎸囧畾浜嗕竴缁勫唴瀛树复鐣屽硷纴褰揿叾涓镆愪釜鍊间笌杩涚▼鎻忚堪涓镄 oom_adj 鍊煎湪钖屼竴锣冨洿镞讹纴璇ヨ繘绋嫔皢琚獽ill鎺夛纸鍦╬arameters/adj涓鎸囧畾oome_adj 镄勬渶灏忓硷级銆傚畠涓庢爣鍑嗙殑Linux OOM链哄埗绫讳技锛屽彧鏄瀹炵幇鏂规硶涓嶅悓
婧愮爜浣岖疆锛歞rivers/misc/lowmemorykiller.c
6.Android PMEM
PMEM 涓昏佷綔鐢ㄥ氨鏄钖戠敤鎴风┖闂存彁渚涜繛缁镄勭墿鐞嗗唴瀛桦尯锘熴
1.璁 GPU 鎴 VPU 缂揿啿鍖哄叡浜 CPU 镙稿绩銆
2.鐢ㄤ簬 Android service 鍫嗐
婧愮爜浣岖疆锛歩nclude/linux/android_pmem.h drivers/android/pmem.c
7.USB Gadget
锘轰簬镙囧嗳 Linux USB gaeget 椹卞姩妗嗘灦镄勮惧囬┍锷ㄣ
婧愮爜浣岖疆锛歞rivers/usb/gadet/
8.Ram Console
涓轰简鎻愪緵璋冭瘯锷熻兘锛宎ndroid 鍏佽稿皢璋冭瘯镞ュ织淇℃伅鍐椤叆杩欎釜璁惧囷纴瀹冩槸锘轰簬 RAM 镄 buffer.
婧愮爜浣岖疆锛 drivers/staging/android/ram_console.c
9.Time Device
瀹氭椂鎺у埗,鎻愪緵浜嗗硅惧囱繘琛屽畾镞舵带鍒剁殑锷熻兘銆
婧愮爜浣岖疆锛歞rivers/staging/android/timed_output.c(timed_gpio.c)
10.Android Alarm
鎻愪緵涓涓瀹氭椂鍣锛岀敤浜庢妸璁惧囦粠镌$湢鐘舵佸敜阅掞纴钖屾椂瀹冭缮鎻愪緵浜嗕竴涓鍗充娇鍦ㄨ惧囩浔鐪犳椂涔熶细杩愯岀殑镞堕挓锘哄嗳銆
璁惧囱妭镣癸细/dev/alarm
婧愮爜浣岖疆锛歞rivers/trc/alarm.c
Android 璁惧囬┍锷
1. Framebuffer 甯х紦瀛樿惧
Framebuffer 椹卞姩鍦 Linux 涓鏄镙囧嗳镄勬樉绀鸿惧囩殑椹卞姩銆傚逛簬 PC 绯荤粺锛屽畠鏄鏄惧崱镄勯┍锷 锛 瀵逛簬宓屽叆寮 SOC 澶勭悊鍣ㄧ郴缁燂纴瀹冩槸 LCD 鎺у埗鍣ㄦ垨钥呭叾浠栨樉绀烘带鍒跺櫒镄勯┍锷ㄣ傚畠鏄涓涓瀛楃﹁惧囷纴鍦ㄦ枃浠剁郴缁熶腑璁惧囱妭镣归氩父鏄 /dev/fbx 銆 姣忎釜绯荤粺鍙浠ユ湁澶氢釜鏄剧ず璁惧 锛 渚濇$敤 /dev/fbO 銆 /dev/fb l
绛夋潵琛ㄧず銆傚湪 Android 绯荤粺涓涓昏惧囧彿涓 29 锛屾¤惧囧彿阃掑炵敓鎴愩
Android 瀵 Framebuffer 椹卞姩镄勪娇鐢ㄦ柟寮忔槸镙囧嗳镄 锛 鍦 / dev / graphie / 涓镄 Framebuffer 璁惧囱妭镣圭敱 init 杩涚▼镊锷ㄥ垱寤 锛 琚 libui 搴撹皟鐢 銆 Android 镄 GUI 绯荤粺涓 锛 阃氲繃璋幂敤 Framebuffer 椹卞姩镄勬爣鍑嗘帴鍙o纴瀹炵幇鏄剧ず璁惧囩殑鎶借薄銆

Framebuff镄勭粨鏋勬嗘灦鍜屽疄鐜 锛

linux LCD椹卞姩锛堜簩锛--FrameBuffer

Linux LCD椹卞姩(锲涳级--椹卞姩镄勫疄鐜
2.Event杈揿叆璁惧囬┍锷
Input 椹卞姩绋嫔簭鏄 Linux 杈揿叆璁惧囩殑椹卞姩绋嫔簭 锛 鍒嗕负娓告垙𨱒 (joystick) 銆 榧犳爣 (mouse 鍜 mice)鍜屼簨浠惰惧 (Event queue)3 绉嶉┍锷ㄧ▼搴忋傚叾涓浜嬩欢椹卞姩绋嫔簭鏄鐩鍓嶉氱敤镄勭▼搴忥纴鍙鏀鎸侀敭鐩 銆 榧犳爣銆佽Е鎽稿睆绛夊氱嶈緭鍏ヨ惧囥 Input 椹卞姩绋嫔簭镄勪富璁惧囧彿鏄 l3 锛屾疮涓绉 Input 璁惧囦粠璁惧囧彿鍗 鐢5 浣 锛 3 绉崭粠璁惧囧彿鍒嗛厤鏄 锛 娓告垙𨱒 0 锝 61 锛 Mouse 榧犳爣 33 锝 62 锛 Mice 榧犳爣 63 锛 浜嬩欢璁惧 64 锝 95 锛屽悇涓鍏蜂綋镄勮惧囧湪 misc 銆 touchscreen 銆 keyboard 绛夌洰褰曚腑銆
Event 璁惧囧湪鐢ㄦ埛绌洪梾浣跨敤 read 銆 ioctl 銆 poll 绛夋枃浠剁郴缁熺殑鎺ュ彛镎崭綔锛 read 鐢ㄤ簬璇诲彇杈揿叆淇℃伅锛 ioctl 鐢ㄤ簬銮峰彇鍜岃剧疆淇℃伅锛 poll 鐢ㄤ簬鐢ㄦ埛绌洪棿镄勯樆濉烇纴褰揿唴镙告湁鎸夐敭绛変腑鏂镞讹纴阃氲繃鍦ㄤ腑鏂涓鍞ら啋鍐呮牳镄 poll 瀹炵幇銆

Event 杈揿叆椹卞姩镄勬灦鏋勫拰瀹炵幇锛
Linux璁惧囬┍锷ㄤ箣钬斺攊nput瀛愮郴缁

3.ALSA阔抽戦┍锷
楂樼骇 Linux 澹伴煶浣撶郴 ALSA(Advanced Linux Sound Architecture ) 鏄涓洪煶棰戠郴缁熸彁渚涢┍锷 镄凩inux 鍐呮牳缁勪欢锛屼互镟夸唬铡熷厛镄勫紑鍙戝0阔崇郴缁 OSS 銆傚畠鏄涓涓瀹屽叏寮鏀炬簮浠g爜镄勯煶棰戦┍锷ㄧ▼搴忛泦 锛岄櫎浜嗗儚 OSS 闾f牱鎻愪緵涓缁勫唴镙搁┍锷ㄧ▼搴忔ā鍧椾箣澶 锛 ALSA 杩树笓闂ㄤ负绠鍖栧簲鐢ㄧ▼搴忕殑缂栧啓鎻愪緵鐩稿簲镄勫嚱鏁板簱锛屼笌 OSS 鎻愪緵镄勫熀浜 ioctl 绛夊师濮嬬紪绋嬫帴鍙g浉姣旓纴 ALSA 鍑芥暟搴扑娇鐢ㄨ捣𨱒ヨ佹洿锷犳柟渚夸竴浜
鍒╃敤璇ュ嚱鏁板簱锛屽紑鍙戜汉锻桦彲浠ユ柟渚裤佸揩鎹峰湴寮鍙戝嚭镊宸辩殑搴旂敤绋嫔簭锛岀粏鑺傚垯鐣欑粰鍑芥暟搴撹繘琛屽唴閮ㄥ勭悊 銆 镓浠ヨ槠铹 ALSA 涔熸彁渚涗简绫讳技浜 OSS 镄勭郴缁熸帴鍙 锛 浣嗗缓璁搴旂敤绋嫔簭寮鍙戣呬娇鐢ㄩ煶棰戝嚱鏁板簱锛岃屼笉鏄鐩存帴璋幂敤椹卞姩鍑芥暟銆
ALSA 椹卞姩镄勪富璁惧囧彿涓 116 锛屾¤惧囧彿鐢卞悇涓璁惧囧崟镫瀹氢箟锛屼富瑕佺殑璁惧囱妭镣瑰备笅锛
/ dev / snd / contmlCX 钬斺 涓绘带鍒 锛
/ dev / snd / pcmXXXc 钬斺 PCM 鏁版嵁阃氶亾 锛
/ dev / snd / seq 钬斺 椤哄簭鍣锛
/ dev / snd / timer 钬斺 瀹氢箟鍣ㄣ
鍦ㄧ敤鎴风┖闂涓 锛 ALSA 椹卞姩阃氩父閰嶅悎 ALsA 搴扑娇鐢 锛 搴挞氲繃 ioctl 绛夋帴鍙h皟鐢 ALSA 椹卞姩绋嫔簭镄勮惧囱妭镣广傚逛簬 AIJSA 椹卞姩镄勮皟鐢锛岃皟鐢ㄧ殑鏄鐢ㄦ埛绌洪棿镄 ALsA 搴撶殑鎺ュ彛锛岃屼笉鏄鐩存帴璋幂敤 ALSA 椹卞姩绋嫔簭銆
ALSA 椹卞姩绋嫔簭镄勪富瑕佸ご鏂囦欢鏄 include / sound ./ sound . h 锛岄┍锷ㄦ牳蹇冩暟鎹缁撴瀯鍜屽叿浣挞┍锷ㄧ殑娉ㄥ唽鍑芥暟鏄 include / sound / core . h 锛岄┍锷ㄧ▼搴 镄勬牳蹇冨疄鐜版槸 Sound / core / sound . c 鏂囦欢銆
ALSA 椹卞姩绋嫔簭浣跨敤涓嬮溃镄勫嚱鏁版敞鍐屾带鍒跺拰璁惧囷细
int snd _ pcm _ new (struct snd _ card * card 锛 char * id 锛 int device 锛 int playback _ count 锛 int capture _ count 锛 struct snd _ pcm ** rpcm) 锛
int snd ctl _ add(struct snd _ card * card 锛 struct snd _ kcontrol * kcontro1) 锛
ALSA 阔抽戦┍锷ㄥ湪鍐呮牳杩涜 menuconfig 閰岖疆镞 锛 閰岖疆阃夐”涓 钬 Device Drivers 钬 > 钬 Sound c ard support 钬 涓 > 钬 Advanced Linux Sound Architecture 钬 銆傚瓙阃夐”鍖呭惈浜 Generic sound devices( 阃氱敤澹伴煶璁惧 ) 銆 ARM 浣撶郴缁撴瀯鏀鎸侊纴浠ュ强鍏煎 OSS 镄勫嚑涓阃夐”銆 ALsA 阔抽戦┍锷ㄩ厤缃瀵瑰簲镄勬枃浠舵槸sound / core / Kconfig 銆
Android 娌℃湁鐩存帴浣跨敤 ALSA 椹卞姩锛屽彲浠ュ熀浜 A-LSA 椹卞姩鍜 ALSA 搴揿疄鐜 Android Audio 镄勭‖浠舵娊璞″眰锛 ALSA 搴撹皟鐢ㄥ唴镙哥殑 ALSA 椹卞姩锛 Audio 镄勭‖浠舵娊璞″眰璋幂敤 ALSA 搴撱
4.OSS阔抽戦┍锷
OSS锛圤pen Sound System寮鏀惧0阔崇郴缁燂级鏄 linux 涓婃渶镞╁嚭鐜扮殑澹板崱椹卞姩銆侽SS 鐢变竴濂楀畬鏁寸殑鍐呮牳椹卞姩绋嫔簭妯″潡缁勬垚锛屽彲浠ヤ负缁濆ぇ澶氭暟澹板崱鎻愪緵缁熶竴镄勭紪绋嬫帴鍙c
OSS 鏄瀛楃﹁惧囷纴涓昏惧囧彿14锛屼富瑕佸寘𨰾涓嬮溃鍑犵嶈惧囨枃浠讹细
1锛 /dev/sndstat
瀹冩槸澹板崱椹卞姩绋嫔簭鎻愪緵镄勭亩鍗曟帴鍙o纴瀹冮氩父鏄涓涓鍙璇绘枃浠讹纴浣灭敤涔熷彧闄愪簬姹囨姤澹板崱镄勫綋鍓岖姸镐併傦纸鐢ㄤ簬妫娴嫔0鍗★级
2锛/dev/dsp
鐢ㄤ簬鏁板瓧閲囨牱鍜屾暟瀛楀綍阔崇殑璁惧囨枃浠躲傚逛簬阔抽戠紪绋嫔緢閲嶈併傚疄鐜版ā𨰾熶俊鍙峰拰鏁板瓧淇″彿镄勮浆鎹銆

3锛/dev/audio
绫讳技浜/dev/dsp锛屼娇鐢ㄧ殑鏄 mu-law 缂栫爜鏂瑰纺銆

4锛/dev/mixer
鐢ㄤ簬澶氢釜淇″彿缁勫悎鎴栬呭彔锷犲湪涓璧凤纴瀵逛簬涓嶅悓镄勫0鍗℃潵璇达纴鍏舵贩阔冲櫒镄勪綔鐢ㄥ彲鑳藉悇涓岖浉钖屻

5锛/dev/sequencer
杩欎釜璁惧囩敤𨱒ュ瑰0鍗″唴寤虹殑娉㈣〃钖堟垚鍣ㄨ繘琛屾搷浣滐纴鎴栬呭 MIDI 镐荤嚎涓婄殑涔愬櫒杩涜屾带鍒躲
OSS 椹卞姩镓娑夊强镄勬枃浠朵富瑕佸寘𨰾锛
kernel/include/linux/soundcard.h
kernel/include/linux/sound.h 瀹氢箟 OSS 椹卞姩镄勬¤惧囧彿鍜屾敞鍐屽嚱鏁
kernel/sound_core.c OSS镙稿绩瀹炵幇閮ㄥ垎
5.V4l2瑙嗛戦┍锷
銆銆 V4L2鏄疺4L镄勫崌绾х増链锛屼负linux涓嬭嗛戣惧囩▼搴忔彁渚涗简涓濂楁帴鍙h勮寖銆傚寘𨰾涓濂楁暟鎹缁撴瀯鍜屽簳灞俈4L2椹卞姩鎺ュ彛銆俈4L2鎻愪緵浜嗗緢澶氲块梾鎺ュ彛锛屼綘鍙浠ユ牴鎹鍏蜂綋闇瑕侀夋嫨镎崭綔鏂规硶銆傞渶瑕佹敞镒忕殑鏄锛屽緢灏戞湁椹卞姩瀹屽叏瀹炵幇浜嗘墍链夌殑鎺ュ彛锷熻兘銆傛墍浠ュ湪浣跨敤镞堕渶瑕佸弬钥冮┍锷ㄦ簮镰侊纴鎴栦粩缁嗛槄璇婚┍锷ㄦ彁渚涜呯殑浣跨敤璇存槑銆
V4L2镄勪富璁惧囧彿鏄81锛屾¤惧囧彿锛0~255锛岃繖浜涙¤惧囧彿閲屼篃链夊ソ鍑犵嶈惧囷纸瑙嗛戣惧囥丷adio璁惧囥乀eletext銆乂BI锛夈
V4L2镄勮惧囱妭镣癸细 /dev/videoX, /dev/vbiX and /dev/radioX
Android 璁惧囬┍锷锛堜笅锛

MTD 椹卞姩
Flash 椹卞姩阃氩父浣跨敤 MTD 锛坢emory technology device )锛屽唴瀛樻妧链璁惧囥
MTD 镄勫瓧绗﹁惧囷细
/dev/mtdX
涓昏惧囧彿 90.
MTD 镄勫潡璁惧囷细
/dev/block/mtdblockX

涓昏惧囧彿 13.
MTD 椹卞姩婧愮爜

drivers/mtd/mtdcore.c锛歁TD镙稿绩锛屽畾涔塎TD铡熷嬭惧
drivers/mtd/mtdchar.c锛歁TD瀛楃﹁惧
drivers/mtd/mtdblock.c锛歁TD鍧楄惧
MTD 椹卞姩绋嫔簭鏄 Linux 涓嬩笓闂ㄤ负宓屽叆寮忕幆澧冨紑鍙戠殑鏂颁竴绫婚┍锷ㄧ▼搴忋侺inux 涓嬬殑 MTD 椹卞姩绋嫔簭鎺ュ彛琚鍒掑垎涓虹敤鎴锋ā鍧楀拰纭浠舵ā鍧楋细
鐢ㄦ埛妯″潡 鎻愪緵浠庣敤鎴风┖闂寸洿鎺ヤ娇鐢ㄧ殑鎺ュ彛锛氩师濮嫔瓧绗﹁块梾銆佸师濮嫔潡璁块梾銆丗TL 锛团lash Transition Layer锛夊拰JFS锛圝ournaled File System锛夈

纭浠舵ā鍧 鎻愪緵鍐呭瓨璁惧囩殑鐗╃悊璁块梾锛屼絾涓岖洿鎺ヤ娇鐢ㄥ畠浠锛屼簩鍗侀氲繃涓婅堪镄勭敤鎴锋ā鍧楁潵璁块梾銆傝繖浜涙ā鍧楁彁渚涗简闂瀛树笂璇汇佸啓鍜屾摝闄ょ瓑镎崭綔镄勫疄鐜般

钃濈堕椹卞姩

鍦 Linux 涓锛岃掴鐗栾惧囬┍锷ㄦ槸缃戠粶璁惧囷纴浣跨敤缃戠粶鎺ュ彛銆
Android 镄勮掴鐗椤岗璁镙堜娇鐢˙lueZ瀹炵幇𨱒ュ笹AP, SDP浠ュ强RFCOMM绛夊簲鐢ㄨ勮寖镄勬敮鎸,骞惰幏寰椾简SIG璁よ瘉銆傜敱浜嶣luez浣跨敤GPL鎺堟潈, 镓浠Android 妗嗘灦阃氲繃D-BUS IPC𨱒ヤ笌bluez镄勭敤鎴风┖闂翠唬镰佷氦浜掍互阆垮厤浣跨敤链缁忔巿𨱒幂殑浠g爜銆

钃濈堕鍗忚閮ㄥ垎澶存枃浠讹细
include/net/bluetooth/hci_core.h
include/net/bluetooth/bluetooth.h
钃濈堕鍗忚婧愪唬镰佹枃浠讹细
net/bluetooth/*
钃濈堕椹卞姩绋嫔簭閮ㄥ垎镄勬枃浠讹细
drivers/bluetooth/*

钃濈堕镄勯┍锷ㄧ▼搴忎竴鑸閮介氲繃镙囧嗳镄凥CI鎺у埗瀹炵幇銆备絾镙规嵁纭浠舵帴鍙e拰鍒濆嫔寲娴佺▼镄勪笉钖岋纴鍙埚瓨鍦ㄤ竴浜涘樊鍒銆傝繖绫诲埯濮嫔寲锷ㄤ綔涓鑸鏄涓浜涙櫠鎸棰戠巼锛屾尝鐗圭巼绛夊熀纭璁剧疆銆傛瘆濡侰SR镄勮姱鐗囦竴鑸阃氲繃BCSP鍗忚瀹屾垚链鍒濈殑鍒濆嫔寲閰岖疆锛屽啀婵娲绘爣鍑咹CI鎺у埗娴佺▼銆傚筁inux𨱒ヨ达纴涓镞bluez鍙浠ヤ娇鐢℉CI涓庤姱鐗囧缓绔嬭捣阃氢俊(涓鑸鏄痟ciattach + hciconfig)锛屼究鍙浠ュ埄鐢ㄥ叾涓婄殑镙囧嗳鍗忚(SCO, L2CAP绛)锛屼笌钃濈堕阃氢俊锛屼娇鍏舵e父宸ヤ綔浜嗐

WLAN 璁惧囬┍锷锛圵i-Fi锛夛纸姣旇缉澶嶆潅鎴戦溃浼氢笓闂ㄥ啓涓犸ifi鍒嗘瀽锛

鍦╨inux涓锛学lan璁惧囧睘浜庣绣缁滆惧囷纴閲囩敤缃戠粶鎺ュ彛銆
Wlan鍦ㄧ敤鎴风┖闂撮噰鐢ㄦ爣鍑嗙殑socket鎺ュ彛杩涜屾带鍒躲
WiFi鍗忚閮ㄥ垎澶存枃浠讹细
include/net/wireless.h
WiFi鍗忚閮ㄥ垎婧愭枃浠讹细
net/wireless/*
WiFi椹卞姩绋嫔簭閮ㄥ垎锛
drivers/net/wireless/*

⑶ 如何在嵌入式linux开发板上使用USB键盘

鼠标驱动可分为几个部分:驱动加载部分、probe部分、open部分、urb回调函数处理部分。
下文阴影部分为注解。
一、驱动加载部分
static int __init usb_mouse_init(void)
{
int retval = usb_register(&usb_mouse_driver);//注册鼠标驱动
if (retval == 0)
info(DRIVER_VERSION ":" DRIVER_DESC);
return retval;
}
其中usb_mouse_driver的定义为:
static struct usb_driver usb_mouse_driver = {
.owner = THIS_MODULE,
.name = "usbmouse",
.probe = usb_mouse_probe,
.disconnect = usb_mouse_disconnect,
.id_table = usb_mouse_id_table,
};
如果注册成功的话,将会调用usb_mouse_probe。那么什么时候才算注册成功呢?
和其它驱动注册过程一样,只有在其对应的“总线”上发现匹配的“设备”才会调用probe。总线匹配的方法和具体总线相关,如:platform_bus_type中是判断驱动名称和平台设备名称是否相同;那如何确认usb总线的匹配方法呢?
Usb设备是注册在usb_bus_type总线下的。查看usb_bus_type的匹配方法。
struct bus_type usb_bus_type = {
.name = "usb",
.match = usb_device_match,
.hotplug = usb_hotplug,
.suspend = usb_generic_suspend,
.resume = usb_generic_resume,
};
其中usb_device_match定义了匹配方法
static int usb_device_match (struct device *dev, struct device_driver *drv)
{
struct usb_interface *intf;
struct usb_driver *usb_drv;
const struct usb_device_id *id;
/* check for generic driver, which we don't match any device with */
if (drv == &usb_generic_driver)
return 0;
intf = to_usb_interface(dev);
usb_drv = to_usb_driver(drv);
id = usb_match_id (intf, usb_drv->id_table);
if (id)
return 1;
return 0;
}
可以看出usb的匹配方法是usb_match_id (intf, usb_drv->id_table),也就是说通过比对“dev中intf信息”和“usb_drv->id_table信息”,如果匹配则说明驱动所对应的设备已经添加到总线上了,所以接下了就会调用drv中的probe方法注册usb设备驱动。
usb_mouse_id_table的定义为:
static struct usb_device_id usb_mouse_id_table[] = {
{ USB_INTERFACE_INFO(3, 1, 2) },
{ } /* Terminating entry */
};
#define USB_INTERFACE_INFO(cl,sc,pr) /
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO, /
.bInterfaceClass = (cl), /
.bInterfaceSubClass = (sc), /
.bInterfaceProtocol = (pr)
鼠标设备遵循USB人机接口设备(HID),在HID规范中规定鼠标接口类码为:
接口类:0x03
接口子类:0x01
接口协议:0x02
这样分类的好处是设备厂商可以直接利用标准的驱动程序。除了HID类以外还有Mass storage、printer、audio等
#define USB_DEVICE_ID_MATCH_INT_INFO /
(USB_DEVICE_ID_MATCH_INT_CLASS | USB_DEVICE_ID_MATCH_INT_SUBCLASS | USB_DEVICE_ID_MATCH_INT_PROTOCOL)
匹配的过程为:
usb_match_id(struct usb_interface *interface, const struct usb_device_id *id)
{
struct usb_host_interface *intf;
struct usb_device *dev;
/* proc_connectinfo in devio.c may call us with id == NULL. */
if (id == NULL)
return NULL;
intf = interface->cur_altsetting;
dev = interface_to_usbdev(interface);
/* It is important to check that id->driver_info is nonzero,
since an entry that is all zeroes except for a nonzero
id->driver_info is the way to create an entry that
indicates that the driver want to examine every
device and interface. */
for (; id->idVendor || id->bDeviceClass || id->bInterfaceClass ||
id->driver_info; id++) {
if ((id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
id->idVendor != le16_to_cpu(dev->descriptor.idVendor))
continue;
if ((id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT) &&
id->idProct != le16_to_cpu(dev->descriptor.idProct))
continue;
/* No need to test id->bcdDevice_lo != 0, since 0 is never greater than any unsigned number. */
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO) &&
(id->bcdDevice_lo > le16_to_cpu(dev->descriptor.bcdDevice)))
continue;
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI) &&
(id->bcdDevice_hi < le16_to_cpu(dev->descriptor.bcdDevice)))
continue;
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS) &&
(id->bDeviceClass != dev->descriptor.bDeviceClass))
continue;
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS) &&
(id->bDeviceSubClass!= dev->descriptor.bDeviceSubClass))
continue;
if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) &&
(id->bDeviceProtocol != dev->descriptor.bDeviceProtocol))
continue;
//接口类
if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) &&
(id->bInterfaceClass != intf->desc.bInterfaceClass))
continue;
//接口子类
if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS) &&
(id->bInterfaceSubClass != intf->desc.bInterfaceSubClass))
continue;
//遵循的协议
if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL) &&
(id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))
continue;
return id;
}
return NULL;
}
从中可以看出,只有当设备的接口类、接口子类、接口协议匹配鼠标驱动时鼠标驱动才会调用probe方法。

阅读全文

与鼠标驱动软件开发整套源码相关的资料

热点内容
最近为什么手机连不上索尼服务器 浏览:875
海康录像机怎么关视频加密 浏览:786
编程以后有可能被机器人代替吗 浏览:522
windows创建文件命令 浏览:986
linuxcopy文件内容 浏览:383
程序员帅哥秃顶 浏览:839
阿里云服务器开通流程 浏览:105
如何开云服务器 浏览:979
网站小说源码 浏览:301
php用什么ide 浏览:867
网上预约课程app哪个好 浏览:152
android兼容测试工具 浏览:96
云服务器不支持虚拟化怎么办 浏览:189
加密方式的演变 浏览:364
java常用算法pdf 浏览:734
服务器数据遇到异常什么原因 浏览:450
phpexif信息 浏览:543
单片机三字节浮点数 浏览:756
命令与征服泰伯利亚战争下载 浏览:378
c窗口界面编程 浏览:25