<root>
<document schema='101' license='1,Multitronik,BM6NTU' title='' description='' target='PIC.16F.16F1829' >
	<config data='!0,3fff!10,3fff%0,7%3,3%5,1%6,1%7,1%8,1%9,3%b,1%c,1%d,1%10,3%14,1%18,1%19,1%1a,1%1c,1%1d,1' clkspd='19660800' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='0' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='ghostype' value='0' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='0' />
			<data name='ictrate' value='20000' />
			<data name='ictmask' value='0' />
			<data name='anlpres' value='19' />
			<data name='digmask1' value='-1' />
			<data name='digmask2' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<ghost >
		<FK2 >
			<data name='FK2D0' port='4294967295' pin='4294967295' />
			<data name='FK2D1' port='4294967295' pin='4294967295' />
			<data name='FK2D2' port='4294967295' pin='4294967295' />
			<data name='FK2D3' port='4294967295' pin='4294967295' />
			<data name='FK2D4' port='4294967295' pin='4294967295' />
			<data name='FK2D5' port='4294967295' pin='4294967295' />
			<data name='FK2D6' port='4294967295' pin='4294967295' />
			<data name='FK2D7' port='4294967295' pin='4294967295' />
			<data name='FK2D8' port='4294967295' pin='4294967295' />
			<data name='FK2D9' port='4294967295' pin='4294967295' />
			<data name='FK2D10' port='4294967295' pin='4294967295' />
			<data name='FK2D11' port='4294967295' pin='4294967295' />
			<data name='FK2D12' port='4294967295' pin='4294967295' />
			<data name='FK2D13' port='4294967295' pin='4294967295' />
			<data name='FK2D14' port='4294967295' pin='4294967295' />
			<data name='FK2D15' port='4294967295' pin='4294967295' />
			<data name='FK2A0' port='4294967295' pin='4294967295' />
			<data name='FK2A1' port='4294967295' pin='4294967295' />
			<data name='FK2A2' port='4294967295' pin='4294967295' />
			<data name='FK2A3' port='4294967295' pin='4294967295' />
			<data name='FK2A4' port='4294967295' pin='4294967295' />
			<data name='FK2A5' port='4294967295' pin='4294967295' />
		</FK2>
		<ICD >
			<data name='AnalogPrescaleValue' value='19' />
			<data name='DigitalSampleRate' value='100000' />
			<data name='BreakpointCount' value='8' />
			<data name='CallStackDepthCount' value='8' />
			<data name='ClockPort' value='0' />
			<data name='ClockPin' value='1' />
			<data name='DataPort' value='0' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='9' />
			<data name='CalculatedCommsDelay' value='9' />
		</ICD>
		<pins >
			<digital A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
			<analog A='0' B='0' C='0' D='0' E='0' F='0' G='0' H='0' I='0' J='0' K='0' L='0' M='0' N='0' O='0' P='0' Q='0' R='0' S='0' T='0' U='0' V='0' W='0' X='0' Y='0' Z='0' />
		</pins>
	</ghost>
	<components >
		<settings autoimg='0' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='a9eb79b0-1d24-4acf-aade-d3639aa800c7' vstate='40' vmin='3' vmaj='1' srcleaf='Pressure_Sensor_BME280.fcfx' visiblename='Pressure Sensor (BME280 - I2C)' description='A small PCB surface mount barometric pressure sensor with a I2C bus interface.
Pressure range 300 to 1100 hPa. Temperature range -40 to +85 °C.
Works with I2C interface only.' category='Sensors' catenable='1' author='Matrix TSL' manuname='Bosch' manucode='BME280' sysinfo='779' keywords='' dynamic='1' iconpath='..\Pictures\Science-Pressure-icon_128.png' />
		<component class_type='root' codename='PressureSensor_BME280' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='0' poslock='0' >
			<resources />
			<properties >
				<property name='Channel' target='cal_i2c1::CHANNEL' typeid='16' hidden='0' locked='0' info='Channel selection' filter='000Software
