*OnlyifI2C_FUNC_PROTOCOL_MANGLINGisset: *%I2C_M_NO_RD_ACK:inareadmessage,masterACK/NACKbitisskipped *%I2C_M_IGNORE_NAK:treatNACKfromclientasACK *%I2C_M_REV_DIR_ADDR:togglestheRd/Wrbit *%I2C_M_STOP:forceaSTOPconditionafterthemessage * *@len:Numberofdatabytesin@bufbeingreadfromorwrittentotheI2C *slaveaddress.Forreadtransactionswhere%I2C_M_RECV_LENisset,the *callerguaranteesthatthisbuffercanholdupto%I2C_SMBUS_BLOCK_MAX *bytesinadditiontotheinitiallengthbytesentbytheslave(plus, *ifused,theSMBusPEC);andthisvaluewillbeincrementedbythenumber *ofblockdatabytesreceived. * *@buf:Thebufferintowhichdataisread,orfromwhichit'swritten. * *Ani2c_msgisthelowlevelrepresentationofonesegmentofanI2C *transaction.Itisvisibletodriversinthe@i2c_transfer()procedure, *touserspacefromi2c-dev,andtoI2Cadapterdriversthroughthe *@i2c_adapter.@master_xfer()method. * *ExceptwhenI2C"protocolmangling"isused,allI2Cadaptersimplement *thestandardrulesforI2Ctransactions.Eachtransactionbeginswitha *START.Thatisfollowedbytheslaveaddress,andabitencodingread *versuswrite.Thenfollowallthedatabytes,possiblyincludingabyte *withSMBusPEC.ThetransferterminateswithaNAK,orwhenallthose *byteshavebeentransferredandACKed.Ifthisisthelastmessageina *group,itisfollowedbyaSTOP.Otherwiseitisfollowedbythenext *@i2c_msgtransactionsegment,beginningwitha(repeated)START. * *Alternatively,whentheadaptersupports%I2C_FUNC_PROTOCOL_MANGLINGthen *passingcertain@flagsmayhavechangedthosestandardprotocolbehaviors. *Thoseflagsareonlyforusewithbroken/nonconformingslaves,andwith *adapterswhichareknowntosupportthespecificmanglingoptionstheyneed.
*/ struct i2c_msg {
__u16 addr;
__u16 flags; #define I2C_M_RD 0x0001 /* guaranteed to be 0x0001! */ #define I2C_M_TEN 0x0010 /* use only if I2C_FUNC_10BIT_ADDR */ #define I2C_M_DMA_SAFE 0x0200 /* use only in kernel space */ #define I2C_M_RECV_LEN 0x0400 /* use only if I2C_FUNC_SMBUS_READ_BLOCK_DATA */ #define I2C_M_NO_RD_ACK 0x0800 /* use only if I2C_FUNC_PROTOCOL_MANGLING */ #define I2C_M_IGNORE_NAK 0x1000 /* use only if I2C_FUNC_PROTOCOL_MANGLING */ #define I2C_M_REV_DIR_ADDR 0x2000 /* use only if I2C_FUNC_PROTOCOL_MANGLING */ #define I2C_M_NOSTART 0x4000 /* use only if I2C_FUNC_NOSTART */ #define I2C_M_STOP 0x8000 /* use only if I2C_FUNC_PROTOCOL_MANGLING */
__u16 len;
__u8 *buf;
};
/* if I2C_M_RECV_LEN is also supported */ #define I2C_FUNC_SMBUS_EMUL_ALL (I2C_FUNC_SMBUS_EMUL | \
I2C_FUNC_SMBUS_READ_BLOCK_DATA | \
I2C_FUNC_SMBUS_BLOCK_PROC_CALL)
/* *DataforSMBusMessages
*/ #define I2C_SMBUS_BLOCK_MAX 32/* As specified in SMBus standard */ union i2c_smbus_data {
__u8 byte;
__u16 word;
__u8 block[I2C_SMBUS_BLOCK_MAX + 2]; /* block[0] is used for length */ /* and one more for user-space compatibility */
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.