Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux I2C InputÉ豸Çý¶¯´úÂëµÄ¼¸µãÀí½â

×î½üÔÚ×öÒ»¸öI2C¼üÅ̵ÄLinuxÇý¶¯£¬²Î¿¼ÁËÆäËûоƬµÄһЩ´úÂ룬ÆäÖнÐø·¢ÏÖÓÐЩÈÃÈËÃÔ»óµÄ¶«Î÷£¬°ÑÎÒµÄÃÔ»ó¼°Àí½âÔÚÕâÀï¼ÓÒԼǼ£º
1. i2c_driver½á¹¹ÌåµÄprobe³ÉÔ±µÄÔ­ÐÍ£º
     int (*probe)(struct i2c_client *, const struct i2c_device_id *);
¼´£ºprobeº¯Êý±»µ÷ÓÃʱ»á´ÓÉϱߴ«Á½¸ö¸ö²ÎÊýÏÂÀ´£¬ÀàÐÍ·Ö±ðÊÇi2c_clientºÍi2c_device_id
ÔÚi2c_client->dev.platform_data³ÉÔ±ÀïµÄÄÚÈݾÍÊÇi2c_board_infoÖÐÄãËùÌî³äµÄplatfrom_dataÊý¾Ý¡£
2. Probeº¯ÊýÖ»»áÔÚÇý¶¯¼ÓÔØʱµ÷ÓÃÒ»´Î£¬Ö®ºó¾Í²»»áÔÙµ÷Ó㬶øÈç¹ûÉ豸֧³Öopen½Ó¿Ú£¬Ôò¿ÉÄÜÐèÒªÔÚopen½Ó¿ÚµÄʵÏÖÖÐ×ö´óÁ¿µÄ¿ÉÖØÈë´¦Àí£¬ÒòΪopen½Ó¿Ú¿ÉÄܱ»¶à´Îµ÷ÓÃÇÒ¿ÉÄܱ»¶àÏß³Ìͬʱµ÷Óá£
3. ´úÂ룺
   INIT_DELAYED_WORK(&kpad->work, sn7325_work);
ʵÏֵŦÄÜÊǽ«sn7325_work¼ÓÈëµ½¹¤×÷¶ÓÁÐÖУ¬µ«ÏÖÔÚ²¢²»Á¢¼´Ö´ÐС£
4. input_devÖеļ¸¸ö³ÉÔ±µÄÒâÒåÈçÏ£º
    input->keycodesize£º ÿһ¸ö¼üÅÌÂëµÄ³ß´ç£¨×Ö½ÚÊý£©¡£
    input->keycodemax£º keymapÖаüº¬¶àÉÙ¸ö¼üÅÌÂë
    input->keycode£º ¾ßÌåµÄ¼üÅÌÂë±í£¨Ò²½Ð£ºKey Matrix»òKeymap£©
5. ´úÂ룺
    __set_bit(EV_KEY, input->evbit);
DocumentÀïÃæµÄʾÀýÓÃÁË½Ó¿Ú set_bit£¬¶þÕßʵ¼ÊÉÏûʲôÏÔÖøÇø±ð£¬Ç°Õß²»ÊÇÔ­×Ó²Ù×÷£¬ºóÕßÊÇÔ­×Ó²Ù×÷¡£
input->evbitÊÇÒ»¸ö±ê־λ¼¯ºÏ£¬Í¨¹ý¶ÔËüµÄһЩλ²Ù×÷£¬INPUT×Óϵͳ¿ÉÒÔÖªµÀÕâ¸öÉ豸֧³ÖÄÇЩevent¡£
__set_bit(kpad->keycode[i] & KEY_MAX, input->keybit);
ÕâÐдúÂëÊÇÉèÖÃinput->keybitÕâ¸ö³ÉÔ±µÄ£¬input->keybit³ÉԱʵ¼ÊÉϺÍevbit²î²»¶à£¬Í¨¹ýÉèÖÃkeybit¿ÉÒÔʹINPUT×Óϵͳ֪µÀÕâ¸öÉ豸֧³ÖÄÇЩ°´¼ü¡£
6. input_report_key
Õâ¸ö½Ó¿Ú»áÏòINPUT×ÓϵͳÉϱ¨°´¼ü£¬Ô­ÐÍÈçÏ£º
static inline void input_report_key(struct input_dev *dev, unsigned int code, int value)
{
input_event(dev, EV_KEY, code, !!value);
}
²ÎÊý£º
dev£ºÊäÈëÉ豸
code£ºÒªÉϱ¨µÄkeycode£¨´ÓkeymapÖÐÖ±½Ó»ò¼ä½ÓµÃµ½µÄij¸öÖµ£©
value£º0»ò1£¬0±íʾ°´¼üµ¯Æð£¬1±íʾ°´¼ü°´ÏÂ
!!valueµÄд·¨Êµ¼ÊÉÏÊǽ«intÀàÐÍת»»ÎªboolÀàÐÍ£¬¼´×îÖÕ´«µÝ½øinput_eventÖеIJÎÊýҪôΪ0ҪôΪ1.
7. input_sync±íÃ÷ʱ¼äÒѾ­Íê³É
8. keymap鍼리񌣼
¿ÉÒÔ¶¨ÒåÒ»¸öºê¶¨Òå