001Channel 1
002Channel 2
' />
				<property name='SDA' target='cal_i2c1::SDA' typeid='5' hidden='0' locked='1' info='Pin used for SDA (data signal)' />
				<property name='SCL' target='cal_i2c1::SCL' typeid='5' hidden='0' locked='1' info='Pin used for SCL (clock signal)' />
				<property name='Baud Select' target='cal_i2c1::BAUD_LIST' typeid='16' hidden='0' locked='0' info='Baud rate option selector' filter='000Custom
001100KHz
002400KHz
0031MHz' />
				<property name='Baud Rate' target='cal_i2c1::BAUD' typeid='14' hidden='0' locked='1' info='Baud rate to be used' />
				<property name='Stop Delay' target='cal_i2c1::StopDel' typeid='7' hidden='0' locked='0' info='On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not 
a 10ms delay between an I2C stop event and the next I2C start event.

Most modern microcontrollers will not have a problem so this property can be disabled to speed up the 
I2C communications. ' />
				<property name='Slave Address' target='SlaveAddress' typeid='16' hidden='0' locked='0' hexview='1' info='' filter='2360x76
2380x77' />
				<property name='Compensation' target='Compensation' typeid='16' hidden='0' locked='0' info='Compensation formulas in double precision floating point or 32 bit fixed point' filter='000Integer
001Float' />
				<property name='Humidity Oversampling' target='HO' typeid='16' hidden='0' locked='0' info='' filter='000OFF
001x1
002x2
003x4
004x8
005x16' />
				<property name='Pressure Oversampling' target='PO' typeid='16' hidden='0' locked='0' info='' filter='000OFF
004x1
008x2
012x4
016x8
020x16' />
				<property name='Temperature Oversampling' target='TO' typeid='16' hidden='0' locked='0' info='' filter='000OFF
032x1
064x2
096x4
128x8
160x16' />
				<property name='Mode' target='Mode' typeid='16' hidden='0' locked='0' info='' filter='000Sleep
001Forced
003Normal' />
				<property name='Standby Normal Mode (ms)' target='Stby' typeid='16' hidden='0' locked='0' info='' filter='0000.5
00462.5
008125
012250
016500
0201000
02410
02820' />
				<property name='Filter Coefficient' target='FC' typeid='16' hidden='0' locked='0' info='' filter='000OFF
0322
0644
0968
12816' />
			</properties>
			<values >
				<value target='cal_i2c1::CHANNEL' data='001' />
				<value target='cal_i2c1::SDA' data='$PORTB.4' />
				<value target='cal_i2c1::SCL' data='$PORTB.6' />
				<value target='cal_i2c1::BAUD_LIST' data='002' />
				<value target='cal_i2c1::BAUD' data='400000' />
				<value target='cal_i2c1::StopDel' data='1' />
				<value target='SlaveAddress' data='236' />
				<value target='Compensation' data='000' />
				<value target='HO' data='002' />
				<value target='PO' data='008' />
				<value target='TO' data='064' />
				<value target='Mode' data='003' />
				<value target='Stby' data='000' />
				<value target='FC' data='000' />
			</values>
			<events />
			<apis >
				<api name='ReadPressureFloat' alt='ReadPressureFloat' type='1' proto='1' />
				<api name='Reset' alt='Reset' type='1' proto='1' />
				<api name='I2C_Read_Register' alt='I2C_Read_Register' type='1' proto='1' />
				<api name='ReadTemperatureFloat' alt='ReadTemperatureFloat' type='1' proto='1' />
				<api name='Altitude' alt='Altitude' type='1' proto='1' />
				<api name='Forced_Read' alt='Forced_Read' type='1' proto='1' />
				<api name='I2C_Write_Register' alt='I2C_Write_Register' type='1' proto='1' />
				<api name='ReadHumidityFloat' alt='ReadHumidityFloat' type='1' proto='1' />
				<api name='Initialise' alt='Initialise' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='TFINE' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T3' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T2' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='T1' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P9' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='H6' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P8' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='H5' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P7' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='H4' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P6' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='H3' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P5' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P4' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='H1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P3' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P2' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='P1' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='H2u' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='H2s' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='ReadPressureFloat' description='Reads the pressure as a floating point value in Bars.
