/*
 * definitions.h
 *
 * Created: 16.4.2016 14:43:43
 *  Author: Ondra
 */ 


#ifndef DEFINITIONS_H_
#define DEFINITIONS_H_

#define F_CPU 1000000UL
#define USART_BAUDRATE 9600
#define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)

/* Ports definition */
#define BTN_RIGHT	0,C
#define BTN_IN		1,C
#define BTN_LEFT	2,C
#define BTN_BLOCK	2,D
#define BTN_OK		3,D

#define IN_RST		5,D
#define OUT_RST		6,D
#define EXP_RST		7,D

#define IN_CS		0,B
#define OUT_CS		1,B
#define EXP_CS		2,B

/* Exp definitions */
#define IODIRA		0x00
#define IODIRB		0x01
#define GPIOA		0x12
#define GPIOB		0x13


#define PORT_SPI    PORTB
#define DDR_SPI     DDRB
#define DD_MISO     DDB4
#define DD_MOSI     DDB3
#define DD_SS       DDB2
#define DD_SCK      DDB5

/* OTHER DEFS */
#define IN_LED		7

/* expander's PORTA pins */
#define REL_IN		7
#define REL_BLOCK	6
#define REL_UHF2	5
#define REL_UHF1	4



#endif /* DEFINITIONS_H_ */