#ifndef DISPLAY_LED_H_
#define DISPLAY_LED_H_

/**** Includes ****/
#include <stdint.h>
#include "../bsp/dout.h"
#include "../bsp/pwm.h"

namespace hw {

/**** Public definitions ****/

class DisplayLed
{
	protected:
	bsp::DigitalOut* led0;
	bsp::DigitalOut* led1;
	bsp::DigitalOut* led2;
	bsp::DigitalOut* led3;
	bsp::DigitalOut* led4;
	bsp::DigitalOut* led5;
	bsp::PWMout* common;
	
	uint16_t lock_counter;
	
	public:
	typedef enum {
		LED_DSP_DOT20,
		LED_DSP_DOT10,
		LED_DSP_BAR
	} style_t;
	
	DisplayLed(bsp::DigitalOut* led0, bsp::DigitalOut* led1, bsp::DigitalOut* led2, bsp::DigitalOut* led3, bsp::DigitalOut* led4, bsp::DigitalOut* led5, bsp::PWMout* common);
	~DisplayLed(void);
	
	void show_percent(uint8_t percent, style_t style);
	void write(uint8_t image);
	
	void set_brigthness(uint8_t percent);
	
	void set_lock(uint16_t timeout);
	void process_timer(void);
	
	uint8_t locked;
};

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

#ifdef TESTING
#endif

} //namespace

#endif /* DISPLAY_LED_H_ */