
unit Pack
{
	public const uint16 ID = 0;
	
	public link unit IN {}

	//[i] function_void OS_init;
	public void OS_init()
	{
		IN.D0_DIR = 1;
	}
	//---------------------------------------------
	U0.D = IN;
	unit U0
	{
		public link unit D {}
		void set_uint8( uint8 addr, uint8 b )
		{
			if( b == 0 ) {
				D.D0_OUT = 1;
			}
			else {
				D.D0_OUT = 0;
			}
		}
		uint8 get_uint8( uint8 addr )
		{
			if( D.D0_IN == 0 ) {
				return 0xFF;
			}
			else {
				return 0x00;
			}
		}
	}
	memory my_bit0
	{
		target = U0;
		type = [ uint8 0, 255 ] uint8;
	}
}
//ն˿
uint8 NULL_uint8;
bit NULL_bit;

public memory my_uint8 {}

//ͼλö˿
public my_uint8 uint8 D_OUT; public link uint8 D_IN = D_OUT; public link uint8 D_DIR = NULL_uint8;

OUT.my_bit = driver.my_bit0;
OUT.NULL_bit = NULL_bit;
public unit OUT {
	public link memory my_bit {}
	public link bit NULL_bit;
	public my_bit bit D0_OUT = #addr 0; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
}




