#ifndef BUTTON_H_
#define BUTTON_H_

/**** Includes ****/
#include <stdint.h>
#include "../board/din.h"

namespace hw {

/**** Public definitions ****/
const uint8_t BUTTON_OFF  = 0;
const uint8_t BUTTON_ON = 1;

class Button
{
	protected:
	board::DigitalIn* din_ch;
	uint8_t act_lvl;
	uint8_t dbnc_cnter;
	
	public:
	Button(board::DigitalIn* din_ch, uint8_t act_lvl, uint8_t dbnc_lim, uint8_t init_state);
	~Button(void);
	
	uint8_t state;
	uint16_t time;
	uint8_t dbnc_lim;
	uint8_t is_new;
	
	uint8_t read(void);
	uint8_t force_read(void);
};

/**** Public function declarations ****/

#ifdef TESTING
#endif

} //namespace

#endif /* BUTTON_H_ */