Linux I2CºËÐÄ¡¢×ÜÏßÓëÉ豸Çý¶¯
Linux I2CºËÐÄ¡¢×ÜÏßÓëÉ豸Çý¶¯
×¢:
ÔÚlinux2.6.32°æ±¾ÖÐÓÐÕâÑùµÄ´úÂëÓë×¢ÊÍ:
struct i2c_driver {
unsigned int class;
/* Notifies the driver that a new bus has appeared or is about to be
* removed. You should avoid using this if you can, it will probably
* be removed in a near future.
*/
int (*attach_adapter)(struct i2c_adapter *);
int (*detach_adapter)(struct i2c_adapter *);
/* Standard driver model interfaces */
int (*probe)(struct i2c_client *, const struct i2c_device_id *);
int (*remove)(struct i2c_client *);
...
}
ÎÒµÄÀí½âÊÇ.а汾ÖÐÓÃprobeºÍremove´úÌæÁËÔÀ´µÄattach_adapterºÍdetach_adapter.
I2C×ÜÏß½ö½öʹÓÃSCL¡¢SDAÁ½¸ùÐźÅÏß¾ÍʵÏÖÁËÉ豸֮¼äµÄÊý¾Ý½»»¥£¬¼«´óµØ¼ò»¯¶ÔÓ²¼þ×ÊÔ´ºÍPCB°å²¼Ïß¿Õ¼äµÄÕ¼Óá£Òò´Ë£¬I2C×ÜÏß±»·Ç³£¹ã·ºµØÓ¦ÓÃÔÚEEPROM¡¢ÊµÊ±ÖÓ¡¢Ð¡ÐÍLCDµÈÉ豸ÓëCPUµÄ½Ó¿ÚÖС£
Linux¶¨ÒåÁËϵͳµÄI2CÇý¶¯Ìåϵ½á¹¹£¬ÔÚLinuxϵͳÖУ¬I2CÇý¶¯ÓÉ3²¿·Ö×é³É£¬¼´I2CºËÐÄ¡¢I2C×ÜÏßÇý¶¯ºÍI2CÉ豸Çý¶¯¡£Õâ3²¿·ÖÏ໥Ð×÷£¬ÐγÉÁ˷dz£Í¨ÓᢿÉÊÊÓ¦ÐÔºÜÇ¿µÄI2C¿ò¼Ü¡£
±¾ÕµÚ1½Ú½«¶ÔLinux I2CÌåϵ½á¹¹½øÐзÖÎö£¬½²Ã÷3¸ö×é³É²¿·Ö¸÷×ԵŦÄܼ°Ï໥ÁªÏµ¡£
µÚ2½Ú½«¶ÔLinux I2CºËÐĽøÐзÖÎö£¬½âÊÍi2c-core.cÎļþµÄ¹¦ÄܺÍÖ÷Òªº¯ÊýµÄʵÏÖ¡£
µÚ3¡¢4½Ú½«·Ö±ðÏêϸ½éÉÜI2C×ÜÏßÇý¶¯ºÍI2CÉ豸Çý¶¯µÄ±àд·½·¨£¬¸ø³ö¿É¹©²Î¿¼µÄÉè¼ÆÄ£°å¡£
µÚ5¡¢6½Ú½«ÒÔµÚ3¡¢4½Ú¸ø³öµÄÉè¼ÆÄ£°åΪ»ù´¡£¬½²½âS3C2410 ARM´¦ÀíÆ÷I2C×ÜÏßÇý¶¯¼°¹Ò½ÓÔÚÉϵÄSAA7113HÊÓƵģÄâ/Êý×Öת»»Ð¾Æ¬É豸Çý¶¯µÄ±àд·½·¨¡£
15.1 Linux I2CÌåϵ½á¹¹
LinuxµÄI2CÌåϵ½á¹¹·ÖΪ3¸ö×é³É²¿·Ö£º
1 I2CºËÐÄ
I2C
ºËÐÄÌṩÁËI2C×ÜÏßÇý¶¯ºÍÉ豸Çý¶¯µÄ×¢²á¡¢×¢Ïú·½·¨£¬I2CͨÐÅ·½·¨£¨¼´“algorithm”£¬±ÊÕßÈÏΪֱÒëΪ“ÔËËã·½·¨”²¢²»ºÏÊÊ£¬ÎªÃâÒýÆðÎó½â£¬
ÏÂÎĽ«Ö±½ÓʹÓÓalgorithm”£©ÉϲãµÄ¡¢Óë¾ßÌåÊÊÅäÆ÷Î޹صĴúÂëÒÔ¼°Ì½²âÉ豸¡¢¼ì²âÉ豸µØÖ·µÄÉϲã´úÂëµÈ¡£
2 I2C×ÜÏßÇý¶¯
I2C×ÜÏßÇý¶¯ÊǶÔI2CÓ²¼þÌåϵ½á¹¹ÖÐÊÊÅäÆ÷¶ËµÄʵÏÖ£¬ÊÊÅäÆ÷¿ÉÓÉCPU¿ØÖÆ£¬ÉõÖÁÖ±½Ó¼¯³ÉÔÚ
Ïà¹ØÎĵµ£º
Ò»£®Ç°ÑÔ
¡¡¡¡LinuxÓµÓзḻ¸÷ÖÖÔ´´úÂë×ÊÔ´,µ«ÊǴ󲿷ִúÂëÔÚWindowsƽ̨Çé¿öÊÇÎÞ·¨Õý³£±àÒëµÄ¡£Windowsƽ̨¸ù±¾ÎÞ·¨Ö±½ÓÀûÓÃÕâЩԴ´úÂë×ÊÔ´¡£Èç¹ûÏëҪʹÓÃÍêÕûµÄ´úÂ룬¾ÍÒª×öÒÆÖ²¹¤×÷¡£ÒòΪC/C++ LibraryµÄ²»Í¬ºÍÆäËûµÄһЩÔÒò£¬ÒÆÖ²C/C++´úÂëÊÇÒ»ÏîÀ§ÄѵŤ×÷¡£±¾ÎĽ«ÒÔÒ»¸öʵ¼ÊµÄÀý×Ó£¨Tar£©À´ËµÃ÷ÈçºÎ°ÑLinux´úÂëÒÆÖ² ......
WindowsÓëLinuxÖеĻ»ÐÐÊDz»Ò»ÑùµÄ£¬ÒѾÓöµ½¹ýºÃ¼¸´ÎÎÊÌâÁË¡«ÅúÁ¿Ð½¨Óû§µÄʱºò£¬ÐÂÓû§²»ÄܵǼ£¬ÒòΪÎÒµÄÎı¾ÊÇÔÚWindowsÏÂÉú³ÉµÄ£¬»»ÐÐÊÇWindows¸ñʽ£¬¶øLinuxÖÐʹÓÃnewusersÃüÁîµ¼Èëµ½passwdÎļþ£¬ÊÇÖ±½Ó¸´ÖƹýÈ¥µÄ¡«²»ÄÜÒ»ÐÐÒ»Ðеĸİ¡¡«ºÇºÇ£¬¸Õ¸Õѧµ½ÁËÒ»ÕС£
×Ö·ûÎļþÔÚÁ½¸öϵͳ֮¼ä¿½±´Ö®ºó£¬¿ÉÒÔʹÓÃdos2unix» ......
×î½ü W3C
Ò»¿ÚÆøÍƳö 7 ¸ö HTML ¹¤×÷²Ý°¸£¬º¸ÇÁË HTML5£¬HTML RDF£¬HTML Microdata£¬HTML Canvas£¬ HTML
Bidi µÈ±ê×¼¡£ÕâЩ²Ý°¸¶àÊýÓë HTML5 Óйأ¬ËäÈ» HTML5 ±ê×¼µÄÕæÕý·¢²¼ÓëʵÏÖ»¹ÓкÜÔ¶µÄ·£¬µ«Õâ¸öδÀ´×îÓÐǰ;µÄ HTML
±ê×¼ÕýÒýÆðÒµ½ç¹ã·ºµÄ¹Ø×¢¡£
W3C ·¢²¼µÄ 7 ¸ö HTML ¹¤×÷²Ý°¸ÊÇ:
HTML5
: HTML 5 ºËÐ ......
ÈôÏëÔÚubuntuϱàÒëc/c++´úÂë
Ê×ÏÈ£¬°²×°g++ºÍgdb£¬¿ÉÒÔÔÚÐÂÁ¢µÃÖÐÖ±½Ó°²×°
ÈôÒª±àÒëc£¬È磺
££include
<stdio.h>
int main()
{
printf("Hello,World!\n");
return 0;
}
......
#include <stdio.h>
int main ()
{
FILE *fp1;
fp1=fopen("test0.txt","rt");
if(fp1==NULL)
{
printf("can not open test0.txt\n");return 0;
&n ......