
unit surport
{
	public link unit driver {}
	
	public const uint16 ID = 0;
	
	
	super: driver.DP = test;
	test.ID = ID;
	unit test
	{
		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;
			#include "$config$.txt"
			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 );
		}
	}
}


