#ifndef MAD_CORE_BUS_I2C_H
#define MAD_CORE_BUS_I2C_H

// Sensors
#define AHT01 0x0  // Upper Sensor TWI Channel
#define AHT02 0x1  // Middle Sensor TWI Channel
#define AHT03 0x2  // Lower Sensor TWI Channel

int I2C_Init(void);
int I2C_Start(unsigned char addr, unsigned char mode);
int I2C_SetChannel(int channel);
int I2C_Write(unsigned char data);
unsigned char I2C_Read_ACK(void);
unsigned char I2C_Read_NACK(void);
int I2C_Wait_ACK(void);
int I2C_Stop(void);

int I2C_AHT20_Init(void);
int I2C_AHT20_Read(float *temp, float *rhum);

unsigned short I2C_ADS1115_Read(int channel);

#endif // MAD_CORE_BUS_I2C_H
