/**** Includes ****/
#include "../utils/utils.h"
#include "mcu/mcu_hal.h"
#include "dio.h"

using namespace board;

/**** Private definitions ****/
/**** Private constants ****/
/**** Private variables ****/
/**** Private function declarations ****/

/**** Public function definitions ****/
board::DigitalIO::DigitalIO(uint8_t gpio_ch, uint8_t init_value) : DigitalIn(gpio_ch, 0, init_value), DigitalOut(gpio_ch, 0)
{
	return;
}

board::DigitalIO::~DigitalIO(void)
{
	this->write(DOUT_HIZ);
}

uint8_t board::DigitalIO::is_io_match(void)
{
	if(this->last_set == DOUT_HIZ) return 1;
	
	uint8_t read_lvl = this->read();
	
	if(read_lvl == (uint8_t)this->last_set) return 1;
	else return 0;
}

/**** Private function definitions ****/
