New file, extract high-voltage programming parameters from Atmel XML

files, and produce an avrdude.conf[.in] snippet.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@603 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2006-08-13 21:10:13 +00:00
parent 914acd42a7
commit abda4d9276
2 changed files with 212 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2006-08-13 Joerg Wunsch <j@uriah.heep.sax.de>
* tools: New directory.
* tools/get-hv-params.xsl: New file, extract high-voltage
programming parameters from Atmel XML files, and produce
an avrdude.conf[.in] snippet.
2006-08-11 Joerg Wunsch <j@uriah.heep.sax.de>
* configure.ac (AC_CHECK_LIB([usb]): implement a private LIBUSB

205
tools/get-hv-params.xsl Normal file
View File

@ -0,0 +1,205 @@
<?xml version="1.0" encoding='ISO-8859-1' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--
* Copyright (c) 2006 Joerg Wunsch
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
*
* $Id$
-->
<!--
* Extract high-voltage (parallel and serial) programming parameters
* out of the Atmel XML files, and convert them into avrdude.conf
* snippets.
*
* Run this file together with the respective AVR's XML file through
* an XSLT processor (xsltproc, saxon), and capture the output for
* inclusion into avrdude.conf.in.
-->
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:for-each select="//*">
<xsl:if test='name() = "STK500_2"'>
<!--
* High-voltage parallel programming parameters.
-->
<xsl:for-each
select="*[starts-with(translate(name(),
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
'PP')]">
<xsl:if test="self::node()[name() = 'PPControlStack']"
> pp_controlstack =
<xsl:value-of select="translate(current(), ' ', ',')" />;
</xsl:if> <!-- PPControlStack -->
<xsl:if test="self::node()[name() = 'PpEnterProgMode']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'stabDelay']"
> hventerstabdelay = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'progModeDelay']"
> progmodedelay = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'latchCycles']"
> latchcycles = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'toggleVtg']"
> togglevtg = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'powerOffDelay']"
> poweroffdelay = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'resetDelayMs']"
> resetdelayms = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'resetDelayUs']"
> resetdelayus = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- PpEnterProgMode -->
<xsl:if test="self::node()[name() = 'PpLeaveProgMode']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'stabDelay']"
> hvleavestabdelay = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- PpLeaveProgMode -->
<xsl:if test="self::node()[name() = 'PpChipErase']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'pulseWidth']"
> chiperasepulsewidth = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'pollTimeout']"
> chiperasepolltimeout = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- PpChipErase -->
<xsl:if test="self::node()[name() = 'PpProgramFuse']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'pulseWidth']"
> programfusepulsewidth = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'pollTimeout']"
> programfusepolltimeout = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- PpProgramFuse -->
<xsl:if test="self::node()[name() = 'PpProgramLock']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'pulseWidth']"
> programlockpulsewidth = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'pollTimeout']"
> programlockpolltimeout = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- PpProgramLock -->
</xsl:for-each> <!-- PP parameters -->
<!--
* High-voltage serial programming parameters.
-->
<xsl:for-each
select="*[starts-with(translate(name(),
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
'HVSP')]">
<xsl:if test="self::node()[name() = 'HvspControlStack']"
> hvsp_controlstack =
<xsl:value-of select="translate(current(), ' ', ',')" />;
</xsl:if> <!-- HvspControlStack -->
<xsl:if test="self::node()[name() = 'HvspEnterProgMode']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'stabDelay']"
> hventerstabdelay = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'cmdexeDelay']"
> hvspcmdexedelay = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'synchCycles']"
> synchcycles = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'latchCycles']"
> latchcycles = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'toggleVtg']"
> togglevtg = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'powoffDelay']"
> poweroffdelay = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'resetDelay1']"
> resetdelayms = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'resetDelay2']"
> resetdelayus = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- HvspEnterProgMode -->
<xsl:if test="self::node()[name() = 'HvspLeaveProgMode']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'stabDelay']"
> hvleavestabdelay = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'resetDelay']"
> resetdelay = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- HvspLeaveProgMode -->
<xsl:if test="self::node()[name() = 'HvspChipErase']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'pollTimeout']"
> chiperasepolltimeout = <xsl:value-of select="." />;
</xsl:if>
<xsl:if test="self::node()[name() = 'eraseTime']"
> chiperasetime = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- HvspChipErase -->
<xsl:if test="self::node()[name() = 'HvspProgramFuse']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'pollTimeout']"
> programfusepolltimeout = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- HvspProgramFuse -->
<xsl:if test="self::node()[name() = 'HvspProgramLock']">
<xsl:for-each select="*">
<xsl:if test="self::node()[name() = 'pollTimeout']"
> programlockpolltimeout = <xsl:value-of select="." />;
</xsl:if>
</xsl:for-each>
</xsl:if> <!-- HvspProgramLock -->
</xsl:for-each> <!-- HVSP parameters -->
</xsl:if> <!-- STK500_2 parameters -->
</xsl:for-each> <!-- All nodes -->
</xsl:template>
</xsl:stylesheet>