<root>
<document scada='0' schema='102' license='1,Bubthenib,RMFW7Y' title='Demo SPI Component' description='A starting point for creating a component based on SPI communications.

Includes the SPI CAL component with all the nesssisary exposed properties.' fcversion='590080' target='ARD.ATMEGA.Arduino Uno R3 PDIP' >
	<config data='' clkspd='16000000' simspd='0' usewdt='0' constif='0' commport='10' Use3V3='0' />
	<plugins >
		<dll_models enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<traces />
	<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='3' />
			<data name='ClockPin' value='1' />
			<data name='DataPort' value='3' />
			<data name='DataPin' value='0' />
			<data name='UseDefaultPins' value='1' />
			<data name='WrapEnabled' value='1' />
			<data name='CommsDelayOverridden' value='0' />
			<data name='CommsDelay' value='11' />
			<data name='CalculatedCommsDelay' value='11' />
			<data name='AnalogEB2PrescaleValue' value='2' />
			<data name='DigitalEB2SampleRate' value='100000' />
		</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='f51245dc-9af9-4a85-8665-55179465c306' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='Demo SPI Component' description='A simple example showing the bare bones used to create a component based on SPI communications.' category='Misc' category2='' category3='' bIs2dOnly='0' catenable='1' author='MatrixTSL' manuname='' manucode='' sysinfo='0' keywords='' dynamic='1' scadaCompatible='0' embeddedCompatible='1' iconpath='' />
		<gdiopts FullContainer='1' FullTransparency='1' ShowGdi='1' ShowOpengl='1' />
		<component class_type='root' codename='AD9833' 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' scadavisible='1' interactive='1' solid='1' layer='0' poslock='0' comp2dType='0' >
			<resources />
			<properties >
				<property name='SPI Properties' folder='property_1' hidden='0' >
					<property name='Connections' folder='cal_spi1::property_2' hidden='0' >
						<property name='Channel' target='cal_spi1::CHANNEL' typeid='16' hidden='0' locked='0' info='SPI Channel selector' filter='000Software
001Channel 1
' />
						<property name='MOSI' target='cal_spi1::MOSI' typeid='5' hidden='0' locked='1' info='SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.' />
						<property name='MOSI Remap Pin' target='cal_spi1::MOSIPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the MOSI hardware pin functionality.' filter='000$PORTC.0
001$PORTC.1
002$PORTC.2
003$PORTC.3
004$PORTC.4
005$PORTC.5
006$PORTC.6
007$PORTC.7
008$PORTB.0
009$PORTB.1
010$PORTB.2
011$PORTB.3
012$PORTB.4
013$PORTB.5
014$PORTB.6
015$PORTB.7' />
						<property name='MISO' target='cal_spi1::MISO' typeid='5' hidden='0' locked='1' info='SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.' />
						<property name='MISO Remap Pin' target='cal_spi1::MISOPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the MISO hardware pin functionality.' filter='016$PORTC.0
017$PORTC.1
018$PORTC.2
019$PORTC.3
020$PORTC.4
021$PORTC.5
022$PORTC.6
023$PORTC.7
008$PORTB.0
009$PORTB.1
010$PORTB.2
011$PORTB.3
012$PORTB.4
013$PORTB.5
014$PORTB.6
015$PORTB.7' />
						<property name='CLK' target='cal_spi1::CLK' typeid='5' hidden='0' locked='1' info='SPI Clock Pin CLK - The Clock signal is driven by the SPI master.' />
						<property name='CLK Remap Pin' target='cal_spi1::CLKPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the CLK hardware pin functionality.' filter='000$PORTC.0
001$PORTC.1
002$PORTC.2
003$PORTC.3
004$PORTC.4
005$PORTC.5
006$PORTC.6
007$PORTC.7
008$PORTB.0
009$PORTB.1
010$PORTB.2
011$PORTB.3
012$PORTB.4
013$PORTB.5
014$PORTB.6
015$PORTB.7' />
						<property name='Use Auto CS' target='cal_spi1::UseAutoCS' typeid='7' hidden='0' locked='0' info='Allow the SPI component to manage the CS pin for us in Master mode.