Calls the ReadPressureRaw function and then converts to a meaningful value.' >
						<return name='Return' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='adc_P' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P1' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P2' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P3' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P4' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P5' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P6' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P7' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P8' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='P9' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TFINE' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ReadTemperatureFloat' />
						<command class_type='call' title='BME280_REGISTER_PRESSUREDATA' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read3_Register' >
							<return exp='.adc_P' />
							<argument exp='0xF7' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.adc_P != 0x800000' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.P1 = P1' />
									<exp exp='.P2 = P2' />
									<exp exp='.P3 = P3' />
									<exp exp='.P4 = P4' />
									<exp exp='.P5 = P5' />
									<exp exp='.P6 = P6' />
									<exp exp='.P7 = P7' />
									<exp exp='.P8 = P8' />
									<exp exp='.P9 = P9' />
									<exp exp='.TFINE = TFINE' />
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.adc_P = .adc_P &gt;&gt; 4' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Compensation = 1' swap='0' >
									<flowline >
										<command class_type='native' title='C Code' ccode='//Returns pressure in Pa as double. Output value of “96386.2” equals 96386.2 Pa = 963.862 hPa
//BME280 Datasheet Page 49

double var1, var2, p;

var1 = ((double)FCL_TFINE/2.0) - 64000.0;
var2 = var1 * var1 * ((double)FCL_P6) / 32768.0;
var2 = var2 + var1 * ((double)FCL_P5) * 2.0;
var2 = (var2/4.0)+(((double)FCL_P4) * 65536.0);
var1 = (((double)FCL_P3) * var1 * var1 / 524288.0 + ((double)FCL_P2) * var1) / 524288.0;
var1 = (1.0 + var1 / 32768.0)*((double)FCL_P1);
if (var1 == 0.0)
{
return 0; // avoid exception caused by division by zero
}
p = 1048576.0 - (double)FCL_ADC_P;
p = (p - (var2 / 4096.0)) * 6250.0 / var1;
var1 = ((double)FCL_P9) * p * p / 2147483648.0;
var2 = p * ((double)FCL_P8) / 32768.0;
p = p + (var1 + var2 + ((double)FCL_P7)) / 16.0;
return p/100;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
									</flowline>
									<flowline >
										<command class_type='native' title='C Code' ccode='//Returns pressure in Pa as unsigned 32 bit integer. Output value of &quot;96386&quot; equals 96386 Pa = 963.86 hPa
//BME280 Datasheet Page 50

#define BME280_S32_t MX_SINT32
#define BME280_U32_t MX_UINT32

BME280_S32_t var1, var2;
BME280_U32_t p;

