/*
 * DeffLedModulLib.h
 *
 * Created: 10.4.2012 11:08:14
 *  Author: JIRKO
 */ 


#ifndef DEFFLEDMODULLIB_H_
#define DEFFLEDMODULLIB_H_


//****************   Definicia V/V   ****************************************************************
	
	#define	LED_ON				sbi(PORTD,3)		// v led module je to naopak
	#define LED_OFF				cbi(PORTD,3)		
	#define LED_NEG				bit_is_set(PORTD,3) ? cbi(PORTD,3) : sbi(PORTD,3)
	
// spinanie tranzistorov

	#define T0_ON				sbi(PORTC,0)
	#define T1_ON				sbi(PORTC,1)
	#define T2_ON				sbi(PORTC,2)
	#define T3_ON				sbi(PORTC,3)
	#define T4_ON				sbi(PORTB,0)
	#define T5_ON				sbi(PORTD,7)
	#define T6_ON				sbi(PORTD,6)
	#define T7_ON				sbi(PORTD,5)
	
	#define T0_OFF				cbi(PORTC,0)
	#define T1_OFF				cbi(PORTC,1)
	#define T2_OFF				cbi(PORTC,2)
	#define T3_OFF				cbi(PORTC,3)
	#define T4_OFF				cbi(PORTB,0)
	#define T5_OFF				cbi(PORTD,7)
	#define T6_OFF				cbi(PORTD,6)
	#define T7_OFF				cbi(PORTD,5)
	
	#define T_PORTC_OFF			PORTC= 0x00
	#define T_PORTD_OFF			PORTD= PORTD & 0b11111000
	#define T_PORTB_OFF			cbi(PORTB,0)
	
	#define T_PORTC_ON			PORTC= PORTC|0x0f
	#define T_PORTD_ON			PORTD= PORTD | 0b11100000
	#define T_PORTB_ON			sbi(PORTB,0)
	
//--------------------------------------------------------------------------------------------------


#endif /* DEFFLEDMODULLIB_H_ */