0
  • struct devices *address - Address of the register.
  • number_bytes - number of byte of data to be written.
  • int8_t wdata - data to be written to the register address.
  • unsigned char *result_buffer - pointer to a buffer of 256 bytes.
  • var is defined as *var, which can be used to store the i2c_write(address,1,wdata, the_buffer) to it.
  • returns a value instead of 0 or 1.
  • For example - (0x2,1, 02, ?).
int i2c_buffer_write(struct devices *address, int number_bytes, int8_t wdata, unsigned char *result_buffer)
{
   char *var;
   char the_buffer[256];
   var = i2c_write(address,1,wdata, the_buffer);
   return var;
}

int i2c_new_write()
{
 //How can I write from the buffer to the function i2c_new_write() ?
}

How can I put the result_buffer such that I can write from the buffer in i2c_buffer_Write to i2c_new_Write??

code_debug
  • 25
  • 4
  • 1
    You should use I2c driver provided with the hardware /or OS drivers .if you write it for a controller you have to tell us about which controller you use? – Ibram Reda Feb 20 '21 at 07:38
  • @Ibram Reda , I use linux and ARM compiler. – code_debug Feb 20 '21 at 07:48
  • Most of the eeprom chips are supported by a corresponding driver (at24 or at25). Are you trying to repeat them on the studying purposes? – 0andriy Feb 20 '21 at 21:31

0 Answers0