#ifndef OUT_DRIVER_H_
#define OUT_DRIVER_H_

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

namespace hw {

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

class OutDriver
{	
	public:
	OutDriver(void);
	~OutDriver(void);
	
	void init(bsp::PwmOut* pwm_high, bsp::DigitalOut* dout_low);
	
	uint16_t target_duty;
	uint8_t target_low;
	
	void write(uint16_t numerator);
	void write(uint8_t percent);
	void write_hiz(void);
	void enable(void);
	void disable(void);
	uint8_t is_disabled(void);
	
	#ifndef TESTING
	protected:
	#endif
	bsp::PwmOut* pwm_high;
	bsp::DigitalOut* dout_low;
	uint8_t disabled;
};

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

#ifdef TESTING
#endif

} //namespace

#endif /* OUT_DRIVER_H_ */