using the st25dv04k i2c address
Hello
We have built a custom board using the st25dv04k and are having trouble understanding how to use it. The device communication is using i2c and the started address we are always using is 0.
The functions we are using are simple read and write functions:
static inline int i2c_write(const struct device *dev, const uint8_t *buf, uint32_t num_bytes, uint16_t addr)
Write a set amount of data to an I2C device. This routine writes a set amount of data synchronously.
Parameters:
dev
– Pointer to the device structure for an I2C controller driver configured in controller mode.
buf
– Memory pool from which the data is transferred.
num_bytes
– Number of bytes to write.
addr
– Address to the target I2C device for writing.
Return values:
0 If successful.
-EIO General input / output error.
static inline int i2c_read(const struct device *dev, uint8_t *buf, uint32_t num_bytes, uint16_t addr)
Read a set amount of data from an I2C device. This routine reads a set amount of data synchronously.
Parameters:
dev
– Pointer to the device structure for an I2C controller driver configured in controller mode.
buf
– Memory pool that stores the retrieved data.
num_bytes
– Number of bytes to read.
addr
– Address of the I2C device being read.
Return values:
0 If successful.
-EIO General input / output error.
The start and and stop conditions are included in the functions. We are firstly just trying to confirm that the board configurations are correct and are looking for a way to do so and not receive strange values. Please assist in a way to help us confirm that they are correct. If possible, please include what to put in the buffer and what to put in the device i2c address. Thank you in advance!
Kind regards,
Hassan
