Files

copied

There are no circuits or boards in this repository.

Last update 6 years 3 months by Petro Zhuk
Filessoftwareclock
..
Debug
I2C.c
I2c.h
Menu.h
brightness_senor.c
brightness_senor.h
clock.componentinfo.xml
clock.cproj
control.c
control.h
crc8.c
crc8.h
delay.c
delay.h
display.c
display.h
ds1307.c
ds1307.h
ds18x20.c
ds18x20.h
encoder.c
encoder.h
ledLight.c
ledLight.h
main.c
menu.c
onewire.c
onewire.h
wa2811.asm
ws2811.s
I2c.h
//-------------------------------------------------< I2C >---------------------------------------------------- #ifndef I2C_H_ #define I2C_H_ #define BYTE unsigned char #define I2C_DDR DDRD // I2C #define I2C_PORT PORTD // I2C #define I2C_PIN PIND // I2C #define I2C_SCL PORTD7 // SCL #define I2C_SDA PORTD6 // SDA #define ACK 0 // #define NACK 1 // #define I2C_DELAY() _delay_ms(1); // #define ONE_SCL() { I2C_DDR &= ~(1 << I2C_SCL); I2C_PORT |= (1 << I2C_SCL); } // SCL #define NULL_SCL() { I2C_DDR |= (1 << I2C_SCL); I2C_PORT &= ~(1 << I2C_SCL); } // SCL #define ONE_SDA() { I2C_DDR &= ~(1 << I2C_SDA); I2C_PORT |= (1 << I2C_SDA); } // SDA #define NULL_SDA() { I2C_DDR |= (1 << I2C_SDA); I2C_PORT &= ~(1 << I2C_SDA); } // SDA // BYTE i2c_stop(void); // / 0 . 1 SDA. 2 SCL. 3, . void i2c_start(void); // void i2c_restart(void); // void i2c_init(void); // BYTE i2c_send_byte(BYTE data); // . ACK , NACK BYTE i2c_read_byte(BYTE ask); // . ACK, . NACK, #endif /* I2C_H_ */
Report a bug