var1 = (((BME280_S32_t)FCL_TFINE)&gt;&gt;1) - (BME280_S32_t)64000;
var2 = (((var1&gt;&gt;2) * (var1&gt;&gt;2)) &gt;&gt; 11 ) * ((BME280_S32_t)FCL_P6);
var2 = var2 + ((var1*((BME280_S32_t)FCL_P5))&lt;&lt;1);
var2 = (var2&gt;&gt;2)+(((BME280_S32_t)FCL_P4)&lt;&lt;16);
var1 = (((FCL_P3 * (((var1&gt;&gt;2) * (var1&gt;&gt;2)) &gt;&gt; 13 )) &gt;&gt; 3) + ((((BME280_S32_t)FCL_P2) * var1)&gt;&gt;1))&gt;&gt;18;
var1 =((((32768+var1))*((BME280_S32_t)FCL_P1))&gt;&gt;15);
if (var1 == 0)
{
return 0; // avoid exception caused by division by zero
}
p = (((BME280_U32_t)(((BME280_S32_t)1048576) - FCL_ADC_P) - (var2&gt;&gt;12)))*3125;
if (p &lt; 0x80000000)
{
p = (p &lt;&lt; 1) / ((BME280_U32_t)var1);
}
else
{
p = (p / (BME280_U32_t)var1) * 2;
}
var1 = (((BME280_S32_t)FCL_P9) * ((BME280_S32_t)(((p&gt;&gt;3) * (p&gt;&gt;3))&gt;&gt;13)))&gt;&gt;12;
var2 = (((BME280_S32_t)(p&gt;&gt;2)) * ((BME280_S32_t)FCL_P8))&gt;&gt;13;
p = (BME280_U32_t)((BME280_S32_t)p + ((var1 + var2 + FCL_P7) &gt;&gt; 4));
//return p;
FCR_RETVAL = p/100.0;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.Return = 0.0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Reset' description='Resets the device' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='0xE0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='0xB6' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Stop' />
						<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='10' type='1' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadCalibData' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='b1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='b2' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='T1' />
							<argument exp='0x88' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='T2' />
							<argument exp='0x8A' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='T3' />
							<argument exp='0x8C' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P1' />
							<argument exp='0x8E' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P2' />
							<argument exp='0x90' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P3' />
							<argument exp='0x92' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P4' />
							<argument exp='0x94' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P5' />
							<argument exp='0x96' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P6' />
							<argument exp='0x98' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P7' />
							<argument exp='0x9A' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P8' />
							<argument exp='0x9C' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_LSB_MSB' >
							<return exp='P9' />
							<argument exp='0x9E' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='H1' />
							<argument exp='0xA1' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read2_Register' >
							<return exp='H2u' />
							<argument exp='0xE1' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='H2u = (H2u &gt;&gt; 8) | (H2u &lt;&lt; 8)' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='H2s = H2u' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='H3' />
							<argument exp='0xE3' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='.b1' />
							<argument exp='0xE4' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='.b2' />
							<argument exp='0xE5' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='H4 = (.b1 &lt;&lt; 4) | (.b2 &amp; 0xF)' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='.b1' />
							<argument exp='0xE6' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='.b2' />
							<argument exp='0xE5' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='H5 = (.b1 &lt;&lt; 4) | (.b2 &gt;&gt; 4)' />
						</command>
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='H6' />
							<argument exp='0xE7' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='I2C_Read_Register' description='Reads a byte value from a register on the device' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='.Address' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Restart' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress | 1' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.Return' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadTemperatureFloat' description='Reads the temperature as a floating point value in °C.
Resultion sets the return bit value and conversion time.
Calls the ReadTemperatureRaw function and then converts to a meaningful value.' >
						<return name='Return' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='adc_T' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TFINE' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='T1' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='T2' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='T3' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='BME280_REGISTER_TEMPDATA' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read3_Register' >
							<return exp='.adc_T' />
							<argument exp='0xFA' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.adc_T != 0x800000' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.T1 = T1' />
									<exp exp='.T2 = T2' />
									<exp exp='.T3 = T3' />
								</command>
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.adc_T = .adc_T &gt;&gt; 4' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Compensation = 1' swap='0' >
									<flowline >
										<command class_type='native' title='C Code' ccode='//Returns temperature in DegC, double precision. Output value of w51.23&quot; equals 51.23 DegC.
//t_fine carries fine temperature as global value
//BME280 Datasheet Page 49
#define BME280_S32_t MX_SINT32

double var1, var2, T;

var1 = (((double)FCL_ADC_T)/16384.0 - ((double)FCL_T1)/1024.0) * ((double)FCL_T2);
var2 = ((((double)FCL_ADC_T)/131072.0 - ((double)FCL_T1)/8192.0) *
(((double)FCL_ADC_T)/131072.0 - ((double) FCL_T1)/8192.0)) * ((double)FCL_T3);
FCL_TFINE = (BME280_S32_t)(var1 + var2);
T = (var1 + var2) / 5120.0;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='TFINE = .TFINE' />
										</command>
										<command class_type='native' title='C Code' ccode='return T;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
									</flowline>
									<flowline >
										<command class_type='native' title='C Code' ccode='//Returns temperature in DegC, resolution is 0.01 DegC. Output value of &quot;5123&quot; equals 51.23 DegC.
//t_fine carries fine temperature as global value
//BME280 Datasheet Page 23 or Page 50
#define BME280_S32_t MX_SINT32

BME280_S32_t var1, var2, T;

