/** 
 * \file keyboard.h
 * \brief keyboard header file
 * \details File contains structures, enumerations and functions declarations for keyboard
 *
 * \author Juraj Golej
 * \version 1.0
 */


#ifndef KEYBOARD_H_
#define KEYBOARD_H_

#include "sam.h"
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <drivers/pio/pio.h>
#include <utils/retcode/retcode.h>
#include <utils/assert/arm_assert.h>
#include <pins.h>
#include "keyboard_cfg.h"

/** 
 * \brief keyboard_click enumeration
 */
enum KB_CLICKTYPE {
	KB_PRESS,			///< Key was pressed
	KB_RELEASE,			///< Key was released
};

typedef void (*keyboard_cb)(enum KB_CLICKTYPE click, uint8_t key);

/**
 * \brief Keyboard initialization
 *
* \param[in] callback Function pointer for pressed and released key reading
 *
 * \note Working pins (irq, pull-up...) must be initialized before using here.
 */
void KEYBOARD_init(keyboard_cb callback);

#endif /* KEYBOARD_H_ */