#ifndef __MAIN_H_
#define __MAIN_H_

#define LCD_H_

#define LCD_DDR DDRD
#define LCD_PORT PORTD
#define LCD_PIN PIND

#define LED_DDR DDRA
#define LED_PORT PORTA
#define LED_PIN PINA

#define BTN_DDR DDRC
#define BTN_PORT PORTC
#define BTN_PIN PINC

#define DATA 0b11110000
#define RS PD2
#define E PD3

#define E1 LCD_PORT |= (1 << E)
#define E0 LCD_PORT &= ~(1 << E)

#define RS1 LCD_PORT |= (1 << RS)
#define RS0 LCD_PORT &= ~(1 << RS)

#define LED1_R1 LED_PORT |= (1 << PA0)
#define LED1_R0 LED_PORT &= ~(1 << PA0)

#define LED1_G1 LED_PORT |= (1 << PA1)
#define LED1_G0 LED_PORT &= ~(1 << PA1)

#define LED1_B1 LED_PORT |= (1 << PA2)
#define LED1_B0 LED_PORT &= ~(1 << PA2)

#define LED2_G1 LED_PORT |= (1 << PA3)
#define LED2_G0 LED_PORT &= ~(1 << PA3)

#define LED2_R1 LED_PORT |= (1 << PA4)
#define LED2_R0 LED_PORT &= ~(1 << PA4)

#define LED3_Y1 LED_PORT |= (1 << PA5)
#define LED3_Y0 LED_PORT &= ~(1 << PA5)

#define LED4_B1 LED_PORT |= (1 << PA6)
#define LED4_B0 LED_PORT &= ~(1 << PA6)

#define LED5_G1 LED_PORT |= (1 << PA7)
#define LED5_G0 LED_PORT &= ~(1 << PA7)

#define BTN_PLAY_PAUSE (~PINC & (1 << PC0))
#define BTN_PREV (~PINC & (1 << PC1))
#define BTN_NEXT (~PINC & (1 << PC2))
#define BTN_VOL_MIN (~PINC & (1 << PC3))
#define BTN_VOL_PLS (~PINC & (1 << PC4))
#define BTN_RAND (~PINC & (1 << PC5))
#define BTN_REPEAT (~PINC & (1 << PC6))
#define BTN_MODE (~PINC & (1 << PC7))

#define FLAG_END_RX (1 << 3)
#define FLAG_ERR_RX (1 << 4)
#define BUF_SIZE 20

#endif /*__MAIN_H_*/