var1 = ((((FCL_ADC_T&gt;&gt;3) - ((BME280_S32_t)FCL_T1 &lt;&lt;1))) * ((BME280_S32_t)FCL_T2)) &gt;&gt; 11;           
var2 = (((((FCL_ADC_T&gt;&gt;4) - ((BME280_S32_t)FCL_T1)) * ((FCL_ADC_T&gt;&gt;4) - ((BME280_S32_t)FCL_T1))) &gt;&gt; 12) * ((BME280_S32_t)FCL_T3)) &gt;&gt; 14;
FCL_TFINE = var1 + var2;
T = (FCL_TFINE * 5 + 128) &gt;&gt; 8;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
										<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
											<exp exp='TFINE = .TFINE' />
										</command>
										<command class_type='native' title='C Code' ccode='//return T;
FCR_RETVAL = T/100.0;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.Return = 0.0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Altitude' description='Calculates the altitude based on difference between actual pressure and the pressure at the sea level P0=1013.25 hPa.
Formula used from Bosch sensor BMP180 Datasheet Page 16.
Altitude = 44330 * (1 - (pow ((P / P0),1 / 5.255)))' >
						<return name='Return' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='P0' type='f32' description='The pressure at sea level 1013.25 hPa' isconst='1' isinit='1' usrinit='1013.25' setinit='1013.25' />
						<local name='P' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ReadPressureFloat' >
							<return exp='.P' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = 44330 * (1 - (pow ((.P / .P0),1 / 5.255)))' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='I2C_Read2_Register' description='Reads two byte values from sequential registers on the device' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='.Address' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Restart' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress| 1' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.temp' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.Return' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Stop' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = .Return | (.temp &lt;&lt; 8)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Forced_Read' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<local name='temp' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='BME280_REGISTER_CONTROL' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Write_Register' >
							<argument exp='0xF4' />
							<argument exp='TO|PO|Mode' />
						</command>
						<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='(.temp &amp; 0x08) != 0' >
							<flowline >
								<command class_type='call' title='is busy reading cal data?' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
									<return exp='.temp' />
									<argument exp='0xF3' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='I2C_Write_Register' description='Writes a byte value to a register on the device' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
						<param name='Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Value' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='.Address' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='.Value' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='I2C_Read3_Register' description='Reads three byte values from sequential registers on the device' >
						<return name='Return' type='u32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='.Address' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Restart' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress| 1' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.Return' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = .Return &lt;&lt; 8' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.temp' />
							<argument exp='0' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = .Return | .temp' />
							<exp exp='.Return = .Return &lt;&lt; 8' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.temp' />
							<argument exp='1' />
						</command>
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = .Return | .temp' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Stop' />
					</flowline>
				</macro>
				<macro >
					<flowline name='ReadHumidityFloat' description='Reads the humidity as a floating point value in percentage 0-100%.
Calls the ReadHumidityRaw function and then converts to a meaningful value.' >
						<return name='Return' type='f32' description='' isconst='0' isinit='0' usrinit='0.0' setinit='' />
						<local name='adc_H' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='H1' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='H3' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='H2' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='H4' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='H5' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='H6' type='s16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='TFINE' type='s32' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ReadTemperatureFloat' />
						<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read2_Register' >
							<return exp='.adc_H' />
							<argument exp='0xFD' />
						</command>
						<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.adc_H != 0x8000' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.H1 = H1' />
									<exp exp='.H2 = H2s' />
									<exp exp='.H3 = H3' />
									<exp exp='.H4 = H4' />
									<exp exp='.H5 = H5' />
									<exp exp='.H6 = H6' />
									<exp exp='.TFINE = TFINE' />
								</command>
								<command class_type='decision' title='Decision' cmdcolor='3568629' cmdcolor_sec='3568629' exp='Compensation = 1' swap='0' >
									<flowline >
										<command class_type='native' title='C Code' ccode='// Returns humidity in %rH as as double. Output value of M46.332&quot; represents 46.332 %rH
//BME280 Datasheet Page 49

double var_H;

