#include "xp_controller.h"

#include "DSP281x_Examples.h"   // DSP281x Examples Include File
#include "DSP281x_Device.h"
#include "MemoryFunctions.h"
#include "Spartan2E_Adr.h"
#include "TuneUpPlane.h"
#include "xerror.h"




void controller_init(T_controller *v)
{

}

void controller_int13_enable(T_controller *v)
{
    if (v->read.status.bit.int13_inited)
	  v->write.setup.bit.use_int13 = 1;
	else
	{
		
	
	}  
}

void controller_int13_disable(T_controller *v)
{
	v->write.setup.bit.use_int13 = 0;
}

/*
T_controller_read controller_read_errors(T_controller *v)
{
	T_controller_read r;

	r.errors.all = i_ReadMemory (ADR_ERRORS_TOTAL_INFO);
	r.errors_buses.all = i_ReadMemory (ADR_BUS_ERROR_READ);

	return r;
}
*/

int controller_read_all(T_controller *v)
{

	v->read.errors.all = ReadMemory (ADR_ERRORS_TOTAL_INFO);
	v->read.errors_buses.all = ReadMemory (ADR_BUS_ERROR_READ);
	return 0;
}






