
//------------------------------
//ͼλӶ˿


unit PORT
{
	public link bit D2_DIR = #.COM_MCU.DDRD.0; public link bit D2_IN = #.COM_MCU.PIND.0; public link bit D2_OUT = #.COM_MCU.PORTD.0;
	public link bit D2_PUL = #.COM_MCU.PORTD.0;
	public link bit D3_DIR = #.COM_MCU.DDRD.1; public link bit D3_IN = #.COM_MCU.PIND.1; public link bit D3_OUT = #.COM_MCU.PORTD.1;
	public link bit D3_PUL = #.COM_MCU.PORTD.1;
}
unit GND
{
	public const uint8 TYPE = 0;
	public bit D0_DIR; public bit D0_IN; public bit D0_OUT; public bit D0_PUL;
	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 bit D0_PUL;
	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 bit D0_PUL;
	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 bit D0_PUL;
	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 bit D0_PUL;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}

unit D0
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRD.0; public link bit D0_IN = #.COM_MCU.PIND.0; public link bit D0_OUT = #.COM_MCU.PORTD.0;
	public link bit D0_PUL = #.COM_MCU.PORTD.0;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D1
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRD.1; public link bit D0_IN = #.COM_MCU.PIND.1; public link bit D0_OUT = #.COM_MCU.PORTD.1;
	public link bit D0_PUL = #.COM_MCU.PORTD.1;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D2
{
	public const uint8 TYPE = 10;
	public const int8 INT_INDEX = 0;
	public link bit D0_DIR = #.COM_MCU.DDRD.2; public link bit D0_IN = #.COM_MCU.PIND.2; public link bit D0_OUT = #.COM_MCU.PORTD.2;
	public link bit D0_PUL = #.COM_MCU.PORTD.2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D3
{
	public const uint8 TYPE = 10;
	public const int8 INT_INDEX = 1;
	public link bit D0_DIR = #.COM_MCU.DDRD.3; public link bit D0_IN = #.COM_MCU.PIND.3; public link bit D0_OUT = #.COM_MCU.PORTD.3;
	public link bit D0_PUL = #.COM_MCU.PORTD.3;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D4
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRD.4; public link bit D0_IN = #.COM_MCU.PIND.4; public link bit D0_OUT = #.COM_MCU.PORTD.4;
	public link bit D0_PUL = #.COM_MCU.PORTD.4;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D5
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRD.5; public link bit D0_IN = #.COM_MCU.PIND.5; public link bit D0_OUT = #.COM_MCU.PORTD.5;
	public link bit D0_PUL = #.COM_MCU.PORTD.5;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D6
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRD.6; public link bit D0_IN = #.COM_MCU.PIND.6; public link bit D0_OUT = #.COM_MCU.PORTD.6;
	public link bit D0_PUL = #.COM_MCU.PORTD.6;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D7
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRD.7; public link bit D0_IN = #.COM_MCU.PIND.7; public link bit D0_OUT = #.COM_MCU.PORTD.7;
	public link bit D0_PUL = #.COM_MCU.PORTD.7;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D8
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.0; public link bit D0_IN = #.COM_MCU.PINB.0; public link bit D0_OUT = #.COM_MCU.PORTB.0;
	public link bit D0_PUL = #.COM_MCU.PORTB.0;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D9
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.1; public link bit D0_IN = #.COM_MCU.PINB.1; public link bit D0_OUT = #.COM_MCU.PORTB.1;
	public link bit D0_PUL = #.COM_MCU.PORTB.1;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D10
{
	public const uint8 TYPE = 10;
	public const int8 INT_INDEX = 2;
	public link bit D0_DIR = #.COM_MCU.DDRB.2; public link bit D0_IN = #.COM_MCU.PINB.2; public link bit D0_OUT = #.COM_MCU.PORTB.2;
	public link bit D0_PUL = #.COM_MCU.PORTB.2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D11
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.3; public link bit D0_IN = #.COM_MCU.PINB.3; public link bit D0_OUT = #.COM_MCU.PORTB.3;
	public link bit D0_PUL = #.COM_MCU.PORTB.3;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D12
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.4; public link bit D0_IN = #.COM_MCU.PINB.4; public link bit D0_OUT = #.COM_MCU.PORTB.4;
	public link bit D0_PUL = #.COM_MCU.PORTB.4;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit D13
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.5; public link bit D0_IN = #.COM_MCU.PINB.5; public link bit D0_OUT = #.COM_MCU.PORTB.5;
	public link bit D0_PUL = #.COM_MCU.PORTB.5;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit DD11
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.3; public link bit D0_IN = #.COM_MCU.PINB.3; public link bit D0_OUT = #.COM_MCU.PORTB.3;
	public link bit D0_PUL = #.COM_MCU.PORTB.3;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit DD12
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.4; public link bit D0_IN = #.COM_MCU.PINB.4; public link bit D0_OUT = #.COM_MCU.PORTB.4;
	public link bit D0_PUL = #.COM_MCU.PORTB.4;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit DD13
{
	public const uint8 TYPE = 10;
	public link bit D0_DIR = #.COM_MCU.DDRB.5; public link bit D0_IN = #.COM_MCU.PINB.5; public link bit D0_OUT = #.COM_MCU.PORTB.5;
	public link bit D0_PUL = #.COM_MCU.PORTB.5;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
//AD
unit A0
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 0;
	public link bit D0_DIR = #.COM_MCU.DDRC.0; public link bit D0_IN = #.COM_MCU.PINC.0; public link bit D0_OUT = #.COM_MCU.PORTC.0;
	public link bit D0_PUL = #.COM_MCU.PORTC.0;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit A1
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 1;
	public link bit D0_DIR = #.COM_MCU.DDRC.1; public link bit D0_IN = #.COM_MCU.PINC.1; public link bit D0_OUT = #.COM_MCU.PORTC.1;
	public link bit D0_PUL = #.COM_MCU.PORTC.1;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit A2
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 2;
	public link bit D0_DIR = #.COM_MCU.DDRC.2; public link bit D0_IN = #.COM_MCU.PINC.2; public link bit D0_OUT = #.COM_MCU.PORTC.2;
	public link bit D0_PUL = #.COM_MCU.PORTC.2;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit A3
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 3;
	public link bit D0_DIR = #.COM_MCU.DDRC.3; public link bit D0_IN = #.COM_MCU.PINC.3; public link bit D0_OUT = #.COM_MCU.PORTC.3;
	public link bit D0_PUL = #.COM_MCU.PORTC.3;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit A4
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 4;
	public link bit D0_DIR = #.COM_MCU.DDRC.4; public link bit D0_IN = #.COM_MCU.PINC.4; public link bit D0_OUT = #.COM_MCU.PORTC.4;
	public link bit D0_PUL = #.COM_MCU.PORTC.4;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit A5
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 5;
	public link bit D0_DIR = #.COM_MCU.DDRC.5; public link bit D0_IN = #.COM_MCU.PINC.5; public link bit D0_OUT = #.COM_MCU.PORTC.5;
	public link bit D0_PUL = #.COM_MCU.PORTC.5;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit A6
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 6;
	public link bit D0_DIR = #.COM_MCU.DDRC.6; public link bit D0_IN = #.COM_MCU.PINC.6; public link bit D0_OUT = #.COM_MCU.PORTC.6;
	public link bit D0_PUL = #.COM_MCU.PORTC.6;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}
unit A7
{
	public const uint8 TYPE = 10;
	public const int8 AD_INDEX = 7;
	public link bit D0_DIR = #.COM_MCU.DDRC.7; public link bit D0_IN = #.COM_MCU.PINC.7; public link bit D0_OUT = #.COM_MCU.PORTC.7;
	public link bit D0_PUL = #.COM_MCU.PORTC.7;
	public void OutputMode() { D0_DIR = 1; }
	public void InputMode() { D0_DIR = 0; }
}




driver.D = D8;
driver.L = D12;
driver.C = D4;
driver.E = D7;
	//---------------------------------------------
	void set_uint8( uint8 data )
	{
		driver.back_data = data;
		driver.send_byte( driver.back_data );
	}
	
	//---------------------------------------------
	uint8 get_uint8()
	{
		return driver.back_data;
	}

//ն˿
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;

M1A.D.my_bit = driver.my_bit;
M1A.D.NULL_bit = NULL_bit;
M1A.power = driver.M1power;
public unit M1A
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		public link memory my_bit {}
		public link bit NULL_bit;
		public my_bit bit D0_OUT = #addr 2; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
	}
}
M1B.D.my_bit = driver.my_bit;
M1B.D.NULL_bit = NULL_bit;
M1B.power = driver.M1power;
public unit M1B
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		public link memory my_bit {}
		public link bit NULL_bit;
		public my_bit bit D0_OUT = #addr 3; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
	}
}
M2A.D.my_bit = driver.my_bit;
M2A.D.NULL_bit = NULL_bit;
M2A.power = driver.M2power;
public unit M2A
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		public link memory my_bit {}
		public link bit NULL_bit;
		public my_bit bit D0_OUT = #addr 1; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
	}
}