var_H = (((double)FCL_TFINE) - 76800.0);
var_H = (FCL_ADC_H - (((double)FCL_H4) * 64.0 + ((double)FCL_H5) / 16384.0 * var_H)) *
(((double)FCL_H2) / 65536.0 * (1.0 + ((double)FCL_H6) / 67108864.0 * var_H *
(1.0 + ((double)FCL_H3) / 67108864.0 * var_H)));
var_H = var_H * (1.0 - ((double)FCL_H1) * var_H / 524288.0);
if (var_H &gt; 100.0)
var_H = 100.0;
else if (var_H &lt; 0.0)
var_H = 0.0;
return var_H;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
									</flowline>
									<flowline >
										<command class_type='native' title='C Code' ccode='// Returns humidity in %RH as unsigned 32 bit integer in Q22.10 format (22 integer and 10 fractional bits).
// Output value of &quot;47445&quot; represents 47445/1024 = 46.333 %RH
//BME280 Datasheet Page 23-24

#define BME280_S32_t MX_SINT32
#define BME280_U32_t MX_UINT32

BME280_S32_t v_x1_u32r;
BME280_U32_t h;

v_x1_u32r = (FCL_TFINE - ((BME280_S32_t)76800));
v_x1_u32r = (((((FCL_ADC_H &lt;&lt; 14) - (((BME280_S32_t)FCL_H4) &lt;&lt; 20) -
                    (((BME280_S32_t)FCL_H5) * v_x1_u32r)) + ((BME280_S32_t)16384)) &gt;&gt; 15) *
                 (((((((v_x1_u32r * ((BME280_S32_t)FCL_H6)) &gt;&gt; 10) *
                      (((v_x1_u32r * ((BME280_S32_t)FCL_H3)) &gt;&gt; 11) + ((BME280_S32_t)32768))) &gt;&gt; 10) +
                    ((BME280_S32_t)2097152)) * ((BME280_S32_t)FCL_H2) + 8192) &gt;&gt; 14));

v_x1_u32r = (v_x1_u32r - (((((v_x1_u32r &gt;&gt; 15) * (v_x1_u32r &gt;&gt; 15)) &gt;&gt; 7) *
                               ((BME280_S32_t)FCL_H1)) &gt;&gt; 4));
v_x1_u32r = (v_x1_u32r &lt; 0) ? 0 : v_x1_u32r;
v_x1_u32r = (v_x1_u32r &gt; 419430400) ? 419430400 : v_x1_u32r;
h = (BME280_U32_t)(v_x1_u32r&gt;&gt;12);
//return h;
FCR_RETVAL = h/1024.0;' cmdcolor='3389439' cmdcolor_sec='3389439' language='C' />
									</flowline>
								</command>
							</flowline>
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.Return = 0.0' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<return name='Return' type='v0' description='' isconst='0' isinit='0' usrinit='' setinit='' />
					</flowline>
				</macro>
				<macro >
					<flowline name='I2C_Read_LSB_MSB' description='Reads two byte values from sequential registers on the device' >
						<return name='Return' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<param name='Address' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Start' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='.Address' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Restart' />
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_TxByte' >
							<argument exp='SlaveAddress | 1' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.Return' />
							<argument exp='0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_RxByte' >
							<return exp='.temp' />
							<argument exp='1' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Stop' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = .Return | (.temp &lt;&lt; 8)' />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='Starts up the I2C bus and initialises the pressure sensor ready for use.
