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

LinuxÉ豸Çý¶¯Ö®I2C¼Ü¹¹·ÖÎö

Ò»:Ç°ÑÔ
I2cÊÇphilipsÌá³öµÄÍâÉè×ÜÏß.I2CÖ»ÓÐÁ½ÌõÏß,Ò»Ìõ´®ÐÐÊý¾ÝÏß:SDA,Ò»ÌõÊÇʱÖÓÏßSCL.ÕýÒòΪÕâÑù,Ëü·½±ãÁ˹¤³ÌÈËÔ±
µÄ²¼Ïß.ÁíÍâ,I2CÊÇÒ»ÖÖ¶àÖ÷»ú¿ØÖÆ×ÜÏß.ËüºÍUSB×ÜÏß²»Í¬,USBÊÇ»ùÓÚmaster-slave»úÖÆ,ÈκÎÉ豸µÄͨÐűØÐëÓÉÖ÷»ú·¢Æð²Å¿ÉÒÔ.¶ø
I2C ÊÇ»ùÓÚmulti master»úÖÆ.һͬ×ÜÏßÉÏ¿ÉÔÊÐí¶à¸ömaster.¹ØÓÚI2CЭÒéµÄ֪ʶ,ÕâÀï²»ÔÙ׸Êö.¿É×ÔÐÐÏÂÔØspecÔĶÁ¼´¿É.
¶þ:I2C¼Ü¹¹¸ÅÊö
ÔÚlinuxÖÐ,I2CÇý¶¯¼Ü¹¹ÈçÏÂËùʾ:
Èç
ÉÏͼËùʾ,ÿһÌõI2C¶ÔÓ¦Ò»¸öadapter.ÔÚkernelÖÐ,ÿһ¸öadapterÌṩÁËÒ»¸öÃèÊöµÄ½á¹¹(struct
i2c_adapter),Ò²¶¨ÒåÁËadapterÖ§³ÖµÄ²Ù×÷(struct i2c_adapter).ÔÙͨ¹ýi2c
core²ã½«i2cÉ豸Óëi2c adapter¹ØÁªÆðÀ´.
Õâ¸öͼֻÊÇÌṩÁËÒ»¸ö´ó¸ÅµÄ¿ò¼Ü.ÔÚÏÂÃæµÄ´úÂë·ÖÎöÖÐ,´ÓÏÂÖÁÉϵÄÀ´·ÖÎöÕâ¸ö¿ò¼Üͼ.ÒÔϵĴúÂë·ÖÎöÊÇ»ùÓÚlinux 2.6.26.·ÖÎöµÄ´úÂë»ù±¾Î»ÓÚ: linux-2.6.26.3/drivers/i2c/λÖÃ.
Èý:adapter×¢²á
ÔÚ
kernelÖÐÌṩÁËÁ½¸öadapter×¢²á½Ó¿Ú,·Ö±ðΪi2c_add_adapter()ºÍ
i2c_add_numbered_adapter().ÓÉÓÚÔÚϵͳÖпÉÄÜ´æÔÚ¶à¸öadapter,ÒòΪ½«Ã¿Ò»ÌõI2C×ÜÏ߶ÔÓ¦Ò»¸ö±àºÅ,ÏÂÎÄÖгÆΪ
I2C×ÜÏߺÅ.Õâ¸ö×ÜÏߺŵÄPCIÖеÄ×ÜÏߺŲ»Í¬.ËüºÍÓ²¼þÎÞ¹Ø,Ö»ÊÇÈí¼þÉϱãÓÚÇø·Ö¶øÒÑ.
¶ÔÓÚi2c_add_adapter()¶øÑÔ,ËüʹÓõÄÊǶ¯Ì¬×ÜÏߺÅ,¼´ÓÉϵͳ¸øÆä·ÖÎöÒ»¸ö×ÜÏߺÅ,¶øi2c_add_numbered_adapter()ÔòÊÇ×Ô¼ºÖ¸¶¨×ÜÏߺÅ,Èç¹ûÕâ¸ö×ÜÏߺŷǷ¨»òÕßÊDZ»Õ¼ÓÃ,¾Í»á×¢²áʧ°Ü.
·Ö±ðÀ´¿´Ò»ÏÂÕâÁ½¸öº¯ÊýµÄ´úÂë:
int i2c_add_adapter(struct i2c_adapter *adapter)
{
    int id, res = 0;
retry:
    if (idr_pre_get(&i2c_adapter_idr, GFP_KERNEL) == 0)
        return -ENOMEM;
    mutex_lock(&core_lock);
    /* "above" here means "above or equal to", sigh */
    res = idr_get_new_above(&i2c_adapter_idr, adapter,
                __i2c_first_dynamic_bus_num, &id);
    mutex_unlock(&core_lock);
    if (res < 0) {
        if (res == -EAGAIN)
            goto retry;
        return res;
    }
    adapter->nr = id;
 


Ïà¹ØÎĵµ£º

linux find ÃüÁîʵÀý

·find  path  -option  [  -print ]  [ -exec  -ok  command ]  {} \;
#-print ½«²éÕÒµ½µÄÎļþÊä³öµ½±ê×¼Êä³ö
#-exec  command  {} \;     -----½«²éµ½µÄÎļþÖ´ÐÐcommand²Ù×÷,{} ºÍ \;Ö®¼äÓпոñ
#-ok ºÍ-execÏàͬ£¬Ö»²»¹ýÔÚ²Ù×÷ǰҪѯ ......

Linux¶¨Ê±Æ÷ Ïê½â[ת]


[ת]Linux¶¨Ê±Æ÷

ºËÖ÷ÒªÐèÒªÁ½ÖÖÀàÐ͵Äʱ¼ä£º


1.

ÔÚÄÚºËÔËÐÐÆÚ¼ä³ÖÐø¼Ç¼µ±Ç°µÄʱ¼äÓëÈÕÆÚ£¬ÒÔ±ãÄں˶ÔijЩ¶ÔÏóºÍʼþ×÷ʱ¼ä±ê¼Ç£¨

timestamp

£¬Ò²³ÆΪ



ʱ¼ä´Á



£©£¬»ò¹©ÓÃ



»§Í¨¹ýʱ¼ä

syscall ......

fedora/linux yumÔ´ÏêϸÉèÖÃ(Ç¿ÁÒÍƼö)

¾­¹ý¼è¿àµÄ·Ü¶·£¬ÖÕÓڸ㶨ÁËfedoraϵͳ´Ó°²×°µ½3DÌØЧ(±¾ÈË°²×°µÄÊÇfedora
11)£¬ÎªÁË·½±ãºóÀ´µÄlinuxer£¬ÌØÁôϱ¾È˵ÄÈ«¹ý³ÌÒÔ¹©²Î¿¼¡£ÒÔϲ½ÖèÓеÄÀ´×ÔÓÚgoogleËÑË÷£¬Óв¿·ÖÀ´×ÔÓÚ¼ÎÓÓÖÐÎIJ©¿Í
£¨http://www.my-guides.net/en/content/view/164/26/£©£¬²¢¸Ðл¸÷·½Ç°±²µÄ±Ê¼£¡£
1.Ìí¼Órpm fusionÔ´
rpm -ivh
http://do ......

Interrupt in Linux£¨Ó²¼þƪ£©—— PIC


±¾ÎÄÀ´×Ô£ºhttp://blog.chinaunix.net/u2/66786/showart.php?id=601766
1.1Ê·Ç°µÄPIC
8259AÊǼ´ÎÒÃÇͨ³£ËµµÄPIC£¬Èçͼ1-1Ëùʾ£º
 
ͼ1-1 8259A
ÆäÖÐ×îÖØÒªµÄ¹Ü½ÅÊÇIR0~IR7£¨Interrupt Request0~7£¬ÓÃÓÚÁ¬½ÓÉ豸£©¡¢INT£¨Á¬½ÓCPU,µ±ÓÐÖжÏÇëÇóʱ£¬À­¸ß¸Ã¹Ü½ÅÒÔ֪ͨCPUÖжϵĵ½À´£©¡¢INTA£¨Á¬½ÓCPU£¬CPUͨ¹ý¸Ã¹Ü½ ......

Linux @ VMWare ÏÂÐÞ¸ÄMACµØÖ·µÄ·½·¨£¨Ç××Ôʵ¼ù£©

½ñÌ쿽±´ÁËÐéÄâ»úÔÚÁíÍâһ̨µçÄÔÉÏʹÓ㬷¢ÏÖMACµØÖ·³åÍ»£¬ÓÚÊÇÈ¥ÍøÉÏÕÒÐ޸ķ½·¨¡£¿É°´ÕÕËù˵µÄ£¬ÎÒ²¢Ã»ÓкÜ˳ÀûÐ޸ijɹ¦¡£
ÏÂÃæÎÒ½«¹ý³Ìд³öÀ´£¬ÀïÃæÓÐЩµØ·½ÐèҪעÒâһϡ£
ÏÂÃæÊÇÎÒ´ÓÍøÉÏËÑË÷µ½´ó²¿·ÖµÄ×ö·¨ÈçÏ£¬ºìÉ«²¿·ÖÊÇÎÒ×¢Ê͵ģ¬ÐèҪעÒâµÄµØ·½£º
VMwareÐéÄâ»úÖÐÐÞ¸ÄLinux MACµØÖ·µÄ·½·¨£º
1¡¢ÐÞ¸ÄÐéÄâ»úµÄ*.v ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