L8Night Picnic

Extendable tool and simple programmer

Home
Microchip
Farnell
R.S.
Google
Microchip

Prototype programmer plugin overview (the begining)

Currently the front end supports two types of plugin; interfaces and programmers.
Interfaces are plugins that export a service for the programmer to use, currently there are 2 interfaces, one for direct access to io ports and one for micro second accurate delays (using busy wait, calling 'QueryPerformanceCounter')
Programmers are plugins that (as the name sugests) connect to device programming hardware and read or write the program (loaded from a hex file).
Any questions, problems or requests for hardware/software improvements email me one_mad_alien [@] hotmail.com
Example of the basic calls that a programmer needs to make.
#include "l8anp_plugin.h"
L8RV __cdecl deviceReadFunc(
		L8HWI ifp, 
		const struct L8ANProgrammerInfo_s * programmer, 
		const struct L8ANDeviceInfo_s * device, 
		L8HexLine ** dataPtr 
) {
	const L8IOPI * iop;
	const L8TMPI * tmip;
	const L8HEXI * hxip;
	// get direct access interface
	if ( L8_OK != getInterface<L8IOPI>(ifp, L8IOPI_NAME, &iop) ) {
		return L8_ERROR;
	}
	// get timer interface
	if ( L8_OK != getInterface<L8TMPI>(ifp, L8TMPI_NAME, &tmip) ) {
		return L8_ERROR;
	}
	// get hex writer interface
	if ( L8_OK != getInterface<L8HEXI>(ifp, L8HEXI_NAME, &hxip) ) {
		return L8_ERROR;
	}
	// ... do work here ...;
	return L8_OK;
}
int __cdecl deviceWriteFunc( 
		L8HWI ifp, 
		const L8ANProgrammerInfo * programmer, 
		const L8ANDeviceInfo * device, 
		L8HexLine * dataPtr 
) {
	const L8IOPI * iop;
	const L8TMPI * tmip;
	// get direct access interface
	if ( L8_OK != getInterface<L8IOPI>(ifp, L8IOPI_NAME, &iop) ) {
		::MessageBox( NULL, "Unable to get raw io interface",
					"Missing interface", MB_OK );
		return L8_ERROR;
	}
	// get timer interface
	if ( L8_OK != getInterface<L8TMPI>(ifp, L8TMPI_NAME, &tmip) ) {
		::MessageBox( NULL, "Unable to get timer interface", 
					"Missing interface", MB_OK );
		return L8_ERROR;
	}
	// ... do work here ...
	return L8_OK;
}
/* list of supported devices */
const L8ANDeviceInfo SUPPORTED[] = {
	{ "DEVICE 1",  "dev 1 info", deviceReadFunc, deviceWriteFunc, NULL },
	{ "DEVICE 2",  "dev 2 info", deviceReadFunc, deviceWriteFunc, NULL },
	{ NULL, NULL, NULL, NULL, NULL }
};

const char * const P_INFO = ""
	"put the programmer info\r\n"
	"into this string\r\n"
	"";

const L8ANProgrammerInfo INFO = {
	"My proto programmer",
	P_INFO,
	SUPPORTED
};

BOOL APIENTRY DllMain( HANDLE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
    return TRUE;
}

/* entry function */
PLUGIN_ENTRY(ptr) {
	*ptr = &INFO;
	return L8_OK;
}

Hosting by WebRing.