diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-07-10 20:08:46 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-07-10 20:08:46 +0000 |
commit | dbfb5a1f70e69a3f412f2a69f528bf398633c10f (patch) | |
tree | 9df9a4e2de93b28fbc22956e6c902cd079cb1f47 /tools/gencfg/lib | |
parent | f9f6c4db2df5174acdbd79959ff6ea3e07fd0de6 (diff) | |
download | ChibiOS-dbfb5a1f70e69a3f412f2a69f528bf398633c10f.tar.gz ChibiOS-dbfb5a1f70e69a3f412f2a69f528bf398633c10f.tar.bz2 ChibiOS-dbfb5a1f70e69a3f412f2a69f528bf398633c10f.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4457 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'tools/gencfg/lib')
-rw-r--r-- | tools/gencfg/lib/libstm32f4xx.ftl | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/tools/gencfg/lib/libstm32f4xx.ftl b/tools/gencfg/lib/libstm32f4xx.ftl index 47b0659e3..9ede34c2c 100644 --- a/tools/gencfg/lib/libstm32f4xx.ftl +++ b/tools/gencfg/lib/libstm32f4xx.ftl @@ -20,14 +20,61 @@ --]
[#--
- -- Emits the ChibiOS/RT standard license exception text.
- -- The license exception text is indented by 4 spaces.
+ -- Emits the STM32F4xx ADC driver constant configuration structures.
--]
[#macro EmitADCConfig config]
[#local cfg_name = config.@name[0]?string /]
/**
-[@code.EmitDoxygenBrief config.@brief /]
-[@code.EmitDoxygenDetails config.details /]
+ [@code.EmitDoxygenBrief config.@brief /]
+ [@code.EmitDoxygenDetails config.details /]
*/
const ADCConfig ${cfg_name} = {0};
+
+ [#list config.groups.group as group]
+ [#local grpcfg_name = group.@name[0]?string /]
+/**
+ [@code.EmitDoxygenBrief group.@brief /]
+ [@code.EmitDoxygenDetails group.details /]
+ */
+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.@conversion_callback[0]?string?trim == ""]
+ NULL,
+ [#else]
+ ${group.@conversion_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]
+};
+ [/#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.@conversion_callback[0]?string?trim != ""]
+ void ${group.@conversion_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]
|