#ifndef __I2C_H__ #define __I2C_H__ typedef struct{ volatile unsigned char *tx_port; unsigned char tx_mask; volatile unsigned char *rx_port; unsigned char rx_mask; volatile unsigned char *clk_port; unsigned char clk_mask; void (*clk_wait)(); } i2c_channel_t; void i2c_toggle(i2c_channel_t *channel); void i2c_write(unsigned char data, i2c_channel_t *channel); unsigned char i2c_read(i2c_channel_t *channel); #endif /* __I2C_H__ */