--- a
+++ b/trunk/Monarco/MonarcoHAT.devdesc.xml
@@ -0,0 +1,233 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--created with CoDeSys 3.0 (http://www.3s-software.com) by DeviceDescriptionBuilder (3S-Smart Software Solutions GmbH)-->
+<DeviceDescription xmlns="http://www.3s-software.com/schemas/DeviceDescription-1.0.xsd" xmlns:ts="http://www.3s-software.com/schemas/TargetSettings-0.1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <Types namespace="local">
+    <BitfieldType basetype="std:BYTE" name="TBitStringByte">
+      <Component identifier="Bit0" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TBitStringByte.Bit0">Bit0</VisibleName>
+      </Component>
+      <Component identifier="Bit1" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TBitStringByte.Bit1">Bit1</VisibleName>
+      </Component>
+      <Component identifier="Bit2" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TBitStringByte.Bit2">Bit2</VisibleName>
+      </Component>
+      <Component identifier="Bit3" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TBitStringByte.Bit3">Bit3</VisibleName>
+      </Component>
+    </BitfieldType>
+	<BitfieldType basetype="std:BYTE" name="TLEDStringByte">
+	  <Component identifier="Led0" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit0">Led0</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+      <Component identifier="Led1" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit1">Led1</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+      <Component identifier="Led2" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit2">Led2</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+      <Component identifier="Led3" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit3">Led3</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+	  <Component identifier="Led4" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit0">Led4</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+      <Component identifier="Led5" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit1">Led5</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+      <Component identifier="Led6" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit2">Led6</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+      <Component identifier="Led7" type="std:BOOL">
+        <Default />
+        <VisibleName name="local:TLEDStringByte.Bit3">Led7</VisibleName>
+		<Description>FALSE => IO Channel Value, TRUE => User Value</Description>
+      </Component>
+	</BitfieldType>
+	<BitfieldType basetype="std:BYTE" name="TCtrlStringByte">
+	  <Component identifier="Status LED CTRL" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>Status LED CTRL</VisibleName>
+		<Description>Status LED indication => TRUE: User controlled, FALSE: System Status Indication</Description>
+	  </Component>
+	  <Component identifier="StatusLEDValue" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>Status LED Value</VisibleName>
+		<Description>Only applicable if Status LED CTRL is enabled => TRUE: LED on, FALSE: LED off</Description>
+	  </Component>
+	  <Component identifier="OneWireShutdown" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>1-Wire power shutdown</VisibleName>
+		<Description>Useful for bus reset in case of freeze => TRUE: 1-Wire bus power down, FALSE: normal operation</Description>
+	  </Component>
+	  <Component identifier="RESERVED" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>[RESERVED]</VisibleName>
+		<Description>RESERVED: Always FALSE</Description>
+	  </Component>
+	  <Component identifier="Counter1Reset" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>Counter 1 Reset</VisibleName>
+		<Description>TRUE: COUNTER1 Value reset request, FALSE: normal operation</Description>
+	  </Component>
+	  <Component identifier="Counter2Reset" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>Counter 2 Reset</VisibleName>
+		<Description>TRUE: COUNTER2 Value reset request, FALSE: normal operation</Description>
+	  </Component>
+	  <Component identifier="SignOfLife0" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>[FUTURE]</VisibleName>
+		<Description>FUTURE: Sign of Life 0/1 - should be incremented with each data transfer as 2bit number low/high bit, used by firmware as health check of SPI Master</Description>
+	  </Component>
+	  <Component identifier="SignOfLife1" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>[FUTURE]</VisibleName>
+		<Description>FUTURE: Sign of Life 0/1 - should be incremented with each data transfer as 2bit number low/high bit, used by firmware as health check of SPI Master</Description>
+	  </Component>
+	</BitfieldType>
+	<BitfieldType basetype="std:BYTE" name="THWConfigStringByte">
+	  <Component identifier="AIN1Shunt" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>AIN1 Shunt</VisibleName>
+		<Description>AIN1 current loop shunt resistor enable (TRUE / FALSE)</Description>
+	  </Component>
+	  <Component identifier="AIN2Shunt" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>AIN2 Shunt</VisibleName>
+		<Description>AIN2 current loop shunt resistor enable (TRUE / FALSE)</Description>
+	  </Component>
+	  <Component identifier="RS-485 Termination resistor" type="std:BOOL">
+		<Default>FALSE</Default>
+		<VisibleName>RS-485 Termination resistor</VisibleName>
+		<Description>RS-485 termination resistor enable (TRUE / FALSE)</Description>
+	  </Component>
+	</BitfieldType>
+ </Types>
+   <Strings namespace="local">
+   <Language lang="en"></Language>
+  </Strings>
+  <Files namespace="local">
+    <Language lang="en">
+	  <File fileref="local" identifier="ImageFile">
+        <LocalFile>Monarco.png</LocalFile>
+      </File>
+      <File fileref="local" identifier="Icon">
+        <LocalFile>Monarco.ico</LocalFile>
+      </File>
+    </Language>
+  </Files>
+  <Device hideInCatalogue="false" showParamsInDevDescOrder="true">
+    <DeviceIdentification>
+      <Type>501</Type>
+      <Id>0004 0005</Id>
+      <Version>2.0.1.2</Version>
+    </DeviceIdentification>
+    <DeviceInfo>
+      <Name name="local:ModelName">Monarco HAT</Name>
+      <Description name="local:DeviceDescription">Monarco HAT SPI device library for CODESYS</Description>
+      <Vendor name="local:VendorName">Monarco.io</Vendor>
+      <OrderNumber>-</OrderNumber>
+	  <Image name="local:ImageFile">Monarco.png</Image>
+	  <Icon name="local:Icon">Monarco.ico</Icon>
+	</DeviceInfo>
+    <Connector moduleType="500" interface="Raspberry.SPI" role="child" explicit="false" connectorId="1" hostpath="-1" alwaysmapping="true">
+      <InterfaceName name="local:PCI">SPI devices</InterfaceName>
+      <Slot count="1" allowEmpty="false">
+      </Slot> 
+      <DriverInfo needsBusCycle="true"> 
+        <RequiredLib libname="Monarco HAT library for CODESYS" vendor="Open Source" version="2.0.1.2" identifier="DeviceLib">
+          <FBInstance basename="$(DeviceName)" fbname="IoDrvMonarco">
+            <Initialize methodName="Initialize" />
+          </FBInstance>
+        </RequiredLib>
+      </DriverInfo>
+ 	<HostParameterSet>
+		<ParameterSection>
+   	        <Name name="local:GeneralParameters">Digital In</Name>
+				<Parameter ParameterId="1000" type="local:TBitStringByte">
+					<Attributes channel="input"/>
+					<Name name="local:digin">Digital Inputs</Name>
+				</Parameter>
+		</ParameterSection>
+		<ParameterSection>
+		    <Name name="local:GeneralParameters">Analog In </Name>
+				<Parameter ParameterId="1100" type="std:WORD">
+					<Attributes channel="input"/>
+					<Name name="AI0">AI0</Name>
+				</Parameter>
+				<Parameter ParameterId="1101" type="std:WORD">
+					<Attributes channel="input"/>
+					<Name name="AI1">AI1</Name>
+				</Parameter>
+		</ParameterSection>
+		<ParameterSection>
+   	        <Name name="local:GeneralParameters">Digital Out</Name>
+				<Parameter ParameterId="2000" type="local:TBitStringByte">
+					<Attributes channel="output"/>
+					<Name name="local:digout">Digital Outputs</Name>
+				</Parameter>
+		</ParameterSection>
+		<ParameterSection>
+		    <Name name="local:GeneralParameters">Analog Out </Name>
+				<Parameter ParameterId="2100" type="std:WORD">
+					<Attributes channel="output"/>
+					<Name name="AO0">AO0</Name>
+				</Parameter>
+				<Parameter ParameterId="2101" type="std:WORD">
+					<Attributes channel="output"/>
+					<Name name="AO1">AO1</Name>
+				</Parameter>
+		</ParameterSection>
+		<ParameterSection>
+   	        <Name name="local:GeneralParameters">Control Byte</Name>
+				<Parameter ParameterId="2200" type="local:TCtrlStringByte">
+					<Attributes channel="output"/>
+					<Name name="local:UserLeds">Control Byte</Name>
+				</Parameter>
+		</ParameterSection>
+		<ParameterSection>
+   	        <Name name="local:GeneralParameters">HW Config</Name>
+				<Parameter ParameterId="2300" type="local:THWConfigStringByte">
+					<Attributes channel="output"/>
+					<Name name="local:UserLeds">HW Config Byte</Name>
+				</Parameter>
+		</ParameterSection>
+		<ParameterSection>
+   	        <Name name="local:GeneralParameters">User Leds</Name>
+				<Parameter ParameterId="2400" type="local:TLEDStringByte">
+					<Attributes channel="output"/>
+					<Name name="local:UserLeds">User Leds Byte</Name>
+				</Parameter>
+		</ParameterSection>
+		</HostParameterSet>
+    </Connector>
+	<ExtendedSettings>
+      <ts:TargetSettings>
+        <ts:section name="deviceconfiguration">
+          <ts:setting name="createBitChannels" type="boolean" access="visible">
+            <ts:value>1</ts:value>
+          </ts:setting>
+        </ts:section>
+      </ts:TargetSettings>
+    </ExtendedSettings>
+  </Device>
+</DeviceDescription>
\ No newline at end of file