On initialise the CS pin is automatically set high to disable the remote SPI device.
Set to No if you want to create a component with multiple CS pins or if you want to manage the CS pin yourself.' />
						<property name='Use Slave Select' target='cal_spi1::UseCS' typeid='7' hidden='1' locked='0' info='Allows the SPI Slave to monitor the hardware SS pin to enable the SPI perpheral.
No: SS pin will not be used and can be used as standard IO
Yes: SS pin will be used to automatically enable the SPI interface when low.' />
						<property name='CS / SS' target='cal_spi1::SS' typeid='5' hidden='0' locked='0' info='Chip Select / Slave Select Pin 
Master Mode: General purpose output pin used to select the remote SPI device.
Slave Mode: Hardware chip select pin input used to select the SPI device.
' />
						<property name='SS Remap Pin' target='cal_spi1::SSPins' typeid='16' hidden='1' locked='0' info='Select which the target pin to assign the SS hardware pin functionality.' />
						<property name='Alt SS Pin' target='cal_spi1::AltSSPin' typeid='7' hidden='1' locked='0' info='Allows an alternative SS hardware pin to be used.' />
					</property>
					<property name='Options' folder='cal_spi1::property_3' hidden='0' >
						<property name='Mode' target='cal_spi1::Mode' typeid='16' hidden='0' locked='0' info='Configures the mode of the SPI component.
Currently only Master mode is supported.' filter='000Master
001Slave' />
						<property name='Prescale' target='cal_spi1::PR_SCALE' typeid='16' hidden='0' locked='0' info='Prescale option selector' filter='004Fosc/4
016Fosc/16
064Fosc/64' />
						<property name='Clock Phase' target='cal_spi1::CKE' typeid='16' hidden='0' locked='0' info='Clock Phase (data change edge) selection' filter='000Leading Edge
001Trailing Edge' />
						<property name='Clock Polarity' target='cal_spi1::CKP' typeid='16' hidden='0' locked='0' info='Clock Polarity setting, inactive (idle) state' filter='000Idle Low
001Idle High' />
						<property name='Sample Point' target='cal_spi1::SMP' typeid='16' hidden='0' locked='0' info='Data bit read sample point' filter='000Middle
001End' />
					</property>
				</property>
				<property name='Simulation' folder='cal_spi1::property_1' hidden='0' >
					<property name='Simulate Comms' target='SimComms' typeid='7' hidden='0' locked='0' info='' />
					<property name='Comms Simulation' folder='property_2' hidden='0' >
						<property name='Scope Traces' target='cal_spi1::ScopeTraces' typeid='7' hidden='0' locked='0' info='Selects if the scope traces are automatically generated or not' />
						<property name='Console Data' target='cal_spi1::ConsoleData' typeid='7' hidden='0' locked='0' info='Selects if the console data is automatically generated or not' />
						<property name='Injector' target='cal_spi1::Injector' typeid='16' hidden='0' locked='0' info='' filter='000
