how to read/write a 16-bit address e2prom?
I need a clue on how to use the interface "at24.c" to write and read the 16-bit EEPROMs, like the 24c256, in user mode. I cross-compiled the kernel (2.6.32) with the "at24" option enabled and now I am able to write and read the i2c EEPROM memory during kernel startup, but I have no idea how to use this interface in user mode, in particular I would like to know how to access a particular EEPROM memory location with 16-bit address.
|
Did the driver create a device file: /dev/XXXX?, where XXXX is some name that reflects the name or type of device (i2c) that it accesses. If so, I think you would use the usual open()/read()/write()/seek()/close/ioctl() semantics to access it. THere may be significant functionality buried in the ioctl() interface. I don't know anything specific about the device to which you refer, but Documentation / i2c / dev-interface may be enlightening.
--- rod. |
With your indications I have compiled this simple program and seems to work.
Code:
#include <stdio.h> |
All times are GMT -5. The time now is 07:59 AM. |