Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?

2023-04-01 Thread Christo Crause via fpc-pascal
On Sat, Apr 1, 2023 at 9:57 PM Bo Berglund via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Question: > Can I use Linux file system commands to read/write the data on the i2c > EEPROM > memory device and if so how from fpc? > To some extent it is possible to handle i2c transactions as f

Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?

2023-04-01 Thread Travis Siegel via fpc-pascal
Generally, raspberry pi devices connected to other devices will (by default) use python for their programming.  The python libs have all the setup and tear down code built in.  You can use C as well, so I see no reason why FPC couldn't be used.  It's probably going to take some work though.  Yo

Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?

2023-04-01 Thread Giuliano Colla via fpc-pascal
Il 01/04/2023 21:56, Bo Berglund via fpc-pascal ha scritto: I need to read and write data to an EEPROM connected by I2C on a RaspberryPi4. The I2C channel is found in /dev as i2c-1: $ ll /dev/i2* crw-rw 1 root i2c 89, 1 2019-02-14 11:12 /dev/i2c-1 In this channel the EEPROM CAT24C128 is at

Re: [fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?

2023-04-01 Thread Travis Siegel via fpc-pascal
On unix (and all of it's derivatives, everything is a file, including connections to other systems.  You can treat it like a file, and in (most) circumstances, it will operate just as if it were a local file. Some devices require special handling, but for the most part, if it's listed as a fil

[fpc-pascal] FPC/Lazarus on RPi4 - How to read/write I2C connected EEPROM?

2023-04-01 Thread Bo Berglund via fpc-pascal
I need to read and write data to an EEPROM connected by I2C on a RaspberryPi4. The I2C channel is found in /dev as i2c-1: $ ll /dev/i2* crw-rw 1 root i2c 89, 1 2019-02-14 11:12 /dev/i2c-1 In this channel the EEPROM CAT24C128 is at address 0x50 The data on the device is organized as 256 pages