Rename module TWI to I2C and add comments
This commit is contained in:
21
src/bus/i2c.h
Normal file
21
src/bus/i2c.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#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);
|
||||
|
||||
#endif // MAD_CORE_BUS_I2C_H
|
||||
Reference in New Issue
Block a user