Project 5  Character Liquid-Crystal Display
Neff Site
i2c.h
Go to the documentation of this file.
1 
17 #ifndef I2C_H_
18 #define I2C_H_
19 
20 #define F_I2C 100000L
21 
22 #define I2C_PORT PORTF
23 #define I2C_MODULE TWIF
24 
25 #define I2C_SDA_bp PIN0_bp
26 #define I2C_SDA_bm PIN0_bm
27 
28 #define I2C_SCL_bp PIN1_bp
29 #define I2C_SCL_bm PIN1_bm
30 
31 #ifdef __cplusplus
32 extern "C"
33 {
34 #endif
35 
37 void i2c_init(void);
38 
45 void i2c_start_write(uint8_t addr);
46 
52 void i2c_write(uint8_t data);
53 
58 void i2c_stop(void);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* I2C_H_ */
void i2c_init(void)
Initializes the I2C module.
void i2c_start_write(uint8_t addr)
Start a write transaction.
void i2c_write(uint8_t data)
Write one byte.
void i2c_stop(void)
Close the current transaction.
Contact