linux I2CÇý¶¯·ÖÎö
I2CÊÇPhillips¿ª·¢µÄ2ÏߵĴ®ÐÐ×ÜÏßÐÒ顣ͨ³£Ó¦ÓÃÔÚǶÈëʽϵͳÖÐÈò»Í¬µÄ×é¼þͨÐÅ£¬PCÖ÷°å¿ÉÒÔͨ¹ýI2CÀ´Ó벻ͬµÄ´«¸ÐÆ÷ͨÐÅ¡£ÕâЩ´«¸ÐÆ÷ͨ³£±¨¸æ·çÉÈËٶȣ¬´¦ÀíÆ÷ζȺÍÕû¸öÓ²¼þϵͳµÄÐÅÏ¢£¬Õâ¸öÐÒéÒ²¿ÉÒÔÓÃÔÚRAM chipsÉÏ£¬Ïò²Ù×÷ϵͳÌṩDIMMµÄÐÅÏ¢¡£
ÔÚ2.0ʱI2CµÄkernelÔ´Âë²»ÔÚÄÚºËÀïµÄ£¬2.4Äں˰üÀ¨ÁËÒ»µã¶ÔI2CµÄÖ§³Ö£¬Ö÷ÒªÊÇÊÓƵÇý¶¯¡£
ÔÚ2.6ÄÚºËÀ´óÁ¿µÄI2C´úÂë¼ÓÈëµ½ÁËÄÚºËÀï¡£¸ÐлºÜ¶àÄں˿ª·¢ÕßµÄŬÁ¦£¬ËûÃÇÈýӿڸüÈÝÒ×±»ÄÚºËÉçÇø½ÓÊÜ¡£ÓÐЩÇý¶¯ÈÔÔÚÍⲿµÄCVSÊ÷ÀûÓзÅÈëkernel.orgÀµ«ÊÇËûÃDZ»ÒÆÖ²Ö»ÊÇʱ¼äµÄÎÊÌâ¡£
I2CµÄkernelÔ´Âë±»·Ö³É¼¸¸ö²¿·Ö£ºthe I2C core, I2C bus drivers£¬I2C algorithm drivers and I2C chip drivers¡£ÎÒÃǽ«ºöÂÔI2C core²¿·Ö£¬¶øÊǹØ×¢ÈçºÎ±àдa bus and algorithm Çý¶¯¡£
I2C Bus Drivers ×ÜÏßÇý¶¯
I2C×ÜÏßÇý¶¯ÓÃÒ»¸ö½á¹¹i2c_adapterÀ´ÃèÊö£¬¸Ã½á¹¹ÔÚÎļþinclude/linux/i2c.hÀﶨÒå¡£
ÒÔϵÄ×Ö¶ÎÐèÒªÔÚ×ÜÏßÇý¶¯ÀïÉèÖãº
struct module *owner; -set to the value (THIS_MODULE) that allows the proper module reference counting.
unsigned int class; -the type of I2C class devices that this driver supports. Usually this is set to the value I2C_ADAP_CLASS_SMBUS.
struct i2c_algorithm *algo; -a pointer to the struct i2c_algorithm structure that describes the way data is transferred through this I2C bus controller. More information on this structure is provided below.
char name[I2C_NAME_SIZE]; -set to a descriptive name of the I2C bus driver. This value shows up in the sysfs filename associated with this I2C adapter.
ÒÔϵĴúÂëÀ´×ÔÒ»¸öI2C adapterÇý¶¯µÄÀý×Ótiny_i2c_adap.c£¬
¿ÉÒÔÔÚthe Linux Journal FTP site [ftp.ssc.com/pub/lj/listings/issue116/7136.tgz [1]] »ñµÃ¡£
À´¿´¿´struct i2c_adapter ÈçºÎ±»ÉèÖãº
static struct i2c_adapter tiny_adapter = {
.owner = THIS_MODULE,
.class = I2C_ADAP_CLASS_SMBUS,
.algo = &tiny_algorithm,
.name = "tiny adapter",
};
Ҫע²áI2C adapter£¬Çý¶¯µ
Ïà¹ØÎĵµ£º
ת×Ôhttp://blog.chinaunix.net/u3/110321/showart.php?id=2159791
²é¿´ Linux Äں˷Óɱí
ʹÓÃÏÂÃæµÄ route ÃüÁî¿ÉÒԲ鿴 Linux Äں˷ÓÉ±í¡£
# route
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 ......
#include <iostream>
#include <cstdlib>
using namespace std;
class Foo
{
public:
Foo(int ii):i(ii){}
int getInt(){return i;}
private:
int i;
};
class Bar
{
public:
static int FooVal(){c++; return f.getInt();}
int callsFooVal(){return c;}
private:
s ......
#include<stdio.h>
int cubeByValue(int n);
int main(){
int number = 5 ;
printf("The original value of number is %d\n",number);
number = cubeByValue(number);
printf("The new  ......
¹Ù·½ÍøÕ¾£ºhttp://www.linuxvirtualserver.org/
°Ù¶È°Ù¿Æ£ºhttp://baike.baidu.com/view/645050.htm?fr=ala0_1_1
ת×Ô£ºhttp://server.csdn.net/n/20090827/4278.html
ÓÃLVS¹¹¼Ü¸ºÔؾùºâLinux¼¯ÈºÏµÍ³ linux lvs
ÓÃLVS¹¹¼Ü¸ºÔؾùºâLinux¼¯ÈºÏµÍ³ linux lvs
×÷ÕߣºÓຣ·¢
Ñ¡ÓõÄLVSʵ¼ÊÉÏÊÇÒ»ÖÖLinux²Ù×÷ÏµÍ³É ......