--- In [email protected], "cbswbot" <br...@...> wrote: > > Hi all, > > i just wanted to read the temperature of an LM75(I2C). > > My firmware is a build with the version "30" sdk. > So i use the newest SDK. > > I used the code from here (little bit modified for the LM75), > http://foxlx.acmesystems.it/?id=10 > and the header files from this article. > http://foxlx.acmesystems.it/foxlx_acmesystems_it/00010/etraxi2c.h > http://foxlx.acmesystems.it/foxlx_acmesystems_it/00010/i2c_errno.h > > anytime i start it, i get the message: > Open error on /dev/i2c > > Do i need to do some config on the I2C to use it? > > And the next question, Geert Vancompernolle wrote in his PDF that i can use > (void i2c_read( unsigned char slave, unsigned char* rbuf, unsigned char rlen > );) and so on.. > But where i can find this prototypes? Is the article about I2C on ACME to old? > > Hope anyone can help me > Many thanks! > > rouven >
Hi, You can find all the necessary info in the "Files" section of the Yahoo FoxBoard site: http://tech.groups.yahoo.com/group/foxboard/files/GeertVc/ Download the file newi2cdriver.rar and read all the documentation. You can also find more information on my Wiki pages: http://www.gevawebsolutions.com/wiki/index.php?title=FB_General_Issues Not all is relevant, but almost all. As Jamie said: comment out the #define he mentioned and all should be fine. If the compiler switch is correctly set, then the MAJOR number must be 123. Otherwise, it will be something like (if I remember well) 254. So, it should be 123... My intention was to create a dynamic MAJOR number, as is advised in the Linux Device Drivers book. But apparently, that switch is set "on" by default, without taking into account al the dependencies related to that switch. If you go through the different documentations, you will get the picture. As for your second question: where is the i2c_read() function defined? You can find it in the file i2c.h. In there, you can find the new functions I've added: /**GVC**/ /* New low level I2C functions */ int i2c_read( unsigned char slave, unsigned char* rbuf, unsigned char rlen ); int i2c_write( unsigned char slave, unsigned char* wbuf, unsigned char wlen ); int i2c_writeread( unsigned char slave , unsigned char* wbuf , unsigned char wlen , unsigned char* rbuf , unsigned char rlen ); /**END GVC**/ But I've noticed that the original i2c.h file, where I've put my functions (and which is part of the newi2cdriver.rar file), has been renamed to i2c_gvc.h. So, pls. look for this file in the archive: ./os/linux-2.6/arch/cris/drivers/i2c_gvc.h The above mentioned prototypes should be over there. Best rgds, --Geert