001API_Ard_Uno1 SPI CH0' />
						<property name='API CS Pin' target='cal_spi1::InjectorCS' typeid='21' hidden='0' locked='0' info='' />
					</property>
					<property name='Injector Handle' target='cal_spi1::InjectorHandle' typeid='21' hidden='1' locked='0' info='' />
				</property>
			</properties>
			<values >
				<value target='cal_spi1::CHANNEL' data='001' />
				<value target='cal_spi1::MOSI' data='$PORTB.3' />
				<value target='cal_spi1::MOSIPins' data='008' />
				<value target='cal_spi1::MISO' data='$PORTB.4' />
				<value target='cal_spi1::MISOPins' data='013' />
				<value target='cal_spi1::CLK' data='$PORTB.5' />
				<value target='cal_spi1::CLKPins' data='004' />
				<value target='cal_spi1::UseAutoCS' data='1' />
				<value target='cal_spi1::UseCS' data='0' />
				<value target='cal_spi1::SS' data='$PORTB.2' />
				<value target='cal_spi1::SSPins' data='000' />
				<value target='cal_spi1::AltSSPin' data='0' />
				<value target='cal_spi1::Mode' data='000' />
				<value target='cal_spi1::PR_SCALE' data='016' />
				<value target='cal_spi1::CKE' data='001' />
				<value target='cal_spi1::CKP' data='000' />
				<value target='cal_spi1::SMP' data='000' />
				<value target='SimComms' data='1' />
				<value target='cal_spi1::ScopeTraces' data='0' />
				<value target='cal_spi1::ConsoleData' data='1' />
				<value target='cal_spi1::Injector' data='001' />
				<value target='cal_spi1::InjectorCS' data='10' />
				<value target='cal_spi1::InjectorHandle' data='3165' />
			</values>
			<events >
				<event class='Components' event='Property' target='Ev_Property' />
				<event class='Components' event='Initialise' target='Ev_Initialise' />
			</events>
			<apis >
				<api name='Initialise' alt='InitialiseSim' type='1' proto='1' />
			</apis>
			<variables >
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='IntCount' type='u8' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='LEDSTATUS' type='b1' description='' isconst='0' isHidden='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isHidden='0' isinit='1' usrinit='1' setinit='1' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='Write9833Config' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<param name='Configuration' type='u16' description='0' isconst='0' isHidden='0' isinit='0' usrinit='0' setinit='' />
						<local name='WriteData' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='3' />
						</local>
						<local name='ReadData' type='u8' description='' isconst='0' isHidden='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
							<array size='3' />
						</local>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Enable_CS' />
						<command class_type='calculation' title='' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' >
							<exp exp='.ReadData[0] = 0' />
							<exp exp='.ReadData[1] = 0' />
							<exp exp='.ReadData[2] = 0' />
							<exp exp='.WriteData[0] = 0xB7' />
							<exp exp='.WriteData[1] = 0xBB' />
							<exp exp='' />
						</command>
						<command class_type='call' title='Write data array' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Transaction' >
							<argument exp='.WriteData' />
							<argument exp='2' />
						</command>
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Disable_CS' />
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Call User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Initialise' />
						<command class_type='loop' title='' textarea='56,52,56,52' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' type='0' exp='1' >
							<flowline >
								<command class_type='call' title='User Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' macro='Write9833Config' >
									<argument exp='0x03' />
								</command>
								<command class_type='delay' title='D' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' exp='100' type='1' />
							</flowline>
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Initialise' description='' statediag='0' >
						<return name='Return' type='v0' description='' isconst='0' isHidden='0' isinit='0' usrinit='' setinit='' />
						<command class_type='call' title='Startup SPI Comms' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Init' />
						<command class_type='call' title='Component Macro' cmdcolor='5767111' cmdcolor_sec='5767111' cmdcolor_txt='2105376' cmdgradient='1' cmdopacity='0.01' component='cal_spi1' macro='Master_Disable_CS' />
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='c67171df-0ad6-4b11-8361-cfe14b072847' vmin='1' vmaj='2' codename='cal_spi1' x='-23' y='-39' z='0' xsz='20' ysz='20' zsz='20' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='ENABLED' data='1' />
					<value target='REF' data='1' />
					<value target='CHANNEL' data='001' />
					<value target='MOSI' data='$PORTB.3' />
					<value target='MOSIPins' data='008' />
					<value target='MISO' data='$PORTB.4' />
					<value target='MISOPins' data='013' />
					<value target='CLK' data='$PORTB.5' />
					<value target='CLKPins' data='004' />
					<value target='UseAutoCS' data='1' />
					<value target='UseCS' data='0' />
					<value target='SS' data='$PORTB.2' />
					<value target='SSPins' data='000' />
					<value target='AltSSPin' data='0' />
					<value target='Mode' data='000' />
					<value target='PR_SCALE' data='016' />
					<value target='CKE' data='001' />
					<value target='CKP' data='000' />
					<value target='SMP' data='000' />
					<value target='ScopeTraces' data='0' />
					<value target='ConsoleData' data='1' />
					<value target='Injector' data='001' />
					<value target='InjectorCS' data='10' />
					<value target='InjectorHandle' data='3165' />
					<value target='InjectorChannel' data='0' />
					<value target='BMODE' data='2' />
					<value target='MOSI_PORT' data='$PORTB.3' />
					<value target='MOSI_TRIS' data='$PORTB.3' />
					<value target='MOSI_PIN' data='3' />
					<value target='MISO_PORT' data='$PORTB.4' />
					<value target='MISO_TRIS' data='$PORTB.4' />
					<value target='MISO_PIN' data='4' />
					<value target='SCK_PORT' data='$PORTB.5' />
					<value target='SCK_TRIS' data='$PORTB.5' />
					<value target='SCK_PIN' data='5' />
					<value target='SS_PORT' data='$PORTB.2' />
					<value target='SS_TRIS' data='$PORTB.2' />
					<value target='SS_PIN' data='2' />
					<value target='Remappable' data='' />
					<value target='MOSIReg' data='008' />
					<value target='CLKREG' data='004' />
					<value target='MOSIRPNUM' data='21' />
					<value target='MOSIBank' data='b' />
					<value target='MOSIBank2' data='c' />
					<value target='CLKRPNUM' data='20' />
					<value target='CLKBank' data='b' />
					<value target='MISORPREG' data='SSP1DATPPS' />
					<value target='MISOBank' data='b' />
					<value target='SPIName' data='' />
					<value target='MISOReg' data='000' />
					<value target='SPIClock' data='' />
					<value target='MISOBank2' data='c' />
					<value target='CLKBank2' data='c' />
					<value target='ParentName' data='' />
					<value target='BitDelay' data='1' />
					<value target='ClockSpeed' data='16000000' />
					<value target='MasterDivider' data='1' />
					<value target='Sim' data='1' />
					<value target='CLKRPREG' data='' />
					<value target='SSRPREG' data='SSP1SSPPS' />
					<value target='SSBank' data='a' />
					<value target='SSBank2' data='d' />
					<value target='AltSSReg' data='' />
					<value target='AltSSMask' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='2b53c2f2-b5d4-4e36-a647-6f9238744a75' vmin='0' vmaj='2' codename='API_Ard_Uno1' x='20' y='-40' z='0' xsz='8.15217' ysz='8.15217' zsz='8.15217' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' scadavisible='1' interactive='1' solid='1' layer='1' poslock='0' comp2dType='0' >
				<resources />
				<properties />
				<values >
					<value target='scada_uart1::com_port' data='024' />
					<value target='scada_uart1::RefreshPorts' data='0' />
					<value target='APIDIGIO' data='20' />
					<value target='APIANIN' data='6' />
					<value target='APIANOUT' data='0' />
					<value target='APIPWM' data='6' />
					<value target='APII2C' data='1' />
					<value target='APISPI' data='1' />
					<value target='APIUART' data='0' />
					<value target='APISERVO' data='0' />
					<value target='ConsoleLog' data='1' />
					<value target='LogMode' data='001' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<scadaresourcelookup />
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' >
		<background rgb='2105930' img='' style='0' />
		<camera xe='-3.90626' ye='-36.46' ze='138.369' xt='-3.90626' yt='-36.46' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
		<viewport dx='510' dy='333' zoom='445.982' fix_topleft='0' />
		<page x='1000' y='1000' show='0' rgb='0' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='1' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='0' />
		<camera xe='0' ye='0' ze='781.66' 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---------------------wUAAAAYAAAAhAQAAH4DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Initialise' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAhAQAAH4DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='Write9833Config' mode='0' placement='LAAAAAAAAAABAAAA---------------------wUAAAAYAAAAhAQAAH4DAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