Returns 1 for a sucessful startup.
Returns 0 for a failed startup or no device detected.' >
						<return name='Return' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='temp' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<local name='PROM' type='u16' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
							<exp exp='.Return = 0' />
						</command>
						<command class_type='call' title='Call Component Macro' cmdcolor='1975743' cmdcolor_sec='1975743' component='cal_i2c1' macro='Master_Init' />
						<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='10' type='1' />
						<command class_type='call' title='Read Chip ID' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
							<return exp='.temp' />
							<argument exp='0xD0' />
						</command>
						<command class_type='decision' title='Check device is correct' cmdcolor='3568629' cmdcolor_sec='3568629' exp='.temp = 0x60' swap='0' >
							<flowline >
								<command class_type='calculation' title='Calculation' cmdcolor='7895044' cmdcolor_sec='7895044' >
									<exp exp='.Return = 1' />
								</command>
								<command class_type='call' title='reset the device using soft-reset' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Write_Register' >
									<argument exp='0xE0' />
									<argument exp='0xB6' />
								</command>
								<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='300' type='1' />
								<command class_type='call' title='is busy reading cal data?' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
									<return exp='.temp' />
									<argument exp='0xF3' />
								</command>
								<command class_type='loop' title='Loop' cmdcolor='3568629' cmdcolor_sec='3568629' type='0' exp='(.temp &amp; 0x01) != 0' >
									<flowline >
										<command class_type='delay' title='Delay' cmdcolor='7895044' cmdcolor_sec='7895044' exp='100' type='1' />
										<command class_type='call' title='is busy reading cal data?' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Read_Register' >
											<return exp='.temp' />
											<argument exp='0xF3' />
										</command>
									</flowline>
								</command>
								<command class_type='comment' title='' comment='Read Coefficients' textarea='12,0,12,0' cmdcolor='1975743' cmdcolor_sec='1975743' />
								<command class_type='call' title='Call Macro' cmdcolor='1975743' cmdcolor_sec='1975743' macro='ReadCalibData' />
								<command class_type='call' title='BME280_REGISTER_CONTROLHUMID' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Write_Register' >
									<argument exp='0xF2' />
									<argument exp='HO' />
								</command>
								<command class_type='call' title='BME280_REGISTER_CONFIG' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Write_Register' >
									<argument exp='0xF5' />
									<argument exp='Stby|FC' />
								</command>
								<command class_type='call' title='BME280_REGISTER_CONTROL' cmdcolor='1975743' cmdcolor_sec='1975743' macro='I2C_Write_Register' >
									<argument exp='0xF4' />
									<argument exp='TO|PO|Mode' />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='ed3a5141-43bb-43e0-86b0-2243fd1147ca' vmin='3' vmaj='1' codename='cal_i2c1' x='0' y='0' z='0' xsz='25' ysz='25' zsz='25' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='REF' data='1' />
					<value target='CHANNEL' data='001' />
					<value target='SDA' data='$PORTB.4' />
					<value target='SCL' data='$PORTB.6' />
					<value target='BAUD_LIST' data='002' />
					<value target='BAUD' data='400000' />
					<value target='SRC' data='000' />
					<value target='SMB' data='000' />
					<value target='StopDel' data='1' />
					<value target='BMODE' data='0' />
					<value target='SDA_PORT' data='$PORTB.4' />
					<value target='SDA_TRIS' data='$PORTB.4' />
					<value target='SDA_PIN' data='4' />
					<value target='SCL_PORT' data='$PORTB.6' />
					<value target='SCL_TRIS' data='$PORTB.6' />
					<value target='SCL_PIN' data='6' />
					<value target='MASTER' data='1' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='2105930' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='1' lighting='2' brightness='0' perspective='0' >
		<background rgb='7895160' img='' style='0' />
		<table rgb='8388608' img='' style='0' size='7' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey0 xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<camerakey1 xe='-3.67394e-14' ye='0' ze='-300' xt='0' yt='0' zt='0' xquat='0' yquat='1' zquat='0' wquat='6.12323e-17' />
		<camerakey2 xe='0' ye='-300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.707107' yquat='0' zquat='0' wquat='0.707107' />
		<camerakey3 xe='-3.67394e-14' ye='300' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-4.32978e-17' yquat='0.707107' zquat='0.707107' wquat='4.32978e-17' />
		<camerakey4 xe='-300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='0.5' zquat='0.5' wquat='0.5' />
		<camerakey5 xe='300' ye='-6.66134e-14' ze='6.66134e-14' xt='0' yt='0' zt='0' xquat='-0.5' yquat='-0.5' zquat='-0.5' wquat='0.5' />
		<camerakey6 xe='-173.205' ye='-173.205' ze='173.205' xt='0' yt='0' zt='0' xquat='-0.424708' yquat='0.17592' zquat='0.339851' wquat='0.820473' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Altitude' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadHumidityFloat' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Reset' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='I2C_Read2_Register' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='I2C_Read3_Register' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadTemperatureFloat' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadPressureFloat' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='I2C_Read_LSB_MSB' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='I2C_Write_Register' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Forced_Read' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='I2C_Read_Register' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='ReadCalibData' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAUAYAANgCAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
