2013年8月4日星期日

Android application to read and write I2C

I refer others to read and write with the NDK + JNI I2C, compiled by the APK can run, but can not read the old data confirm this I2C address how much it is? Was slaveAddr the value should be how to set? Or What other questions?
------ Solution ----------------------------------- ---------
I2C what?
integer to char?
------ Solution ----------------------------- ---------------
1 Floor answer made me lost.
------ Solution ---------------------------------------- ----
rookie passing a message waiting for you at the top answer I also learn

------ Solution ------------------------------------ --------
must first ensure that the ioctl I2C_SLAVE this case must perform to.
generally through ioctl interface to transfer data to the driver, gave his all & slaveAddr this form, the kernel to get the user mode address, will do some validation, and then copy or read.

------ Solution ------------------------------------ --------
I2C I also wrote a program does not know is not the same as I want to enable the I2C on the CTP, various sensors and FM , have all been achieved landlord does not know what to do?
------ For reference only -------------------------------------- -
consecutive thirty-three postings I have no answer, and each time can be given to the current maximum score, O God, I am so in good faith, to reward an answer you can solve the problem?
------ For reference only -------------------------------------- -
driver i2c-dev.c file i2cdev_ioctl print function is a plus, but after the success of the JNI calls ioctl also did not see the print. feeling did not transferred, the code: res = ioctl (fileHander, I2C_SLAVE, slaveAddr);
------ For reference only ----------------------- ----------------
little progress, and has been added in the print driver information, see the call to the correlation function, but still fails, tomorrow add some LOG See
------ For reference only ------------------------------------ ---
if ((buf [0] & 0x10) == 0x01) { ;
Log.w (TAG, "------ success ----- ");
} else {
Log.w (TAG, "---- fail ------- ");
}

more than a few lines of code do not know what it meant, and why such judgments Yeah
------ For reference only -------------------- -------------------

I look at this if statement can never be established, do not know why the judge!
- ---- For reference only ---------------------------------------
< br /> read Codec for I2C, upstairs can provide source? written?
------ For reference only -------------------- -------------------
I2C problem also had 10 days was estimated to be no one to answer, do not tangle, who can get under Android GPIO analog serial?
http://bbs.csdn.net/topics/390321025
----- - For reference only ---------------------------------------
ask the landlord Finally, how to solve? Recently, I also do, but also can not reproduce the data, can give pointers about?

没有评论:

发表评论