Ïà¹ØÎĵµ£º

Àí½âLinuxµÄÊØ»¤½ø³Ì

 Linux·þÎñÆ÷ÔÚÆô¶¯Ê±ÐèÒªÆô¶¯ºÜ¶àϵͳ·þÎñ£¬ËüÃÇÏò±¾µØºÍÍøÂçÓû§ÌṩÁËLinuxµÄϵͳ¹¦Äܽӿڣ¬Ö±½ÓÃæÏòÓ¦ÓóÌÐòºÍÓû§¡£ÌṩÕâЩ·þÎñµÄ³ÌÐòÊÇÓÉÔËÐÐÔÚºǫ́µÄÊØ»¤½ø³Ì£¨daemons£©À´Ö´Ðеġ£ÊØ»¤½ø³ÌÊÇÉú´æÆÚ³¤µÄÒ»ÖÖ½ø³Ì¡£ËüÃǶÀÁ¢ÓÚ¿ØÖÆÖն˲¢ÇÒÖÜÆÚÐÔµÄÖ´ÐÐijÖÖÈÎÎñ»òµÈ´ý´¦ÀíijЩ·¢ÉúµÄʼþ¡£ËûÃdz£³£ÔÚϵͳÒýµ¼×°È ......

ÈçºÎ×°ÐéÄâ»ú¼°ÔÚÉÏÃæ°²×°LINUX²Ù×÷ϵͳ

ÍƼöʹÓÃVMware Workstation(ÐéÄâ»ú),ÏÂÔصØÖ·£º
http://www.gd2.xdowns.com:8080/uploadFile/2008-3/ha_vmware_cn-v6.03.rar
Ó²¼þÒªÇó£ºÖ»ÒªÄÜÕý³£ÔËÐÐxpµÄ¾ÍÐУ¬ÄÚ´æ512M»ò¸ü´ó£¨ÏÖÔÚÂòµÄ»ú×ÓÓ¦¸ÃûÓеÍÓÚÕâ¸ö±ê×¼µÄÁË°É£©¡£
×îÖØÒªµÄÊÇÒªÓÐLinux°²×°ÅÌ£¨ÍøÉÏÏÂÔصľµÏóÎļþÒ²ÐУ¬·´Õý¿ÉÒÔÖ±½ÓʹÓã©¡£
¾ßÌå²Ù×÷È ......

linux ioctlº¯Êý¼°ÆäÇý¶¯ºÍÓ¦ÓóÌÐò×¢ÒâÊÂÏî

¹ØÓÚIOCTLÇý¶¯µÄ±àд·½·¨LDDÕâ±¾ÊéȷʵдµÄ±È½ÏÃ÷°×ÁË£¬ÔÚÕâÄØÎҾͼòµ¥µÄ×öÒ»¸ö½éÉÜ¡£ÕâÀïÎÒÖ÷ÒªÃèÊö×Ô¼º±àдIOCTLÇý¶¯Ê±ËùÓöµ½µÄÎÊÌâ¼°ÆäÔ­Òò¡£
    Çý¶¯ÀïµÄioctlº¯ÊýÖ÷ҪʵÏÖ²»ÓÃread,writeº¯ÊýµÄÓëÓû§¿Õ¼äµÄ¼òµ¥Êý¾Ý½»»¥¼°ÎÞ²ÎÊýµÄÃüÁî¿ØÖÆ¡£ÄÇôÎÒÃÇÈçºÎʵÏÖÕ⼸ÖÖ¹¦ÄܵÄIOCTLº¯ÊýÄØ£¿ioctlÇý¶¯ÖÐÒÔS ......

linux´ÅÅÌÐÔÄܲâÊÔ

 120-test:/# apt-get install hdparm
Õæʵ»úÆ÷120ÉϲâÊÔ½á¹û£º
²âÊÔ´ÅÅÌÐÔÄÜ£¨²»cache£©
120-test:/home/lai# hdparm -t /dev/sda
/dev/sda:
 Timing buffered disk reads:  346 MB in  3.02 seconds = 114.65 MB/sec
²âÊÔ´ÅÅÌÐÔÄÜ£¨´øcache£©
120-test:/home/lai# hdparm -T /dev/sda
/dev/s ......

LinuxÏ»ùÓڶ˿ڵķþÎñ¼ì²é½Å±¾

#!/bin/bash
#program:Usingtostudythe[if...then...fi]program
#dsk2007/10/83:00
#content:Iwillusingthisprogramtoshowyousevices
#1.printtheprogram''sworkinyourscreen
echo "Now,the service of your Linux system will be detect!"
echo "The www,ftp,ssh,and sendmail pop3 will be detect!"
echo ""
#2.w ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