
unit SerialPort
{
	//---------------------------------------------------
	//³υΚΌ»―
	//[i] function_void OS_init;
	public void OS_init()
	{
		LED.D0_DIR = 1;
		LED.D0_OUT = 0;
	}
	//---------------------------------------------------
	//[i] function_void OS_thread;
	public void OS_thread()
	{
		
	}
	//---------------------------------------------------
	//[i] function_void open_led;
	public void open_led()
	{
		LED.D0_OUT = 1;
	}
	//---------------------------------------------------
	//[i] function_void close_led;
	public void close_led()
	{
		LED.D0_OUT = 0;
	}
	
	//=================================================================================
	
	memory my_bit { type = [ uint8 0, 255 ] uint8; }
	
	void set_uint8( uint8 addr, uint8 b )
	{
		#.OS.REMO_DataChannelWrite( (int)addr, (int)b );
	}
	//---------------------------------------------------
	uint8 get_uint8( uint8 addr )
	{
		int32 d = #.OS.REMO_DataChannelRead( (int)addr );
		return (uint8)(uint16)(uint)d;
	}
	
	public memory VHdata { type = [ uint8 0, 255 ] uint32; }
	void set_uint32( uint8 addr, uint32 b )
	{
		#.OS.REMO_DataChannelWrite( (int)addr, (int)b );
	}
	//---------------------------------------------------
	uint32 get_uint32( uint8 addr )
	{
		int32 d = #.OS.REMO_DataChannelRead( (int)addr );
		return (uint)d;
	}
	
	public link unit LED {}
}

#.USER0 = driver;
driver.LED = PB5;

unit GND
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit GND1
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit GND2
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit GND3
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit GND4
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit GND5
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit GND6
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit GND7
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC1
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC2
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC3
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC4
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC5
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC6
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit VCC7
{
	public const uint8 TYPE = 2;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
PD0.my_bit = driver.my_bit;
public unit PD0
{
	public const int8 INDEX = 0;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PD1.my_bit = driver.my_bit;
public unit PD1
{
	public const int8 INDEX = 1;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PD2.my_bit = driver.my_bit;
public unit PD2
{
	public const int8 INDEX = 2;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PD3.my_bit = driver.my_bit;
public unit PD3
{
	public const int8 INDEX = 3;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PD4.my_bit = driver.my_bit;
public unit PD4
{
	public const int8 INDEX = 4;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PD5.my_bit = driver.my_bit;
public unit PD5
{
	public const int8 INDEX = 5;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PD6.my_bit = driver.my_bit;
public unit PD6
{
	public const int8 INDEX = 6;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PD7.my_bit = driver.my_bit;
public unit PD7
{
	public const int8 INDEX = 7;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PB0.my_bit = driver.my_bit;
public unit PB0
{
	public const int8 INDEX = 8;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PB1.my_bit = driver.my_bit;
public unit PB1
{
	public const int8 INDEX = 9;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PB2.my_bit = driver.my_bit;
public unit PB2
{
	public const int8 INDEX = 10;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PB3.my_bit = driver.my_bit;
public unit PB3
{
	public const int8 INDEX = 11;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PB4.my_bit = driver.my_bit;
public unit PB4
{
	public const int8 INDEX = 12;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PB5.my_bit = driver.my_bit;
public unit PB5
{
	public const int8 INDEX = 13;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}


PC0.my_bit = driver.my_bit;
public unit PC0
{
	public const int8 INDEX = 14;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PC1.my_bit = driver.my_bit;
public unit PC1
{
	public const int8 INDEX = 15;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PC2.my_bit = driver.my_bit;
public unit PC2
{
	public const int8 INDEX = 16;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PC3.my_bit = driver.my_bit;
public unit PC3
{
	public const int8 INDEX = 17;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PC4.my_bit = driver.my_bit;
public unit PC4
{
	public const int8 INDEX = 18;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
PC5.my_bit = driver.my_bit;
public unit PC5
{
	public const int8 INDEX = 19;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
ADC6.my_bit = driver.my_bit;
public unit ADC6
{
	public const int8 INDEX = 20;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}
ADC7.my_bit = driver.my_bit;
public unit ADC7
{
	public const int8 INDEX = 21;
	public link memory my_bit {}
	public my_bit bit D0_OUT = #addr INDEX * 4; public my_bit bit D0_IN = #addr INDEX * 4 + 1; public my_bit bit D0_DIR = #addr INDEX * 4 + 2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
	public const uint8 TYPE = 10;
}


