#pragma once

struct I2C_Device
{
  unsigned char* Buffer;
  unsigned char Size;
  void (*CallbackProc)(unsigned char Address, const unsigned char* Data, unsigned char Size);
  
  unsigned char Address;
  unsigned char Write;
  unsigned char Read;
  
  I2C_Device* Next;
};

void I2C2_Init();
void I2C2_Write(unsigned char Address, unsigned char Data);
void I2C2_Write(unsigned char Address, const void* Data, unsigned char Size);
void I2C2_Read(unsigned char Address, void* Data, unsigned char Size);
void I2C2_Stop();

void I2C1_Init();
void I2C1_Write(unsigned char Address, unsigned char Data);
void I2C1_Write(unsigned char Address, const void* Data, unsigned char Size);
void I2C1_Write2(unsigned char Address, const void* Data1, unsigned char Size1, const void* Data2, unsigned char Size2);
void I2C1_Read(unsigned char Address, void* Data, unsigned char Size);
void I2C1_Stop();
