From ab4703c491d8cbc4848d43902857adcfb8768a87 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 12 Jul 2012 14:02:44 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4463 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- boards/ST_STM32F4_DISCOVERY/stm32f4board.xml | 11 +- tools/gencfg/lib/libcode.ftl | 67 +- tools/gencfg/lib/libstm32f4xx.ftl | 50 +- .../boards/stm32f4xx/templates/board.h.ftl | 24 +- .../boards/stm32f4xx/templates/board.mk.ftl | 4 +- .../hal/stm32f4xx/templates/hal_cfg.c.ftl | 2 +- .../hal/stm32f4xx/templates/hal_cfg.h.ftl | 2 +- tools/gencfg/schema/boards/abstract_board.xsd | 81 +- tools/gencfg/schema/boards/stm32f4xx_board.xsd | 99 +- tools/gencfg/schema/common/doc.xsd | 111 +- tools/gencfg/schema/hal/abstract_adc_cfg.xsd | 56 +- .../schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd | 227 ++- tools/gencfg/xml/stm32f4board.xml | 1460 ++++---------------- tools/gencfg/xml/stm32f4xx_cfg.xml | 31 +- 14 files changed, 732 insertions(+), 1493 deletions(-) diff --git a/boards/ST_STM32F4_DISCOVERY/stm32f4board.xml b/boards/ST_STM32F4_DISCOVERY/stm32f4board.xml index a2ed2543a..7e1c446ce 100644 --- a/boards/ST_STM32F4_DISCOVERY/stm32f4board.xml +++ b/boards/ST_STM32F4_DISCOVERY/stm32f4board.xml @@ -2,13 +2,10 @@ + xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f4xx_board.xsd"> + STMicroelectronics STM32F4-Discovery + ST_STM32F4_DISCOVERY + 0] [#local cr1 = cr1 + " | ADC_CR1_DISCEN" /] + [#local cr1 = cr1 + " | ADC_CR1_DISCNUM_N(" + (disc - 1)?string + ")" /] [/#if] ${cr1}, /* CR2 register initialization value.*/ - [#local exten = group.@trigger_mode[0]?word_list[0]?number /] + [#local exten = group.trigger_mode[0]?word_list[0]?number /] [#local cr2 = "ADC_CR1_EXTEN_N(" + exten?string + ")" /] - [#local extsel = group.@trigger_source[0]?word_list[0]?number /] + [#local extsel = group.trigger_source[0]?word_list[0]?number /] [#local cr2 = cr2 + " | ADC_CR1_EXSEL_N(" + extsel?string + ")" /] - [#if group.@alignment[0]?word_list[0]?number != 0] + [#if group.alignment[0]?word_list[0]?number != 0] [#local cr2 = cr2 + " | ADC_CR2_ALIGN" /] [/#if] ${cr2}, @@ -131,19 +125,19 @@ const ADCGroupConfig ${grpcfg_name} = { -- Emits the STM32F4xx ADC driver configuration external declarations. --] [#macro EmitADCConfigExtern config] - [#local cfg_name = config.@name[0]?string /] + [#local cfg_name = config.name[0]?string /] [#list config.groups.group as group] - [#local grpcfg_name = group.@name[0]?string /] + [#local grpcfg_name = group.name[0]?string /] [#-- Only emits the comment if there is at least a callback defined.--] /* ADC configuration "${cfg_name}".*/ extern const ADCConfig ${cfg_name}; /* ADC conversion group "${grpcfg_name}".*/ extern const ADCGroupConfig ${grpcfg_name}; - [#if group.@conversion_callback[0]?string?trim != ""] - void ${group.@conversion_callback[0]?string?trim}(ADCDriver *, adcsample_t *, size_t); + [#if group.conv_callback[0]?string?trim != ""] + void ${group.conv_callback[0]?string?trim}(ADCDriver *, adcsample_t *, size_t); [/#if] - [#if group.@error_callback[0]?string?trim != ""] - void ${group.@error_callback[0]?string?trim}(ADCDriver *, adcerror_t); + [#if group.error_callback[0]?string?trim != ""] + void ${group.error_callback[0]?string?trim}(ADCDriver *, adcerror_t); [/#if] [/#list] diff --git a/tools/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl b/tools/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl index dccb8782f..593b3883c 100644 --- a/tools/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl +++ b/tools/gencfg/processors/boards/stm32f4xx/templates/board.h.ftl @@ -30,43 +30,43 @@ #define _BOARD_H_ /* - * Setup for ${doc1.board.@name[0]} board. + * Setup for ${doc1.board.board_name[0]} board. */ /* * Board identifier. */ -#define BOARD_${doc1.board.@BoardID[0]} -#define BOARD_NAME "${doc1.board.@name[0]}" +#define BOARD_${doc1.board.board_id[0]} +#define BOARD_NAME "${doc1.board.board_name[0]}" -[#if doc1.board.@BoardPHYID[0]??] +[#if doc1.board.ethernet_phy[0]??] /* * Ethernet PHY type. */ -#define BOARD_PHY_ID ${doc1.board.@BoardPHYID[0]} -[#if doc1.board.@BoardPHYType[0]?string == "RMII"] +#define BOARD_PHY_ID ${doc1.board.ethernet_phy.identifier[0]} +[#if doc1.board.ethernet_phy.type[0]?string == "RMII"] #define BOARD_PHY_RMII [/#if] [/#if] /* * Board oscillators-related settings. -[#if doc1.board.@LSEFrequency[0]?number == 0] +[#if doc1.board.clocks.@LSEFrequency[0]?number == 0] * NOTE: LSE not fitted. [/#if] -[#if doc1.board.@HSEFrequency[0]?number == 0] +[#if doc1.board.clocks.@HSEFrequency[0]?number == 0] * NOTE: HSE not fitted. [/#if] */ #if !defined(STM32_LSECLK) -#define STM32_LSECLK ${doc1.board.@LSEFrequency[0]} +#define STM32_LSECLK ${doc1.board.clocks.@LSEFrequency[0]} #endif #if !defined(STM32_HSECLK) -#define STM32_HSECLK ${doc1.board.@HSEFrequency[0]} +#define STM32_HSECLK ${doc1.board.clocks.@HSEFrequency[0]} #endif -[#if doc1.board.@HSEBypass[0]?string == "true"] +[#if doc1.board.clocks.@HSEBypass[0]?string == "true"] #define STM32_HSE_BYPASS [/#if] @@ -74,7 +74,7 @@ * Board voltages. * Required for performance limits calculation. */ -#define STM32_VDD ${doc1.board.@VDD[0]} +#define STM32_VDD ${doc1.board.clocks.@VDD[0]} /* * MCU type as defined in the ST header file stm32f4xx.h. diff --git a/tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl b/tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl index 34804dd67..c88471ac3 100644 --- a/tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl +++ b/tools/gencfg/processors/boards/stm32f4xx/templates/board.mk.ftl @@ -22,7 +22,7 @@ [#import "/@lib/libutils.ftl" as utils /] [@pp.changeOutputFile name="board.mk" /] # List of all the board related files. -BOARDSRC = ${'$'}{CHIBIOS}/boards/${doc1.board.@BoardID[0]}/board.c +BOARDSRC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]}/board.c # Required include directories -BOARDINC = ${'$'}{CHIBIOS}/boards/${doc1.board.@BoardID[0]} +BOARDINC = ${'$'}{CHIBIOS}/boards/${doc1.board.board_id[0]} diff --git a/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.c.ftl b/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.c.ftl index cd8b17a01..eeea09d99 100644 --- a/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.c.ftl +++ b/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.c.ftl @@ -23,7 +23,7 @@ [#import "/@lib/liblicense.ftl" as license /] [#import "/@lib/libcode.ftl" as code /] [#import "/@lib/libstm32f4xx.ftl" as stm32f4xx /] -[#assign fname = doc1.configuration.@name[0] /] +[#assign fname = doc1.configuration.name[0] /] [@pp.changeOutputFile name = fname + ".c" /] /* [@license.EmitLicenseAsText /] diff --git a/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.h.ftl b/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.h.ftl index 050b2f84d..47ea70f7c 100644 --- a/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.h.ftl +++ b/tools/gencfg/processors/hal/stm32f4xx/templates/hal_cfg.h.ftl @@ -23,7 +23,7 @@ [#import "/@lib/liblicense.ftl" as license /] [#import "/@lib/libcode.ftl" as code /] [#import "/@lib/libstm32f4xx.ftl" as stm32f4xx /] -[#assign fname = doc1.configuration.@name[0] /] +[#assign fname = doc1.configuration.name[0] /] [@pp.changeOutputFile name = fname + ".h" /] /* [@license.EmitLicenseAsText /] diff --git a/tools/gencfg/schema/boards/abstract_board.xsd b/tools/gencfg/schema/boards/abstract_board.xsd index b3a854307..1a2c38bf2 100644 --- a/tools/gencfg/schema/boards/abstract_board.xsd +++ b/tools/gencfg/schema/boards/abstract_board.xsd @@ -5,45 +5,48 @@ - - - - - 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 index 0b3622e6f..ace3b5acb 100644 --- a/tools/gencfg/schema/boards/stm32f4xx_board.xsd +++ b/tools/gencfg/schema/boards/stm32f4xx_board.xsd @@ -10,61 +10,53 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - HSE frequency or zero if not present. - - - - - - - - - - - - LSE frequency or zero if not present. - - - - - - - - + + - - - STM32F4xx VDD. - - - - - - - - - @@ -93,4 +85,5 @@ + diff --git a/tools/gencfg/schema/common/doc.xsd b/tools/gencfg/schema/common/doc.xsd index b7395605b..e5be361d5 100644 --- a/tools/gencfg/schema/common/doc.xsd +++ b/tools/gencfg/schema/common/doc.xsd @@ -4,33 +4,26 @@ - >Generic item with optional name and brief + + >Generic item with optional name and brief description - - - Object name. - - - - - - - - - - Object brief description, 72 chars max in a - single line. - - - - - - - - - + + + + Name of the object. + + + + + + + + + + + @@ -41,15 +34,73 @@ - - + + + + + Brief description of the object. + + + + + + + + + + + + + + Object documentation as text, does not preserve + formatting. + + + + + + + + + - Object documentation as text, does not - preserve formatting. + + Object pre-requisites as text, does not preserve + formatting. + + + + + + - + + + + Object post-requisites as text, does not preserve + formatting. + + + + + + + + + + + + Object note as text, does not preserve formatting. + + + + + + + + + diff --git a/tools/gencfg/schema/hal/abstract_adc_cfg.xsd b/tools/gencfg/schema/hal/abstract_adc_cfg.xsd index 4a2901c4e..52a6c9096 100644 --- a/tools/gencfg/schema/hal/abstract_adc_cfg.xsd +++ b/tools/gencfg/schema/hal/abstract_adc_cfg.xsd @@ -7,29 +7,37 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -37,7 +45,7 @@ - + diff --git a/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd b/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd index c038263c2..331933109 100644 --- a/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd +++ b/tools/gencfg/schema/hal/stm32f4xx/stm32f4xx_adc_cfg.xsd @@ -20,34 +20,103 @@ - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -61,8 +130,7 @@ - + @@ -76,8 +144,7 @@ - + @@ -91,8 +158,7 @@ - + @@ -106,8 +172,7 @@ - + @@ -121,8 +186,7 @@ - + @@ -136,8 +200,7 @@ - + @@ -151,8 +214,7 @@ - + @@ -166,8 +228,7 @@ - + @@ -181,8 +242,7 @@ - + @@ -196,8 +256,7 @@ - + @@ -211,8 +270,7 @@ - + @@ -226,8 +284,7 @@ - + @@ -241,8 +298,7 @@ - + @@ -256,8 +312,7 @@ - + @@ -271,8 +326,7 @@ - + @@ -286,8 +340,7 @@ - + @@ -316,8 +369,7 @@ - + @@ -368,68 +420,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/tools/gencfg/xml/stm32f4board.xml b/tools/gencfg/xml/stm32f4board.xml index ae76505c5..dffa016c7 100644 --- a/tools/gencfg/xml/stm32f4board.xml +++ b/tools/gencfg/xml/stm32f4board.xml @@ -2,1185 +2,319 @@ - + xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/boards/stm32f4xx_board.xsd"> + -----human readable blard name----- + BOARD_IDENTIFIER + + MII_KS8721_ID + RMII + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + diff --git a/tools/gencfg/xml/stm32f4xx_cfg.xml b/tools/gencfg/xml/stm32f4xx_cfg.xml index a0ed7fbb6..896cc2614 100644 --- a/tools/gencfg/xml/stm32f4xx_cfg.xml +++ b/tools/gencfg/xml/stm32f4xx_cfg.xml @@ -1,18 +1,25 @@ -
Application HAL configurations.
+ xsi:noNamespaceSchemaLocation="http://www.chibios.org/xml/schema/hal/stm32f4xx/stm32f4xx_cfg.xsd"> + hal_configs + Application HAL-related settings. - + + adccfg1 + Example ADC configuration. - + + adcgrpcfg1 + Example ADC conversion group configuration. + true + conv_callback + error_callback + 0 Samples are Right Aligned + 0 12 bits + 0 Software + 0 Timer 1 CC1 event + 2 Two discontinous conversions ADC_SAMPLE_3 ADC_SAMPLE_3 @@ -36,8 +43,10 @@ ADC_CHANNEL_IN0 + ADC_CHANNEL_IN8 - + +
-- cgit v1.2.3