
unit surport
{
	public const uint16 ID = 0;
	
	public link unit driver {}
	memory my_bit { type = [ uint32] uint8; }
	
	super: driver.LED_DDR = DIR;
	super: driver.LED_PORT = PORT;
	
	bit DIR;
	my_bit bit PORT = #addr ID * 0x00010000 + 0x0000;
	
	my_bit uint32 Color = #addr ID * 0x00010000 + 0x0003;
	
	void set_uint8( uint32 addr, uint8 b )
	{
		uint32 c;
		c.24(uint8) = 150;
		c.16(uint8) = 255;
		c.8(uint8) = 150;
		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 );
	}
}