

	public link bit DS_OUT = DS.D0_OUT;
	public link bit DS_IN = DS.D0_IN;
	public link bit DS_DIR = DS.D0_DIR;
	
	
	
	#include "MEGA.txt"
	
	public int32 get_temperature()
	{
		//读取上一次的测量结果
		start_sd();
		//跳过序列号
		write_byte( 0xcc );
		//读取寄存器
		write_byte( 0xbe );
		
		uint16 temp;
		temp.0(uint8) = read_byte();
		temp.8(uint8) = read_byte();
		
		//触发下一次测量
		start_sd();
		//跳过序列号
		write_byte( 0xcc );
		//启动温度转换
		write_byte( 0x44 );
		
		//这里应等待500ms,所以这个函数的调用间隔应该大于0.5秒
		//...
		return (int)temp;
	}
	//---------------------------------------------------
	///[i] function_void read_8byte_serial_number array;
	public void read_8byte_serial_number( [uint8*?] buffer )
	{
		start_sd();
		write_byte( 0x33 );
		
		uint8 i = 0;
		loop( 8 ) {
			buffer[i] = read_byte();
			i + 1;
		}
	}
	
	
	