// test1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <windows.h>
#include <commctrl.h>
#include <iostream>
#include "cspi_1.h"

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	uint32_t written, read;
	Polled_CSPI_1::InitializeMasterMode();
	Polled_CSPI_1::Enable();
	// Polled_CSPI_1::EnableLoopback();
	Polled_CSPI_1::DisableLoopback();

	DEBUGMSG(1, (_T("Test Started\n")));
	cout << "Test Started" << endl;
	written = 0;
	while (1) 
	{
		Polled_CSPI_1::SendSample(written);
		read = Polled_CSPI_1::GetSample();

		DEBUGMSG(1, (_T("Read = %d  Written = %d \n"), read, written));
		written = written + 1;
	}
	return 0;
}

