#ifndef _AVR_definice_H_
#define _AVR_definice_H_ 1

//5V switch
#define SW_5V_PORT PORTA
#define SW_5V_DDR DDRA
#define SW_5V_PIN PINA
#define SW_5V_nmbr 5

void SW_5V_init(void)
{
	SW_5V_PORT &= ~(1<<SW_5V_nmbr);		// nastavime vystup na log 0
	SW_5V_DDR |= (1<<SW_5V_nmbr);		// pull up - vystupni port
}

#define SW_5V_on() (SW_5V_PORT|=(1<<SW_5V_nmbr))
#define SW_5V_off() (SW_5V_PORT&=~(1<<SW_5V_nmbr))

//GSM switch
#define SW_GSM_PORT PORTA
#define SW_GSM_DDR DDRA
#define SW_GSM_PIN PINA
#define SW_GSM_nmbr 6

void SW_GSM_init(void)
{
	SW_GSM_PORT &= ~(1<<SW_GSM_nmbr);
	SW_GSM_DDR |= (1<<SW_GSM_nmbr);
}

#define SW_GSM_on() (SW_GSM_PORT|=(1<<SW_GSM_nmbr))
#define SW_GSM_off() (SW_GSM_PORT&=~(1<<SW_GSM_nmbr))

//Voltmeter switch
#define SW_VOLT_PORT PORTA
#define SW_VOLT_DDR DDRA
#define SW_VOLT_PIN PINA
#define SW_VOLT_nmbr 7

void SW_VOLT_init(void)
{
	SW_VOLT_PORT &= ~(1<<SW_VOLT_nmbr);
	SW_VOLT_DDR |= (1<<SW_VOLT_nmbr);
}

#define SW_VOLT_on() (SW_VOLT_PORT|=(1<<SW_VOLT_nmbr))
#define SW_VOLT_off() (SW_VOLT_PORT&=~(1<<SW_VOLT_nmbr))

//Voltmeter
#define VOLTMETER_PORT PORTA
#define VOLTMETER_DDR DDRA
#define VOLTMETER_PIN PINA
#define VOLTMETER_nmbr 0


#endif /* _AVR_definice_H_ */