
driver.LED = LED;
LED.ID = driver.ID;

unit LED
{
	public const uint16 ID = 0;
	
	memory my_bit { type = [ uint32] uint8; }
	
	bit D0_DIR;
	my_bit bit D0_OUT = #addr ID * 0x00010000 + 0x0000;
	
	my_bit uint32 Color = #addr ID * 0x00010000 + 0x0003;
	
	void set_uint8( uint32 addr, uint8 b )
	{
		uint32 c;
		c.24(uint8) = 220;
		c.16(uint8) = 255;
		c.8(uint8) = 100;
		c.0(uint8) = 50;
		Color = c;
		#.OS.REMO_ModuleWrite( (int)addr, (int)b );
	}
	void set_uint32( uint32 addr, uint32 Data )
	{
		#.OS.REMO_ModuleWrite( (int)addr, (int)Data );
	}
	//---------------------------------------------------
	uint8 get_uint8( uint32 addr )
	{
		return (uint8)(uint16)(uint)#.OS.REMO_ModuleRead( (int)addr );
	}
}

unit GND
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
}
unit GND1
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
}
unit GND2
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
}
unit VCC1
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
}
unit VCC2
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
}


public unit D0
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 0;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D1
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 1;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D2
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 2;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D3
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 3;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D4
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 4;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D5
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 5;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D6
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 6;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D7
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 7;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D8
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 8;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D9
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 9;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D10
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 10;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D11
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 11;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D12
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 12;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit D13
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 13;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}


public unit A0
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 14;
	public const int8 AD_INDEX = 0;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit A1
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 15;
	public const int8 AD_INDEX = 1;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit A2
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 16;
	public const int8 AD_INDEX = 2;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit A3
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 17;
	public const int8 AD_INDEX = 3;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit A4
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 18;
	public const int8 AD_INDEX = 4;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

public unit A5
{
	public const uint8 TYPE = 10;
	public const int8 INDEX = 19;
	public const int8 AD_INDEX = 5;
	
	public bit D0_DIR;
	public bit D0_OUT;
	public bit D0_IN;
	public bit D0_PUL;
}

