<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!DOCTYPE decoder-config SYSTEM "../DTD/decoder-config.dtd">

<!-- Copyright (C) JMRI 2004 All rights reserved -->
<!-- $Id: Hornby8249.xml,v 1.1 2008/08/24 02:31:12 jacobsen Exp $ -->
<!--                                                                        -->
<!-- JMRI is free software; you can redistribute it and/or modify it under  -->
<!-- the terms of version 2 of the GNU General Public License as published  -->
<!-- by the Free Software Foundation. See the "COPYING" file for a copy     -->
<!-- of this license.                                                       -->
<!--                                                                        -->
<!-- JMRI is distributed in the hope that it will be useful, but WITHOUT    -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or  -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License  -->
<!-- for more details.                                                      -->

<decoder-config>
		<version author="Bob Jacobsen rgj1927@pacbell.net"
			version="1" lastUpdated="20080821" />
		<!-- Decoder used in Hornby engines -->

<decoder>
	<family name="R8249" mfg="Hornby">
			
		<model model="R8249" numOuts="4" numFns="4" 
		    nmraWarrant="yes" nmraWarrantStart="200808" 
		    maxTotalCurrent="0.5A" maxMotorCurrent="0.5A" >
		    <size length="17" width="10" height="3.5" units="mm"/>
        </model>
		    <!-- don't know version id, maybe lowVersionID="13"?  -->

	</family>

	<programming direct="yes" paged="yes"
	                     register="yes" ops="yes"></programming>

	<variables>

		<variable label="Primary Address" CV="1" comment="Short address"
						item="Short Address"  default="03">
			<shortAddressVal/></variable>

		<variable label="Acceleration Rate  " CV="3" default="5"
						item="Accel" >
			<decVal max="255"/></variable>
		<variable label="Deceleration Rate  " CV="4" default="5"
						item="Decel">
			<decVal max="255"/></variable>

		<variable label="Long Address" CV="17" item="Extended Address"
		        comment="4 digit address (Range 0001-9999)">
			<longAddressVal/>
			</variable>

		<variable label="Version ID" CV="7" readOnly="yes"
				item="Decoder Version" >
			<decVal/>
			</variable>

		<variable label="Manufacturer ID" CV="8" readOnly="yes"
				item="Manufacturer" default="48">
			<decVal/>
			</variable>


		<variable label="Manufacturer ID - Reset" CV="8" default="99">
			<decVal/>
			</variable>

		<variable label="Normal direction of motion" CV="29"
				mask="XXXXXXXV"
		        item="Locomotive Direction">
			<enumVal>
				<enumChoice choice="Forward"/>
				<enumChoice choice="Reverse"/>
				</enumVal>
			</variable>

		<variable label="Speed Steps" CV="29" mask="XXXXXXVX"
				item="Speed Step Mode" default="1">
			<enumVal>
				<enumChoice choice="14"/>
				<enumChoice choice="28/128 (recommended)"/>
				</enumVal>
			</variable>
		<variable label="Analog conversion mode" CV="29"
				mask="XXXXXVXX" default="0"
				item="Analog (DC) Operation">
			<enumVal>
				<enumChoice choice="Off"/>
				<enumChoice choice="On"/>
				</enumVal>
			</variable>		

		<variable label="Addressing Mode" CV="29" mask="XXVXXXXX"
				item="Address Format">
			<enumVal>
				<enumChoice choice="2 digit addressing"/>
				<enumChoice choice="4 digit addressing"/>
				</enumVal>
			</variable>

	<!-- Define the fixed Function-Output mapping -->
	<constant label="FL(f) controls output 1" minOut="1" default="1" /> 
	<constant label="FL(r) controls output 2" minOut="2" default="1" /> 
	<constant label="F1 controls output 3" minOut="3" default="1" /> 
	<constant label="F2 controls output 4" minOut="4" default="1" /> 

	</variables>
        <resets>
		<factReset label="HARD RESET all CVs reset to default values" CV="8" default="8"/>
        </resets>

</decoder>


</decoder-config>





