本帖最后由 Simon21ic 于 2010-1-4 19:55 编辑
这个界面不用增加任何代码,以前为AVR的熔丝位做的配置界面,完全根据配置数据,自动生成。对于STM8,只是在xml配置文件中,增加了对熔丝位的配置,然后一切就自动发生了。。。。。。当然,修改还是做了一小点,就是使用了64位变量代替以前用的32位,因为STM8的熔丝位数据比较多而已。
XML中的配置数据:
<fuse init="0x0000000000000000" bytesize="8">
<setting name="ROP" mask="0x00000000000000FF" info="Read-out protection" checked="0xAA" unchecked="0" />
<setting name="UBC" mask="0x000000000000FF00" info="User boot code" radix="16" shift="8" bytelen="1"/>
<setting name="AFR" mask="0x0000000000FF0000" info="Alternate function remapping" radix="16" shift="16" bytelen="1"/>
<setting name="WWDG_HALT" mask="0x0000000001000000" info="Window watchdog reset on halt" unchecked="0" />
<setting name="WWDG_HW" mask="0x0000000002000000" info="Window watchdog activation" unchecked="0" />
<setting name="IWDG_HW" mask="0x0000000004000000" info="Independent watchdog" unchecked="0" />
<setting name="LIS_EN" mask="0x0000000008000000" info="Low speed internal clock enable" unchecked="0" />
<setting name="PRSC" mask="0x0000000300000000" info="AWU clock prescaler">
<choice value="0x0000000300000000" text="4 Mhz to 128 kHz prescaler" />
<choice value="0x0000000200000000" text="8 Mhz to 128 kHz prescaler" />
<choice value="0x0000000100000000" text="16 Mhz to 128 kHz prescaler" />
<choice value="0x0000000000000000" text="24 Mhz to 128 kHz prescaler" />
</setting>
<setting name="CKAWUSEL" mask="0x0000000400000000" info="Auto wakeup unit/clock">
<choice value="0x0000000400000000" text="HSE clock with prescaler selected as clock source for AWU" />
<choice value="0x0000000000000000" text="LSI clock source selected for AWU" />
</setting>
<setting name="EXTCLK" mask="0x0000000800000000" info="External clock selection">
<choice value="0x0000000800000000" text="External clock signal on OSCIN" />
<choice value="0x0000000000000000" text="External crystal connected to OSCIN/OSCOUT" />
</setting>
<setting name="HSECNT" mask="0x0000FF0000000000" info="HSE crystal oscillator stabilization time" radix="16" shift="40" bytelen="1" />
<setting name="WAITSTATE" mask="0x0001000000000000" info="Wait state configuration" unchecked="0" />
<setting name="BL" mask="0xFF00000000000000" info="Bootloader option byte" radix="16" shift="56" bytelen="1"/>
<setting name="ALL" mask="0xFFFFFFFFFFFFFFFF" info="Option bytes" radix="16" shift="0" bytelen="8" />
</fuse> |