Writing to a memory address using I2C
-
- Posts: 15
- Joined: Fri Mar 19, 2021 9:58 pm
Writing to a memory address using I2C
Is there a way of writing to a specific memory address using the ESP32 I2C driver? I could find the functions i2c_master_write_to_device and i2c_master_read_from_device but they don't take into consideration the memory address of the device.
Re: Writing to a memory address using I2C
Every I2C device needs a driver. The ESP I2C APi just write data to the device.
For memory read or write there is a register on the memory device that holds the memory address you want accessed.
Look at the I2C device, find the part number and then find the documentation for that part . that should tell you how to access the memory of the part.
For memory read or write there is a register on the memory device that holds the memory address you want accessed.
Look at the I2C device, find the part number and then find the documentation for that part . that should tell you how to access the memory of the part.
-
- Posts: 1696
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Writing to a memory address using I2C
The protocol used for accessing certain functions/addresses/... of an I2C slave is specific to the slave device and not part of the I2C protocol layer.
If you can't find a driver for your specific device, you'll have to implement that device's protocol youself, using the IDF's I2C driver API to build and execute transactions conforming to that protocol. The datasheet of the slave device will give you all the specifics as to what an I2C master needs to do to perform the desired operations on the slave.
If you can't find a driver for your specific device, you'll have to implement that device's protocol youself, using the IDF's I2C driver API to build and execute transactions conforming to that protocol. The datasheet of the slave device will give you all the specifics as to what an I2C master needs to do to perform the desired operations on the slave.
Who is online
Users browsing this forum: Bing [Bot] and 99 guests