% let Common   = system.getScript("/driverlib/Common.js");
% let allPinsInfo = system.deviceData.devicePins
% if (Common.isAllocationOff())
% {
	% var contextNames = Common.getContextNames();
	% for (var cntx of contextNames) {
	% 	var module = Common.getModuleForCore('/driverlib/aio.js', cntx);
	%if (module != null)
	%{
//*****************************************************************************
//
// AIO Configurations
//
//*****************************************************************************
	% for(var i = 0; i < module.$instances.length; i++) {
		% var instance = module.$instances[i];
		% let aioPin        = instance.aioPin;
		% let solution    = aioPin.$solution;
		% let peripheral  = system.deviceData.peripherals[instance.aioPin.$solution.peripheralName];
		% var aioName = peripheral.name;
		% var gpioNumber = aioName.substring(2);
		% gpioNumber = Common.gpioNameToNumber(gpioNumber);
#define `instance.$name` `gpioNumber`
void `instance.$name`_init();
	% }
	%}
	%}
%}
% else {
//*****************************************************************************
//
// AIO Configurations
//
//*****************************************************************************
	% let raData = system.resourceAllocation.data
	% for (let context of raData.contexts)
	% {
	    % let module = context.modules.find(x => x.moduleName === '/driverlib/aio.js')
		% if ((module != null) && ((system.context == context.contextName) || (system.context == "CPU1")))
		% {
			% for(let instance of module.instances) {
				% let assignedPin = instance.requiredArgs.aioPin.$assign
				% let aioNumber = Common.gpioNameToNumber(assignedPin)
#define `instance.allocationName` `aioNumber`
void `instance.allocationName`_init();
			% }
		%}
	%}
% }