M2B.D.my_bit = driver.my_bit;
M2B.D.NULL_bit = NULL_bit;
M2B.power = driver.M2power;
public unit M2B
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		public link memory my_bit {}
		public link bit NULL_bit;
		public my_bit bit D0_OUT = #addr 4; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
	}
}

M3A.D.my_bit = driver.my_bit;
M3A.D.NULL_bit = NULL_bit;
M3A.power = driver.M3power;
public unit M3A
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		public link memory my_bit {}
		public link bit NULL_bit;
		public my_bit bit D0_OUT = #addr 7; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
	}
}

M3B.D.my_bit = driver.my_bit;
M3B.D.NULL_bit = NULL_bit;
M3B.power = driver.M3power;
public unit M3B
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		public link memory my_bit {}
		public link bit NULL_bit;
		public my_bit bit D0_OUT = #addr 5; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
	}
}

M4A.D.my_bit = driver.my_bit;
M4A.D.NULL_bit = NULL_bit;
M4A.power = driver.M4power;
public unit M4A
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		public link memory my_bit {}
		public link bit NULL_bit;
		public my_bit bit D0_OUT = #addr 6; public link bit D0_IN = D0_OUT; public link bit D0_DIR = NULL_bit;
	}
}

M4B.D.my_bit = driver.my_bit;
M4B.D.NULL_bit = NULL_bit;
M4B.power = driver.M4power;
public unit M4B
{
	int8 DT;
	public link int8 power;
	public unit D
	{
		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;
	}
}







