i2c.h (364B)
1 #ifndef _I2C_H_ 2 #define _I2C_H_ 3 4 #include <stdint.h> 5 6 #define I2C_MASTER 0x08 7 #define I2C_SLEW_OFF 0x80 8 #define I2C_SLEW_ON 0x00 9 #define I2C_CLK_1MHZ 1000000 10 11 void i2c_init(uint8_t, uint8_t, uint32_t); 12 void i2c_hold(void); 13 void i2c_start(void); 14 void i2c_stop(void); 15 void i2c_restart(void); 16 void i2c_write(uint8_t); 17 uint8_t i2c_read(uint8_t); 18 19 #endif /* _I2C_H_ */