From 013ee5e609034f894563c5e44a8385535cb2206e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 4 Apr 2020 08:01:46 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13512 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- tools/ftl/libs/code_snippets.xml | 50 + tools/ftl/libs/libcode.ftl | 317 ++++ tools/ftl/libs/liblicense.ftl | 27 +- tools/ftl/libs/libsnippets.ftl | 34 + tools/ftl/libs/libstm32f4xx.ftl | 145 ++ tools/ftl/libs/libutils.ftl | 25 +- tools/ftl/schema/boards/abstract_board.xsd | 121 ++ tools/ftl/schema/boards/stm32f0xx_board.xsd | 160 ++ tools/ftl/schema/boards/stm32f3xx_board.xsd | 140 ++ tools/ftl/schema/boards/stm32f4xx_board.xsd | 136 ++ tools/ftl/schema/boards/stm32f7xx_board.xsd | 173 ++ tools/ftl/schema/boards/stm32g0xx_board.xsd | 129 ++ tools/ftl/schema/boards/stm32g4xx_board.xsd | 128 ++ tools/ftl/schema/boards/stm32h7xx_board.xsd | 170 ++ tools/ftl/schema/boards/stm32l0xx_board.xsd | 141 ++ tools/ftl/schema/boards/stm32l1xx_board.xsd | 140 ++ tools/ftl/schema/boards/stm32l4xx_board.xsd | 142 ++ tools/ftl/schema/boards/stm32l5xx_board.xsd | 125 ++ tools/ftl/schema/common/code_snippets.xsd | 59 + tools/ftl/schema/common/config_settings.xsd | 75 + tools/ftl/schema/common/doc.xsd | 108 ++ .../schema/common/stm32/stm32_gpiov2_port.xsd | 214 +++ .../schema/common/stm32/stm32_gpiov3_port.xsd | 217 +++ tools/ftl/xml/stm32f0board.xml | 803 +++++++++ tools/ftl/xml/stm32f3board.xml | 1059 ++++++++++++ tools/ftl/xml/stm32f4board.xml | 1457 ++++++++++++++++ tools/ftl/xml/stm32f7board.xml | 1458 +++++++++++++++++ tools/ftl/xml/stm32g0board.xml | 673 ++++++++ tools/ftl/xml/stm32g4board.xml | 929 +++++++++++ tools/ftl/xml/stm32h7board.xml | 1458 +++++++++++++++++ tools/ftl/xml/stm32l0board.xml | 673 ++++++++ tools/ftl/xml/stm32l1board.xml | 1062 ++++++++++++ tools/ftl/xml/stm32l4board.xml | 1319 +++++++++++++++ tools/ftl/xml/stm32l5board.xml | 1319 +++++++++++++++ 34 files changed, 15165 insertions(+), 21 deletions(-) create mode 100644 tools/ftl/libs/code_snippets.xml create mode 100644 tools/ftl/libs/libcode.ftl create mode 100644 tools/ftl/libs/libsnippets.ftl create mode 100644 tools/ftl/libs/libstm32f4xx.ftl create mode 100644 tools/ftl/schema/boards/abstract_board.xsd create mode 100644 tools/ftl/schema/boards/stm32f0xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32f3xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32f4xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32f7xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32g0xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32g4xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32h7xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32l0xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32l1xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32l4xx_board.xsd create mode 100644 tools/ftl/schema/boards/stm32l5xx_board.xsd create mode 100644 tools/ftl/schema/common/code_snippets.xsd create mode 100644 tools/ftl/schema/common/config_settings.xsd create mode 100644 tools/ftl/schema/common/doc.xsd create mode 100644 tools/ftl/schema/common/stm32/stm32_gpiov2_port.xsd create mode 100644 tools/ftl/schema/common/stm32/stm32_gpiov3_port.xsd create mode 100644 tools/ftl/xml/stm32f0board.xml create mode 100644 tools/ftl/xml/stm32f3board.xml create mode 100644 tools/ftl/xml/stm32f4board.xml create mode 100644 tools/ftl/xml/stm32f7board.xml create mode 100644 tools/ftl/xml/stm32g0board.xml create mode 100644 tools/ftl/xml/stm32g4board.xml create mode 100644 tools/ftl/xml/stm32h7board.xml create mode 100644 tools/ftl/xml/stm32l0board.xml create mode 100644 tools/ftl/xml/stm32l1board.xml create mode 100644 tools/ftl/xml/stm32l4board.xml create mode 100644 tools/ftl/xml/stm32l5board.xml diff --git a/tools/ftl/libs/code_snippets.xml b/tools/ftl/libs/code_snippets.xml new file mode 100644 index 000000000..2d0e5959a --- /dev/null +++ b/tools/ftl/libs/code_snippets.xml @@ -0,0 +1,50 @@ + + + + + + thread_body + Empty + + + + + thread_body + Checks for Termination + + + + + thread_body + Message Server + + + + + diff --git a/tools/ftl/libs/libcode.ftl b/tools/ftl/libs/libcode.ftl new file mode 100644 index 000000000..83fedcf20 --- /dev/null +++ b/tools/ftl/libs/libcode.ftl @@ -0,0 +1,317 @@ +[#ftl] +[#-- + ChibiOS - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013,2014,2015,2016,2017,2018, + 2019,2020 Giovanni Di Sirio. + + This file is part of ChibiOS. + + ChibiOS 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 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 . + --] + +<#-- + -- Coding style global settings. + --> +[#assign indentation = " " /] +[#assign fields_align = 24 /] +[#assign define_value_align = 36 /] +[#assign comments_align = 48 /] +[#assign boundary = 80 /] + +[#-- + -- This macro generates a brief description in DoxyGen format. + --] +[#macro EmitDoxygenBrief object=[]] + [#if object.brief[0]??] +[@utils.FormatStringAsText " * @brief " + " * " + utils.WithDot(object.brief[0]?cap_first) + boundary /] + [/#if] +[/#macro] + +[#-- + -- This macro generates a detailed description in DoxyGen format. + --] +[#macro EmitDoxygenDetails object=[]] + [#if object.details[0]??] +[@utils.FormatStringAsText " * @details " + " * " + utils.WithDot(object.details[0]?cap_first) + boundary /] + [/#if] +[/#macro] + +[#-- + -- This macro generates a notes list in DoxyGen format. + --] +[#macro EmitDoxygenNotes object=[]] + [#list object.* as note] + [#if note?node_name == "note"] + [@utils.FormatStringAsText " * @note " + " * " + utils.WithDot(note[0]?cap_first) + boundary /] + [/#if] + [/#list] +[/#macro] + +[#-- + -- This macro generates a pre-requisites list in DoxyGen format. + --] +[#macro EmitDoxygenPrerequisites object=[]] + [#list object.* as pre] + [#if pre?node_name == "pre"] + [@utils.FormatStringAsText " * @pre " + " * " + utils.WithDot(pre[0]?cap_first) + boundary /] + [/#if] + [/#list] +[/#macro] + +[#-- + -- This macro generates a post-requisites list in DoxyGen format. + --] +[#macro EmitDoxygenPostrequisites object=[]] + [#list object.* as post] + [#if post?node_name == "post"] + [@utils.FormatStringAsText " * @post " + " * " + utils.WithDot(post[0]?cap_first) + boundary /] + [/#if] + [/#list] +[/#macro] + +[#-- + -- This macro generates a complete Doxygen documentation comment. + --] +[#macro EmitDoxygenDocumentationComment object=[]] +/** + [@code.EmitDoxygenBrief object /] + [@code.EmitDoxygenDetails object /] + [@code.EmitDoxygenPrerequisites object /] + [@code.EmitDoxygenPostrequisites object /] + [@code.EmitDoxygenNotes object /] + */ +[/#macro] + +[#-- + -- This macro generates the parameters description in DoxyGen format. + --] +[#macro EmitDoxygenParams params=[]] + [#list params as param] + [#local name = (param.@name[0]!"no-name")?trim /] + [#local brief = (param.@brief[0]!"")?trim /] + [#local dir = (param.@dir[0]!"boh")?trim?lower_case /] + [#if dir == "in"] +[@utils.FormatStringAsText " * @param[in] " + " * " + utils.IntelligentDot(name + " " + brief?uncap_first) + boundary /] + [#elseif dir == "out"] +[@utils.FormatStringAsText " * @param[out] " + " * " + utils.IntelligentDot(name + " " + brief?uncap_first) + boundary /] + [#elseif dir == "both"] +[@utils.FormatStringAsText " * @param[in,out] " + " * " + utils.IntelligentDot(name + " " + brief?uncap_first) + boundary /] + [#elseif dir == "boh"] +[@utils.FormatStringAsText " * @param " + " * " + utils.IntelligentDot(name + " " + brief?uncap_first) + boundary /] + [/#if] + [/#list] +[/#macro] + +[#-- + -- This macro generates a return description followed by a retval list + -- in DoxyGen format. + --] +[#macro EmitDoxygenReturn return=[]] + [#if return[0]?? && ((return[0].@type[0]!"void")?trim != "void")] + [#local brief = (return[0].@brief[0]!"")?trim /] + [#if brief != ""] +[@utils.FormatStringAsText " * @return " + " * " + utils.WithDot(brief?cap_first) + boundary /] + [/#if] + [#list return[0].value as value] + [#local label = (value.@name[0]!"no-val")?trim /] + [#local brief = (value.@brief[0]!"")?trim /] +[@utils.FormatStringAsText " * @retval " + " * " + utils.WithDot(label + " " + brief?uncap_first) + boundary /] + [/#list] + [/#if] +[/#macro] + +[#-- + -- This macro generates the inner function code (if present). + --] +[#macro EmitCode code=[]] + [#if function.code[0]?? && (function.code[0]?trim != "")] +${indentation}${function.code[0]?trim} + [/#if] +[/#macro] + +[#-- + -- Returns true if the module exports some functions. + --] +[#function HasPublicFunctions module=[]] + [#local flag = false /] + [#list module.function as function] + [#if (function.@visibility[0]!"private") == "public"] + [#local flag = true /] + [/#if] + [/#list] + [#return flag /] +[/#function] + +[#-- + -- Returns true if the module has static functions. + --] +[#function HasPrivateFunctions module=[]] + [#local flag = false /] + [#list module.function as function] + [#if (function.@visibility[0]!"private") == "private"] + [#local flag = true /] + [/#if] + [/#list] + [#return flag /] +[/#function] + +[#-- + -- This macro generates a function prototype from an XML "function" + -- node passed as parameter. + -- @note Does not generate the final EOL. + --] +[#macro GeneratePrototype function={}] + [#if function.return?? && function.return[0]??] + [#local rettype = (function.return[0].@type[0]!"void")?trim /] + [#else] + [#local rettype = "void" /] + [/#if] + [#local name = (function.@name[0]!"no-name")?trim /] + [#local visibility = (function.@visibility[0]!"private")?trim /] + [#if function.param?? && function.param[0]??] + [#-- If the function has parameters then generates the parameters list --] + [#local l1 = rettype + " " + name + "(" /] + [#if visibility == "private"] + [#local l1 = "static " + l1 /] + [/#if] + [#local ln = ""?right_pad(l1?length) /] + [#list function.param as param] + [#local type = (param.@type[0]!"no-type")?trim /] + [#if type?contains("$")] + [#local pstring = type?replace("$", (param.@name[0]!"no-name")?trim) /] + [#else] + [#local pstring = type + " " + (param.@name[0]!"no-name")?trim /] + [/#if] + [#local dir = (param.@dir[0]!"boh")?trim?lower_case /] + [#if dir == "in"] + [#local pstring = "const " + pstring /] + [/#if] + [#if param_index == 0] + [#local line = l1 + pstring /] + [#else] + [#if (line + ", " + pstring + " ")?length > boundary] +${line + ","} + [#local line = ln + pstring /] + [#else] + [#local line = line + ", " + pstring /] + [/#if] + [/#if] + [/#list] +${line + ")"}[#rt] + [#else] +${rettype + " " + name}(void)[#rt] + [/#if] +[/#macro] + +[#-- + -- This macro generates a function (and its Doxygen documentation) + -- from an XML "function" node passed as parameter. + --] +[#macro GenerateFunction function={}] +/** +[@EmitDoxygenBrief function.@brief /] +[@EmitDoxygenDetails function.details /] +[@EmitDoxygenParams function.param /] +[@EmitDoxygenReturn function.return /] + * + * @note --Implementer notes here (or remove the tag)-- + * @bug --Known problems please here (or remove the tag)-- + * @todo --Implement this function (then remove the tag)-- + */ +[@GeneratePrototype function /] { + [#if function.code[0]??] + [#-- Makes sure to undef the do_code macro --] + [#assign inline = "[#ftl][#macro do_code function][/#macro]"?interpret /] +[@inline /] + [#-- Interprets the code within the code element --] + [#assign inline = function.code[0]?interpret /] +[@inline /] +[@do_code function /] + [#else] + +${indentation}/* ${function.@name[0]!"no-name"}() Implementation here! */ + [/#if] +} +[/#macro] + +[#-- + -- Generates the implementations for the private functions in the specified + -- module. + --] +[#macro GeneratePrivateFunctionsImplementations module] + [#list module.function as function] + [#if (function.@visibility[0]!"private") == "private"] +[@code.GenerateFunction function /] + + [/#if] + [/#list] +[/#macro] + +[#-- + -- Generates the prototypes of the public functions in the specified + -- module. + --] +[#macro GeneratePublicFunctionsPrototypes indentation module] + [#list module.function as function] + [#if (function.@visibility[0]!"private")?trim == "public"] +${indentation}[@code.GeneratePrototype function /]; + [/#if] + [/#list] +[/#macro] + +[#-- + -- Generates the implementations for the public functions in the specified + -- module. + --] +[#macro GeneratePublicFunctionsImplementations module] + [#list module.function as function] + [#if (function.@visibility[0]!"private") == "public"] +[@code.GenerateFunction function /] + + [/#if] + [/#list] +[/#macro] diff --git a/tools/ftl/libs/liblicense.ftl b/tools/ftl/libs/liblicense.ftl index 325c21032..3b87198a3 100644 --- a/tools/ftl/libs/liblicense.ftl +++ b/tools/ftl/libs/liblicense.ftl @@ -1,18 +1,23 @@ [#ftl] [#-- - ChibiOS/RT - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013,2014,2015,2016,2017,2018, + 2019,2020 Giovanni Di Sirio. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at + This file is part of ChibiOS. - http://www.apache.org/licenses/LICENSE-2.0 + ChibiOS 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. - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + ChibiOS 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 . --] [#-- @@ -20,7 +25,7 @@ -- The license text is indented by 4 spaces. --] [#macro EmitLicenseAsText] - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2020 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/tools/ftl/libs/libsnippets.ftl b/tools/ftl/libs/libsnippets.ftl new file mode 100644 index 000000000..1ce95b94b --- /dev/null +++ b/tools/ftl/libs/libsnippets.ftl @@ -0,0 +1,34 @@ +[#ftl] +[#-- + ChibiOS - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013,2014,2015,2016,2017,2018, + 2019,2020 Giovanni Di Sirio. + + This file is part of ChibiOS. + + ChibiOS 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 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 . + --] + +[#-- + -- Find and return a code template from the templates archive. + --] +[#function GetThreadCode name] + [#list doc_snippets.code.snippets.snippet as snippet] + [#if (snippet.type[0] == "thread_body") && + ((snippet.name[0]!"")?trim?lower_case == name?trim?lower_case)] + [#return snippet.text[0]!"" /] + [/#if] + [/#list] + [#return "/* Thread style not found: " + name + " */" /] +[/#function] diff --git a/tools/ftl/libs/libstm32f4xx.ftl b/tools/ftl/libs/libstm32f4xx.ftl new file mode 100644 index 000000000..16f0d002f --- /dev/null +++ b/tools/ftl/libs/libstm32f4xx.ftl @@ -0,0 +1,145 @@ +[#ftl] +[#-- + ChibiOS - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013,2014,2015,2016,2017,2018, + 2019,2020 Giovanni Di Sirio. + + This file is part of ChibiOS. + + ChibiOS 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 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 . + --] + +[#-- + -- Emits the STM32F4xx ADC driver constant configuration structures. + --] +[#macro EmitADCConfig config] + [#local cfg_name = config.name[0]?string /] + [@code.EmitDoxygenDocumentationComment config /] +const ADCConfig ${cfg_name} = {0}; + + [#list config.groups.group as group] + [#local grpcfg_name = group.name[0]?string /] + [@code.EmitDoxygenDocumentationComment group /] +const ADCGroupConfig ${grpcfg_name} = { + /* Circular conversion flag.*/ + ${group.circular[0]?string?upper_case}, + /* Number of channels sampled in the conversion group.*/ + ${group.channels_sequence.channel?size}, + /* End of conversion callback or NULL.*/ + [#if group.conv_callback[0]?string?trim == ""] + NULL, + [#else] + ${group.conv_callback[0]?string?trim}, + [/#if] + /* Error callback or NULL.*/ + [#if group.error_callback[0]?string?trim == ""] + NULL, + [#else] + ${group.error_callback[0]?string?trim}, + [/#if] + /* CR1 register initialization value.*/ + [#local resolution = group.resolution[0]?word_list[0]?number /] + [#local cr1 = "ADC_CR1_RESOLUTION_N(" + resolution?string + ")" /] + [#local disc = group.discontinuous[0]?word_list[0]?number /] + [#if disc > 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 cr2 = "ADC_CR1_EXTEN_N(" + exten?string + ")" /] + [#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] + [#local cr2 = cr2 + " | ADC_CR2_ALIGN" /] + [/#if] + ${cr2}, + /* Channels sample time settings.*/ + [#local smpr1 = "" /] + [#local smpr2 = "" /] + [#list group.sample_time.* as input] + [#local sinput = input?node_name] + [#if input_index < 9] + [#local smpr2 = smpr2 + "ADC_SMPR2_SMP_" + input?node_name + + "(" + input?string + ") | " /] + [#elseif input_index == 9] + [#local smpr2 = smpr2 + "ADC_SMPR2_SMP_" + input?node_name + + "(" + input?string + ")," /] + [#elseif input_index < 18] + [#local smpr1 = smpr1 + "ADC_SMPR1_SMP_" + input?node_name + + "(" + input?string + ") | " /] + [#else] + [#local smpr1 = smpr1 + "ADC_SMPR1_SMP_" + input?node_name + + "(" + input?string + ")," /] + [/#if] + [/#list] + [@utils.FormatStringAsText " " " " smpr1 80 /] + [@utils.FormatStringAsText " " " " smpr2 80 /] + /* Channels sequence.*/ + [#local sqr1 = "ADC_SQR1_NUM_CH(" + group.channels_sequence?size + ")" /] + [#local sqr2 = "" /] + [#local sqr3 = "" /] + [#list group.channels_sequence.channel as channel] + [#if channel_index <= 5] + [#local sqr3 = sqr3 + "ADC_SQR3_SQ" + (channel_index + 1) + + "_N(" + channel + ")" /] + [#if channel_has_next && channel_index < 5] + [#local sqr3 = sqr3 + " | " /] + [/#if] + [#elseif channel_index <= 11] + [#local sqr2 = sqr2 + "ADC_SQR2_SQ" + (channel_index + 1) + + "_N(" + channel + ")" /] + [#if channel_has_next && channel_index < 11] + [#local sqr2 = sqr2 + " | " /] + [/#if] + [#else] + [#local sqr1 = sqr1 + " | ADC_SQR2_SQ" + (channel_index + 1) + + "_N(" + channel + ")" /] + [/#if] + [/#list] + [#-- SQR2 could be empty.--] + [#if sqr2 == ""] + [#local sqr2 = "0" /] + [/#if] + [#local sqr1 = sqr1 + "," /] + [#local sqr2 = sqr2 + "," /] + [@utils.FormatStringAsText " " " " sqr1 80 /] + [@utils.FormatStringAsText " " " " sqr2 80 /] + [@utils.FormatStringAsText " " " " sqr3 80 /] +}; + [/#list] +[/#macro] + +[#-- + -- Emits the STM32F4xx ADC driver configuration external declarations. + --] +[#macro EmitADCConfigExtern config] + [#local cfg_name = config.name[0]?string /] + [#list config.groups.group as group] + [#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.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] + + [/#list] +[/#macro] diff --git a/tools/ftl/libs/libutils.ftl b/tools/ftl/libs/libutils.ftl index 21601fa64..513d1e389 100755 --- a/tools/ftl/libs/libutils.ftl +++ b/tools/ftl/libs/libutils.ftl @@ -1,18 +1,23 @@ [#ftl] [#-- - ChibiOS/RT - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006,2007,2008,2009,2010, + 2011,2012,2013,2014,2015,2016,2017,2018, + 2019,2020 Giovanni Di Sirio. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at + This file is part of ChibiOS. - http://www.apache.org/licenses/LICENSE-2.0 + ChibiOS 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. - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + ChibiOS 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 . --] [#-- diff --git a/tools/ftl/schema/boards/abstract_board.xsd b/tools/ftl/schema/boards/abstract_board.xsd new file mode 100644 index 000000000..ae74f6729 --- /dev/null +++ b/tools/ftl/schema/boards/abstract_board.xsd @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Kind of PHY for USB interfaces. + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32f0xx_board.xsd b/tools/ftl/schema/boards/stm32f0xx_board.xsd new file mode 100644 index 000000000..7f560adcc --- /dev/null +++ b/tools/ftl/schema/boards/stm32f0xx_board.xsd @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32f3xx_board.xsd b/tools/ftl/schema/boards/stm32f3xx_board.xsd new file mode 100644 index 000000000..f27e4e415 --- /dev/null +++ b/tools/ftl/schema/boards/stm32f3xx_board.xsd @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32f4xx_board.xsd b/tools/ftl/schema/boards/stm32f4xx_board.xsd new file mode 100644 index 000000000..ab9245e32 --- /dev/null +++ b/tools/ftl/schema/boards/stm32f4xx_board.xsd @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32f7xx_board.xsd b/tools/ftl/schema/boards/stm32f7xx_board.xsd new file mode 100644 index 000000000..59450bf98 --- /dev/null +++ b/tools/ftl/schema/boards/stm32f7xx_board.xsd @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32g0xx_board.xsd b/tools/ftl/schema/boards/stm32g0xx_board.xsd new file mode 100644 index 000000000..e605fb37c --- /dev/null +++ b/tools/ftl/schema/boards/stm32g0xx_board.xsd @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32g4xx_board.xsd b/tools/ftl/schema/boards/stm32g4xx_board.xsd new file mode 100644 index 000000000..e5cc50d6d --- /dev/null +++ b/tools/ftl/schema/boards/stm32g4xx_board.xsd @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32h7xx_board.xsd b/tools/ftl/schema/boards/stm32h7xx_board.xsd new file mode 100644 index 000000000..094e2944c --- /dev/null +++ b/tools/ftl/schema/boards/stm32h7xx_board.xsd @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32l0xx_board.xsd b/tools/ftl/schema/boards/stm32l0xx_board.xsd new file mode 100644 index 000000000..54d5bf35f --- /dev/null +++ b/tools/ftl/schema/boards/stm32l0xx_board.xsd @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32l1xx_board.xsd b/tools/ftl/schema/boards/stm32l1xx_board.xsd new file mode 100644 index 000000000..e3191cbdf --- /dev/null +++ b/tools/ftl/schema/boards/stm32l1xx_board.xsd @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32l4xx_board.xsd b/tools/ftl/schema/boards/stm32l4xx_board.xsd new file mode 100644 index 000000000..d542696f9 --- /dev/null +++ b/tools/ftl/schema/boards/stm32l4xx_board.xsd @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/boards/stm32l5xx_board.xsd b/tools/ftl/schema/boards/stm32l5xx_board.xsd new file mode 100644 index 000000000..ec3745c2e --- /dev/null +++ b/tools/ftl/schema/boards/stm32l5xx_board.xsd @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/common/code_snippets.xsd b/tools/ftl/schema/common/code_snippets.xsd new file mode 100644 index 000000000..ad0bad11a --- /dev/null +++ b/tools/ftl/schema/common/code_snippets.xsd @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/schema/common/config_settings.xsd b/tools/ftl/schema/common/config_settings.xsd new file mode 100644 index 000000000..15a5b3794 --- /dev/null +++ b/tools/ftl/schema/common/config_settings.xsd @@ -0,0 +1,75 @@ + + + + + + + + + Templates resources associated to the + configuration. + + + + + Path of template files inside the plugin. + + + + + + + + + + + + Output directory relative to the configuration + file. + + + + + Output files path relative to the .chcfg file. + + + + + + + + + + + Final path for board files, it is used for paths inside board.mk, if not present then the default path is used by templates. + + + + + + + + + + + + + + HAL version, generated files may change + depending on version. + + + + + + + + + + + + diff --git a/tools/ftl/schema/common/doc.xsd b/tools/ftl/schema/common/doc.xsd new file mode 100644 index 000000000..e5be361d5 --- /dev/null +++ b/tools/ftl/schema/common/doc.xsd @@ -0,0 +1,108 @@ + + + + + + + >Generic item with optional name and brief + description + + + + + + Name of the object. + + + + + + + + + + + + + + + + >Something that can have a detailed description + attached + + + + + + + + + Brief description of the object. + + + + + + + + + + + + + + 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/ftl/schema/common/stm32/stm32_gpiov2_port.xsd b/tools/ftl/schema/common/stm32/stm32_gpiov2_port.xsd new file mode 100644 index 000000000..5a2cf9f07 --- /dev/null +++ b/tools/ftl/schema/common/stm32/stm32_gpiov2_port.xsd @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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. + + + + + + + + + + + + + + Logic level for the ODR register. + + + + + + + + + + + + Pin speed as defined in SPEEDR register. + + + + + + + + + + + + + + + Pin type as defined in TYPER 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/ftl/schema/common/stm32/stm32_gpiov3_port.xsd b/tools/ftl/schema/common/stm32/stm32_gpiov3_port.xsd new file mode 100644 index 000000000..10a7e3608 --- /dev/null +++ b/tools/ftl/schema/common/stm32/stm32_gpiov3_port.xsd @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Object representing an STM32 pin for the GPIOv3 + peripheral. + + + + + + Pin identifier, used to generate a #define with the + pin name. + + + + + + + + + + + + + + + Pin mode, as defined for MODER register. + + + + + + + + + + + + + + + Logic level for the ODR register. + + + + + + + + + + + + + Pin speed as defined in SPEEDR register. + + + + + + + + + + + + + + + Pin type as defined in TYPER 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/ftl/xml/stm32f0board.xml b/tools/ftl/xml/stm32f0board.xml new file mode 100644 index 000000000..26a4b0505 --- /dev/null +++ b/tools/ftl/xml/stm32f0board.xml @@ -0,0 +1,803 @@ + + + + + resources/gencfg/processors/boards/stm32f0xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + STM32F051x8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32f3board.xml b/tools/ftl/xml/stm32f3board.xml new file mode 100644 index 000000000..16a33d654 --- /dev/null +++ b/tools/ftl/xml/stm32f3board.xml @@ -0,0 +1,1059 @@ + + + + + resources/gencfg/processors/boards/stm32f3xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + STM32F303xC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32f4board.xml b/tools/ftl/xml/stm32f4board.xml new file mode 100644 index 000000000..c68b45433 --- /dev/null +++ b/tools/ftl/xml/stm32f4board.xml @@ -0,0 +1,1457 @@ + + + + + resources/gencfg/processors/boards/stm32f4xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + + MII_KS8721_ID + RMII + + STM32F407xx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32f7board.xml b/tools/ftl/xml/stm32f7board.xml new file mode 100644 index 000000000..bf2dd9542 --- /dev/null +++ b/tools/ftl/xml/stm32f7board.xml @@ -0,0 +1,1458 @@ + + + + + resources/gencfg/processors/boards/stm32f7xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + + MII_KS8721_ID + RMII + + STM32F746xx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32g0board.xml b/tools/ftl/xml/stm32g0board.xml new file mode 100644 index 000000000..248b1ceb1 --- /dev/null +++ b/tools/ftl/xml/stm32g0board.xml @@ -0,0 +1,673 @@ + + + + + resources/gencfg/processors/boards/stm32g0xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + STM32G071xB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32g4board.xml b/tools/ftl/xml/stm32g4board.xml new file mode 100644 index 000000000..8d2298d9f --- /dev/null +++ b/tools/ftl/xml/stm32g4board.xml @@ -0,0 +1,929 @@ + + + + + resources/gencfg/processors/boards/stm32g4xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + STM32G474xx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32h7board.xml b/tools/ftl/xml/stm32h7board.xml new file mode 100644 index 000000000..5950f11cc --- /dev/null +++ b/tools/ftl/xml/stm32h7board.xml @@ -0,0 +1,1458 @@ + + + + + resources/gencfg/processors/boards/stm32h7xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + + MII_KS8721_ID + RMII + + STM32H743xx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32l0board.xml b/tools/ftl/xml/stm32l0board.xml new file mode 100644 index 000000000..0b5b16ea6 --- /dev/null +++ b/tools/ftl/xml/stm32l0board.xml @@ -0,0 +1,673 @@ + + + + + resources/gencfg/processors/boards/stm32l0xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + STM32L053xx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32l1board.xml b/tools/ftl/xml/stm32l1board.xml new file mode 100644 index 000000000..fc213a57b --- /dev/null +++ b/tools/ftl/xml/stm32l1board.xml @@ -0,0 +1,1062 @@ + + + + + resources/gencfg/processors/boards/stm32l1xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + STM32L151xB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32l4board.xml b/tools/ftl/xml/stm32l4board.xml new file mode 100644 index 000000000..e9fc33900 --- /dev/null +++ b/tools/ftl/xml/stm32l4board.xml @@ -0,0 +1,1319 @@ + + + + + resources/gencfg/processors/boards/stm32l4xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + + MII_KS8721_ID + RMII + + STM32L476xx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/ftl/xml/stm32l5board.xml b/tools/ftl/xml/stm32l5board.xml new file mode 100644 index 000000000..77019f53a --- /dev/null +++ b/tools/ftl/xml/stm32l5board.xml @@ -0,0 +1,1319 @@ + + + + + resources/gencfg/processors/boards/stm32l5xx/templates + . + 5.0.x + + -----human readable board name----- + BOARD_IDENTIFIER + + + MII_KS8721_ID + RMII + + STM32L552xx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +