/* ---------------------------------------------------------------------
**	file: keyb_drv.h
**	function: Keyboard driver header file
** author: Jakub Tiller
** last update: 4.12.2011
** ---------------------------------------------------------------------
*/

#ifndef _KEYB_DRV
#define _KEYB_DRV

#include <avr/io.h>

#define KEYB_PORT			PORTB
#define KEYB_DDR			DDRB
#define KEYB_PIN			PINB

#define NUMBER_OF_KEYS	4
#define FISRT_PIN			0

enum PULL_UP_t {
	PULLUP_YES = 0,
	PULLUP_NO
};

#define KEY_PUSHED(x)	(!(KEYB_PIN & (1<<x)))

void keyb_init(enum PULL_UP_t PULL_UP);
unsigned char keyb_pushed(void);

#endif
