Embedded Application Programming Interface - picmg
Embedded Application Programming Interface - picmg
Embedded Application Programming Interface - picmg
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
7.6.3 Return Status Codes<br />
Condition<br />
Library Uninitialized<br />
(WriteBCnt>1)&&(pWBuffer==NULL)<br />
(ReadBCnt>1)&&(pRBuffer==NULL)<br />
(ReadBCnt>1)&&(RBufLen==0)<br />
((WriteBCnt==0)&&(ReadBCnt==0))<br />
unknown Id<br />
WriteBCnt>(pMaxBlkLen+1)<br />
ReadBCnt>(pMaxBlkLen+1)<br />
Bus Busy SDA/SDC low<br />
Arbitration Error/Collision Error<br />
On Write 1 write cycle<br />
SDA Remains low<br />
Timeout due to clock stretching<br />
startNak<br />
startNak<br />
startAckNak<br />
ReadBCnt>(RBufLen+1)<br />
Return Value<br />
EAPI_STATUS_NOT_INITIALIZED<br />
EAPI_STATUS_INVALID_PARAMETER<br />
EAPI_STATUS_INVALID_PARAMETER<br />
EAPI_STATUS_INVALID_PARAMETER<br />
EAPI_STATUS_INVALID_PARAMETER<br />
EAPI_STATUS_UNSUPPORTED<br />
EAPI_STATUS_INVALID_BLOCK_LENGTH<br />
EAPI_STATUS_INVALID_BLOCK_LENGTH<br />
EAPI_STATUS_BUSY_COLLISION<br />
EAPI_STATUS_BUSY_COLLISION<br />
EAPI_STATUS_HW_TIMEOUT<br />
EAPI_STATUS_NOT_FOUND<br />
EAPI_STATUS_NOT_FOUND<br />
EAPI_STATUS_WRITE_ERROR<br />
EAPI_STATUS_MORE_DATA<br />
... see 2.3 Status Codes on page 16<br />
Success<br />
EAPI_STATUS_SUCCESS<br />
7.7 EapiI2CReadTransfer<br />
uint32_t<br />
EAPI_CALLTYPE<br />
EApiI2CReadTransfer(<br />
__IN uint32_t Id , /* I2C Bus Id */<br />
__IN uint32_t Addr<br />
7.7.1 Description<br />
Reads from a specific register in the selected I2C device.<br />
, /* Encoded 7/10Bit I2C<br />
* Device Address<br />
*/<br />
__IN uint32_t Cmd , /* I2C Command/Offset */<br />
__OUT void *pBuffer , /* Transfer Data pBuffer */<br />
__IN uint32_t BufLen , /* Data pBuffer Length */<br />
__IN uint32_t ByteCnt /* Byte Count to read */<br />
);<br />
FUNC_DEF 14: EApiI2CReadTransfer<br />
Reads from I2C device at the I2C address Addr the amount of ByteCnt bytes to the buffer pBuffer<br />
while using the device specific command Cmd. Depending on the addressed I2C device Cmd can be<br />
a specific command or a byte offset.<br />
PICMG® EAPI R1.0, August 8, 2010 page 38 of 83