[fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?
bo.berglund at gmail.com
Sun Apr 2 10:23:24 CEST 2023
On Sun, 2 Apr 2023 07:31:43 +0200, Christo Crause via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:
>On Sat, Apr 1, 2023 at 9:57?PM Bo Berglund via fpc-pascal <
>fpc-pascal at lists.freepascal.org> wrote:
>> Can I use Linux file system commands to read/write the data on the i2c
>> memory device and if so how from fpc?
>To some extent it is possible to handle i2c transactions as file read/write
>operations, but some ioctl calls are required to configure e.g. the device
>address . Take note that only a subset of i2c functionality is available
>using read/write calls. Lazi2cdev  uses this approach.
>For finer control over the i2c transactions (for example combined
>write/read transactions) low level ioctl calls are available in Linux. I
>wrote an i2c class  using this approach.
Thanks for the reply and links!
Then I need to go the low-level way, I guess...
I had hoped it would be a simpler way using OS available functions on RPi.
I have used these EEPROM devices on some Microchip PIC24 projects where I had to
do the nitty-gritty low level stuff myself including bit-banging the I2C bus...
With that approach I have to *read the details* on the EEPROM datasheets to see
how they are handled, unless of course I can port my own i2c code (Ansi-C) to
Luckily on RPi the system is built to allow users to do low-level stuff on the
Developer in Sweden
More information about the fpc-pascal