From: Luis.F.Correia <Lui...@se...> - 2005-02-15 08:50:42
|
Hi! (yes, i'm still reading) > -----Original Message----- > From: paul kamphuis [mailto:pau...@xs...] [snip] > > Now to the way on how to do it. (Luis are you still reading, > here comes your I2C API :-) ) > > file = open("/dev/i2c-0",O_RDWR); // open i2c bus > ioctl(file,I2C_SLAVE,0x26); // select device > struct i2c_smbus_ioctl_data args; > args.read_write = I2C_SMBUS_WRITE; > args.size = I2C_SMBUS_BYTE; > args.command = 0x03; // <- this is the byte to write!! > ioctl(file,I2C_SMBUS,&args); // write byte to selected device Ok then, did you found out which header files to include? It should be something like <i2c.h> and not <linux/12c.h> as I had before. It was even commented out because it did not really compile... Anyway, from my experiences, you must create a very static lcd4linux.conf file, just as a test. No bars, no scrollers no moving icons, just something like showing the Linux kernel version. This is necessary in order to reduce the amount of information that lcd4linux will force on the driver. At first I just got the .conf file from my router and the result was a very big mess... :) So please feel free to adapt my code to whatever you think doable. About the display connections, how did you wired it? In my driver I used the same type of connections that Martin Hejl uses in his GPIO driver for Soekris boards (http://soekris.hejl.de/wiring.gif) > There is hardly any documentation on this and it required > some digging in kernel source code to find that 'command' > should contain the byte write. But it does work, to write a > byte to the port. > > Now for the sad news. The display doesn't start yet. Of > course this can have several reasons, that I still have to > look into. It might even require bringing an oscilloscope > home from work. > > Luis, thanks for your feedback! > > Paul > Have fun! Luis Correia |