/*
 * conf_brd.h
 *
 * Created: 22.2.2016 22:50:12
 *  Author: Chenda
 */ 


#ifndef CONF_BRD_H_
#define CONF_BRD_H_

#define F_CPU 16000000UL

#define TIMER_PRESCALER			64

// LCD port mapping  */
#define LCD_PORT		PORTA
#define LCD_DDR         DDRA

// UART1 bus RS-485 direction, connect to both DE & /RE
#define mU1BusRs485Dir_Enab()		DDRD|=(1<<PD4)
#define mU1BusRs485Dir_Out()		PORTD&=~(1<<PD4)	// logic "0"
#define mU1BusRs485Dir_In()			PORTD|=(1<<PD4)		// logic "1"

// Status LED
#define mStatusLed_Enab()			DDRD|=(1<<PD5)
#define mStatusLed_Off()			PORTD|=(1<<PD5)
#define mStatusLed_On()				PORTD&=~(1<<PD5)
#define mStatusLed_Toggle()			PORTD^=(1<<PD5)

// buzzer
#define mBuzzer_Enab()				DDRD|=(1<<PD6)
#define mBuzzer_Off()				PORTD|=(1<<PD6)
#define mBuzzer_On()				PORTD&=~(1<<PD6)
#define mBuzzer_Toggle()			PORTD^=(1<<PD6)


#endif /* CONF_BRD_H_ */