Keil 的Configuration Wizard的编写

来源:互联网 发布:德阳数控铣床编程培训 编辑:程序博客网 时间:2024/05/22 15:37

Configuration Wizard   

       Configuration Wizard 是一个集成的编辑器实用工具,在使用汇编语言、C/C++语言或者是初始化文件时用于生成GUI配置控制。利用Configuration Wizard Annotations用源码中产生控制。一个Configuration Wizard部分必须首先是100行的代码并且以下面这行注释开始:

// <<< Use Configuration Wizard in Context Menu >>>

   Configuration Wizard 部分的末尾有以下可选的注释:

// <<< end of configuration section >>>

这张图是下面源码示例的结果图

注:

      1、option 是设备的特性,它可以以树状结构呈现,每一个条目可以有一个条目工具解释。

      2、value 设置属性值。可以通过预来封装数据在下拉菜单中。

单击Configuration Wizard标签页并通过图形界面设置设备选项。单击Text Editor来查看和改变源代码。

例子:

     下面的例子代码生成了上面Conguration Wizard所呈现出的效果。

//*** <<< Use Configuration Wizard in Context Menu >>> ***FUNC void Setup (void) {// <h> External Bus Interface (EBI)//   <e1.13> Enable Chip Select 0 (CSR0)//     <o1.20..31> BA: Base Address <0x0-0xFFF00000:0x100000><#/0x100000>//                 <i> Start Address for Chip Select Signal//     <o1.7..8>   PAGES: Page Size      <0=> 1M Byte    <1=> 4M Bytes//                                       <2=> 16M Bytes  <3=> 64M Bytes//                 <i> Selects Active Bits in Base Address//     <o1.0..1>   DBW: Data Bus Width   <1=> 16-bit     <2=> 8-bit//     <o1.12>     BAT: Byte Access Type <0=> Byte-write//                                       <1=> Byte-select//     <e1.5>      WSE: Enable Wait State Generation//       <o1.2..4>   NWS: Number of Standard Wait States <1-8><#-1>//     </e>//     <o1.9..11>  TDF: Data Float Output Time <0-7>//                 <i> Number of Cycles Added after the Transfer//   </e>  _WDWORD(0xFFE00000, 0x010024A9);   // EBI_CSR0: Flash//   <e1.13> Enable Chip Select 1 (CSR1)//     <o1.20..31> BA: Base Address <0x0-0xFFF00000:0x100000><#/0x100000>//                 <i> Start Address for Chip Select Signal//     <o1.7..8>   PAGES: Page Size      <0=> 1M Byte    <1=> 4M Bytes//                                       <2=> 16M Bytes  <3=> 64M Bytes//                 <i> Selects Active Bits in Base Address//     <o1.0..1>   DBW: Data Bus Width   <1=> 16-bit     <2=> 8-bit//     <o1.12>     BAT: Byte Access Type <0=> Byte-write//                                       <1=> Byte-select//     <e1.5>      WSE: Enable Wait State Generation//       <o1.2..4>   NWS: Number of Standard Wait States <1-8><#-1>//     </e>//     <o1.9..11>  TDF: Data Float Output Time <0-7>//                 <i> Number of Cycles Added after the Transfer//   </e>  _WDWORD(0xFFE00004, 0x040034A5);   // EBI_CSR1: RAM//   <q1.4>        DRP: Data Read Protocol//                      <0=> Standard Read//                      <1=> Early Read  _WDWORD(0xFFE00024, 0x00000010);   // EBI_MCR:  Data Read Protocol  _WDWORD(0xFFE00020, 0x00000001);   // EBI_RCR:  Remap Command// </h>// <o> Program Entry Point  PC = 0x04000000;}// <s> Change ID// <s1.30> Change Password String#define ID  "My User ID"char pw[] = "My Password";//*** <<< end of configuration section >>>    ***

Configuration Wizard Annotations

    Configuration Wizard Annotations是条目和注释符,用来创建GUI的元素。注释和在代码中写注释一样。


     默认情况下:下一个数或者紧跟注解的字符串是要被修改的。以§ 标注的条目可以紧跟一个跳跃值(skip Value),一个跳跃值跳过一些条目,这个例子修改紧跟注释的第二个数字。

       条目注释可以紧跟文本。

       条目和注释符中的空白字符都将被忽略。

       在前面的描述中使用数据手册中的符号名是一个好习惯。

 下表列出了配置向导的注释符:



翻译自keil help 的Configuration Wizard 。

0 0
原创粉丝点击