|
case IOCONTROL_I2C_RCVSTR:
{
MutexI2C *m_8836_READ = new MutexI2C(0xc5, 1000, MutexI2C::MES_I2C0, MutexI2C::I2CMasterMode);
m_8836_READ->Init(MutexI2C::TXCLKSRC_PCLK256, 6, 10);
U8 len=*pInBuffer;
str=(BYTE *)malloc(sizeof(BYTE)*len+1);
m_8836_READ->Read(str,len);
//*(str+len)=0;
for(int i=0;i
RETAILMSG(1, (L".........IOCONTROL_I2C_RCVSTR.....i2ciocontrol str[%d]=%x.....\r\n",i,*(str+i)));
delete m_8836_READ;
pOutBuffer=str;
}
break;
应用里面
if (hI2c)
{
value=DeviceIoControl(hI2c,IOCONTROL_I2C_RCVSTR,&getlen,sizeof(getlen),getstr,sizeof(getstr),&len,NULL);
} |
|