From 5f342be96eb860286417b9ad84b861dede2cdd25 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 8 Jul 2012 07:52:10 +0000 Subject: Configuration tool prototype (not complete). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4427 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- .../.externalToolBuilders/FMPP Builder.launch | 9 + tools/gencfg/.project | 25 + tools/gencfg/config.fmpp | 10 + .../gencfg/processors/boards/stm32f4xx/config.fmpp | 5 + .../boards/stm32f4xx/datamodel/stm32f4board.xml | 1040 ++++++++++++++++++++ .../boards/stm32f4xx/templates/board.mk.ftl | 27 + tools/gencfg/readme.txt | 1 + tools/gencfg/run.bat | 1 + tools/gencfg/schema/boards/abstract_board.xsd | 49 + tools/gencfg/schema/boards/stm32f4xx_board.xsd | 84 ++ tools/gencfg/schema/common/doc.xsd | 42 + .../schema/common/stm32/stm32_gpiov2_port.xsd | 105 ++ tools/gencfg/schema/stm32f4board.xml | 1040 ++++++++++++++++++++ 13 files changed, 2438 insertions(+) create mode 100644 tools/gencfg/.externalToolBuilders/FMPP Builder.launch create mode 100644 tools/gencfg/.project create mode 100644 tools/gencfg/config.fmpp create mode 100644 tools/gencfg/processors/boards/stm32f4xx/config.fmpp create mode 100644 tools/gencfg/processors/boards/stm32f4xx/datamodel/stm32f4board.xml create mode 100644 tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl create mode 100644 tools/gencfg/readme.txt create mode 100644 tools/gencfg/run.bat create mode 100644 tools/gencfg/schema/boards/abstract_board.xsd create mode 100644 tools/gencfg/schema/boards/stm32f4xx_board.xsd create mode 100644 tools/gencfg/schema/common/doc.xsd create mode 100644 tools/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd create mode 100644 tools/gencfg/schema/stm32f4board.xml diff --git a/tools/gencfg/.externalToolBuilders/FMPP Builder.launch b/tools/gencfg/.externalToolBuilders/FMPP Builder.launch new file mode 100644 index 000000000..266ef7bdc --- /dev/null +++ b/tools/gencfg/.externalToolBuilders/FMPP Builder.launch @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tools/gencfg/.project b/tools/gencfg/.project new file mode 100644 index 000000000..a112039b3 --- /dev/null +++ b/tools/gencfg/.project @@ -0,0 +1,25 @@ + + + _Configuration Tool + + + + + + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + + LaunchConfigHandle + <project>/.externalToolBuilders/FMPP Builder.launch + + + incclean + true + + + + + + + diff --git a/tools/gencfg/config.fmpp b/tools/gencfg/config.fmpp new file mode 100644 index 000000000..0f34b0a03 --- /dev/null +++ b/tools/gencfg/config.fmpp @@ -0,0 +1,10 @@ +# Change the next line to point to the processor you want to use. Processors +# are identified by a file named "config.fmpp" under the "processors" root +# directory. +inheritConfiguration: processors/boards/stm32f4xx/config.fmpp + +# Settings common to all processors. Do not change the following lines. +freemarkerLinks: { + lib: ./lib +} +logFile: ./log.fmpp diff --git a/tools/gencfg/processors/boards/stm32f4xx/config.fmpp b/tools/gencfg/processors/boards/stm32f4xx/config.fmpp new file mode 100644 index 000000000..a182fe12e --- /dev/null +++ b/tools/gencfg/processors/boards/stm32f4xx/config.fmpp @@ -0,0 +1,5 @@ +sourceRoot: templates +outputRoot: output +data: { + doc1: xml(../datamodel/stm32f4board.xml) +} diff --git a/tools/gencfg/processors/boards/stm32f4xx/datamodel/stm32f4board.xml b/tools/gencfg/processors/boards/stm32f4xx/datamodel/stm32f4board.xml new file mode 100644 index 000000000..08016b73c --- /dev/null +++ b/tools/gencfg/processors/boards/stm32f4xx/datamodel/stm32f4board.xml @@ -0,0 +1,1040 @@ + + + +
Board definition for STM32F4-Discovery.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl b/tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl new file mode 100644 index 000000000..d221241ed --- /dev/null +++ b/tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl @@ -0,0 +1,27 @@ +[#ftl] +[#-- + ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012 Giovanni Di Sirio. + + This file is part of ChibiOS/RT. + + ChibiOS/RT 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 3 of the License, or + (at your option) any later version. + + ChibiOS/RT 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, see . + --] +[@pp.dropOutputFile /] +[@pp.changeOutputFile name="boark.mk" /] +# List of all the board related files. +BOARDSRC = ${'$'}{CHIBIOS}/boards/${doc1.board.@BoardID[0]}/board.c + +# Required include directories +BOARDINC = ${'$'}{CHIBIOS}/boards/${doc1.board.@BoardID[0]} diff --git a/tools/gencfg/readme.txt b/tools/gencfg/readme.txt new file mode 100644 index 000000000..ffd318f25 --- /dev/null +++ b/tools/gencfg/readme.txt @@ -0,0 +1 @@ +Write requirements and setup documentation here. \ No newline at end of file diff --git a/tools/gencfg/run.bat b/tools/gencfg/run.bat new file mode 100644 index 000000000..460783f39 --- /dev/null +++ b/tools/gencfg/run.bat @@ -0,0 +1 @@ +fmpp -C config.fmpp diff --git a/tools/gencfg/schema/boards/abstract_board.xsd b/tools/gencfg/schema/boards/abstract_board.xsd new file mode 100644 index 000000000..9ce06495a --- /dev/null +++ b/tools/gencfg/schema/boards/abstract_board.xsd @@ -0,0 +1,49 @@ + + + + + + + + + + + Board identifier string, it is used to + create the board files folder name and the board + identifier macro in board.h. + + + + + + + + + + + PHY identifier as defined in mii.h or empty if a PHY is not present. + + + + + + + + + + + Type of the PHY device: RMII or MII, this attribute is defaulted to MII if not present. + + + + + + + + + + + + + diff --git a/tools/gencfg/schema/boards/stm32f4xx_board.xsd b/tools/gencfg/schema/boards/stm32f4xx_board.xsd new file mode 100644 index 000000000..8b7ba2bbb --- /dev/null +++ b/tools/gencfg/schema/boards/stm32f4xx_board.xsd @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + HSE frequency or zero if not present. + + + + + + + + + + + + + LSE frequency or zero if not present. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/gencfg/schema/common/doc.xsd b/tools/gencfg/schema/common/doc.xsd new file mode 100644 index 000000000..573beb618 --- /dev/null +++ b/tools/gencfg/schema/common/doc.xsd @@ -0,0 +1,42 @@ + + + + + + >Generic item with optional name and brief description + + + + + + + + + >Something that can have a detailed description attached + + + + + + + + + + + + + diff --git a/tools/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd b/tools/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd new file mode 100644 index 000000000..dbefc05d3 --- /dev/null +++ b/tools/gencfg/schema/common/stm32/stm32_gpiov2_port.xsd @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Object representing an STM32 pin for the GPIOv2 peripheral. + + + + + Pin identifier, used to generate a #define with the pin name. + + + + + + + + + Pin mode, as defined for MODER register. + + + + + + + + + + + + + Pin type as defined in TYPER register. + + + + + + + + + + + Pin speed as defined in SPEEDR register. + + + + + + + + + + + + + Pin pull-up/down resistor as defined in PUDR register. + + + + + + + + + + + + Pin alternate function number, only valid if "Alternate" is selected in the Mode attribute. + + + + + + + + + + + + diff --git a/tools/gencfg/schema/stm32f4board.xml b/tools/gencfg/schema/stm32f4board.xml new file mode 100644 index 000000000..08016b73c --- /dev/null +++ b/tools/gencfg/schema/stm32f4board.xml @@ -0,0 +1,1040 @@ + + + +
Board definition for STM32F4-Discovery.
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-- cgit v1.2.3