فهرست منبع

Merge pull request #8 from RT-Thread/master

sync
HubretXie 6 سال پیش
والد
کامیت
17f7f1c7ca
100فایلهای تغییر یافته به همراه5515 افزوده شده و 38967 حذف شده
  1. 6 4
      .travis.yml
  2. 1 0
      bsp/CME_M7/SConstruct
  3. 1 29
      bsp/CME_M7/project.uvproj
  4. 2 0
      bsp/allwinner_tina/Kconfig
  5. 1 0
      bsp/allwinner_tina/SConstruct
  6. 2 2
      bsp/allwinner_tina/link.lds
  7. 1 1
      bsp/amebaz/.config
  8. 6 1
      bsp/amebaz/Kconfig
  9. 1 0
      bsp/amebaz/SConstruct
  10. 2229 2434
      bsp/amebaz/project.ewp
  11. 10 10
      bsp/amebaz/project.eww
  12. 1 1
      bsp/amebaz/rtconfig.h
  13. 1 0
      bsp/apollo2/SConstruct
  14. 0 1224
      bsp/apollo2/project.uvoptx
  15. 314 210
      bsp/apollo2/project.uvprojx
  16. 5 1
      bsp/asm9260t/Kconfig
  17. 1 0
      bsp/asm9260t/SConstruct
  18. 2277 2264
      bsp/asm9260t/project.ewp
  19. 10 10
      bsp/asm9260t/project.eww
  20. 150 150
      bsp/asm9260t/project.uvproj
  21. 1 1
      bsp/at91sam9260/.config
  22. 6 0
      bsp/at91sam9260/Kconfig
  23. 1 0
      bsp/at91sam9260/SConstruct
  24. 1 1
      bsp/at91sam9260/rtconfig.h
  25. 1 1
      bsp/at91sam9g45/.config
  26. 1 0
      bsp/at91sam9g45/SConstruct
  27. 1 1
      bsp/at91sam9g45/rtconfig.h
  28. 1 0
      bsp/avr32uc3b0/SConstruct
  29. 1 1
      bsp/beaglebone/.config
  30. 6 0
      bsp/beaglebone/Kconfig
  31. 1 0
      bsp/beaglebone/SConstruct
  32. 2 2
      bsp/beaglebone/beaglebone_ram.lds
  33. 1 1
      bsp/beaglebone/rtconfig.h
  34. 6 0
      bsp/ck802/Kconfig
  35. 1 0
      bsp/ck802/SConstruct
  36. 1 1
      bsp/dm365/.config
  37. 6 0
      bsp/dm365/Kconfig
  38. 1 0
      bsp/dm365/SConstruct
  39. 1 1
      bsp/dm365/rtconfig.h
  40. 1 0
      bsp/efm32/SConstruct
  41. 0 74
      bsp/es32f0334/drivers/drv_pm.c
  42. BIN
      bsp/es32f0334/libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf
  43. 0 793
      bsp/es32f0334/libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.rtf
  44. 0 11
      bsp/es32f0334/libraries/CMSIS/Include/SConscript
  45. 0 14
      bsp/es32f0334/libraries/CMSIS/index.html
  46. BIN
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/EASTSOFT_ES32F033x_ALD.chm
  47. 0 356
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_acmp.h
  48. 0 557
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_adc.h
  49. 0 184
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_bkpc.h
  50. 0 615
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_cmu.h
  51. 0 191
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_crc.h
  52. 0 255
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_crypt.h
  53. 0 156
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_dbgc.h
  54. 0 377
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_dma.h
  55. 0 277
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_gpio.h
  56. 0 513
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_i2c.h
  57. 0 496
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_lcd.h
  58. 0 358
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_lptim.h
  59. 0 468
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_lpuart.h
  60. 0 614
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_pis.h
  61. 0 275
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_pmu.h
  62. 0 261
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_rmu.h
  63. 0 669
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_rtc.h
  64. 0 274
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_smartcard.h
  65. 0 362
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_spi.h
  66. 0 199
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_temp.h
  67. 0 1086
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_timer.h
  68. 0 176
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_trng.h
  69. 0 461
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_uart.h
  70. 0 561
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_usart.h
  71. 0 326
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_acmp.c
  72. 0 1291
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_adc.c
  73. 0 1065
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_cmu.c
  74. 0 342
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_crc.c
  75. 0 999
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_crypt.c
  76. 0 734
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_dma.c
  77. 0 508
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_flash.c
  78. 0 3136
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_i2c.c
  79. 0 345
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_lcd.c
  80. 0 675
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_lptim.c
  81. 0 1192
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_lpuart.c
  82. 0 317
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_pis.c
  83. 0 283
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_pmu.c
  84. 0 143
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_rmu.c
  85. 0 1193
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_rtc.c
  86. 0 1740
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_spi.c
  87. 0 209
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_temp.c
  88. 0 3709
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_timer.c
  89. 0 220
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_trng.c
  90. 0 1182
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_uart.c
  91. 0 2347
      bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_usart.c
  92. 1 1
      bsp/es32f0654/.config
  93. 2 0
      bsp/es32f0654/Kconfig
  94. 1 0
      bsp/es32f0654/SConstruct
  95. 1 22
      bsp/es32f0654/project.uvprojx
  96. 1 1
      bsp/es32f0654/rtconfig.h
  97. 445 0
      bsp/essemi/es32f0334/.config
  98. 4 3
      bsp/essemi/es32f0334/Kconfig
  99. 0 0
      bsp/essemi/es32f0334/README.md
  100. 0 0
      bsp/essemi/es32f0334/SConscript

+ 6 - 4
.travis.yml

@@ -7,12 +7,12 @@ before_script:
 # travis has changed to 64-bit and we require 32-bit compatibility libraries
   - sudo apt-get update
   # clang
-  - "sudo apt-get -qq install gcc-multilib libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 libsdl-dev || true"
+  - "sudo apt-get -qq install gcc-multilib libc6:i386 libgcc1:i386 libstdc++5:i386 libstdc++6:i386 libsdl-dev scons || true"
   # - sudo apt-get -qq install gcc-arm-none-eabi
   # - "[ $RTT_TOOL_CHAIN = 'sourcery-arm' ] && export RTT_EXEC_PATH=/usr/bin && arm-none-eabi-gcc --version || true"
   # - "[ $RTT_TOOL_CHAIN = 'sourcery-arm' ] && curl -s https://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-2014.05-28-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 | sudo tar xjf - -C /opt && export RTT_EXEC_PATH=/opt/arm-2014.05/bin && /opt/arm-2014.05/bin/arm-none-eabi-gcc --version || true"
   - "[ $RTT_TOOL_CHAIN = 'sourcery-arm' ] && wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/arm-2017q2-v6/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 && sudo tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -C /opt && export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-6-2017-q2-update/bin && /opt/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc --version || true"
-  - "[ $RTT_TOOL_CHAIN = 'sourcery-mips' ] && curl -s https://sourcery.mentor.com/public/gnu_toolchain/mips-sde-elf/mips-2016.05-7-mips-sde-elf-i686-pc-linux-gnu.tar.bz2 | sudo tar xjf - -C /opt && export RTT_EXEC_PATH=/opt/mips-2016.05/bin && /opt/mips-2016.05/bin/mips-sde-elf-gcc --version || true"
+  - "[ $RTT_TOOL_CHAIN = 'sourcery-mips' ] && wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.1/mips-2016.05-7-mips-sde-elf-i686-pc-linux-gnu.tar.bz2 && sudo tar xjf mips-2016.05-7-mips-sde-elf-i686-pc-linux-gnu.tar.bz2 -C /opt && export RTT_EXEC_PATH=/opt/mips-2016.05/bin && /opt/mips-2016.05/bin/mips-sde-elf-gcc --version || true"
   # - "[ $RTT_TOOL_CHAIN = 'sourcery-ppc' ] && curl -s https://sourcery.mentor.com/public/gnu_toolchain/powerpc-eabi/freescale-2011.03-39-powerpc-eabi-i686-pc-linux-gnu.tar.bz2 | sudo tar xjf - -C /opt && export RTT_EXEC_PATH=/opt/freescale-2011.03/bin && /opt/freescale-2011.03/bin/powerpc-eabi-gcc --version || true"
   # - "[ $RTT_TOOL_CHAIN = 'atmel-avr32' ] && curl -s http://www.atmel.com/images/avr32-gnu-toolchain-3.4.1.348-linux.any.x86.tar.gz | sudo tar xzf - -C /opt && export RTT_EXEC_PATH=/opt/avr32-gnu-toolchain-linux_x86/bin && /opt/avr32-gnu-toolchain-linux_x86/bin/avr32-gcc --version && curl -sO http://www.atmel.com/images/avr-headers-3.2.3.970.zip && unzip -qq avr-headers-3.2.3.970.zip -d bsp/$RTT_BSP || true"
   - export RTT_ROOT=`pwd`
@@ -88,9 +88,11 @@ env:
   - RTT_BSP='stm32/stm32f407-atk-explorer' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f407-st-discovery' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f411-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
+  - RTT_BSP='stm32/stm32f427-robomaster-a' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f429-armfly-v6' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f429-atk-apollo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f429-fire-challenger' RTT_TOOL_CHAIN='sourcery-arm'
+  - RTT_BSP='stm32/stm32f429-st-disco' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f446-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f469-st-disco' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f746-st-disco' RTT_TOOL_CHAIN='sourcery-arm'
@@ -98,7 +100,9 @@ env:
   - RTT_BSP='stm32/stm32f767-fire-challenger' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32f767-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32g071-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
+  - RTT_BSP='stm32/stm32g431-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32h743-atk-apollo' RTT_TOOL_CHAIN='sourcery-arm'
+  - RTT_BSP='stm32/stm32h743-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32l4r9-st-eval' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32l053-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32l432-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
@@ -107,8 +111,6 @@ env:
   - RTT_BSP='stm32/stm32l476-st-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32/stm32l496-ali-developer' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='stm32f20x' RTT_TOOL_CHAIN='sourcery-arm'
-  - RTT_BSP='stm32f429-disco' RTT_TOOL_CHAIN='sourcery-arm'
-  - RTT_BSP='stm32h743-nucleo' RTT_TOOL_CHAIN='sourcery-arm'
   - RTT_BSP='swm320-lq100' RTT_TOOL_CHAIN='sourcery-arm'
 #  - RTT_BSP='taihu' RTT_TOOL_CHAIN='sourcery-ppc'
 #  - RTT_BSP='upd70f3454' # iar

+ 1 - 0
bsp/CME_M7/SConstruct

@@ -8,6 +8,7 @@ from building import *
 
 TARGET = 'rtthread.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 1 - 29
bsp/CME_M7/project.uvproj

@@ -811,13 +811,6 @@
               <FilePath>..\..\components\finsh\shell.c</FilePath>
             </File>
           </Files>
-          <Files>
-            <File>
-              <FileName>symbol.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>..\..\components\finsh\symbol.c</FilePath>
-            </File>
-          </Files>
           <Files>
             <File>
               <FileName>cmd.c</FileName>
@@ -832,20 +825,6 @@
               <FilePath>..\..\components\finsh\msh.c</FilePath>
             </File>
           </Files>
-          <Files>
-            <File>
-              <FileName>msh_cmd.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>..\..\components\finsh\msh_cmd.c</FilePath>
-            </File>
-          </Files>
-          <Files>
-            <File>
-              <FileName>msh_file.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>..\..\components\finsh\msh_file.c</FilePath>
-            </File>
-          </Files>
           <Files>
             <File>
               <FileName>finsh_compiler.c</FileName>
@@ -944,14 +923,7 @@
             <File>
               <FileName>time.c</FileName>
               <FileType>1</FileType>
-              <FilePath>..\..\components\libc\compilers\armlibc\time.c</FilePath>
-            </File>
-          </Files>
-          <Files>
-            <File>
-              <FileName>gmtime_r.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>..\..\components\libc\compilers\common\gmtime_r.c</FilePath>
+              <FilePath>..\..\components\libc\compilers\common\time.c</FilePath>
             </File>
           </Files>
         </Group>

+ 2 - 0
bsp/allwinner_tina/Kconfig

@@ -24,6 +24,8 @@ source "$PKGS_DIR/Kconfig"
 config SOC_TINA
     bool 
     select ARCH_ARM_ARM9
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
     default y
 
 source "$BSP_DIR/drivers/Kconfig"

+ 1 - 0
bsp/allwinner_tina/SConstruct

@@ -9,6 +9,7 @@ from building import *
 
 TARGET = 'rtthread.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
     AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
     CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 2 - 2
bsp/allwinner_tina/link.lds

@@ -82,8 +82,8 @@ SECTIONS
         PROVIDE(__dtors_end__ = .);
     }
 
+    . = ALIGN(8);
     __data_start = .;
-    . = ALIGN(4);
     .data :
     {
         *(.data)
@@ -118,7 +118,7 @@ SECTIONS
     }
     __data_end = .;
 
-    . = ALIGN(4);
+    . = ALIGN(8);
     __bss_start = .;
     .bss       :
     {

+ 1 - 1
bsp/amebaz/.config

@@ -15,7 +15,7 @@ CONFIG_RT_THREAD_PRIORITY_MAX=32
 CONFIG_RT_TICK_PER_SECOND=1000
 CONFIG_RT_USING_OVERFLOW_CHECK=y
 CONFIG_RT_USING_HOOK=y
-CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
 CONFIG_IDLE_THREAD_STACK_SIZE=256
 CONFIG_RT_USING_TIMER_SOFT=y
 CONFIG_RT_TIMER_THREAD_PRIO=4

+ 6 - 1
bsp/amebaz/Kconfig

@@ -29,4 +29,9 @@ source "$ENV_DIR/tools/scripts/cmds/Kconfig"
 source "$BSP_DIR/libraries/Kconfig"
 source "$BSP_DIR/drivers/Kconfig"
 
-select PKG_USING_REALTEK_AMEBA
+config SOC_AMEBAZ
+    bool
+    select PKG_USING_REALTEK_AMEBA
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
+    default y

+ 1 - 0
bsp/amebaz/SConstruct

@@ -17,6 +17,7 @@ except:
 
 TARGET = 'rtthread.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
     AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
     CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 2229 - 2434
bsp/amebaz/project.ewp

@@ -1,2434 +1,2229 @@
-<project>
-  <fileVersion>2</fileVersion>
-  <configuration>
-    <name>Debug</name>
-    <toolchain>
-      <name>ARM</name>
-    </toolchain>
-    <debug>1</debug>
-    <settings>
-      <name>General</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <version>22</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>ExePath</name>
-          <state>Debug\Exe</state>
-        </option>
-        <option>
-          <name>ObjPath</name>
-          <state>Debug\Obj</state>
-        </option>
-        <option>
-          <name>ListPath</name>
-          <state>Debug\List</state>
-        </option>
-        <option>
-          <name>Variant</name>
-          <version>21</version>
-          <state>39</state>
-        </option>
-        <option>
-          <name>GEndianMode</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input variant</name>
-          <version>3</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input description</name>
-          <state>Automatic choice of formatter.</state>
-        </option>
-        <option>
-          <name>Output variant</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Output description</name>
-          <state>Automatic choice of formatter.</state>
-        </option>
-        <option>
-          <name>GOutputBinary</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FPU</name>
-          <version>3</version>
-          <state>5</state>
-        </option>
-        <option>
-          <name>OGCoreOrChip</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelect</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelectSlave</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>RTDescription</name>
-          <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
-        </option>
-        <option>
-          <name>OGProductVersion</name>
-          <state>7.30.4.8186</state>
-        </option>
-        <option>
-          <name>OGLastSavedByProductVersion</name>
-          <state>7.30.4.8186</state>
-        </option>
-        <option>
-          <name>GeneralEnableMisra</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraVerbose</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGChipSelectEditMenu</name>
-          <state>Default	None</state>
-        </option>
-        <option>
-          <name>GenLowLevelInterface</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GEndianModeBE</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OGBufferedTerminalOutput</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GenStdoutInterface</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>GeneralMisraVer</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>RTConfigPath2</name>
-          <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
-        </option>
-        <option>
-          <name>GFPUCoreSlave</name>
-          <version>21</version>
-          <state>39</state>
-        </option>
-        <option>
-          <name>GBECoreSlave</name>
-          <version>21</version>
-          <state>39</state>
-        </option>
-        <option>
-          <name>OGUseCmsis</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGUseCmsisDspLib</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GRuntimeLibThreads</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ICCARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>31</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>CCDefines</name>
-          <state />
-          <state>CONFIG_PLATFORM_8711B</state>
-          <state>CONFIG_BUILD_ROM</state>
-          <state>PLATFORM_RTTHREAD</state>
-          <state>__IEEE_LITTLE_ENDIAN</state>
-          <state>RT_USING_DLIBC</state>
-          <state>_DLIB_FILE_DESCRIPTOR</state>
-          <state>_DLIB_THREAD_SUPPORT</state>
-          <state>CONFIG_PLATFORM_8711B</state>
-          <state>PLATFORM_RTTHREAD</state>
-          <state>__IEEE_LITTLE_ENDIAN</state>
-          <state>RT_USING_DLIBC</state>
-        </option>
-        <option>
-          <name>CCPreprocFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocComments</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMnemonics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMessages</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssSource</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCEnableRemarks</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCDiagSuppress</name>
-          <state>Be006,Pa050,Pa039,Pa089,Pe014,Pe047,Pe068,Pe089,Pe167,Pe177,Pe186,Pe188,Pe375,Pe550,Pe550,Pe223,Pe549,Pe550</state>
-        </option>
-        <option>
-          <name>CCDiagRemark</name>
-          <state />
-        </option>
-        <option>
-          <name>CCDiagWarning</name>
-          <state />
-        </option>
-        <option>
-          <name>CCDiagError</name>
-          <state />
-        </option>
-        <option>
-          <name>CCObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCAllowList</name>
-          <version>1</version>
-          <state>11111110</state>
-        </option>
-        <option>
-          <name>CCDebugInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IEndianMode</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IExtraOptionsCheck</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IExtraOptions</name>
-          <state>--enum_is_int</state>
-        </option>
-        <option>
-          <name>CCLangConformance</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSignedPlainChar</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRequirePrototypes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCDiagWarnAreErr</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCompilerRuntimeInfo</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OutputFile</name>
-          <state>$FILE_BNAME$.o</state>
-        </option>
-        <option>
-          <name>CCLibConfigHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>PreInclude</name>
-          <state />
-        </option>
-        <option>
-          <name>CompilerMisraOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCIncludePath2</name>
-          <state />
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\drivers\wlan\realtek\wlan_ram_map\rom</state>
-          <state>$PROJ_DIR$\..\..\components\libc\compilers\dlib</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\platform</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\realtek\8711b\include</state>
-          <state>$PROJ_DIR$\..\..\include</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\netif</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\app\monitor\include</state>
-          <state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\os_dep\include</state>
-          <state>$PROJ_DIR$\..\..\components\drivers\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\freertos\freertos_v8.1.2\Source\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi\rtw_wpa_supplicant\src</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src</state>
-          <state>$PROJ_DIR$\drivers</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\ipv4</state>
-          <state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4</state>
-          <state>$PROJ_DIR$\.</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\drivers\wlan\realtek\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\cmsis\device</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\swlib\std_lib\libc\rom\string</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\hal</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\hal_ext</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip_dhcpd</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\freertos</state>
-          <state>$PROJ_DIR$\applications</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\network\ssl\polarssl-1.3.8\include</state>
-          <state>$PROJ_DIR$\drivers\wlan</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\freertos\freertos_v8.1.2\Source\portable\IAR\ARM_CM4F</state>
-          <state>$PROJ_DIR$\..\..\components\finsh</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\cmsis</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\swlib\rtl_lib</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\os</state>
-          <state>$PROJ_DIR$\..\..\components\drivers\wlan</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\fwlib\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\drivers\wlan\realtek\src\osdep</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\network\ssl\ssl_ram_map\rom</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\swlib\std_lib\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi</state>
-          <state>$PROJ_DIR$\libraries\smartconfig\inc</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\api</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\include</state>
-        </option>
-        <option>
-          <name>CCStdIncCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCodeSection</name>
-          <state>.text</state>
-        </option>
-        <option>
-          <name>IInterwork2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IProcessorMode2</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCOptLevel</name>
-          <state>3</state>
-        </option>
-        <option>
-          <name>CCOptStrategy</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCOptLevelSlave</name>
-          <state>3</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>CCPosIndRopi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndRwpi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndNoDynInit</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccLang</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCDialect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccAllowVLA</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCppDialect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccExceptions</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccRTTI</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccStaticDestr</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccCppInlineSemantics</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccFloatSemantics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCOptimizationNoSizeConstraints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCNoLiteralPool</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCOptStrategySlave</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCGuardCalls</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>AARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>9</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>AObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AEndian</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>ACaseSensitivity</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacroChars</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnEnable</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnWhat</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnOne</name>
-          <state />
-        </option>
-        <option>
-          <name>AWarnRange1</name>
-          <state />
-        </option>
-        <option>
-          <name>AWarnRange2</name>
-          <state />
-        </option>
-        <option>
-          <name>ADebug</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AltRegisterNames</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ADefines</name>
-          <state />
-        </option>
-        <option>
-          <name>AList</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AListHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AListing</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>Includes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacDefs</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacExps</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacExec</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OnlyAssed</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MultiLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLengthCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLength</name>
-          <state>80</state>
-        </option>
-        <option>
-          <name>TabSpacing</name>
-          <state>8</state>
-        </option>
-        <option>
-          <name>AXRef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDefines</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefInternal</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDual</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AOutputFile</name>
-          <state>$FILE_BNAME$.o</state>
-        </option>
-        <option>
-          <name>AMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsEdit</name>
-          <state>100</state>
-        </option>
-        <option>
-          <name>AIgnoreStdInclude</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AUserIncludes</name>
-          <state />
-        </option>
-        <option>
-          <name>AExtraOptionsCheckV2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AExtraOptionsV2</name>
-          <state />
-        </option>
-        <option>
-          <name>AsmNoLiteralPool</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>OBJCOPY</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OOCOutputFormat</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCOutputOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OOCOutputFile</name>
-          <state>template.srec</state>
-        </option>
-        <option>
-          <name>OOCCommandLineProducer</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OOCObjCopyEnable</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>CUSTOM</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <extensions />
-        <cmdline />
-        <hasPrio>0</hasPrio>
-      </data>
-    </settings>
-    <settings>
-      <name>BICOMP</name>
-      <archiveVersion>0</archiveVersion>
-      <data />
-    </settings>
-    <settings>
-      <name>BUILDACTION</name>
-      <archiveVersion>1</archiveVersion>
-      <data>
-        <prebuild>CSCRIPT  "$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\prebuild.vbs" "$PROJ_DIR$" "1" "0x08080000"</prebuild>
-        <postbuild>CSCRIPT  "$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\postbuild_img2.vbs" "$TARGET_DIR$" "$PROJ_DIR$"</postbuild>
-      </data>
-    </settings>
-    <settings>
-      <name>ILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>16</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>IlinkLibIOConfig</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>XLinkMisraHandler</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkInputFileSlave</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOutputFile</name>
-          <state>application.axf</state>
-        </option>
-        <option>
-          <name>IlinkDebugInfoEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkKeepSymbols</name>
-          <state>bootloader</state>
-        </option>
-        <option>
-          <name>IlinkRawBinaryFile</name>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\image\boot_all.bin</state>
-        </option>
-        <option>
-          <name>IlinkRawBinarySymbol</name>
-          <state>bootloader</state>
-        </option>
-        <option>
-          <name>IlinkRawBinarySegment</name>
-          <state>LOADER</state>
-        </option>
-        <option>
-          <name>IlinkRawBinaryAlign</name>
-          <state>4</state>
-        </option>
-        <option>
-          <name>IlinkDefines</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkConfigDefines</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkMapFile</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogFile</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogInitialization</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogModule</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogSection</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogVeneer</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkIcfOverride</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkIcfFile</name>
-          <state>$PROJ_DIR$\image2.icf</state>
-        </option>
-        <option>
-          <name>IlinkIcfFileSlave</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkEnableRemarks</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkSuppressDiags</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkTreatAsRem</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkTreatAsWarn</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkTreatAsErr</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkWarningsAreErrors</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkUseExtraOptions</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkExtraOptions</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkLowLevelInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAutoLibEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAdditionalLibs</name>
-          <state />
-          <state>$PROJ_DIR$\libraries\smartconfig\libs\libsmartconfig_armcm4_iar.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_platform.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_rtlstd.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_wlan.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_wps.a</state>
-        </option>
-        <option>
-          <name>IlinkOverrideProgramEntryLabel</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabelSelect</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabel</name>
-          <state>Reset_Handler</state>
-        </option>
-        <option>
-          <name>DoFill</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FillerByte</name>
-          <state>0xFF</state>
-        </option>
-        <option>
-          <name>FillerStart</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>FillerEnd</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>CrcSize</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcAlign</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcPoly</name>
-          <state>0x11021</state>
-        </option>
-        <option>
-          <name>CrcCompl</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcBitOrder</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcInitialValue</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>DoCrc</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkBE8Slave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkBufferedTerminalOutput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkStdoutInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcFullSize</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIElfToolPostProcess</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogAutoLibSelect</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogRedirSymbols</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogUnusedFragments</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCrcReverseByteOrder</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCrcUseAsInput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptInline</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsAllow</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsForce</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptMergeDuplSections</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptUseVfe</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptForceVfe</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkStackAnalysisEnable</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkStackControlFile</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkStackCallGraphFile</name>
-          <state />
-        </option>
-        <option>
-          <name>CrcAlgorithm</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcUnitSize</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkThreadsSlave</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>IARCHIVE</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>IarchiveInputs</name>
-          <state />
-        </option>
-        <option>
-          <name>IarchiveOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IarchiveOutput</name>
-          <state>###Unitialized###</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>BILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data />
-    </settings>
-  </configuration>
-  <configuration>
-    <name>Release</name>
-    <toolchain>
-      <name>ARM</name>
-    </toolchain>
-    <debug>0</debug>
-    <settings>
-      <name>General</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <version>22</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>ExePath</name>
-          <state>Release\Exe</state>
-        </option>
-        <option>
-          <name>ObjPath</name>
-          <state>Release\Obj</state>
-        </option>
-        <option>
-          <name>ListPath</name>
-          <state>Release\List</state>
-        </option>
-        <option>
-          <name>Variant</name>
-          <version>21</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GEndianMode</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input variant</name>
-          <version>3</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input description</name>
-          <state />
-        </option>
-        <option>
-          <name>Output variant</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Output description</name>
-          <state />
-        </option>
-        <option>
-          <name>GOutputBinary</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FPU</name>
-          <version>3</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGCoreOrChip</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelect</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelectSlave</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>RTDescription</name>
-          <state />
-        </option>
-        <option>
-          <name>OGProductVersion</name>
-          <state>7.30.4.8186</state>
-        </option>
-        <option>
-          <name>OGLastSavedByProductVersion</name>
-          <state />
-        </option>
-        <option>
-          <name>GeneralEnableMisra</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraVerbose</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGChipSelectEditMenu</name>
-          <state />
-        </option>
-        <option>
-          <name>GenLowLevelInterface</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GEndianModeBE</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGBufferedTerminalOutput</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GenStdoutInterface</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>GeneralMisraVer</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>RTConfigPath2</name>
-          <state />
-        </option>
-        <option>
-          <name>GFPUCoreSlave</name>
-          <version>21</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GBECoreSlave</name>
-          <version>21</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OGUseCmsis</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGUseCmsisDspLib</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GRuntimeLibThreads</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ICCARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>31</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>CCDefines</name>
-          <state>NDEBUG</state>
-          <state>CONFIG_PLATFORM_8711B</state>
-          <state>PLATFORM_RTTHREAD</state>
-          <state>__IEEE_LITTLE_ENDIAN</state>
-          <state>RT_USING_DLIBC</state>
-        </option>
-        <option>
-          <name>CCPreprocFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocComments</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMnemonics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMessages</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssSource</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCEnableRemarks</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCDiagSuppress</name>
-          <state />
-        </option>
-        <option>
-          <name>CCDiagRemark</name>
-          <state />
-        </option>
-        <option>
-          <name>CCDiagWarning</name>
-          <state />
-        </option>
-        <option>
-          <name>CCDiagError</name>
-          <state />
-        </option>
-        <option>
-          <name>CCObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCAllowList</name>
-          <version>1</version>
-          <state>11111110</state>
-        </option>
-        <option>
-          <name>CCDebugInfo</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IEndianMode</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IExtraOptionsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IExtraOptions</name>
-          <state />
-        </option>
-        <option>
-          <name>CCLangConformance</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSignedPlainChar</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCRequirePrototypes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCDiagWarnAreErr</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCompilerRuntimeInfo</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OutputFile</name>
-          <state />
-        </option>
-        <option>
-          <name>CCLibConfigHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>PreInclude</name>
-          <state />
-        </option>
-        <option>
-          <name>CompilerMisraOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCIncludePath2</name>
-          <state />
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\drivers\wlan\realtek\wlan_ram_map\rom</state>
-          <state>$PROJ_DIR$\..\..\components\libc\compilers\dlib</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\platform</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\realtek\8711b\include</state>
-          <state>$PROJ_DIR$\..\..\include</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\netif</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\app\monitor\include</state>
-          <state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\os_dep\include</state>
-          <state>$PROJ_DIR$\..\..\components\drivers\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\freertos\freertos_v8.1.2\Source\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi\rtw_wpa_supplicant\src</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src</state>
-          <state>$PROJ_DIR$\drivers</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\ipv4</state>
-          <state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4</state>
-          <state>$PROJ_DIR$\.</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\drivers\wlan\realtek\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\cmsis\device</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\swlib\std_lib\libc\rom\string</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\hal</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\hal_ext</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip_dhcpd</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\freertos</state>
-          <state>$PROJ_DIR$\applications</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\network\ssl\polarssl-1.3.8\include</state>
-          <state>$PROJ_DIR$\drivers\wlan</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\freertos\freertos_v8.1.2\Source\portable\IAR\ARM_CM4F</state>
-          <state>$PROJ_DIR$\..\..\components\finsh</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\cmsis</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\swlib\rtl_lib</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\os</state>
-          <state>$PROJ_DIR$\..\..\components\drivers\wlan</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\fwlib\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\drivers\wlan\realtek\src\osdep</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\network\ssl\ssl_ram_map\rom</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\swlib\std_lib\include</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi</state>
-          <state>$PROJ_DIR$\libraries\smartconfig\inc</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\api</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
-          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\include</state>
-        </option>
-        <option>
-          <name>CCStdIncCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCodeSection</name>
-          <state>.text</state>
-        </option>
-        <option>
-          <name>IInterwork2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IProcessorMode2</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCOptLevel</name>
-          <state>3</state>
-        </option>
-        <option>
-          <name>CCOptStrategy</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCOptLevelSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>CCPosIndRopi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndRwpi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndNoDynInit</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccLang</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCDialect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccAllowVLA</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCppDialect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccExceptions</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccRTTI</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccStaticDestr</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccCppInlineSemantics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccFloatSemantics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCOptimizationNoSizeConstraints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCNoLiteralPool</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCOptStrategySlave</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCGuardCalls</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>AARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>9</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>AObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AEndian</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>ACaseSensitivity</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacroChars</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnEnable</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnWhat</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnOne</name>
-          <state />
-        </option>
-        <option>
-          <name>AWarnRange1</name>
-          <state />
-        </option>
-        <option>
-          <name>AWarnRange2</name>
-          <state />
-        </option>
-        <option>
-          <name>ADebug</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AltRegisterNames</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ADefines</name>
-          <state />
-        </option>
-        <option>
-          <name>AList</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AListHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AListing</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>Includes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacDefs</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacExps</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacExec</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OnlyAssed</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MultiLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLengthCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLength</name>
-          <state>80</state>
-        </option>
-        <option>
-          <name>TabSpacing</name>
-          <state>8</state>
-        </option>
-        <option>
-          <name>AXRef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDefines</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefInternal</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDual</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AOutputFile</name>
-          <state />
-        </option>
-        <option>
-          <name>AMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsEdit</name>
-          <state>100</state>
-        </option>
-        <option>
-          <name>AIgnoreStdInclude</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AUserIncludes</name>
-          <state />
-        </option>
-        <option>
-          <name>AExtraOptionsCheckV2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AExtraOptionsV2</name>
-          <state />
-        </option>
-        <option>
-          <name>AsmNoLiteralPool</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>OBJCOPY</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OOCOutputFormat</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCOutputOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OOCOutputFile</name>
-          <state />
-        </option>
-        <option>
-          <name>OOCCommandLineProducer</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OOCObjCopyEnable</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>CUSTOM</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <extensions />
-        <cmdline />
-        <hasPrio>0</hasPrio>
-      </data>
-    </settings>
-    <settings>
-      <name>BICOMP</name>
-      <archiveVersion>0</archiveVersion>
-      <data />
-    </settings>
-    <settings>
-      <name>BUILDACTION</name>
-      <archiveVersion>1</archiveVersion>
-      <data>
-        <prebuild />
-        <postbuild />
-      </data>
-    </settings>
-    <settings>
-      <name>ILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>16</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>IlinkLibIOConfig</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>XLinkMisraHandler</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkInputFileSlave</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOutputFile</name>
-          <state>###Unitialized###</state>
-        </option>
-        <option>
-          <name>IlinkDebugInfoEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkKeepSymbols</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkRawBinaryFile</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkRawBinarySymbol</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkRawBinarySegment</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkRawBinaryAlign</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkDefines</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkConfigDefines</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkMapFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogInitialization</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogModule</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogSection</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogVeneer</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIcfOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIcfFile</name>
-          <state>lnk0t.icf</state>
-        </option>
-        <option>
-          <name>IlinkIcfFileSlave</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkEnableRemarks</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkSuppressDiags</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkTreatAsRem</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkTreatAsWarn</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkTreatAsErr</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkWarningsAreErrors</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkUseExtraOptions</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkExtraOptions</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkLowLevelInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAutoLibEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAdditionalLibs</name>
-          <state />
-          <state>$PROJ_DIR$\libraries\smartconfig\libs\libsmartconfig_armcm4_iar.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_platform.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_rtlstd.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_wlan.a</state>
-          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\lib\common\IAR\lib_wps.a</state>
-        </option>
-        <option>
-          <name>IlinkOverrideProgramEntryLabel</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabelSelect</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabel</name>
-          <state />
-        </option>
-        <option>
-          <name>DoFill</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FillerByte</name>
-          <state>0xFF</state>
-        </option>
-        <option>
-          <name>FillerStart</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>FillerEnd</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>CrcSize</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcAlign</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcPoly</name>
-          <state>0x11021</state>
-        </option>
-        <option>
-          <name>CrcCompl</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcBitOrder</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcInitialValue</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>DoCrc</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkBE8Slave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkBufferedTerminalOutput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkStdoutInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcFullSize</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIElfToolPostProcess</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogAutoLibSelect</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogRedirSymbols</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogUnusedFragments</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCrcReverseByteOrder</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCrcUseAsInput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptInline</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsAllow</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsForce</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptMergeDuplSections</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptUseVfe</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptForceVfe</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkStackAnalysisEnable</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkStackControlFile</name>
-          <state />
-        </option>
-        <option>
-          <name>IlinkStackCallGraphFile</name>
-          <state />
-        </option>
-        <option>
-          <name>CrcAlgorithm</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcUnitSize</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkThreadsSlave</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>IARCHIVE</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>IarchiveInputs</name>
-          <state />
-        </option>
-        <option>
-          <name>IarchiveOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IarchiveOutput</name>
-          <state>###Unitialized###</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>BILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data />
-    </settings>
-  </configuration>
-  <group>
-    <name>Applications</name>
-    <file>
-      <name>$PROJ_DIR$\applications\main.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\applications\smartconfig_app.c</name>
-    </file>
-  </group>
-  <group>
-    <name>Drivers</name>
-    <file>
-      <name>$PROJ_DIR$\drivers\board.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\drivers\drv_uart.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\drivers\wlan\drv_wifi.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\drivers\wlan\drv_wlan.c</name>
-    </file>
-  </group>
-  <group>
-    <name>smartconfig</name>
-  </group>
-  <group>
-    <name>amebaz_sdk</name>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\os\rtthread_service.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\realtek\8711b\app_start.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\realtek\8711b\rtl8710b_startup.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\rtthread_patch\realtek\common\wifi\wifi_conf.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi\rtw_wpa_supplicant\wpa_supplicant\wifi_eap_config.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi\wifi_ind.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi\wifi_promisc.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\api\wifi\wifi_util.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\analogin_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\dma_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\efuse_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\flash_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\gpio_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\gpio_irq_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\i2c_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\i2s_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\nfc_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\pinmap.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\pinmap_common.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\port_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\pwmout_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\rtc_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\serial_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\sleep.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\spi_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\sys_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\timer_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\us_ticker.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\us_ticker_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\wait_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\common\mbed\targets\hal\rtl8711b\wdt_api.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\os\os_dep\osdep_service.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\app\monitor\ram\monitor.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\app\monitor\ram\rtl_consol.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\cmsis\device\system_8195a.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\fwlib\ram_lib\rtl8710b_intfcfg.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\fwlib\ram_lib\rtl8710b_pinmapcfg.c</name>
-    </file>
-  </group>
-  <group>
-    <name>Kernel</name>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\clock.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\components.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\device.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\idle.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\ipc.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\irq.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\kservice.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\mem.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\mempool.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\object.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\scheduler.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\signal.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\thread.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\src\timer.c</name>
-    </file>
-  </group>
-  <group>
-    <name>CORTEX-M4</name>
-    <file>
-      <name>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4\cpuport.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4\context_iar.S</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\libcpu\arm\common\div0.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\libcpu\arm\common\showmem.c</name>
-    </file>
-  </group>
-  <group>
-    <name>DeviceDrivers</name>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\serial\serial.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\src\completion.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\src\dataqueue.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\src\pipe.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\src\ringblk_buf.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\src\ringbuffer.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\src\waitqueue.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\src\workqueue.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_cfg.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_cmd.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_dev.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_lwip.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_mgnt.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_prot.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_workqueue.c</name>
-    </file>
-  </group>
-  <group>
-    <name>finsh</name>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\finsh\shell.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\finsh\symbol.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\finsh\cmd.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\finsh\msh.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\finsh\msh_cmd.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\finsh\msh_file.c</name>
-    </file>
-  </group>
-  <group>
-    <name>dlib</name>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\environ.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\libc.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\rmtx.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\stdio.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_close.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_lseek.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_mem.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_open.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_read.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_remove.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_write.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\time.c</name>
-    </file>
-  </group>
-  <group>
-    <name>lwIP</name>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\sys_arch.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\api_lib.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\api_msg.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\err.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netbuf.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netdb.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netifapi.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\sockets.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\tcpip.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\def.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\dns.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\inet_chksum.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\init.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ip.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\memp.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\netif.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\pbuf.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\raw.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\stats.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\sys.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp_in.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp_out.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\timeouts.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\udp.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\ethernet.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\ethernetif.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\lowpan6.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\autoip.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\dhcp.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\etharp.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\icmp.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\igmp.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4_addr.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4_frag.c</name>
-    </file>
-    <file>
-      <name>$PROJ_DIR$\..\..\components\net\lwip_dhcpd\dhcp_server_raw.c</name>
-    </file>
-  </group>
-</project>
+<project>
+  <fileVersion>2</fileVersion>
+  <configuration>
+    <name>Debug</name>
+    <toolchain>
+      <name>ARM</name>
+    </toolchain>
+    <debug>1</debug>
+    <settings>
+      <name>General</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <version>22</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>ExePath</name>
+          <state>Debug\Exe</state>
+        </option>
+        <option>
+          <name>ObjPath</name>
+          <state>Debug\Obj</state>
+        </option>
+        <option>
+          <name>ListPath</name>
+          <state>Debug\List</state>
+        </option>
+        <option>
+          <name>Variant</name>
+          <version>21</version>
+          <state>39</state>
+        </option>
+        <option>
+          <name>GEndianMode</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Input variant</name>
+          <version>3</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Input description</name>
+          <state>Automatic choice of formatter.</state>
+        </option>
+        <option>
+          <name>Output variant</name>
+          <version>2</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Output description</name>
+          <state>Automatic choice of formatter.</state>
+        </option>
+        <option>
+          <name>GOutputBinary</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>FPU</name>
+          <version>3</version>
+          <state>5</state>
+        </option>
+        <option>
+          <name>OGCoreOrChip</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelect</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelectSlave</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>RTDescription</name>
+          <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
+        </option>
+        <option>
+          <name>OGProductVersion</name>
+          <state>7.30.4.8186</state>
+        </option>
+        <option>
+          <name>OGLastSavedByProductVersion</name>
+          <state>7.30.4.8186</state>
+        </option>
+        <option>
+          <name>GeneralEnableMisra</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraVerbose</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGChipSelectEditMenu</name>
+          <state>Default	None</state>
+        </option>
+        <option>
+          <name>GenLowLevelInterface</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>GEndianModeBE</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OGBufferedTerminalOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GenStdoutInterface</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>GeneralMisraVer</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>RTConfigPath2</name>
+          <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
+        </option>
+        <option>
+          <name>GFPUCoreSlave</name>
+          <version>21</version>
+          <state>39</state>
+        </option>
+        <option>
+          <name>GBECoreSlave</name>
+          <version>21</version>
+          <state>39</state>
+        </option>
+        <option>
+          <name>OGUseCmsis</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGUseCmsisDspLib</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibThreads</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>ICCARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>31</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>CCDefines</name>
+          <state />
+          <state>CONFIG_PLATFORM_8711B</state>
+          <state>CONFIG_BUILD_ROM</state>
+          <state>PLATFORM_RTTHREAD</state>
+          <state>__IEEE_LITTLE_ENDIAN</state>
+          <state>RT_USING_DLIBC</state>
+          <state>_DLIB_FILE_DESCRIPTOR</state>
+          <state>_DLIB_THREAD_SUPPORT</state>
+          <state>RT_USING_DLIBC</state>
+        </option>
+        <option>
+          <name>CCPreprocFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocComments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMnemonics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMessages</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssSource</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagSuppress</name>
+          <state>Be006,Pa050,Pa039,Pa089,Pe014,Pe047,Pe068,Pe089,Pe167,Pe177,Pe186,Pe188,Pe375,Pe550,Pe550,Pe223,Pe549,Pe550</state>
+        </option>
+        <option>
+          <name>CCDiagRemark</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagWarning</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagError</name>
+          <state />
+        </option>
+        <option>
+          <name>CCObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCAllowList</name>
+          <version>1</version>
+          <state>11111110</state>
+        </option>
+        <option>
+          <name>CCDebugInfo</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IEndianMode</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IExtraOptionsCheck</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IExtraOptions</name>
+          <state>--enum_is_int</state>
+        </option>
+        <option>
+          <name>CCLangConformance</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCSignedPlainChar</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCRequirePrototypes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagWarnAreErr</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCompilerRuntimeInfo</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OutputFile</name>
+          <state>$FILE_BNAME$.o</state>
+        </option>
+        <option>
+          <name>CCLibConfigHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>PreInclude</name>
+          <state />
+        </option>
+        <option>
+          <name>CompilerMisraOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCIncludePath2</name>
+          <state />
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\ipv4</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src</state>
+          <state>$PROJ_DIR$\applications</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\dlib</state>
+          <state>$PROJ_DIR$\drivers</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\common</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\netif</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip_dhcpd</state>
+          <state>$PROJ_DIR$\.</state>
+          <state>$PROJ_DIR$\..\..\include</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4</state>
+          <state>$PROJ_DIR$\drivers\wlan</state>
+          <state>$PROJ_DIR$\libraries\smartconfig\inc</state>
+          <state>$PROJ_DIR$\..\..\components\drivers\include</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
+          <state>$PROJ_DIR$\..\..\components\drivers\wlan</state>
+          <state>$PROJ_DIR$\..\..\components\finsh</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\include</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include</state>
+        </option>
+        <option>
+          <name>CCStdIncCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCodeSection</name>
+          <state>.text</state>
+        </option>
+        <option>
+          <name>IInterwork2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IProcessorMode2</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCOptLevel</name>
+          <state>3</state>
+        </option>
+        <option>
+          <name>CCOptStrategy</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCOptLevelSlave</name>
+          <state>3</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>CCPosIndRopi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndRwpi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndNoDynInit</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccLang</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCDialect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccAllowVLA</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCppDialect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccExceptions</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccRTTI</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccStaticDestr</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccCppInlineSemantics</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccFloatSemantics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptimizationNoSizeConstraints</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCNoLiteralPool</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptStrategySlave</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCGuardCalls</name>
+          <state>1</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>AARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>9</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>AObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AEndian</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>ACaseSensitivity</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacroChars</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnWhat</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnOne</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange1</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange2</name>
+          <state />
+        </option>
+        <option>
+          <name>ADebug</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AltRegisterNames</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ADefines</name>
+          <state />
+        </option>
+        <option>
+          <name>AList</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AListHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AListing</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>Includes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacDefs</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacExps</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacExec</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OnlyAssed</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MultiLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLengthCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLength</name>
+          <state>80</state>
+        </option>
+        <option>
+          <name>TabSpacing</name>
+          <state>8</state>
+        </option>
+        <option>
+          <name>AXRef</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDefines</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefInternal</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDual</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AOutputFile</name>
+          <state>$FILE_BNAME$.o</state>
+        </option>
+        <option>
+          <name>AMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ALimitErrorsCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ALimitErrorsEdit</name>
+          <state>100</state>
+        </option>
+        <option>
+          <name>AIgnoreStdInclude</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AUserIncludes</name>
+          <state />
+        </option>
+        <option>
+          <name>AExtraOptionsCheckV2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AExtraOptionsV2</name>
+          <state />
+        </option>
+        <option>
+          <name>AsmNoLiteralPool</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>OBJCOPY</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>1</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>OOCOutputFormat</name>
+          <version>2</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OCOutputOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OOCOutputFile</name>
+          <state>template.srec</state>
+        </option>
+        <option>
+          <name>OOCCommandLineProducer</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OOCObjCopyEnable</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>CUSTOM</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <extensions />
+        <cmdline />
+        <hasPrio>0</hasPrio>
+      </data>
+    </settings>
+    <settings>
+      <name>BICOMP</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+    <settings>
+      <name>BUILDACTION</name>
+      <archiveVersion>1</archiveVersion>
+      <data>
+        <prebuild>CSCRIPT  "$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\prebuild.vbs" "$PROJ_DIR$" "1" "0x08080000"</prebuild>
+        <postbuild>CSCRIPT  "$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\postbuild_img2.vbs" "$TARGET_DIR$" "$PROJ_DIR$"</postbuild>
+      </data>
+    </settings>
+    <settings>
+      <name>ILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>16</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>IlinkLibIOConfig</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>XLinkMisraHandler</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkInputFileSlave</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOutputFile</name>
+          <state>application.axf</state>
+        </option>
+        <option>
+          <name>IlinkDebugInfoEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkKeepSymbols</name>
+          <state>bootloader</state>
+        </option>
+        <option>
+          <name>IlinkRawBinaryFile</name>
+          <state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\image\boot_all.bin</state>
+        </option>
+        <option>
+          <name>IlinkRawBinarySymbol</name>
+          <state>bootloader</state>
+        </option>
+        <option>
+          <name>IlinkRawBinarySegment</name>
+          <state>LOADER</state>
+        </option>
+        <option>
+          <name>IlinkRawBinaryAlign</name>
+          <state>4</state>
+        </option>
+        <option>
+          <name>IlinkDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkConfigDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkMapFile</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkLogFile</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkLogInitialization</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogModule</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogSection</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogVeneer</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkIcfOverride</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkIcfFile</name>
+          <state>$PROJ_DIR$\image2.icf</state>
+        </option>
+        <option>
+          <name>IlinkIcfFileSlave</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkSuppressDiags</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsRem</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsWarn</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsErr</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkWarningsAreErrors</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkUseExtraOptions</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkExtraOptions</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkLowLevelInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAutoLibEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAdditionalLibs</name>
+          <state />
+          <state>$PROJ_DIR$\libraries\smartconfig\libs\libsmartconfig_armcm4_iar.a</state>
+        </option>
+        <option>
+          <name>IlinkOverrideProgramEntryLabel</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabelSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabel</name>
+          <state>Reset_Handler</state>
+        </option>
+        <option>
+          <name>DoFill</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>FillerByte</name>
+          <state>0xFF</state>
+        </option>
+        <option>
+          <name>FillerStart</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>FillerEnd</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>CrcSize</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcAlign</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcPoly</name>
+          <state>0x11021</state>
+        </option>
+        <option>
+          <name>CrcCompl</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcBitOrder</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcInitialValue</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>DoCrc</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkBE8Slave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkBufferedTerminalOutput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkStdoutInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcFullSize</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIElfToolPostProcess</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogAutoLibSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogRedirSymbols</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogUnusedFragments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcReverseByteOrder</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcUseAsInput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptInline</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsAllow</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsForce</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptMergeDuplSections</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptUseVfe</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptForceVfe</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackAnalysisEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackControlFile</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkStackCallGraphFile</name>
+          <state />
+        </option>
+        <option>
+          <name>CrcAlgorithm</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcUnitSize</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkThreadsSlave</name>
+          <state>1</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>IARCHIVE</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>0</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>IarchiveInputs</name>
+          <state />
+        </option>
+        <option>
+          <name>IarchiveOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IarchiveOutput</name>
+          <state>###Unitialized###</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>BILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+  </configuration>
+  <configuration>
+    <name>Release</name>
+    <toolchain>
+      <name>ARM</name>
+    </toolchain>
+    <debug>0</debug>
+    <settings>
+      <name>General</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <version>22</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>ExePath</name>
+          <state>Release\Exe</state>
+        </option>
+        <option>
+          <name>ObjPath</name>
+          <state>Release\Obj</state>
+        </option>
+        <option>
+          <name>ListPath</name>
+          <state>Release\List</state>
+        </option>
+        <option>
+          <name>Variant</name>
+          <version>21</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GEndianMode</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Input variant</name>
+          <version>3</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Input description</name>
+          <state />
+        </option>
+        <option>
+          <name>Output variant</name>
+          <version>2</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Output description</name>
+          <state />
+        </option>
+        <option>
+          <name>GOutputBinary</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>FPU</name>
+          <version>3</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGCoreOrChip</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelect</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelectSlave</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>RTDescription</name>
+          <state />
+        </option>
+        <option>
+          <name>OGProductVersion</name>
+          <state>7.30.4.8186</state>
+        </option>
+        <option>
+          <name>OGLastSavedByProductVersion</name>
+          <state />
+        </option>
+        <option>
+          <name>GeneralEnableMisra</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraVerbose</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGChipSelectEditMenu</name>
+          <state />
+        </option>
+        <option>
+          <name>GenLowLevelInterface</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GEndianModeBE</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGBufferedTerminalOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GenStdoutInterface</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>GeneralMisraVer</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>RTConfigPath2</name>
+          <state />
+        </option>
+        <option>
+          <name>GFPUCoreSlave</name>
+          <version>21</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>GBECoreSlave</name>
+          <version>21</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OGUseCmsis</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGUseCmsisDspLib</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibThreads</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>ICCARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>31</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>CCDefines</name>
+          <state>NDEBUG</state>
+          <state>RT_USING_DLIBC</state>
+        </option>
+        <option>
+          <name>CCPreprocFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocComments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMnemonics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMessages</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssSource</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagSuppress</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagRemark</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagWarning</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagError</name>
+          <state />
+        </option>
+        <option>
+          <name>CCObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCAllowList</name>
+          <version>1</version>
+          <state>11111110</state>
+        </option>
+        <option>
+          <name>CCDebugInfo</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IEndianMode</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IExtraOptionsCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IExtraOptions</name>
+          <state />
+        </option>
+        <option>
+          <name>CCLangConformance</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCSignedPlainChar</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCRequirePrototypes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagWarnAreErr</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCompilerRuntimeInfo</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OutputFile</name>
+          <state />
+        </option>
+        <option>
+          <name>CCLibConfigHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>PreInclude</name>
+          <state />
+        </option>
+        <option>
+          <name>CompilerMisraOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCIncludePath2</name>
+          <state />
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\ipv4</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src</state>
+          <state>$PROJ_DIR$\applications</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\dlib</state>
+          <state>$PROJ_DIR$\drivers</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\common</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\netif</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip_dhcpd</state>
+          <state>$PROJ_DIR$\.</state>
+          <state>$PROJ_DIR$\..\..\include</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4</state>
+          <state>$PROJ_DIR$\drivers\wlan</state>
+          <state>$PROJ_DIR$\libraries\smartconfig\inc</state>
+          <state>$PROJ_DIR$\..\..\components\drivers\include</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
+          <state>$PROJ_DIR$\..\..\components\drivers\wlan</state>
+          <state>$PROJ_DIR$\..\..\components\finsh</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include\posix</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\include</state>
+          <state>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\include</state>
+        </option>
+        <option>
+          <name>CCStdIncCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCodeSection</name>
+          <state>.text</state>
+        </option>
+        <option>
+          <name>IInterwork2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IProcessorMode2</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCOptLevel</name>
+          <state>3</state>
+        </option>
+        <option>
+          <name>CCOptStrategy</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptLevelSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>CCPosIndRopi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndRwpi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndNoDynInit</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccLang</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCDialect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccAllowVLA</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCppDialect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccExceptions</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccRTTI</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccStaticDestr</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccCppInlineSemantics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccFloatSemantics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptimizationNoSizeConstraints</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCNoLiteralPool</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptStrategySlave</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCGuardCalls</name>
+          <state>1</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>AARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>9</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>AObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AEndian</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>ACaseSensitivity</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacroChars</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnWhat</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnOne</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange1</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange2</name>
+          <state />
+        </option>
+        <option>
+          <name>ADebug</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AltRegisterNames</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ADefines</name>
+          <state />
+        </option>
+        <option>
+          <name>AList</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AListHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AListing</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>Includes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacDefs</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacExps</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacExec</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OnlyAssed</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MultiLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLengthCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLength</name>
+          <state>80</state>
+        </option>
+        <option>
+          <name>TabSpacing</name>
+          <state>8</state>
+        </option>
+        <option>
+          <name>AXRef</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDefines</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefInternal</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDual</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AOutputFile</name>
+          <state />
+        </option>
+        <option>
+          <name>AMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ALimitErrorsCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ALimitErrorsEdit</name>
+          <state>100</state>
+        </option>
+        <option>
+          <name>AIgnoreStdInclude</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AUserIncludes</name>
+          <state />
+        </option>
+        <option>
+          <name>AExtraOptionsCheckV2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AExtraOptionsV2</name>
+          <state />
+        </option>
+        <option>
+          <name>AsmNoLiteralPool</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>OBJCOPY</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>1</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>OOCOutputFormat</name>
+          <version>2</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OCOutputOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OOCOutputFile</name>
+          <state />
+        </option>
+        <option>
+          <name>OOCCommandLineProducer</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OOCObjCopyEnable</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>CUSTOM</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <extensions />
+        <cmdline />
+        <hasPrio>0</hasPrio>
+      </data>
+    </settings>
+    <settings>
+      <name>BICOMP</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+    <settings>
+      <name>BUILDACTION</name>
+      <archiveVersion>1</archiveVersion>
+      <data>
+        <prebuild />
+        <postbuild />
+      </data>
+    </settings>
+    <settings>
+      <name>ILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>16</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>IlinkLibIOConfig</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>XLinkMisraHandler</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkInputFileSlave</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOutputFile</name>
+          <state>###Unitialized###</state>
+        </option>
+        <option>
+          <name>IlinkDebugInfoEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkKeepSymbols</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinaryFile</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinarySymbol</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinarySegment</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinaryAlign</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkConfigDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkMapFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogInitialization</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogModule</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogSection</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogVeneer</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIcfOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIcfFile</name>
+          <state>lnk0t.icf</state>
+        </option>
+        <option>
+          <name>IlinkIcfFileSlave</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkSuppressDiags</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsRem</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsWarn</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsErr</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkWarningsAreErrors</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkUseExtraOptions</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkExtraOptions</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkLowLevelInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAutoLibEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAdditionalLibs</name>
+          <state />
+          <state>$PROJ_DIR$\libraries\smartconfig\libs\libsmartconfig_armcm4_iar.a</state>
+        </option>
+        <option>
+          <name>IlinkOverrideProgramEntryLabel</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabelSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabel</name>
+          <state />
+        </option>
+        <option>
+          <name>DoFill</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>FillerByte</name>
+          <state>0xFF</state>
+        </option>
+        <option>
+          <name>FillerStart</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>FillerEnd</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>CrcSize</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcAlign</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcPoly</name>
+          <state>0x11021</state>
+        </option>
+        <option>
+          <name>CrcCompl</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcBitOrder</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcInitialValue</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>DoCrc</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkBE8Slave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkBufferedTerminalOutput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkStdoutInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcFullSize</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIElfToolPostProcess</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogAutoLibSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogRedirSymbols</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogUnusedFragments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcReverseByteOrder</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcUseAsInput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptInline</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsAllow</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsForce</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptMergeDuplSections</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptUseVfe</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptForceVfe</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackAnalysisEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackControlFile</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkStackCallGraphFile</name>
+          <state />
+        </option>
+        <option>
+          <name>CrcAlgorithm</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcUnitSize</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkThreadsSlave</name>
+          <state>1</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>IARCHIVE</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>0</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>IarchiveInputs</name>
+          <state />
+        </option>
+        <option>
+          <name>IarchiveOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IarchiveOutput</name>
+          <state>###Unitialized###</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>BILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+  </configuration>
+  <group>
+    <name>Kernel</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\clock.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\components.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\cpu.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\device.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\idle.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\ipc.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\irq.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\kservice.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\mem.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\mempool.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\object.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\scheduler.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\signal.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\thread.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\timer.c</name>
+    </file>
+  </group>
+  <group>
+    <name>Applications</name>
+    <file>
+      <name>$PROJ_DIR$\applications\main.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\applications\smartconfig_app.c</name>
+    </file>
+  </group>
+  <group>
+    <name>Drivers</name>
+    <file>
+      <name>$PROJ_DIR$\drivers\board.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\drivers\drv_uart.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\drivers\wlan\drv_wifi.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\drivers\wlan\drv_wlan.c</name>
+    </file>
+  </group>
+  <group>
+    <name>smartconfig</name>
+  </group>
+  <group>
+    <name>cpu</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\common\div0.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\common\showmem.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4\cpuport.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\cortex-m4\context_iar.S</name>
+    </file>
+  </group>
+  <group>
+    <name>DeviceDrivers</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\serial\serial.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\completion.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\dataqueue.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\pipe.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\ringblk_buf.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\ringbuffer.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\waitqueue.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\workqueue.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\wlan\wlan_dev.c</name>
+    </file>
+  </group>
+  <group>
+    <name>finsh</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\shell.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\cmd.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\msh.c</name>
+    </file>
+  </group>
+  <group>
+    <name>libc</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\common\time.c</name>
+    </file>
+  </group>
+  <group>
+    <name>dlib</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\environ.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\libc.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\rmtx.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\stdio.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_close.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_lseek.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_mem.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_open.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_read.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_remove.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_write.c</name>
+    </file>
+  </group>
+  <group>
+    <name>lwIP</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\arch\sys_arch.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\api_lib.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\api_msg.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\err.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netbuf.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netdb.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\netifapi.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\sockets.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\api\tcpip.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\def.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\dns.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\inet_chksum.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\init.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ip.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\memp.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\netif.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\pbuf.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\raw.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\stats.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\sys.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp_in.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\tcp_out.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\timeouts.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\udp.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\ethernet.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\ethernetif.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\netif\lowpan6.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\autoip.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\dhcp.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\etharp.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\icmp.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\igmp.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4_addr.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip-2.0.2\src\core\ipv4\ip4_frag.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\net\lwip_dhcpd\dhcp_server_raw.c</name>
+    </file>
+  </group>
+</project>

+ 10 - 10
bsp/amebaz/project.eww

@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<workspace>
-  <project>
-    <path>$WS_DIR$\project.ewp</path>
-  </project>
-  <batchBuild/>
-</workspace>
-
-
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<workspace>
+  <project>
+    <path>$WS_DIR$\project.ewp</path>
+  </project>
+  <batchBuild/>
+</workspace>
+
+

+ 1 - 1
bsp/amebaz/rtconfig.h

@@ -13,7 +13,7 @@
 #define RT_TICK_PER_SECOND 1000
 #define RT_USING_OVERFLOW_CHECK
 #define RT_USING_HOOK
-#define RT_IDEL_HOOK_LIST_SIZE 4
+#define RT_IDLE_HOOK_LIST_SIZE 4
 #define IDLE_THREAD_STACK_SIZE 256
 #define RT_USING_TIMER_SOFT
 #define RT_TIMER_THREAD_PRIO 4

+ 1 - 0
bsp/apollo2/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread_apollo2.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 0 - 1224
bsp/apollo2/project.uvoptx

@@ -161,1228 +161,4 @@
     </TargetOption>
   </Target>
 
-  <Group>
-    <GroupName>Applications</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>1</GroupNumber>
-      <FileNumber>1</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>applications\main.c</PathWithFileName>
-      <FilenameWithoutPath>main.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>Board</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>2</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\adc.c</PathWithFileName>
-      <FilenameWithoutPath>adc.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>3</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\board.c</PathWithFileName>
-      <FilenameWithoutPath>board.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>4</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\flash.c</PathWithFileName>
-      <FilenameWithoutPath>flash.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>5</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\gpio.c</PathWithFileName>
-      <FilenameWithoutPath>gpio.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>6</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\i2c.c</PathWithFileName>
-      <FilenameWithoutPath>i2c.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>7</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\led.c</PathWithFileName>
-      <FilenameWithoutPath>led.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>8</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\pdm.c</PathWithFileName>
-      <FilenameWithoutPath>pdm.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>9</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\pwm.c</PathWithFileName>
-      <FilenameWithoutPath>pwm.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>10</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\rtc.c</PathWithFileName>
-      <FilenameWithoutPath>rtc.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>11</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\smbus.c</PathWithFileName>
-      <FilenameWithoutPath>smbus.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>12</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\spi.c</PathWithFileName>
-      <FilenameWithoutPath>spi.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>2</GroupNumber>
-      <FileNumber>13</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>board\uart.c</PathWithFileName>
-      <FilenameWithoutPath>uart.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>Libraries</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>14</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_clkgen.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_clkgen.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>15</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_debug.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_debug.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>16</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_cachectrl.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_cachectrl.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>17</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_pwrctrl.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_pwrctrl.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>18</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_mcuctrl.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_mcuctrl.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>19</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_sysctrl.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_sysctrl.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>20</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_reset.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_reset.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>21</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_stimer.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_stimer.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>22</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_ctimer.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_ctimer.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>23</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_rtc.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_rtc.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>24</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_interrupt.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_interrupt.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>25</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_queue.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_queue.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>26</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_iom.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_iom.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>27</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_ios.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_ios.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>28</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_vcomp.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_vcomp.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>29</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_flash.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_flash.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>30</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_gpio.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_gpio.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>31</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_uart.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_uart.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>32</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_adc.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_adc.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>33</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_pdm.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_pdm.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>34</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\drivers\hal\am_hal_i2c_bit_bang.c</PathWithFileName>
-      <FilenameWithoutPath>am_hal_i2c_bit_bang.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>3</GroupNumber>
-      <FileNumber>35</FileNumber>
-      <FileType>2</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>libraries\startup\arm\startup_keil.s</PathWithFileName>
-      <FilenameWithoutPath>startup_keil.s</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>Kernel</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>36</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\clock.c</PathWithFileName>
-      <FilenameWithoutPath>clock.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>37</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\components.c</PathWithFileName>
-      <FilenameWithoutPath>components.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>38</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\device.c</PathWithFileName>
-      <FilenameWithoutPath>device.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>39</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\idle.c</PathWithFileName>
-      <FilenameWithoutPath>idle.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>40</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\ipc.c</PathWithFileName>
-      <FilenameWithoutPath>ipc.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>41</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\irq.c</PathWithFileName>
-      <FilenameWithoutPath>irq.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>42</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\kservice.c</PathWithFileName>
-      <FilenameWithoutPath>kservice.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>43</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\mem.c</PathWithFileName>
-      <FilenameWithoutPath>mem.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>44</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\mempool.c</PathWithFileName>
-      <FilenameWithoutPath>mempool.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>45</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\object.c</PathWithFileName>
-      <FilenameWithoutPath>object.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>46</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\scheduler.c</PathWithFileName>
-      <FilenameWithoutPath>scheduler.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>47</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\signal.c</PathWithFileName>
-      <FilenameWithoutPath>signal.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>48</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\thread.c</PathWithFileName>
-      <FilenameWithoutPath>thread.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>4</GroupNumber>
-      <FileNumber>49</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\src\timer.c</PathWithFileName>
-      <FilenameWithoutPath>timer.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>CORTEX-M4</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>5</GroupNumber>
-      <FileNumber>50</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\libcpu\arm\cortex-m4\cpuport.c</PathWithFileName>
-      <FilenameWithoutPath>cpuport.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>5</GroupNumber>
-      <FileNumber>51</FileNumber>
-      <FileType>2</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\libcpu\arm\cortex-m4\context_rvds.S</PathWithFileName>
-      <FilenameWithoutPath>context_rvds.S</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>5</GroupNumber>
-      <FileNumber>52</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\libcpu\arm\common\backtrace.c</PathWithFileName>
-      <FilenameWithoutPath>backtrace.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>5</GroupNumber>
-      <FileNumber>53</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\libcpu\arm\common\div0.c</PathWithFileName>
-      <FilenameWithoutPath>div0.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>5</GroupNumber>
-      <FileNumber>54</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\libcpu\arm\common\showmem.c</PathWithFileName>
-      <FilenameWithoutPath>showmem.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>Filesystem</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>6</GroupNumber>
-      <FileNumber>55</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\dfs\src\dfs.c</PathWithFileName>
-      <FilenameWithoutPath>dfs.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>6</GroupNumber>
-      <FileNumber>56</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\dfs\src\dfs_file.c</PathWithFileName>
-      <FilenameWithoutPath>dfs_file.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>6</GroupNumber>
-      <FileNumber>57</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\dfs\src\dfs_fs.c</PathWithFileName>
-      <FilenameWithoutPath>dfs_fs.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>6</GroupNumber>
-      <FileNumber>58</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\dfs\src\dfs_posix.c</PathWithFileName>
-      <FilenameWithoutPath>dfs_posix.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>6</GroupNumber>
-      <FileNumber>59</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\dfs\src\poll.c</PathWithFileName>
-      <FilenameWithoutPath>poll.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>6</GroupNumber>
-      <FileNumber>60</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\dfs\src\select.c</PathWithFileName>
-      <FilenameWithoutPath>select.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>6</GroupNumber>
-      <FileNumber>61</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\dfs\filesystems\devfs\devfs.c</PathWithFileName>
-      <FilenameWithoutPath>devfs.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>DeviceDrivers</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>62</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\i2c\i2c_core.c</PathWithFileName>
-      <FilenameWithoutPath>i2c_core.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>63</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\i2c\i2c_dev.c</PathWithFileName>
-      <FilenameWithoutPath>i2c_dev.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>64</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\misc\pin.c</PathWithFileName>
-      <FilenameWithoutPath>pin.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>65</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\rtc\rtc.c</PathWithFileName>
-      <FilenameWithoutPath>rtc_rtc.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>66</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\serial\serial.c</PathWithFileName>
-      <FilenameWithoutPath>serial.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>67</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\spi\spi_core.c</PathWithFileName>
-      <FilenameWithoutPath>spi_core.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>68</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\spi\spi_dev.c</PathWithFileName>
-      <FilenameWithoutPath>spi_dev.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>69</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\src\completion.c</PathWithFileName>
-      <FilenameWithoutPath>completion.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>70</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\src\dataqueue.c</PathWithFileName>
-      <FilenameWithoutPath>dataqueue.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>71</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\src\pipe.c</PathWithFileName>
-      <FilenameWithoutPath>pipe.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>72</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\src\ringblk_buf.c</PathWithFileName>
-      <FilenameWithoutPath>ringblk_buf.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>73</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\src\ringbuffer.c</PathWithFileName>
-      <FilenameWithoutPath>ringbuffer.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>74</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\src\waitqueue.c</PathWithFileName>
-      <FilenameWithoutPath>waitqueue.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>7</GroupNumber>
-      <FileNumber>75</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\drivers\src\workqueue.c</PathWithFileName>
-      <FilenameWithoutPath>workqueue.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>finsh</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>76</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\shell.c</PathWithFileName>
-      <FilenameWithoutPath>shell.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>77</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\symbol.c</PathWithFileName>
-      <FilenameWithoutPath>symbol.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>78</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\cmd.c</PathWithFileName>
-      <FilenameWithoutPath>cmd.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>79</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\msh.c</PathWithFileName>
-      <FilenameWithoutPath>msh.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>80</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\msh_cmd.c</PathWithFileName>
-      <FilenameWithoutPath>msh_cmd.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>81</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\msh_file.c</PathWithFileName>
-      <FilenameWithoutPath>msh_file.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>82</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_compiler.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_compiler.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>83</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_error.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_error.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>84</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_heap.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_heap.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>85</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_init.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_init.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>86</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_node.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_node.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>87</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_ops.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_ops.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>88</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_parser.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_parser.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>89</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_var.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_var.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>90</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_vm.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_vm.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>8</GroupNumber>
-      <FileNumber>91</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\finsh\finsh_token.c</PathWithFileName>
-      <FilenameWithoutPath>finsh_token.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
-  <Group>
-    <GroupName>libc</GroupName>
-    <tvExp>0</tvExp>
-    <tvExpOptDlg>0</tvExpOptDlg>
-    <cbSel>0</cbSel>
-    <RteFlg>0</RteFlg>
-    <File>
-      <GroupNumber>9</GroupNumber>
-      <FileNumber>92</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\libc\compilers\armlibc\libc.c</PathWithFileName>
-      <FilenameWithoutPath>libc.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>9</GroupNumber>
-      <FileNumber>93</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\libc\compilers\armlibc\mem_std.c</PathWithFileName>
-      <FilenameWithoutPath>mem_std.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>9</GroupNumber>
-      <FileNumber>94</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\libc\compilers\armlibc\stdio.c</PathWithFileName>
-      <FilenameWithoutPath>stdio.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>9</GroupNumber>
-      <FileNumber>95</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\libc\compilers\armlibc\stubs.c</PathWithFileName>
-      <FilenameWithoutPath>stubs.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-    <File>
-      <GroupNumber>9</GroupNumber>
-      <FileNumber>96</FileNumber>
-      <FileType>1</FileType>
-      <tvExp>0</tvExp>
-      <tvExpOptDlg>0</tvExpOptDlg>
-      <bDave2>0</bDave2>
-      <PathWithFileName>..\..\components\libc\compilers\armlibc\time.c</PathWithFileName>
-      <FilenameWithoutPath>time.c</FilenameWithoutPath>
-      <RteFlg>0</RteFlg>
-      <bShared>0</bShared>
-    </File>
-  </Group>
-
 </ProjectOpt>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 314 - 210
bsp/apollo2/project.uvprojx


+ 5 - 1
bsp/asm9260t/Kconfig

@@ -18,6 +18,11 @@ config PKGS_DIR
 source "$RTT_DIR/Kconfig"
 source "$PKGS_DIR/Kconfig"
 
+config SOC_AT91SAM926
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
+    default y
+
 config RT_USING_UART0
     bool "Using RT_USING_UART0"
     default n    
@@ -35,4 +40,3 @@ config RT_USING_LED
 	default y
 	help
 		led blink demo
- 

+ 1 - 0
bsp/asm9260t/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 2277 - 2264
bsp/asm9260t/project.ewp

@@ -1,2268 +1,2281 @@
-<?xml version="1.0" encoding="UTF-8"?>
 <project>
-    <fileVersion>3</fileVersion>
-    <configuration>
-        <name>Debug</name>
-        <toolchain>
-            <name>ARM</name>
-        </toolchain>
+  <fileVersion>3</fileVersion>
+  <configuration>
+    <name>Debug</name>
+    <toolchain>
+      <name>ARM</name>
+    </toolchain>
+    <debug>1</debug>
+    <settings>
+      <name>General</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <version>28</version>
+        <wantNonLocal>1</wantNonLocal>
         <debug>1</debug>
-        <settings>
-            <name>General</name>
-            <archiveVersion>3</archiveVersion>
-            <data>
-                <version>28</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>1</debug>
-                <option>
-                    <name>ExePath</name>
-                    <state>build\Debug\Exe</state>
-                </option>
-                <option>
-                    <name>ObjPath</name>
-                    <state>build\Debug\Obj</state>
-                </option>
-                <option>
-                    <name>ListPath</name>
-                    <state>build\Debug\List</state>
-                </option>
-                <option>
-                    <name>GEndianMode</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>Input description</name>
-                    <state>Full formatting, without multibyte support.</state>
-                </option>
-                <option>
-                    <name>Output description</name>
-                    <state>Full formatting, without multibyte support.</state>
-                </option>
-                <option>
-                    <name>GOutputBinary</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGCoreOrChip</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GRuntimeLibSelect</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>GRuntimeLibSelectSlave</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>RTDescription</name>
-                    <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
-                </option>
-                <option>
-                    <name>OGProductVersion</name>
-                    <state>5.10.0.159</state>
-                </option>
-                <option>
-                    <name>OGLastSavedByProductVersion</name>
-                    <state>8.10.1.12859</state>
-                </option>
-                <option>
-                    <name>GeneralEnableMisra</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GeneralMisraVerbose</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGChipSelectEditMenu</name>
-                    <state>AT91SAM9260	Atmel AT91SAM9260</state>
-                </option>
-                <option>
-                    <name>GenLowLevelInterface</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>GEndianModeBE</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGBufferedTerminalOutput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GenStdoutInterface</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GeneralMisraRules98</name>
-                    <version>0</version>
-                    <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-                </option>
-                <option>
-                    <name>GeneralMisraVer</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GeneralMisraRules04</name>
-                    <version>0</version>
-                    <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-                </option>
-                <option>
-                    <name>RTConfigPath2</name>
-                    <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
-                </option>
-                <option>
-                    <name>GBECoreSlave</name>
-                    <version>24</version>
-                    <state>12</state>
-                </option>
-                <option>
-                    <name>OGUseCmsis</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGUseCmsisDspLib</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GRuntimeLibThreads</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CoreVariant</name>
-                    <version>24</version>
-                    <state>12</state>
-                </option>
-                <option>
-                    <name>GFPUDeviceSlave</name>
-                    <state>AT91SAM9260	Atmel AT91SAM9260</state>
-                </option>
-                <option>
-                    <name>FPU2</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>NrRegs</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>NEON</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GFPUCoreSlave2</name>
-                    <version>24</version>
-                    <state>12</state>
-                </option>
-                <option>
-                    <name>OGCMSISPackSelectDevice</name>
-                </option>
-                <option>
-                    <name>OgLibHeap</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGLibAdditionalLocale</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGPrintfVariant</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OGPrintfMultibyteSupport</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGScanfVariant</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OGScanfMultibyteSupport</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GenLocaleTags</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>GenLocaleDisplayOnly</name>
-                    <state></state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>ICCARM</name>
-            <archiveVersion>2</archiveVersion>
-            <data>
-                <version>34</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>1</debug>
-                <option>
-                    <name>CCOptimizationNoSizeConstraints</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCDefines</name>
-                    <state>RT_USING_DLIBC</state>
-                </option>
-                <option>
-                    <name>CCPreprocFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPreprocComments</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPreprocLine</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListCFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListCMnemonics</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListCMessages</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListAssFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListAssSource</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCEnableRemarks</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCDiagSuppress</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCDiagRemark</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCDiagWarning</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCDiagError</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCObjPrefix</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCAllowList</name>
-                    <version>1</version>
-                    <state>00000000</state>
-                </option>
-                <option>
-                    <name>CCDebugInfo</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IEndianMode</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IExtraOptionsCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IExtraOptions</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCLangConformance</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCSignedPlainChar</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCRequirePrototypes</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCDiagWarnAreErr</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCCompilerRuntimeInfo</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IFpuProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OutputFile</name>
-                    <state>$FILE_BNAME$.o</state>
-                </option>
-                <option>
-                    <name>CCLibConfigHeader</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>PreInclude</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CompilerMisraOverride</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCIncludePath2</name>
-                    <state>$PROJ_DIR$\../../libcpu/arm/common</state>
-                    <state>$PROJ_DIR$\../../components/drivers/include</state>
-                    <state>$PROJ_DIR$\platform</state>
-                    <state>$PROJ_DIR$\../../components/libc/compilers/dlib</state>
-                    <state>$PROJ_DIR$\drivers</state>
-                    <state>$PROJ_DIR$\../../libcpu/arm/arm926</state>
-                    <state>$PROJ_DIR$\.</state>
-                    <state>$PROJ_DIR$\applications</state>
-                    <state>$PROJ_DIR$\../../include</state>
-                    <state>$PROJ_DIR$\../../components/finsh</state>
-                </option>
-                <option>
-                    <name>CCStdIncCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCCodeSection</name>
-                    <state>.text</state>
-                </option>
-                <option>
-                    <name>IProcessorMode2</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCOptLevel</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCOptStrategy</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCOptLevelSlave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CompilerMisraRules98</name>
-                    <version>0</version>
-                    <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-                </option>
-                <option>
-                    <name>CompilerMisraRules04</name>
-                    <version>0</version>
-                    <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-                </option>
-                <option>
-                    <name>CCPosIndRopi</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPosIndRwpi</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPosIndNoDynInit</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccLang</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccCDialect</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IccAllowVLA</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccStaticDestr</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IccCppInlineSemantics</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccCmsis</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IccFloatSemantics</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCNoLiteralPool</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCOptStrategySlave</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCGuardCalls</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCEncSource</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCEncOutput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCEncOutputBom</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCEncInput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccExceptions2</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccRTTI2</name>
-                    <state>0</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>AARM</name>
-            <archiveVersion>2</archiveVersion>
-            <data>
-                <version>10</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>1</debug>
-                <option>
-                    <name>AObjPrefix</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AEndian</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>ACaseSensitivity</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>MacroChars</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AWarnEnable</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AWarnWhat</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AWarnOne</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AWarnRange1</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AWarnRange2</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>ADebug</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AltRegisterNames</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>ADefines</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AList</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AListHeader</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AListing</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>Includes</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>MacDefs</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>MacExps</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>MacExec</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OnlyAssed</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>MultiLine</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>PageLengthCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>PageLength</name>
-                    <state>80</state>
-                </option>
-                <option>
-                    <name>TabSpacing</name>
-                    <state>8</state>
-                </option>
-                <option>
-                    <name>AXRef</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AXRefDefines</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AXRefInternal</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AXRefDual</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AFpuProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AOutputFile</name>
-                    <state>$FILE_BNAME$.o</state>
-                </option>
-                <option>
-                    <name>ALimitErrorsCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>ALimitErrorsEdit</name>
-                    <state>100</state>
-                </option>
-                <option>
-                    <name>AIgnoreStdInclude</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AUserIncludes</name>
-                    <state>$PROJ_DIR$\platform</state>
-                </option>
-                <option>
-                    <name>AExtraOptionsCheckV2</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AExtraOptionsV2</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AsmNoLiteralPool</name>
-                    <state>0</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>OBJCOPY</name>
-            <archiveVersion>0</archiveVersion>
-            <data>
-                <version>1</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>1</debug>
-                <option>
-                    <name>OOCOutputFormat</name>
-                    <version>3</version>
-                    <state>3</state>
-                </option>
-                <option>
-                    <name>OCOutputOverride</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OOCOutputFile</name>
-                    <state>rtthread.bin</state>
-                </option>
-                <option>
-                    <name>OOCCommandLineProducer</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OOCObjCopyEnable</name>
-                    <state>1</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>CUSTOM</name>
-            <archiveVersion>3</archiveVersion>
-            <data>
-                <extensions></extensions>
-                <cmdline></cmdline>
-                <hasPrio>0</hasPrio>
-            </data>
-        </settings>
-        <settings>
-            <name>BICOMP</name>
-            <archiveVersion>0</archiveVersion>
-            <data />
-        </settings>
-        <settings>
-            <name>BUILDACTION</name>
-            <archiveVersion>1</archiveVersion>
-            <data>
-                <prebuild></prebuild>
-                <postbuild></postbuild>
-            </data>
-        </settings>
-        <settings>
-            <name>ILINK</name>
-            <archiveVersion>0</archiveVersion>
-            <data>
-                <version>20</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>1</debug>
-                <option>
-                    <name>IlinkOutputFile</name>
-                    <state>rtthread.out</state>
-                </option>
-                <option>
-                    <name>IlinkLibIOConfig</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>XLinkMisraHandler</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkInputFileSlave</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkDebugInfoEnable</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkKeepSymbols</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinaryFile</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinarySymbol</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinarySegment</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinaryAlign</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkDefines</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkConfigDefines</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkMapFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogInitialization</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogModule</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogSection</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogVeneer</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkIcfOverride</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkIcfFile</name>
-                    <state>D:\GitHub\rt-thread\bsp\asm9260t\link_scripts\sdram.icf</state>
-                </option>
-                <option>
-                    <name>IlinkIcfFileSlave</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkEnableRemarks</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkSuppressDiags</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkTreatAsRem</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkTreatAsWarn</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkTreatAsErr</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkWarningsAreErrors</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkUseExtraOptions</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkExtraOptions</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkLowLevelInterfaceSlave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkAutoLibEnable</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkAdditionalLibs</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkOverrideProgramEntryLabel</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkProgramEntryLabelSelect</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkProgramEntryLabel</name>
-                    <state>__iar_program_start</state>
-                </option>
-                <option>
-                    <name>DoFill</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>FillerByte</name>
-                    <state>0xFF</state>
-                </option>
-                <option>
-                    <name>FillerStart</name>
-                    <state>0x0</state>
-                </option>
-                <option>
-                    <name>FillerEnd</name>
-                    <state>0x0</state>
-                </option>
-                <option>
-                    <name>CrcSize</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcAlign</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcPoly</name>
-                    <state>0x11021</state>
-                </option>
-                <option>
-                    <name>CrcCompl</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CrcBitOrder</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CrcInitialValue</name>
-                    <state>0x0</state>
-                </option>
-                <option>
-                    <name>DoCrc</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkBE8Slave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkBufferedTerminalOutput</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkStdoutInterfaceSlave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcFullSize</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkIElfToolPostProcess</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogAutoLibSelect</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogRedirSymbols</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogUnusedFragments</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkCrcReverseByteOrder</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkCrcUseAsInput</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptInline</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkOptExceptionsAllow</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptExceptionsForce</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkCmsis</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptMergeDuplSections</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkOptUseVfe</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptForceVfe</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkStackAnalysisEnable</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkStackControlFile</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkStackCallGraphFile</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CrcAlgorithm</name>
-                    <version>1</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcUnitSize</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkThreadsSlave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkLogCallGraph</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkIcfFile_AltDefault</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkEncInput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkEncOutput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkEncOutputBom</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkHeapSelect</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkLocaleSelect</name>
-                    <state>1</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>IARCHIVE</name>
-            <archiveVersion>0</archiveVersion>
-            <data>
-                <version>0</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>1</debug>
-                <option>
-                    <name>IarchiveInputs</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IarchiveOverride</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IarchiveOutput</name>
-                    <state>###Unitialized###</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>BILINK</name>
-            <archiveVersion>0</archiveVersion>
-            <data />
-        </settings>
-    </configuration>
-    <configuration>
-        <name>Release</name>
-        <toolchain>
-            <name>ARM</name>
-        </toolchain>
+        <option>
+          <name>ExePath</name>
+          <state>build\Debug\Exe</state>
+        </option>
+        <option>
+          <name>ObjPath</name>
+          <state>build\Debug\Obj</state>
+        </option>
+        <option>
+          <name>ListPath</name>
+          <state>build\Debug\List</state>
+        </option>
+        <option>
+          <name>GEndianMode</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Input description</name>
+          <state>Full formatting, without multibyte support.</state>
+        </option>
+        <option>
+          <name>Output description</name>
+          <state>Full formatting, without multibyte support.</state>
+        </option>
+        <option>
+          <name>GOutputBinary</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGCoreOrChip</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelect</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelectSlave</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>RTDescription</name>
+          <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
+        </option>
+        <option>
+          <name>OGProductVersion</name>
+          <state>5.10.0.159</state>
+        </option>
+        <option>
+          <name>OGLastSavedByProductVersion</name>
+          <state>8.10.1.12859</state>
+        </option>
+        <option>
+          <name>GeneralEnableMisra</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraVerbose</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGChipSelectEditMenu</name>
+          <state>AT91SAM9260	Atmel AT91SAM9260</state>
+        </option>
+        <option>
+          <name>GenLowLevelInterface</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>GEndianModeBE</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGBufferedTerminalOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GenStdoutInterface</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>GeneralMisraVer</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>RTConfigPath2</name>
+          <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
+        </option>
+        <option>
+          <name>GBECoreSlave</name>
+          <version>24</version>
+          <state>12</state>
+        </option>
+        <option>
+          <name>OGUseCmsis</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGUseCmsisDspLib</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibThreads</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CoreVariant</name>
+          <version>24</version>
+          <state>12</state>
+        </option>
+        <option>
+          <name>GFPUDeviceSlave</name>
+          <state>AT91SAM9260	Atmel AT91SAM9260</state>
+        </option>
+        <option>
+          <name>FPU2</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>NrRegs</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>NEON</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GFPUCoreSlave2</name>
+          <version>24</version>
+          <state>12</state>
+        </option>
+        <option>
+          <name>OGCMSISPackSelectDevice</name>
+        </option>
+        <option>
+          <name>OgLibHeap</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGLibAdditionalLocale</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGPrintfVariant</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OGPrintfMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGScanfVariant</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OGScanfMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GenLocaleTags</name>
+          <state />
+        </option>
+        <option>
+          <name>GenLocaleDisplayOnly</name>
+          <state />
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>ICCARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>34</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>CCOptimizationNoSizeConstraints</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDefines</name>
+          <state />
+          <state>RT_USING_DLIBC</state>
+        </option>
+        <option>
+          <name>CCPreprocFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocComments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMnemonics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMessages</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssSource</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagSuppress</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagRemark</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagWarning</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagError</name>
+          <state />
+        </option>
+        <option>
+          <name>CCObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCAllowList</name>
+          <version>1</version>
+          <state>00000000</state>
+        </option>
+        <option>
+          <name>CCDebugInfo</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IEndianMode</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IExtraOptionsCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IExtraOptions</name>
+          <state />
+        </option>
+        <option>
+          <name>CCLangConformance</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCSignedPlainChar</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCRequirePrototypes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagWarnAreErr</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCompilerRuntimeInfo</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OutputFile</name>
+          <state>$FILE_BNAME$.o</state>
+        </option>
+        <option>
+          <name>CCLibConfigHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>PreInclude</name>
+          <state />
+        </option>
+        <option>
+          <name>CompilerMisraOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCIncludePath2</name>
+          <state />
+          <state>$PROJ_DIR$\applications</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\dlib</state>
+          <state>$PROJ_DIR$\drivers</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\common</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\arm926</state>
+          <state>$PROJ_DIR$\.</state>
+          <state>$PROJ_DIR$\..\..\include</state>
+          <state>$PROJ_DIR$\platform</state>
+          <state>$PROJ_DIR$\..\..\components\drivers\include</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
+          <state>$PROJ_DIR$\..\..\components\finsh</state>
+        </option>
+        <option>
+          <name>CCStdIncCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCodeSection</name>
+          <state>.text</state>
+        </option>
+        <option>
+          <name>IProcessorMode2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptLevel</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCOptStrategy</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptLevelSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>CCPosIndRopi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndRwpi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndNoDynInit</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccLang</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCDialect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccAllowVLA</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccStaticDestr</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccCppInlineSemantics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccFloatSemantics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCNoLiteralPool</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptStrategySlave</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCGuardCalls</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCEncSource</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEncOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEncOutputBom</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCEncInput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccExceptions2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccRTTI2</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>AARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>10</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>AObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AEndian</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>ACaseSensitivity</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacroChars</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnWhat</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnOne</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange1</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange2</name>
+          <state />
+        </option>
+        <option>
+          <name>ADebug</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AltRegisterNames</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ADefines</name>
+          <state />
+        </option>
+        <option>
+          <name>AList</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AListHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AListing</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>Includes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacDefs</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacExps</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacExec</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OnlyAssed</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MultiLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLengthCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLength</name>
+          <state>80</state>
+        </option>
+        <option>
+          <name>TabSpacing</name>
+          <state>8</state>
+        </option>
+        <option>
+          <name>AXRef</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDefines</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefInternal</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDual</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AOutputFile</name>
+          <state>$FILE_BNAME$.o</state>
+        </option>
+        <option>
+          <name>ALimitErrorsCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ALimitErrorsEdit</name>
+          <state>100</state>
+        </option>
+        <option>
+          <name>AIgnoreStdInclude</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AUserIncludes</name>
+          <state>D:\GitHub\rt-thread\bsp\asm9260t\platform</state>
+        </option>
+        <option>
+          <name>AExtraOptionsCheckV2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AExtraOptionsV2</name>
+          <state />
+        </option>
+        <option>
+          <name>AsmNoLiteralPool</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>OBJCOPY</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>1</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>OOCOutputFormat</name>
+          <version>3</version>
+          <state>3</state>
+        </option>
+        <option>
+          <name>OCOutputOverride</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OOCOutputFile</name>
+          <state>rtthread.bin</state>
+        </option>
+        <option>
+          <name>OOCCommandLineProducer</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OOCObjCopyEnable</name>
+          <state>1</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>CUSTOM</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <extensions />
+        <cmdline />
+        <hasPrio>0</hasPrio>
+      </data>
+    </settings>
+    <settings>
+      <name>BICOMP</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+    <settings>
+      <name>BUILDACTION</name>
+      <archiveVersion>1</archiveVersion>
+      <data>
+        <prebuild />
+        <postbuild />
+      </data>
+    </settings>
+    <settings>
+      <name>ILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>20</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>IlinkOutputFile</name>
+          <state>rtthread.out</state>
+        </option>
+        <option>
+          <name>IlinkLibIOConfig</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>XLinkMisraHandler</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkInputFileSlave</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkDebugInfoEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkKeepSymbols</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinaryFile</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinarySymbol</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinarySegment</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinaryAlign</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkConfigDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkMapFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogInitialization</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogModule</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogSection</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogVeneer</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIcfOverride</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkIcfFile</name>
+          <state>D:\GitHub\rt-thread\bsp\asm9260t\link_scripts\sdram.icf</state>
+        </option>
+        <option>
+          <name>IlinkIcfFileSlave</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkSuppressDiags</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsRem</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsWarn</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsErr</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkWarningsAreErrors</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkUseExtraOptions</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkExtraOptions</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkLowLevelInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAutoLibEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAdditionalLibs</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkOverrideProgramEntryLabel</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabelSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabel</name>
+          <state>__iar_program_start</state>
+        </option>
+        <option>
+          <name>DoFill</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>FillerByte</name>
+          <state>0xFF</state>
+        </option>
+        <option>
+          <name>FillerStart</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>FillerEnd</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>CrcSize</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcAlign</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcPoly</name>
+          <state>0x11021</state>
+        </option>
+        <option>
+          <name>CrcCompl</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcBitOrder</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcInitialValue</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>DoCrc</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkBE8Slave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkBufferedTerminalOutput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkStdoutInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcFullSize</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIElfToolPostProcess</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogAutoLibSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogRedirSymbols</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogUnusedFragments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcReverseByteOrder</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcUseAsInput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptInline</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsAllow</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsForce</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptMergeDuplSections</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptUseVfe</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptForceVfe</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackAnalysisEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackControlFile</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkStackCallGraphFile</name>
+          <state />
+        </option>
+        <option>
+          <name>CrcAlgorithm</name>
+          <version>1</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcUnitSize</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkThreadsSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkLogCallGraph</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIcfFile_AltDefault</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkEncInput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkEncOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkEncOutputBom</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkHeapSelect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkLocaleSelect</name>
+          <state>1</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>IARCHIVE</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>0</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>1</debug>
+        <option>
+          <name>IarchiveInputs</name>
+          <state />
+        </option>
+        <option>
+          <name>IarchiveOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IarchiveOutput</name>
+          <state>###Unitialized###</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>BILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+  </configuration>
+  <configuration>
+    <name>Release</name>
+    <toolchain>
+      <name>ARM</name>
+    </toolchain>
+    <debug>0</debug>
+    <settings>
+      <name>General</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <version>28</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>ExePath</name>
+          <state>Release\Exe</state>
+        </option>
+        <option>
+          <name>ObjPath</name>
+          <state>Release\Obj</state>
+        </option>
+        <option>
+          <name>ListPath</name>
+          <state>Release\List</state>
+        </option>
+        <option>
+          <name>GEndianMode</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>Input description</name>
+          <state>Full formatting.</state>
+        </option>
+        <option>
+          <name>Output description</name>
+          <state>Full formatting.</state>
+        </option>
+        <option>
+          <name>GOutputBinary</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGCoreOrChip</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelect</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>GRuntimeLibSelectSlave</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>RTDescription</name>
+          <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
+        </option>
+        <option>
+          <name>OGProductVersion</name>
+          <state>5.10.0.159</state>
+        </option>
+        <option>
+          <name>OGLastSavedByProductVersion</name>
+          <state>8.10.1.12859</state>
+        </option>
+        <option>
+          <name>GeneralEnableMisra</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraVerbose</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGChipSelectEditMenu</name>
+          <state>default	None</state>
+        </option>
+        <option>
+          <name>GenLowLevelInterface</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GEndianModeBE</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGBufferedTerminalOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GenStdoutInterface</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>GeneralMisraVer</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GeneralMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>RTConfigPath2</name>
+          <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
+        </option>
+        <option>
+          <name>GBECoreSlave</name>
+          <version>24</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGUseCmsis</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGUseCmsisDspLib</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GRuntimeLibThreads</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CoreVariant</name>
+          <version>24</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GFPUDeviceSlave</name>
+          <state>default	None</state>
+        </option>
+        <option>
+          <name>FPU2</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>NrRegs</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>NEON</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GFPUCoreSlave2</name>
+          <version>24</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGCMSISPackSelectDevice</name>
+        </option>
+        <option>
+          <name>OgLibHeap</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGLibAdditionalLocale</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGPrintfVariant</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OGPrintfMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OGScanfVariant</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OGScanfMultibyteSupport</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>GenLocaleTags</name>
+          <state />
+        </option>
+        <option>
+          <name>GenLocaleDisplayOnly</name>
+          <state />
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>ICCARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>34</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>CCOptimizationNoSizeConstraints</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDefines</name>
+          <state>NDEBUG</state>
+          <state>RT_USING_DLIBC</state>
+        </option>
+        <option>
+          <name>CCPreprocFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocComments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPreprocLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMnemonics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListCMessages</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCListAssSource</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagSuppress</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagRemark</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagWarning</name>
+          <state />
+        </option>
+        <option>
+          <name>CCDiagError</name>
+          <state />
+        </option>
+        <option>
+          <name>CCObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCAllowList</name>
+          <version>1</version>
+          <state>11111110</state>
+        </option>
+        <option>
+          <name>CCDebugInfo</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IEndianMode</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IExtraOptionsCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IExtraOptions</name>
+          <state />
+        </option>
+        <option>
+          <name>CCLangConformance</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCSignedPlainChar</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCRequirePrototypes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCDiagWarnAreErr</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCompilerRuntimeInfo</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OutputFile</name>
+          <state>$FILE_BNAME$.o</state>
+        </option>
+        <option>
+          <name>CCLibConfigHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>PreInclude</name>
+          <state />
+        </option>
+        <option>
+          <name>CompilerMisraOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCIncludePath2</name>
+          <state />
+          <state>$PROJ_DIR$\applications</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\dlib</state>
+          <state>$PROJ_DIR$\drivers</state>
+          <state>$PROJ_DIR$\..\..\components\libc\compilers\common</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\arm926</state>
+          <state>$PROJ_DIR$\.</state>
+          <state>$PROJ_DIR$\..\..\include</state>
+          <state>$PROJ_DIR$\platform</state>
+          <state>$PROJ_DIR$\..\..\components\drivers\include</state>
+          <state>$PROJ_DIR$\..\..\libcpu\arm\common</state>
+          <state>$PROJ_DIR$\..\..\components\finsh</state>
+        </option>
+        <option>
+          <name>CCStdIncCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCCodeSection</name>
+          <state>.text</state>
+        </option>
+        <option>
+          <name>IProcessorMode2</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCOptLevel</name>
+          <state>3</state>
+        </option>
+        <option>
+          <name>CCOptStrategy</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptLevelSlave</name>
+          <state>3</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules98</name>
+          <version>0</version>
+          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
+        </option>
+        <option>
+          <name>CompilerMisraRules04</name>
+          <version>0</version>
+          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
+        </option>
+        <option>
+          <name>CCPosIndRopi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndRwpi</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCPosIndNoDynInit</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccLang</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCDialect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccAllowVLA</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccStaticDestr</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccCppInlineSemantics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IccFloatSemantics</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCNoLiteralPool</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCOptStrategySlave</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCGuardCalls</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCEncSource</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEncOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CCEncOutputBom</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CCEncInput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccExceptions2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IccRTTI2</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>AARM</name>
+      <archiveVersion>2</archiveVersion>
+      <data>
+        <version>10</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>AObjPrefix</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AEndian</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>ACaseSensitivity</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacroChars</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnWhat</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AWarnOne</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange1</name>
+          <state />
+        </option>
+        <option>
+          <name>AWarnRange2</name>
+          <state />
+        </option>
+        <option>
+          <name>ADebug</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AltRegisterNames</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ADefines</name>
+          <state />
+        </option>
+        <option>
+          <name>AList</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AListHeader</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AListing</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>Includes</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacDefs</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MacExps</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>MacExec</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OnlyAssed</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>MultiLine</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLengthCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>PageLength</name>
+          <state>80</state>
+        </option>
+        <option>
+          <name>TabSpacing</name>
+          <state>8</state>
+        </option>
+        <option>
+          <name>AXRef</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDefines</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefInternal</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AXRefDual</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AFpuProcessor</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>AOutputFile</name>
+          <state>$FILE_BNAME$.o</state>
+        </option>
+        <option>
+          <name>ALimitErrorsCheck</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>ALimitErrorsEdit</name>
+          <state>100</state>
+        </option>
+        <option>
+          <name>AIgnoreStdInclude</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AUserIncludes</name>
+          <state />
+        </option>
+        <option>
+          <name>AExtraOptionsCheckV2</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>AExtraOptionsV2</name>
+          <state />
+        </option>
+        <option>
+          <name>AsmNoLiteralPool</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>OBJCOPY</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>1</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>OOCOutputFormat</name>
+          <version>3</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OCOutputOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>OOCOutputFile</name>
+          <state>c.srec</state>
+        </option>
+        <option>
+          <name>OOCCommandLineProducer</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>OOCObjCopyEnable</name>
+          <state>0</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>CUSTOM</name>
+      <archiveVersion>3</archiveVersion>
+      <data>
+        <extensions />
+        <cmdline />
+        <hasPrio>0</hasPrio>
+      </data>
+    </settings>
+    <settings>
+      <name>BICOMP</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+    <settings>
+      <name>BUILDACTION</name>
+      <archiveVersion>1</archiveVersion>
+      <data>
+        <prebuild />
+        <postbuild />
+      </data>
+    </settings>
+    <settings>
+      <name>ILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>20</version>
+        <wantNonLocal>1</wantNonLocal>
+        <debug>0</debug>
+        <option>
+          <name>IlinkOutputFile</name>
+          <state>c.out</state>
+        </option>
+        <option>
+          <name>IlinkLibIOConfig</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>XLinkMisraHandler</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkInputFileSlave</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkDebugInfoEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkKeepSymbols</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinaryFile</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinarySymbol</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinarySegment</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkRawBinaryAlign</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkConfigDefines</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkMapFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogFile</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogInitialization</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogModule</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogSection</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogVeneer</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIcfOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIcfFile</name>
+          <state>$TOOLKIT_DIR$\CONFIG\generic.icf</state>
+        </option>
+        <option>
+          <name>IlinkIcfFileSlave</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkEnableRemarks</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkSuppressDiags</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsRem</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsWarn</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkTreatAsErr</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkWarningsAreErrors</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkUseExtraOptions</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkExtraOptions</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkLowLevelInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAutoLibEnable</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkAdditionalLibs</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkOverrideProgramEntryLabel</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabelSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkProgramEntryLabel</name>
+          <state />
+        </option>
+        <option>
+          <name>DoFill</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>FillerByte</name>
+          <state>0xFF</state>
+        </option>
+        <option>
+          <name>FillerStart</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>FillerEnd</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>CrcSize</name>
+          <version>0</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcAlign</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcPoly</name>
+          <state>0x11021</state>
+        </option>
+        <option>
+          <name>CrcCompl</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcBitOrder</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>CrcInitialValue</name>
+          <state>0x0</state>
+        </option>
+        <option>
+          <name>DoCrc</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkBE8Slave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkBufferedTerminalOutput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkStdoutInterfaceSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcFullSize</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIElfToolPostProcess</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogAutoLibSelect</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogRedirSymbols</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkLogUnusedFragments</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcReverseByteOrder</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCrcUseAsInput</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptInline</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsAllow</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptExceptionsForce</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkCmsis</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptMergeDuplSections</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkOptUseVfe</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkOptForceVfe</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackAnalysisEnable</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkStackControlFile</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkStackCallGraphFile</name>
+          <state />
+        </option>
+        <option>
+          <name>CrcAlgorithm</name>
+          <version>1</version>
+          <state>1</state>
+        </option>
+        <option>
+          <name>CrcUnitSize</name>
+          <version>0</version>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkThreadsSlave</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkLogCallGraph</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkIcfFile_AltDefault</name>
+          <state />
+        </option>
+        <option>
+          <name>IlinkEncInput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkEncOutput</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IlinkEncOutputBom</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkHeapSelect</name>
+          <state>1</state>
+        </option>
+        <option>
+          <name>IlinkLocaleSelect</name>
+          <state>1</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>IARCHIVE</name>
+      <archiveVersion>0</archiveVersion>
+      <data>
+        <version>0</version>
+        <wantNonLocal>1</wantNonLocal>
         <debug>0</debug>
-        <settings>
-            <name>General</name>
-            <archiveVersion>3</archiveVersion>
-            <data>
-                <version>28</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>0</debug>
-                <option>
-                    <name>ExePath</name>
-                    <state>Release\Exe</state>
-                </option>
-                <option>
-                    <name>ObjPath</name>
-                    <state>Release\Obj</state>
-                </option>
-                <option>
-                    <name>ListPath</name>
-                    <state>Release\List</state>
-                </option>
-                <option>
-                    <name>GEndianMode</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>Input description</name>
-                    <state>Full formatting.</state>
-                </option>
-                <option>
-                    <name>Output description</name>
-                    <state>Full formatting.</state>
-                </option>
-                <option>
-                    <name>GOutputBinary</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGCoreOrChip</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GRuntimeLibSelect</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>GRuntimeLibSelectSlave</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>RTDescription</name>
-                    <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
-                </option>
-                <option>
-                    <name>OGProductVersion</name>
-                    <state>5.10.0.159</state>
-                </option>
-                <option>
-                    <name>OGLastSavedByProductVersion</name>
-                    <state>8.10.1.12859</state>
-                </option>
-                <option>
-                    <name>GeneralEnableMisra</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GeneralMisraVerbose</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGChipSelectEditMenu</name>
-                    <state>default	None</state>
-                </option>
-                <option>
-                    <name>GenLowLevelInterface</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GEndianModeBE</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGBufferedTerminalOutput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GenStdoutInterface</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GeneralMisraRules98</name>
-                    <version>0</version>
-                    <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-                </option>
-                <option>
-                    <name>GeneralMisraVer</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GeneralMisraRules04</name>
-                    <version>0</version>
-                    <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-                </option>
-                <option>
-                    <name>RTConfigPath2</name>
-                    <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
-                </option>
-                <option>
-                    <name>GBECoreSlave</name>
-                    <version>24</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGUseCmsis</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGUseCmsisDspLib</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GRuntimeLibThreads</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CoreVariant</name>
-                    <version>24</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GFPUDeviceSlave</name>
-                    <state>default	None</state>
-                </option>
-                <option>
-                    <name>FPU2</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>NrRegs</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>NEON</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GFPUCoreSlave2</name>
-                    <version>24</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGCMSISPackSelectDevice</name>
-                </option>
-                <option>
-                    <name>OgLibHeap</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGLibAdditionalLocale</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGPrintfVariant</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OGPrintfMultibyteSupport</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OGScanfVariant</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OGScanfMultibyteSupport</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>GenLocaleTags</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>GenLocaleDisplayOnly</name>
-                    <state></state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>ICCARM</name>
-            <archiveVersion>2</archiveVersion>
-            <data>
-                <version>34</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>0</debug>
-                <option>
-                    <name>CCOptimizationNoSizeConstraints</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCDefines</name>
-                    <state>NDEBUG</state>
-                    <state>RT_USING_DLIBC</state>
-                </option>
-                <option>
-                    <name>CCPreprocFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPreprocComments</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPreprocLine</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListCFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListCMnemonics</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListCMessages</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListAssFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCListAssSource</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCEnableRemarks</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCDiagSuppress</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCDiagRemark</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCDiagWarning</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCDiagError</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCObjPrefix</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCAllowList</name>
-                    <version>1</version>
-                    <state>11111110</state>
-                </option>
-                <option>
-                    <name>CCDebugInfo</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IEndianMode</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IExtraOptionsCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IExtraOptions</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CCLangConformance</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCSignedPlainChar</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCRequirePrototypes</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCDiagWarnAreErr</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCCompilerRuntimeInfo</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IFpuProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OutputFile</name>
-                    <state>$FILE_BNAME$.o</state>
-                </option>
-                <option>
-                    <name>CCLibConfigHeader</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>PreInclude</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CompilerMisraOverride</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCIncludePath2</name>
-                    <state>$PROJ_DIR$\../../libcpu/arm/common</state>
-                    <state>$PROJ_DIR$\../../components/drivers/include</state>
-                    <state>$PROJ_DIR$\platform</state>
-                    <state>$PROJ_DIR$\../../components/libc/compilers/dlib</state>
-                    <state>$PROJ_DIR$\drivers</state>
-                    <state>$PROJ_DIR$\../../libcpu/arm/arm926</state>
-                    <state>$PROJ_DIR$\.</state>
-                    <state>$PROJ_DIR$\applications</state>
-                    <state>$PROJ_DIR$\../../include</state>
-                    <state>$PROJ_DIR$\../../components/finsh</state>
-                </option>
-                <option>
-                    <name>CCStdIncCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCCodeSection</name>
-                    <state>.text</state>
-                </option>
-                <option>
-                    <name>IProcessorMode2</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCOptLevel</name>
-                    <state>3</state>
-                </option>
-                <option>
-                    <name>CCOptStrategy</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCOptLevelSlave</name>
-                    <state>3</state>
-                </option>
-                <option>
-                    <name>CompilerMisraRules98</name>
-                    <version>0</version>
-                    <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-                </option>
-                <option>
-                    <name>CompilerMisraRules04</name>
-                    <version>0</version>
-                    <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-                </option>
-                <option>
-                    <name>CCPosIndRopi</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPosIndRwpi</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCPosIndNoDynInit</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccLang</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccCDialect</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IccAllowVLA</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccStaticDestr</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IccCppInlineSemantics</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccCmsis</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IccFloatSemantics</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCNoLiteralPool</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCOptStrategySlave</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCGuardCalls</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCEncSource</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCEncOutput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CCEncOutputBom</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CCEncInput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccExceptions2</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IccRTTI2</name>
-                    <state>0</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>AARM</name>
-            <archiveVersion>2</archiveVersion>
-            <data>
-                <version>10</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>0</debug>
-                <option>
-                    <name>AObjPrefix</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AEndian</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>ACaseSensitivity</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>MacroChars</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AWarnEnable</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AWarnWhat</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AWarnOne</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AWarnRange1</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AWarnRange2</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>ADebug</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AltRegisterNames</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>ADefines</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AList</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AListHeader</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AListing</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>Includes</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>MacDefs</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>MacExps</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>MacExec</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OnlyAssed</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>MultiLine</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>PageLengthCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>PageLength</name>
-                    <state>80</state>
-                </option>
-                <option>
-                    <name>TabSpacing</name>
-                    <state>8</state>
-                </option>
-                <option>
-                    <name>AXRef</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AXRefDefines</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AXRefInternal</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AXRefDual</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AFpuProcessor</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>AOutputFile</name>
-                    <state>$FILE_BNAME$.o</state>
-                </option>
-                <option>
-                    <name>ALimitErrorsCheck</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>ALimitErrorsEdit</name>
-                    <state>100</state>
-                </option>
-                <option>
-                    <name>AIgnoreStdInclude</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AUserIncludes</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AExtraOptionsCheckV2</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>AExtraOptionsV2</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>AsmNoLiteralPool</name>
-                    <state>0</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>OBJCOPY</name>
-            <archiveVersion>0</archiveVersion>
-            <data>
-                <version>1</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>0</debug>
-                <option>
-                    <name>OOCOutputFormat</name>
-                    <version>3</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OCOutputOverride</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>OOCOutputFile</name>
-                    <state>c.srec</state>
-                </option>
-                <option>
-                    <name>OOCCommandLineProducer</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>OOCObjCopyEnable</name>
-                    <state>0</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>CUSTOM</name>
-            <archiveVersion>3</archiveVersion>
-            <data>
-                <extensions></extensions>
-                <cmdline></cmdline>
-                <hasPrio>0</hasPrio>
-            </data>
-        </settings>
-        <settings>
-            <name>BICOMP</name>
-            <archiveVersion>0</archiveVersion>
-            <data />
-        </settings>
-        <settings>
-            <name>BUILDACTION</name>
-            <archiveVersion>1</archiveVersion>
-            <data>
-                <prebuild></prebuild>
-                <postbuild></postbuild>
-            </data>
-        </settings>
-        <settings>
-            <name>ILINK</name>
-            <archiveVersion>0</archiveVersion>
-            <data>
-                <version>20</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>0</debug>
-                <option>
-                    <name>IlinkOutputFile</name>
-                    <state>c.out</state>
-                </option>
-                <option>
-                    <name>IlinkLibIOConfig</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>XLinkMisraHandler</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkInputFileSlave</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkDebugInfoEnable</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkKeepSymbols</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinaryFile</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinarySymbol</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinarySegment</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkRawBinaryAlign</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkDefines</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkConfigDefines</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkMapFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogFile</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogInitialization</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogModule</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogSection</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogVeneer</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkIcfOverride</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkIcfFile</name>
-                    <state>$TOOLKIT_DIR$\CONFIG\generic.icf</state>
-                </option>
-                <option>
-                    <name>IlinkIcfFileSlave</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkEnableRemarks</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkSuppressDiags</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkTreatAsRem</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkTreatAsWarn</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkTreatAsErr</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkWarningsAreErrors</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkUseExtraOptions</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkExtraOptions</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkLowLevelInterfaceSlave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkAutoLibEnable</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkAdditionalLibs</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkOverrideProgramEntryLabel</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkProgramEntryLabelSelect</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkProgramEntryLabel</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>DoFill</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>FillerByte</name>
-                    <state>0xFF</state>
-                </option>
-                <option>
-                    <name>FillerStart</name>
-                    <state>0x0</state>
-                </option>
-                <option>
-                    <name>FillerEnd</name>
-                    <state>0x0</state>
-                </option>
-                <option>
-                    <name>CrcSize</name>
-                    <version>0</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcAlign</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcPoly</name>
-                    <state>0x11021</state>
-                </option>
-                <option>
-                    <name>CrcCompl</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CrcBitOrder</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>CrcInitialValue</name>
-                    <state>0x0</state>
-                </option>
-                <option>
-                    <name>DoCrc</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkBE8Slave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkBufferedTerminalOutput</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkStdoutInterfaceSlave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcFullSize</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkIElfToolPostProcess</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogAutoLibSelect</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogRedirSymbols</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkLogUnusedFragments</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkCrcReverseByteOrder</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkCrcUseAsInput</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptInline</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptExceptionsAllow</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptExceptionsForce</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkCmsis</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptMergeDuplSections</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkOptUseVfe</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkOptForceVfe</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkStackAnalysisEnable</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkStackControlFile</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkStackCallGraphFile</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>CrcAlgorithm</name>
-                    <version>1</version>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>CrcUnitSize</name>
-                    <version>0</version>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkThreadsSlave</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkLogCallGraph</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkIcfFile_AltDefault</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IlinkEncInput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkEncOutput</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IlinkEncOutputBom</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkHeapSelect</name>
-                    <state>1</state>
-                </option>
-                <option>
-                    <name>IlinkLocaleSelect</name>
-                    <state>1</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>IARCHIVE</name>
-            <archiveVersion>0</archiveVersion>
-            <data>
-                <version>0</version>
-                <wantNonLocal>1</wantNonLocal>
-                <debug>0</debug>
-                <option>
-                    <name>IarchiveInputs</name>
-                    <state></state>
-                </option>
-                <option>
-                    <name>IarchiveOverride</name>
-                    <state>0</state>
-                </option>
-                <option>
-                    <name>IarchiveOutput</name>
-                    <state>###Unitialized###</state>
-                </option>
-            </data>
-        </settings>
-        <settings>
-            <name>BILINK</name>
-            <archiveVersion>0</archiveVersion>
-            <data />
-        </settings>
-    </configuration>
-    <group>
-        <name>Applications</name>
-        <file>
-            <name>$PROJ_DIR$\applications\application.c</name>
-        </file>
-    </group>
-    <group>
-        <name>ARM926</name>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\context_iar.S</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\cpuport.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\common\div0.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\mmu.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\common\showmem.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\stack.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\start_iar.S</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\trap.c</name>
-        </file>
-    </group>
-    <group>
-        <name>DeviceDrivers</name>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\drivers\src\completion.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\drivers\src\dataqueue.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\drivers\src\pipe.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\drivers\src\ringbuffer.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\drivers\serial\serial.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\drivers\src\waitqueue.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\drivers\src\workqueue.c</name>
-        </file>
-    </group>
-    <group>
-        <name>dlib</name>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\environ.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\libc.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\rmtx.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\stdio.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_close.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_lseek.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_mem.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_open.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_read.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_remove.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_write.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\time.c</name>
-        </file>
-    </group>
-    <group>
-        <name>Drivers</name>
-        <file>
-            <name>$PROJ_DIR$\drivers\board.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\drivers\led.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\drivers\usart.c</name>
-        </file>
-    </group>
-    <group>
-        <name>finsh</name>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\cmd.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_compiler.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_error.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_heap.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_init.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_node.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_ops.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_parser.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_token.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_var.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\finsh_vm.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\shell.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\components\finsh\symbol.c</name>
-        </file>
-    </group>
-    <group>
-        <name>Kernel</name>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\clock.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\components.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\device.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\idle.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\ipc.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\irq.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\kservice.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\memheap.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\mempool.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\object.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\scheduler.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\signal.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\slab.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\thread.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\..\..\src\timer.c</name>
-        </file>
-    </group>
-    <group>
-        <name>platform</name>
-        <file>
-            <name>$PROJ_DIR$\platform\gpio.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\platform\interrupt.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\platform\reset.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\platform\rt_low_level_init.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\platform\system_clock.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\platform\timer0.c</name>
-        </file>
-        <file>
-            <name>$PROJ_DIR$\platform\uart.c</name>
-        </file>
-    </group>
+        <option>
+          <name>IarchiveInputs</name>
+          <state />
+        </option>
+        <option>
+          <name>IarchiveOverride</name>
+          <state>0</state>
+        </option>
+        <option>
+          <name>IarchiveOutput</name>
+          <state>###Unitialized###</state>
+        </option>
+      </data>
+    </settings>
+    <settings>
+      <name>BILINK</name>
+      <archiveVersion>0</archiveVersion>
+      <data />
+    </settings>
+  </configuration>
+  <group>
+    <name>Kernel</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\clock.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\components.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\cpu.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\device.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\idle.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\ipc.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\irq.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\kservice.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\memheap.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\mempool.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\object.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\scheduler.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\signal.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\slab.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\thread.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\src\timer.c</name>
+    </file>
+  </group>
+  <group>
+    <name>Applications</name>
+    <file>
+      <name>$PROJ_DIR$\applications\application.c</name>
+    </file>
+  </group>
+  <group>
+    <name>Drivers</name>
+    <file>
+      <name>$PROJ_DIR$\drivers\board.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\drivers\usart.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\drivers\led.c</name>
+    </file>
+  </group>
+  <group>
+    <name>platform</name>
+    <file>
+      <name>$PROJ_DIR$\platform\gpio.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\platform\interrupt.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\platform\reset.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\platform\rt_low_level_init.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\platform\system_clock.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\platform\timer0.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\platform\uart.c</name>
+    </file>
+  </group>
+  <group>
+    <name>cpu</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\common\backtrace.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\common\div0.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\common\showmem.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\cpuport.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\machine.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\mmu.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\stack.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\trap.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\context_iar.S</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\libcpu\arm\arm926\start_iar.S</name>
+    </file>
+  </group>
+  <group>
+    <name>DeviceDrivers</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\serial\serial.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\completion.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\dataqueue.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\pipe.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\ringblk_buf.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\ringbuffer.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\waitqueue.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\drivers\src\workqueue.c</name>
+    </file>
+  </group>
+  <group>
+    <name>finsh</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\shell.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\cmd.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_compiler.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_error.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_heap.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_init.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_node.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_ops.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_parser.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_var.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_vm.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\finsh\finsh_token.c</name>
+    </file>
+  </group>
+  <group>
+    <name>libc</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\common\time.c</name>
+    </file>
+  </group>
+  <group>
+    <name>dlib</name>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\environ.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\libc.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\rmtx.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\stdio.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_close.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_lseek.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_mem.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_open.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_read.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_remove.c</name>
+    </file>
+    <file>
+      <name>$PROJ_DIR$\..\..\components\libc\compilers\dlib\syscall_write.c</name>
+    </file>
+  </group>
 </project>

+ 10 - 10
bsp/asm9260t/project.eww

@@ -1,10 +1,10 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<workspace>
-  <project>
-    <path>$WS_DIR$\project.ewp</path>
-  </project>
-  <batchBuild/>
-</workspace>
-
-
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<workspace>
+  <project>
+    <path>$WS_DIR$\project.ewp</path>
+  </project>
+  <batchBuild/>
+</workspace>
+
+

+ 150 - 150
bsp/asm9260t/project.uvproj

@@ -359,7 +359,7 @@
               <MiscControls />
               <Define>RT_USING_ARM_LIBC</Define>
               <Undefine />
-              <IncludePath>drivers;applications;.;platform;../../include;../../libcpu/arm/arm926;../../libcpu/arm/common;../../components/drivers/include;../../components/drivers/include;../../components/libc/compilers/armlibc;../../components/finsh</IncludePath>
+              <IncludePath>.;..\..\include;applications;.;drivers;platform;..\..\libcpu\arm\common;..\..\libcpu\arm\arm926;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh;..\..\components\libc\compilers\armlibc;..\..\components\libc\compilers\common</IncludePath>
             </VariousControls>
           </Cads>
           <Aads>
@@ -392,7 +392,7 @@
             <ScatterFile>.\link_scripts\sdram.scat</ScatterFile>
             <IncludeLibs />
             <IncludeLibsPath />
-            <Misc> --keep *.o(.rti_fn.*)   --keep *.o(FSymTab) --keep *.o(VSymTab) </Misc>
+            <Misc />
             <LinkerInputFile />
             <DisabledWarnings />
           </LDads>
@@ -400,453 +400,453 @@
       </TargetOption>
       <Groups>
         <Group>
-          <GroupName>Drivers</GroupName>
+          <GroupName>Kernel</GroupName>
           <Files>
             <File>
-              <FileName>board.c</FileName>
+              <FileName>clock.c</FileName>
               <FileType>1</FileType>
-              <FilePath>drivers/board.c</FilePath>
+              <FilePath>..\..\src\clock.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>usart.c</FileName>
+              <FileName>components.c</FileName>
               <FileType>1</FileType>
-              <FilePath>drivers/usart.c</FilePath>
+              <FilePath>..\..\src\components.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>led.c</FileName>
+              <FileName>cpu.c</FileName>
               <FileType>1</FileType>
-              <FilePath>drivers/led.c</FilePath>
+              <FilePath>..\..\src\cpu.c</FilePath>
             </File>
           </Files>
-        </Group>
-        <Group>
-          <GroupName>Applications</GroupName>
           <Files>
             <File>
-              <FileName>application.c</FileName>
+              <FileName>device.c</FileName>
               <FileType>1</FileType>
-              <FilePath>applications/application.c</FilePath>
+              <FilePath>..\..\src\device.c</FilePath>
             </File>
           </Files>
-        </Group>
-        <Group>
-          <GroupName>platform</GroupName>
           <Files>
             <File>
-              <FileName>gpio.c</FileName>
+              <FileName>idle.c</FileName>
               <FileType>1</FileType>
-              <FilePath>platform/gpio.c</FilePath>
+              <FilePath>..\..\src\idle.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>interrupt.c</FileName>
+              <FileName>ipc.c</FileName>
               <FileType>1</FileType>
-              <FilePath>platform/interrupt.c</FilePath>
+              <FilePath>..\..\src\ipc.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>reset.c</FileName>
+              <FileName>irq.c</FileName>
               <FileType>1</FileType>
-              <FilePath>platform/reset.c</FilePath>
+              <FilePath>..\..\src\irq.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>rt_low_level_init.c</FileName>
+              <FileName>kservice.c</FileName>
               <FileType>1</FileType>
-              <FilePath>platform/rt_low_level_init.c</FilePath>
+              <FilePath>..\..\src\kservice.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>system_clock.c</FileName>
+              <FileName>memheap.c</FileName>
               <FileType>1</FileType>
-              <FilePath>platform/system_clock.c</FilePath>
+              <FilePath>..\..\src\memheap.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>timer0.c</FileName>
+              <FileName>mempool.c</FileName>
               <FileType>1</FileType>
-              <FilePath>platform/timer0.c</FilePath>
+              <FilePath>..\..\src\mempool.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>uart.c</FileName>
+              <FileName>object.c</FileName>
               <FileType>1</FileType>
-              <FilePath>platform/uart.c</FilePath>
+              <FilePath>..\..\src\object.c</FilePath>
             </File>
           </Files>
-        </Group>
-        <Group>
-          <GroupName>Kernel</GroupName>
           <Files>
             <File>
-              <FileName>clock.c</FileName>
+              <FileName>scheduler.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/clock.c</FilePath>
+              <FilePath>..\..\src\scheduler.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>components.c</FileName>
+              <FileName>signal.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/components.c</FilePath>
+              <FilePath>..\..\src\signal.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>device.c</FileName>
+              <FileName>slab.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/device.c</FilePath>
+              <FilePath>..\..\src\slab.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>idle.c</FileName>
+              <FileName>thread.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/idle.c</FilePath>
+              <FilePath>..\..\src\thread.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>ipc.c</FileName>
+              <FileName>timer.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/ipc.c</FilePath>
+              <FilePath>..\..\src\timer.c</FilePath>
             </File>
           </Files>
+        </Group>
+        <Group>
+          <GroupName>Applications</GroupName>
           <Files>
             <File>
-              <FileName>irq.c</FileName>
+              <FileName>application.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/irq.c</FilePath>
+              <FilePath>applications\application.c</FilePath>
             </File>
           </Files>
+        </Group>
+        <Group>
+          <GroupName>Drivers</GroupName>
           <Files>
             <File>
-              <FileName>kservice.c</FileName>
+              <FileName>board.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/kservice.c</FilePath>
+              <FilePath>drivers\board.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>memheap.c</FileName>
+              <FileName>usart.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/memheap.c</FilePath>
+              <FilePath>drivers\usart.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>mempool.c</FileName>
+              <FileName>led.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/mempool.c</FilePath>
+              <FilePath>drivers\led.c</FilePath>
             </File>
           </Files>
+        </Group>
+        <Group>
+          <GroupName>platform</GroupName>
           <Files>
             <File>
-              <FileName>object.c</FileName>
+              <FileName>gpio.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/object.c</FilePath>
+              <FilePath>platform\gpio.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>scheduler.c</FileName>
+              <FileName>interrupt.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/scheduler.c</FilePath>
+              <FilePath>platform\interrupt.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>signal.c</FileName>
+              <FileName>reset.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/signal.c</FilePath>
+              <FilePath>platform\reset.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>slab.c</FileName>
+              <FileName>rt_low_level_init.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/slab.c</FilePath>
+              <FilePath>platform\rt_low_level_init.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>thread.c</FileName>
+              <FileName>system_clock.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/thread.c</FilePath>
+              <FilePath>platform\system_clock.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>timer.c</FileName>
+              <FileName>timer0.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../src/timer.c</FilePath>
+              <FilePath>platform\timer0.c</FilePath>
             </File>
           </Files>
-        </Group>
-        <Group>
-          <GroupName>ARM926</GroupName>
           <Files>
             <File>
-              <FileName>cpuport.c</FileName>
+              <FileName>uart.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../libcpu/arm/arm926/cpuport.c</FilePath>
+              <FilePath>platform\uart.c</FilePath>
             </File>
           </Files>
+        </Group>
+        <Group>
+          <GroupName>cpu</GroupName>
           <Files>
             <File>
-              <FileName>mmu.c</FileName>
+              <FileName>backtrace.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../libcpu/arm/arm926/mmu.c</FilePath>
+              <FilePath>..\..\libcpu\arm\common\backtrace.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>stack.c</FileName>
+              <FileName>div0.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../libcpu/arm/arm926/stack.c</FilePath>
+              <FilePath>..\..\libcpu\arm\common\div0.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>trap.c</FileName>
+              <FileName>showmem.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../libcpu/arm/arm926/trap.c</FilePath>
+              <FilePath>..\..\libcpu\arm\common\showmem.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>context_rvds.S</FileName>
-              <FileType>2</FileType>
-              <FilePath>../../libcpu/arm/arm926/context_rvds.S</FilePath>
+              <FileName>cpuport.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\libcpu\arm\arm926\cpuport.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>start_rvds.S</FileName>
-              <FileType>2</FileType>
-              <FilePath>../../libcpu/arm/arm926/start_rvds.S</FilePath>
+              <FileName>machine.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\libcpu\arm\arm926\machine.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>backtrace.c</FileName>
+              <FileName>mmu.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../libcpu/arm/common/backtrace.c</FilePath>
+              <FilePath>..\..\libcpu\arm\arm926\mmu.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>div0.c</FileName>
+              <FileName>stack.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../libcpu/arm/common/div0.c</FilePath>
+              <FilePath>..\..\libcpu\arm\arm926\stack.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>showmem.c</FileName>
+              <FileName>trap.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../libcpu/arm/common/showmem.c</FilePath>
+              <FilePath>..\..\libcpu\arm\arm926\trap.c</FilePath>
             </File>
           </Files>
-        </Group>
-        <Group>
-          <GroupName>DeviceDrivers</GroupName>
           <Files>
             <File>
-              <FileName>serial.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>../../components/drivers/serial/serial.c</FilePath>
+              <FileName>context_rvds.S</FileName>
+              <FileType>2</FileType>
+              <FilePath>..\..\libcpu\arm\arm926\context_rvds.S</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>completion.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>../../components/drivers/src/completion.c</FilePath>
+              <FileName>start_rvds.S</FileName>
+              <FileType>2</FileType>
+              <FilePath>..\..\libcpu\arm\arm926\start_rvds.S</FilePath>
             </File>
           </Files>
+        </Group>
+        <Group>
+          <GroupName>DeviceDrivers</GroupName>
           <Files>
             <File>
-              <FileName>dataqueue.c</FileName>
+              <FileName>serial.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/drivers/src/dataqueue.c</FilePath>
+              <FilePath>..\..\components\drivers\serial\serial.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>pipe.c</FileName>
+              <FileName>completion.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/drivers/src/pipe.c</FilePath>
+              <FilePath>..\..\components\drivers\src\completion.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>ringbuffer.c</FileName>
+              <FileName>dataqueue.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/drivers/src/ringbuffer.c</FilePath>
+              <FilePath>..\..\components\drivers\src\dataqueue.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>waitqueue.c</FileName>
+              <FileName>pipe.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/drivers/src/waitqueue.c</FilePath>
+              <FilePath>..\..\components\drivers\src\pipe.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>workqueue.c</FileName>
+              <FileName>ringblk_buf.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/drivers/src/workqueue.c</FilePath>
+              <FilePath>..\..\components\drivers\src\ringblk_buf.c</FilePath>
             </File>
           </Files>
-        </Group>
-        <Group>
-          <GroupName>libc</GroupName>
           <Files>
             <File>
-              <FileName>libc.c</FileName>
+              <FileName>ringbuffer.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/libc/compilers/armlibc/libc.c</FilePath>
+              <FilePath>..\..\components\drivers\src\ringbuffer.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>libc_syms.c</FileName>
+              <FileName>waitqueue.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/libc/compilers/armlibc/libc_syms.c</FilePath>
+              <FilePath>..\..\components\drivers\src\waitqueue.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>mem_std.c</FileName>
+              <FileName>workqueue.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/libc/compilers/armlibc/mem_std.c</FilePath>
+              <FilePath>..\..\components\drivers\src\workqueue.c</FilePath>
             </File>
           </Files>
+        </Group>
+        <Group>
+          <GroupName>finsh</GroupName>
           <Files>
             <File>
-              <FileName>stdio.c</FileName>
+              <FileName>shell.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/libc/compilers/armlibc/stdio.c</FilePath>
+              <FilePath>..\..\components\finsh\shell.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>stubs.c</FileName>
+              <FileName>cmd.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/libc/compilers/armlibc/stubs.c</FilePath>
+              <FilePath>..\..\components\finsh\cmd.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>time.c</FileName>
+              <FileName>finsh_compiler.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/libc/compilers/armlibc/time.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_compiler.c</FilePath>
             </File>
           </Files>
-        </Group>
-        <Group>
-          <GroupName>finsh</GroupName>
           <Files>
             <File>
-              <FileName>shell.c</FileName>
+              <FileName>finsh_error.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/shell.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_error.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>symbol.c</FileName>
+              <FileName>finsh_heap.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/symbol.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_heap.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>cmd.c</FileName>
+              <FileName>finsh_init.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/cmd.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_init.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_compiler.c</FileName>
+              <FileName>finsh_node.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_compiler.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_node.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_error.c</FileName>
+              <FileName>finsh_ops.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_error.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_ops.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_heap.c</FileName>
+              <FileName>finsh_parser.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_heap.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_parser.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_init.c</FileName>
+              <FileName>finsh_var.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_init.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_var.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_node.c</FileName>
+              <FileName>finsh_vm.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_node.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_vm.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_ops.c</FileName>
+              <FileName>finsh_token.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_ops.c</FilePath>
+              <FilePath>..\..\components\finsh\finsh_token.c</FilePath>
             </File>
           </Files>
+        </Group>
+        <Group>
+          <GroupName>libc</GroupName>
           <Files>
             <File>
-              <FileName>finsh_parser.c</FileName>
+              <FileName>libc.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_parser.c</FilePath>
+              <FilePath>..\..\components\libc\compilers\armlibc\libc.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_var.c</FileName>
+              <FileName>mem_std.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_var.c</FilePath>
+              <FilePath>..\..\components\libc\compilers\armlibc\mem_std.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_vm.c</FileName>
+              <FileName>stubs.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_vm.c</FilePath>
+              <FilePath>..\..\components\libc\compilers\armlibc\stubs.c</FilePath>
             </File>
           </Files>
           <Files>
             <File>
-              <FileName>finsh_token.c</FileName>
+              <FileName>time.c</FileName>
               <FileType>1</FileType>
-              <FilePath>../../components/finsh/finsh_token.c</FilePath>
+              <FilePath>..\..\components\libc\compilers\common\time.c</FilePath>
             </File>
           </Files>
         </Group>

+ 1 - 1
bsp/at91sam9260/.config

@@ -15,7 +15,7 @@ CONFIG_RT_THREAD_PRIORITY_MAX=32
 CONFIG_RT_TICK_PER_SECOND=100
 CONFIG_RT_USING_OVERFLOW_CHECK=y
 CONFIG_RT_USING_HOOK=y
-CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
 CONFIG_IDLE_THREAD_STACK_SIZE=256
 # CONFIG_RT_USING_TIMER_SOFT is not set
 CONFIG_RT_DEBUG=y

+ 6 - 0
bsp/at91sam9260/Kconfig

@@ -18,6 +18,12 @@ config PKGS_DIR
 source "$RTT_DIR/Kconfig"
 source "$PKGS_DIR/Kconfig"
 
+config SOC_AT91SAM926
+    bool 
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
+    default y   
+
 config RT_USING_DBGU
     bool "Using RT_USING_DBGU"
     default y    

+ 1 - 0
bsp/at91sam9260/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread-at91sam9260.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 1 - 1
bsp/at91sam9260/rtconfig.h

@@ -13,7 +13,7 @@
 #define RT_TICK_PER_SECOND 100
 #define RT_USING_OVERFLOW_CHECK
 #define RT_USING_HOOK
-#define RT_IDEL_HOOK_LIST_SIZE 4
+#define RT_IDLE_HOOK_LIST_SIZE 4
 #define IDLE_THREAD_STACK_SIZE 256
 #define RT_DEBUG
 #define RT_DEBUG_COLOR

+ 1 - 1
bsp/at91sam9g45/.config

@@ -15,7 +15,7 @@ CONFIG_RT_THREAD_PRIORITY_MAX=32
 CONFIG_RT_TICK_PER_SECOND=1000
 CONFIG_RT_USING_OVERFLOW_CHECK=y
 CONFIG_RT_USING_HOOK=y
-CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
 CONFIG_IDLE_THREAD_STACK_SIZE=256
 # CONFIG_RT_USING_TIMER_SOFT is not set
 CONFIG_RT_DEBUG=y

+ 1 - 0
bsp/at91sam9g45/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread-at91sam9g45.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 1 - 1
bsp/at91sam9g45/rtconfig.h

@@ -13,7 +13,7 @@
 #define RT_TICK_PER_SECOND 1000
 #define RT_USING_OVERFLOW_CHECK
 #define RT_USING_HOOK
-#define RT_IDEL_HOOK_LIST_SIZE 4
+#define RT_IDLE_HOOK_LIST_SIZE 4
 #define IDLE_THREAD_STACK_SIZE 256
 #define RT_DEBUG
 #define RT_DEBUG_COLOR

+ 1 - 0
bsp/avr32uc3b0/SConstruct

@@ -12,6 +12,7 @@ from building import *
  
 TARGET = 'rtthread-' + rtconfig.ARCH + '.' + rtconfig.TARGET_EXT
  
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
    AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
    CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 1 - 1
bsp/beaglebone/.config

@@ -15,7 +15,7 @@ CONFIG_RT_THREAD_PRIORITY_MAX=32
 CONFIG_RT_TICK_PER_SECOND=100
 CONFIG_RT_USING_OVERFLOW_CHECK=y
 CONFIG_RT_USING_HOOK=y
-CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
 CONFIG_IDLE_THREAD_STACK_SIZE=256
 # CONFIG_RT_USING_TIMER_SOFT is not set
 CONFIG_RT_DEBUG=y

+ 6 - 0
bsp/beaglebone/Kconfig

@@ -26,6 +26,12 @@ config ENV_DIR
 source "$RTT_DIR/Kconfig"
 source "$PKGS_DIR/Kconfig"
 
+config SOC_AM335X
+    bool 
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
+    default y
+
 config RT_USING_UART1
     bool "Using RT_USING_UART1"
     default y

+ 1 - 0
bsp/beaglebone/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread-beaglebone.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 2 - 2
bsp/beaglebone/beaglebone_ram.lds

@@ -57,8 +57,8 @@ SECTIONS
         PROVIDE(__dtors_end__ = .);
     }
 
+    . = ALIGN(8);
     __data_start = .;
-    . = ALIGN(4);
     .data :
     {
         *(.data)
@@ -66,7 +66,7 @@ SECTIONS
     }
     __data_end = .;
 
-    . = ALIGN(4);
+    . = ALIGN(8);
     __bss_start = .;
     .bss       :
     {

+ 1 - 1
bsp/beaglebone/rtconfig.h

@@ -13,7 +13,7 @@
 #define RT_TICK_PER_SECOND 100
 #define RT_USING_OVERFLOW_CHECK
 #define RT_USING_HOOK
-#define RT_IDEL_HOOK_LIST_SIZE 4
+#define RT_IDLE_HOOK_LIST_SIZE 4
 #define IDLE_THREAD_STACK_SIZE 256
 #define RT_DEBUG
 #define RT_DEBUG_COLOR

+ 6 - 0
bsp/ck802/Kconfig

@@ -21,6 +21,12 @@ config PKGS_DIR
 source "$RTT_DIR/Kconfig"
 source "$PKGS_DIR/Kconfig"
 
+config SOC_CK802
+    bool
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
+    default y
+
 if RT_USING_SERIAL
 
     config RT_USING_UART1

+ 1 - 0
bsp/ck802/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread-ck802.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
     AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
     CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 1 - 1
bsp/dm365/.config

@@ -15,7 +15,7 @@ CONFIG_RT_THREAD_PRIORITY_MAX=256
 CONFIG_RT_TICK_PER_SECOND=100
 CONFIG_RT_USING_OVERFLOW_CHECK=y
 CONFIG_RT_USING_HOOK=y
-CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
 CONFIG_IDLE_THREAD_STACK_SIZE=1024
 CONFIG_RT_USING_TIMER_SOFT=y
 CONFIG_RT_TIMER_THREAD_PRIO=8

+ 6 - 0
bsp/dm365/Kconfig

@@ -18,6 +18,12 @@ config PKGS_DIR
 source "$RTT_DIR/Kconfig"
 source "$PKGS_DIR/Kconfig"
 
+config SOC_DM365
+    bool    
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
+    default y
+
 comment "BSP configure"
 
 config RT_USING_GPIO_DEVICE

+ 1 - 0
bsp/dm365/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread-dm365.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 1 - 1
bsp/dm365/rtconfig.h

@@ -15,7 +15,7 @@
 #define RT_TICK_PER_SECOND 100
 #define RT_USING_OVERFLOW_CHECK
 #define RT_USING_HOOK
-#define RT_IDEL_HOOK_LIST_SIZE 4
+#define RT_IDLE_HOOK_LIST_SIZE 4
 #define IDLE_THREAD_STACK_SIZE 1024
 #define RT_USING_TIMER_SOFT
 #define RT_TIMER_THREAD_PRIO 8

+ 1 - 0
bsp/efm32/SConstruct

@@ -12,6 +12,7 @@ from building import *
 
 TARGET = 'rtthread-efm32.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
 	AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
 	CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 0 - 74
bsp/es32f0334/drivers/drv_pm.c

@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2018 Shanghai Eastsoft Microelectronics Co., Ltd.
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author        Notes
- * 2019-04-08     wangyq        the first version
- * 2019-05-06     Zero-Free     adapt to the new power management interface
- */
-
-#include <rthw.h>
-#include <rtdevice.h>
-#include "board.h"
-#include "drv_pm.h"
-#include <ald_pmu.h>
-
-#ifdef RT_USING_PM
-
-static void _drv_pm_enter(struct rt_pm *pm, uint8_t mode)
-{
-    switch (mode)
-    {
-    case PM_SLEEP_MODE_NONE:
-        break;
-
-    case PM_SLEEP_MODE_IDLE:
-        __WFI();
-        break;
-
-    case PM_SLEEP_MODE_LIGHT:
-        break;
-
-    case PM_SLEEP_MODE_DEEP:
-        pmu_stop2_enter();
-        break;
-
-    case PM_SLEEP_MODE_STANDBY:
-        pmu_standby_enter(PMU_STANDBY_PORT_NONE);
-        break;
-
-    case PM_SLEEP_MODE_SHUTDOWN:
-        break;
-
-    default:
-        RT_ASSERT(0);
-        break;
-    }
-}
-
-static int drv_hw_pm_init(void)
-{
-    static const struct rt_pm_ops _ops =
-    {
-        _drv_pm_enter,
-        RT_NULL,
-        RT_NULL,
-        RT_NULL,
-        RT_NULL
-    };
-
-    rt_uint8_t timer_mask = 0;
-
-    /* initialize timer mask(no need tickless) */
-    // timer_mask = 1UL << PM_SLEEP_MODE_DEEP;
-
-    /* initialize system pm module */
-    rt_system_pm_init(&_ops, timer_mask, RT_NULL);
-
-    return 0;
-}
-INIT_BOARD_EXPORT(drv_hw_pm_init);
-
-#endif

BIN
bsp/es32f0334/libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf


+ 0 - 793
bsp/es32f0334/libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.rtf

@@ -1,793 +0,0 @@
-{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch37\stshfloch37\stshfhich37\stshfbi0\deflang2057\deflangfe2057\themelang2057\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
-{\f2\fbidi \fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f3\fbidi \froman\fcharset2\fprq2{\*\panose 05050102010706020507}Symbol;}{\f10\fbidi \fnil\fcharset2\fprq2{\*\panose 05000000000000000000}Wingdings;}
-{\f14\fbidi \froman\fcharset136\fprq2{\*\panose 02020500000000000000}PMingLiU{\*\falt \'b7\'73\'b2\'d3\'a9\'fa\'c5\'e9};}{\f34\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria Math;}
-{\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f38\fbidi \fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}{\f39\fbidi \fmodern\fcharset0\fprq1{\*\panose 020b0609020204030204}Consolas;}
-{\f40\fbidi \froman\fcharset136\fprq2{\*\panose 02020500000000000000}@PMingLiU;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;}
-{\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}
-{\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}
-{\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f41\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f42\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\f44\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f45\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f46\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f47\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\f48\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f49\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f51\fbidi \fswiss\fcharset238\fprq2 Arial CE;}{\f52\fbidi \fswiss\fcharset204\fprq2 Arial Cyr;}
-{\f54\fbidi \fswiss\fcharset161\fprq2 Arial Greek;}{\f55\fbidi \fswiss\fcharset162\fprq2 Arial Tur;}{\f56\fbidi \fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f57\fbidi \fswiss\fcharset178\fprq2 Arial (Arabic);}
-{\f58\fbidi \fswiss\fcharset186\fprq2 Arial Baltic;}{\f59\fbidi \fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f61\fbidi \fmodern\fcharset238\fprq1 Courier New CE;}{\f62\fbidi \fmodern\fcharset204\fprq1 Courier New Cyr;}
-{\f64\fbidi \fmodern\fcharset161\fprq1 Courier New Greek;}{\f65\fbidi \fmodern\fcharset162\fprq1 Courier New Tur;}{\f66\fbidi \fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f67\fbidi \fmodern\fcharset178\fprq1 Courier New (Arabic);}
-{\f68\fbidi \fmodern\fcharset186\fprq1 Courier New Baltic;}{\f69\fbidi \fmodern\fcharset163\fprq1 Courier New (Vietnamese);}{\f183\fbidi \froman\fcharset0\fprq2 PMingLiU Western{\*\falt \'b7\'73\'b2\'d3\'a9\'fa\'c5\'e9};}
-{\f381\fbidi \froman\fcharset238\fprq2 Cambria Math CE;}{\f382\fbidi \froman\fcharset204\fprq2 Cambria Math Cyr;}{\f384\fbidi \froman\fcharset161\fprq2 Cambria Math Greek;}{\f385\fbidi \froman\fcharset162\fprq2 Cambria Math Tur;}
-{\f388\fbidi \froman\fcharset186\fprq2 Cambria Math Baltic;}{\f389\fbidi \froman\fcharset163\fprq2 Cambria Math (Vietnamese);}{\f411\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f412\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\f414\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f415\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f418\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f419\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}
-{\f421\fbidi \fswiss\fcharset238\fprq2 Tahoma CE;}{\f422\fbidi \fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f424\fbidi \fswiss\fcharset161\fprq2 Tahoma Greek;}{\f425\fbidi \fswiss\fcharset162\fprq2 Tahoma Tur;}
-{\f426\fbidi \fswiss\fcharset177\fprq2 Tahoma (Hebrew);}{\f427\fbidi \fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f428\fbidi \fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f429\fbidi \fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}
-{\f430\fbidi \fswiss\fcharset222\fprq2 Tahoma (Thai);}{\f431\fbidi \fmodern\fcharset238\fprq1 Consolas CE;}{\f432\fbidi \fmodern\fcharset204\fprq1 Consolas Cyr;}{\f434\fbidi \fmodern\fcharset161\fprq1 Consolas Greek;}
-{\f435\fbidi \fmodern\fcharset162\fprq1 Consolas Tur;}{\f438\fbidi \fmodern\fcharset186\fprq1 Consolas Baltic;}{\f439\fbidi \fmodern\fcharset163\fprq1 Consolas (Vietnamese);}{\f443\fbidi \froman\fcharset0\fprq2 @PMingLiU Western;}
-{\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;}
-{\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;}
-{\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
-{\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}
-{\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}
-{\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}
-{\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}
-{\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}
-{\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;}
-{\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}
-{\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}
-{\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}
-{\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}}
-{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;
-\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red34\green34\blue34;}{\*\defchp \loch\af37\hich\af37\dbch\af37 }{\*\defpap 
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 
-\ltrch\fcs0 \fs22\lang2057\langfe1033\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\*
-\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv 
-\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 \fs20\lang2057\langfe2057\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp2057 
-\snext11 \ssemihidden \sunhideused \sqformat Normal Table;}{\s15\ql \li0\ri0\widctlpar
-\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af2\afs20\alang1025 \ltrch\fcs0 
-\f2\fs20\lang2057\langfe2057\cgrid\langnp2057\langfenp2057 \sbasedon0 \snext15 \slink16 \ssemihidden \sunhideused HTML Preformatted;}{\*\cs16 \additive \f2\fs20\lang0\langfe2057\langfenp2057 \slink15 \slocked \ssemihidden HTML Preformatted Char;}{\*\cs17 
-\additive \ul\cf2 \sunhideused Hyperlink;}{\*\cs18 \additive \fs16 \ssemihidden \sunhideused annotation reference;}{\s19\ql \li0\ri0\sa200\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs20\alang1025 
-\ltrch\fcs0 \fs20\lang2057\langfe1033\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext19 \slink20 \ssemihidden \sunhideused annotation text;}{\*\cs20 \additive \fs20 \slink19 \slocked \ssemihidden Comment Text Char;}{
-\s21\ql \li0\ri0\sa200\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \ab\af0\afs20\alang1025 \ltrch\fcs0 \b\fs20\lang2057\langfe1033\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 
-\sbasedon19 \snext19 \slink22 \ssemihidden \sunhideused annotation subject;}{\*\cs22 \additive \b\fs20 \slink21 \slocked \ssemihidden Comment Subject Char;}{\s23\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 
-\rtlch\fcs1 \af38\afs16\alang1025 \ltrch\fcs0 \fs16\lang2057\langfe1033\loch\f38\hich\af38\dbch\af37\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext23 \slink24 \ssemihidden \sunhideused Balloon Text;}{\*\cs24 \additive \f38\fs16 
-\slink23 \slocked \ssemihidden Balloon Text Char;}{\s25\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\tqc\tx4680\tqr\tx9360\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext25 \slink26 \sunhideused header;}{\*\cs26 \additive \fs22\lang2057\langfe0\langnp2057 \slink25 \slocked Header Char;}{
-\s27\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\tqc\tx4680\tqr\tx9360\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext27 \slink28 \sunhideused \spriority0 footer;}{\*\cs28 \additive \fs22\lang2057\langfe0\langnp2057 \slink27 \slocked \ssemihidden Footer Char;}{\*\cs29 
-\additive \rtlch\fcs1 \af0 \ltrch\fcs0 \sbasedon10 \spriority0 page number;}{\s30\ql \fi-425\li1134\ri0\sb120\sa120\widctlpar\tx1134\tqr\tx7920\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin1134\itap0 \rtlch\fcs1 \af0\afs20\alang1025 \ltrch\fcs0 
-\fs18\lang2057\langfe1033\loch\f1\hich\af1\dbch\af14\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext30 \spriority0 Indent;}{\s31\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af0\afs22\alang1025 
-\ltrch\fcs0 \fs22\lang2057\langfe1033\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 \snext31 \shidden \ssemihidden Revision;}{\s32\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 
-\af0\afs21\alang1025 \ltrch\fcs0 \f39\fs21\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext32 \slink33 \sunhideused Plain Text;}{\*\cs33 \additive \f39\fs21\lang0\langfe1033\langfenp1033 \slink32 \slocked Plain Text Char;}{
-\s34\ql \li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang2057\langfe1033\loch\f37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 
-\sbasedon0 \snext34 \sqformat \spriority34 List Paragraph;}}{\*\listtable{\*\listpicture{\pict{\*\picprop\shplid1027{\sp{\sn shapeType}{\sv 75}}{\sp{\sn fFlipH}{\sv 0}}{\sp{\sn fFlipV}{\sv 0}}{\sp{\sn fLine}{\sv 0}}{\sp{\sn borderTopColor}{\sv -16777216}}
-{\sp{\sn borderLeftColor}{\sv -16777216}}{\sp{\sn borderBottomColor}{\sv -16777216}}{\sp{\sn borderRightColor}{\sv -16777216}}{\sp{\sn fIsBullet}{\sv 1}}{\sp{\sn fLayoutInCell}{\sv 1}}}\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0
-\picw7620\pich7620\picwgoal4320\pichgoal4320\wmetafile8\bliptag769486312\blipupi-183{\*\blipuid 2ddd6de88f5353a50bdc5a988851b0ca}
-0100090000038d00000002001c00000000000400000003010800050000000b0200000000050000000c0209070507040000002e0118001c000000fb0210000700
-00000000bc02000000000102022253797374656d0076a0823c0bcc8a330019e2957680019a767049340bd88a3300040000002d010000040000002d0100000400
-0000020101001c000000fb02a4ff0000000000009001000000000440002243616c69627269000000000000000000000000000000000000000000000000000400
-00002d010100040000002d010100040000002d010100050000000902000000020d000000320a570000000100040000000000080708072000360005000000090200000002040000002d010000040000002d010000030000000000}}{\list\listtemplateid-492936738\listhybrid{\listlevel\levelnfc0
-\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
-\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 
-\ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2
-\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
-\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 
-\ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid39328222}{\list\listtemplateid-917765150\listhybrid{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1080\lin1080 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
-\fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel
-\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0
-\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }
-{\listname ;}\listid144588935}{\list\listtemplateid-1026387870{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\'00;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 
-\fi-360\li360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'03\'00.\'01;}{\levelnumbers\'01\'03;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li360\lin360 }{\listlevel\levelnfc0
-\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'05\'00.\'01.\'02;}{\levelnumbers\'01\'03\'05;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
-\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'07\'00.\'01.\'02.\'03;}{\levelnumbers\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\levelspace0\levelindent0{\leveltext\'09\'00.\'01.\'02.\'03.\'04;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\levelspace0\levelindent0{\leveltext\'0b\'00.\'01.\'02.\'03.\'04.\'05;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\levelspace0\levelindent0{\leveltext\'0d\'00.\'01.\'02.\'03.\'04.\'05.\'06;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\levelspace0\levelindent0{\leveltext\'0f\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
-\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'11\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li1440\lin1440 }{\listname 
-;}\listid155655221}{\list\listtemplateid466939434\listhybrid{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat6\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 
-\fi-360\li1080\lin1080 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1800\lin1800 }{\listlevel
-\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2520\lin2520 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
-\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3240\lin3240 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3960\lin3960 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4680\lin4680 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-360\li5400\lin5400 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li6120\lin6120 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6840\lin6840 }{\listname ;}\listid207642902}
-{\list\listtemplateid-868587660\listhybrid{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \cf1\dbch\af0\fbias0 
-\fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2
-\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0
-\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid244075828}
-{\list\listtemplateid-301287646\listhybrid{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \cf1\dbch\af0\fbias0 
-\fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2
-\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0
-\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid358317280}
-{\list\listtemplateid572415416\listhybrid{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \cf0\dbch\af37\fbias0 
-\fi-360\li786\lin786 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1506\lin1506 }{\listlevel\levelnfc2
-\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2226\lin2226 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2946\lin2946 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0
-\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3666\lin3666 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4386\lin4386 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-360\li5106\lin5106 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5826\lin5826 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6546\lin6546 }{\listname ;}\listid423112302}
-{\list\listtemplateid-1459612926\listhybrid{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li1275\lin1275 }
-{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1995\lin1995 }{\listlevel\levelnfc2\levelnfcn2\leveljc2
-\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2715\lin2715 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3435\lin3435 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0
-{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li4155\lin4155 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4875\lin4875 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
-\fi-360\li5595\lin5595 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li6315\lin6315 }{\listlevel
-\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li7035\lin7035 }{\listname ;}\listid454718230}
-{\list\listtemplateid-551514274\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'01-;}{\levelnumbers;}\loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li1080\lin1080 }{\listlevel
-\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li1800\lin1800 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2520\lin2520 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0
-{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3240\lin3240 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 
-\fi-360\li3960\lin3960 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li4680\lin4680 }{\listlevel\levelnfc23\levelnfcn23
-\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5400\lin5400 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li6120\lin6120 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
-\f10\fbias0 \fi-360\li6840\lin6840 }{\listname ;}\listid474840100}{\list\listtemplateid-1601537400{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}
-\f3\fs20\fbias0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fs20\fbias0 \levelpicture0\fi-360\li1440
-\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0 \fi-360\li2160\jclisttab\tx2160\lin2160 }
-{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23
-\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0 \fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0 \fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'01\u-3929 ?;}{\levelnumbers;}\f10\fs20\fbias0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}
-\f10\fs20\fbias0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid891499942}{\list\listtemplateid-2106560774\listhybrid{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
-\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
-\fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel
-\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2
-\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid939029968}{\list\listtemplateid1475657882\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'01-;}{\levelnumbers;}
-\loch\af1\hich\af1\dbch\af0\fbias0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li2160\lin2160 }{\listlevel\levelnfc23
-\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li4320\lin4320 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li5040\lin5040 }
-{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\fbias0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
-\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'01o;}{\levelnumbers;}\f2\fbias0 \fi-360\li6480\lin6480 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0
-{\leveltext\'01\u-3929 ?;}{\levelnumbers;}\f10\fbias0 \fi-360\li7200\lin7200 }{\listname ;}\listid1080055287}{\list\listtemplateid345380616\listhybrid{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0
-{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1864\lin1864 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2224\lin2224 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-180\li2944\lin2944 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3664\lin3664 }
-{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li4384\lin4384 }{\listlevel\levelnfc2\levelnfcn2\leveljc2
-\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li5104\lin5104 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5824\lin5824 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0
-{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li6544\lin6544 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li7264\lin7264 }{\listname ;}\listid1198470673}{\list\listtemplateid-1488150726\listhybrid{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
-\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1080\lin1080 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
-\fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel
-\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2
-\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid1264800667}{\list\listtemplateid1709371634{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\'00;}{\levelnumbers\'01;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat2\levelspace0\levelindent0{\leveltext\'03\'00.\'01;}{\levelnumbers\'01\'03;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 
-\fi-360\li360\lin360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'05\'00.\'01.\'02;}{\levelnumbers\'01\'03\'05;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\lin720 }{\listlevel
-\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'07\'00.\'01.\'02.\'03;}{\levelnumbers\'01\'03\'05\'07;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\lin720 }{\listlevel\levelnfc0\levelnfcn0
-\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'09\'00.\'01.\'02.\'03.\'04;}{\levelnumbers\'01\'03\'05\'07\'09;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
-\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0b\'00.\'01.\'02.\'03.\'04.\'05;}{\levelnumbers\'01\'03\'05\'07\'09\'0b;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
-\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0d\'00.\'01.\'02.\'03.\'04.\'05.\'06;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1080\li1080\lin1080 }{\listlevel\levelnfc0\levelnfcn0
-\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'0f\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-1440\li1440\lin1440 }{\listlevel
-\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'11\'00.\'01.\'02.\'03.\'04.\'05.\'06.\'07.\'08;}{\levelnumbers\'01\'03\'05\'07\'09\'0b\'0d\'0f\'11;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 
-\fi-1440\li1440\lin1440 }{\listname ;}\listid1335182434}{\list\listtemplateid-1861725538\listhybrid{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
-\fi-360\li1440\lin1440 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel
-\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0
-\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }
-{\listname ;}\listid1556695208}{\list\listtemplateid-301287646\listhybrid{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 
-\cf1\dbch\af0\fbias0 \fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
-\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1
-\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0
-{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}
-\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 
-\fi-360\li5760\lin5760 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname 
-;}\listid1583906200}{\list\listtemplateid1806592008\listhybrid{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 
-\fi-360\li720\lin720 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\lin1440 }{\listlevel\levelnfc2
-\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2880\lin2880 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0
-\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600\lin3600 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 
-\af0 \ltrch\fcs0 \fi-360\li5040\lin5040 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\lin5760 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6480\lin6480 }{\listname ;}\listid1801338294}
-{\list\listtemplateid-1056679890\listhybrid{\listlevel\levelnfc2\levelnfcn2\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'03(\'00);}{\levelnumbers\'02;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-720\li1429
-\jclisttab\tx1429\lin1429 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1789\jclisttab\tx1789\lin1789 }
-{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li2509\jclisttab\tx2509\lin2509 }{\listlevel\levelnfc0
-\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3229\jclisttab\tx3229\lin3229 }{\listlevel\levelnfc4\levelnfcn4\leveljc0
-\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3949\jclisttab\tx3949\lin3949 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0
-\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li4669\jclisttab\tx4669\lin4669 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative
-\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5389\jclisttab\tx5389\lin5389 }{\listlevel\levelnfc4\levelnfcn4\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0
-{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li6109\jclisttab\tx6109\lin6109 }{\listlevel\levelnfc2\levelnfcn2\leveljc2\leveljcn2\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext
-\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-180\li6829\jclisttab\tx6829\lin6829 }{\listname ;}\listid1872956500}{\list\listtemplateid2052502928{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0
-\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc3\levelnfcn3\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext
-\'02\'01.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers
-\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li2160\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 
-\ltrch\fcs0 \fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li3600
-\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'05.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li4320\jclisttab\tx4320\lin4320 }
-{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5040\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc0
-\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
-\leveljcn0\levelfollow0\levelstartat1\lvltentative\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\rtlch\fcs1 \af0 \ltrch\fcs0 \fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid1950702225}}{\*\listoverridetable
-{\listoverride\listid474840100\listoverridecount0\ls1}{\listoverride\listid1080055287\listoverridecount0\ls2}{\listoverride\listid1872956500\listoverridecount0\ls3}{\listoverride\listid1198470673\listoverridecount0\ls4}{\listoverride\listid1950702225
-\listoverridecount0\ls5}{\listoverride\listid1556695208\listoverridecount0\ls6}{\listoverride\listid454718230\listoverridecount0\ls7}{\listoverride\listid939029968\listoverridecount0\ls8}{\listoverride\listid1264800667\listoverridecount0\ls9}
-{\listoverride\listid244075828\listoverridecount0\ls10}{\listoverride\listid423112302\listoverridecount0\ls11}{\listoverride\listid1801338294\listoverridecount0\ls12}{\listoverride\listid155655221\listoverridecount0\ls13}{\listoverride\listid1335182434
-\listoverridecount0\ls14}{\listoverride\listid144588935\listoverridecount0\ls15}{\listoverride\listid1583906200\listoverridecount0\ls16}{\listoverride\listid891499942\listoverridecount0\ls17}{\listoverride\listid358317280\listoverridecount0\ls18}
-{\listoverride\listid207642902\listoverridecount0\ls19}{\listoverride\listid39328222\listoverridecount9{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel
-\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat\levelstartat1}{\lfolevel\listoverridestartat
-\levelstartat1}\ls20}}{\*\rsidtbl \rsid1198806\rsid7222687\rsid9508363\rsid11754636\rsid13262587}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info
-{\title LEC-PRE-00489 ~ EULA for CMSIS Deliverables}{\author emidre01}{\operator Joachim Krech}{\creatim\yr2014\mo6\dy2\hr8\min46}{\revtim\yr2014\mo6\dy2\hr8\min48}{\printim\yr2014\mo6\dy2\hr8\min46}{\version3}{\edmins4}{\nofpages4}{\nofwords1696}
-{\nofchars9668}{\*\company ARM Ltd}{\nofcharsws11342}{\vern49167}{\*\saveprevpict}}{\*\userprops {\propname Check In Comment}\proptype30{\staticval Major Version Publish}{\propname ComputedCompany}\proptype30{\staticval ARM/}{\propname ComputedLR}
-\proptype30{\staticval AP/}{\propname ComputedNumber}\proptype30{\staticval LEC-PRE-00489-V6.0}{\propname Created}\proptype30{\staticval 2014-02-19T13:26:48Z}{\propname Description}\proptype30{\staticval }{\propname display_urn:schemas-microsoft-com:offic
-e:office#Author}\proptype30{\staticval Emily Drea}{\propname display_urn:schemas-microsoft-com:office:office#Editor}\proptype30{\staticval Emily Drea}{\propname EMAIL_OWNER_ADDRESS}\proptype30{\staticval sAAAUYtyAkeNWR4c/hyv83djDdgT//SlfRfj0yul0Nymu58=}
-{\propname FileLeafRef}\proptype30{\staticval LEC-PRE-00489}{\propname HiddenDelete}\proptype30{\staticval }{\propname HiddenUpload}\proptype30{\staticval }{\propname MAIL_MSG_ID1}\proptype30{\staticval ABAAVOAfoSrQoywVz+n89RkH8vckJh2hX9X1LeIJRLXpkh+XCtJm
-zNRfIdvcDdtCC+CW}{\propname MAIL_MSG_ID2}\proptype30{\staticval c5CxtGnFSJrNPiFAS7uBa/Md4M/GKbLGzLnuTUVlLUhYPGbMRhOa5RG4vn7\'0d\'0aRvdHkjT0j+KBwUyX0J0TijfAeRM/c9+3kWygmQ==}{\propname Modified}\proptype30{\staticval 2014-06-01T22:00:57Z}{\propname Modified
- By}\proptype30{\staticval 62\'3b#Emily Drea,#EMEA\'5cemidre01,#Emily.Drea@arm.com,#,#Emily Drea}{\propname Name}\proptype30{\staticval LEC-PRE-00489.doc}{\propname Order}\proptype30{\staticval 672300}{\propname Property Bag}\proptype30{\staticval vti_con
-tentversionisdirty:BW|false\'0d\'0avti_parserversion:SR|14.0.0.6029\'0d\'0aEXT:SW|doc\'0d\'0aOrder:IW|672300\'0d\'0avti_contenttag:SW|\'7bED0E0651-0814-4E38-B7AA-8478D3CBF58F\'7d,123,48\'0d\'0a_Category:SW|\'0d\'0aRESPONSE_SENDER_NAME:SW|gAAAdya76B99d4hLG
-UR1rQ+8TxTv0GGEPdix\'0d\'0avti_author:SR|}{\propname RESPONSE_SENDER_NAME}\proptype30{\staticval gAAAdya76B99d4hLGUR1rQ+8TxTv0GGEPdix}{\propname Title}\proptype30{\staticval LEC-PRE-00489 ~ EULA for CMSIS Deliverables}}{\*\xmlnstbl {\xmlns1 http://schemas
-.microsoft.com/office/word/2003/wordml}}\paperw11906\paperh16838\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect 
-\widowctrl\ftnbj\aenddoc\revisions\trackmoves0\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1
-\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1
-\jexpand\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
-\asianbrkrule\rsidroot2688764\newtblstyruls\nogrowautofit\utinl \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0{\*\ftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 
-\rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1198806 \chftnsep 
-\par }}{\*\ftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1198806 \chftnsepc 
-\par }}{\*\aftnsep \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1198806 \chftnsep 
-\par }}{\*\aftnsepc \ltrpar \pard\plain \ltrpar\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid1198806 \chftnsepc 
-\par }}\ltrpar \sectd \ltrsect\linex0\headery400\footery708\colsx708\endnhere\sectlinegrid360\sectdefaultcl\sectrsid11754636\sftnbj {\headerr \ltrpar \ltrrow\trowd \irow0\irowband0\ltrrow
-\ts11\trgaph108\trrh240\trleft-108\trftsWidth1\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth3009\clshdrawnil \cellx2901
-\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth3009\clshdrawnil \cellx5910\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl 
-\cltxlrtb\clftsWidth3\clwWidth3009\clshdrawnil \cellx8919\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \hich\af1\dbch\af1\loch\f1 1 June 2014\cell }\pard \ltrpar\qc \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \hich\af1\dbch\af1\loch\f1 CONFIDENTIAL\cell }\pard \ltrpar\qr \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \hich\af1\dbch\af1\loch\f1 LEC-PRE-00489\cell }\pard \ltrpar
-\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \trowd \irow0\irowband0\ltrrow
-\ts11\trgaph108\trrh240\trleft-108\trftsWidth1\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth3009\clshdrawnil \cellx2901
-\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth3009\clshdrawnil \cellx5910\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl 
-\cltxlrtb\clftsWidth3\clwWidth3009\clshdrawnil \cellx8919\row \ltrrow}\trowd \irow1\irowband1\lastrow \ltrrow\ts11\trgaph108\trrh240\trleft-108\trftsWidth1\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt
-\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth9026\clshdrawnil \cellx8919\pard \ltrpar\qr \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af1 
-\ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \hich\af1\dbch\af1\loch\f1 SP-Version: 3.0\cell }\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af1 \ltrch\fcs0 
-\fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \trowd \irow1\irowband1\lastrow \ltrrow\ts11\trgaph108\trrh240\trleft-108\trftsWidth1\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl 
-\clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth9026\clshdrawnil \cellx8919\row }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 
-\insrsid11754636 
-\par }}{\footerr \ltrpar \ltrrow\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trgaph108\trrh240\trleft-108\trftsWidth1\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr
-\brdrtbl \cltxlrtb\clftsWidth3\clwWidth4513\clshdrawnil \cellx4405\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth4513\clshdrawnil \cellx8918\pard\plain \ltrpar\qr \li0\ri0\sa200\sl276\slmult1
-\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 \fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 
-\fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \hich\af1\dbch\af1\loch\f1 PAGE}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\lang1024\langfe1024\loch\af1\hich\af1\dbch\af1\noproof\insrsid9508363 \hich\af1\dbch\af1\loch\f1 4}}}\sectd \ltrsect
-\linex0\endnhere\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \hich\af1\dbch\af1\loch\f1  of }{\field{\*\fldinst {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 
-\hich\af1\dbch\af1\loch\f1 NUMPAGES}}{\fldrslt {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\lang1024\langfe1024\loch\af1\hich\af1\dbch\af1\noproof\insrsid9508363 \hich\af1\dbch\af1\loch\f1 4}}}\sectd \ltrsect\linex0\endnhere\sectdefaultcl\sftnbj {\rtlch\fcs1 \af1 
-\ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 \cell \cell }\pard \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 {\rtlch\fcs1 \af1 \ltrch\fcs0 \fs18\loch\af1\hich\af1\dbch\af1\insrsid11754636 
-\trowd \irow0\irowband0\lastrow \ltrrow\ts11\trgaph108\trrh240\trleft-108\trftsWidth1\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddfr3\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl 
-\cltxlrtb\clftsWidth3\clwWidth4513\clshdrawnil \cellx4405\clvertalt\clbrdrt\brdrtbl \clbrdrl\brdrtbl \clbrdrb\brdrtbl \clbrdrr\brdrtbl \cltxlrtb\clftsWidth3\clwWidth4513\clshdrawnil \cellx8918\row }\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1
-\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 {\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11754636 
-\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}
-{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8
-\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\qj \li0\ri0\sa240\widctlpar
-\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 END USER LICENCE AGREEMENT FOR THE }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CORTEX MICROCONTROLLER SOFTWARE INTERFACE STANDARD (CMSIS) DELIVERABLES }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-\par THIS END USER LICENCE AGREEMENT ("LICENCE") IS A LEGAL AGREEMENT BETWEEN YOU (EITHER A }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid5861575 
-SINGLE INDIVIDUAL, OR SINGLE LEGAL ENTITY) AND ARM LIMITED ("ARM") FOR THE USE OF THE CMSIS }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 DELIVERABLES}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid5861575 . ARM IS ONLY WILLING TO LICENSE THE }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS DELIVERABLES }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid5861575 TO YOU ON CONDITION THAT YOU ACCEPT ALL OF THE}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  TERMS IN THIS LICENCE. BY CLICKING "I AGREE", OR BY INSTALLING OR OTHERWISE USING OR COPYING THE }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS DELIVERABLES }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-YOU INDICATE THAT YOU AGREE TO BE BOUND BY ALL THE TERMS OF THIS LICENCE. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENCE, ARM IS UNWILLING TO LICENSE YOU TO USE }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 OF }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 THE }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS DELIVERABLES}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  AND YOU MAY NOT INSTALL, USE OR COPY THE }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS DELIVERABLES}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 .
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 \'93
-CMSIS Deliverables\'94 means the following components: (i) CMSIS-CORE; (ii) CMSIS-DRIVER; (iii) CMSIS-DSP; (iv) CMSIS-PACK; (v) CMSIS-RTOS API; and (vi) CMSIS-SVD . 
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\tx0\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 \'93CMSIS-CORE
-\'94 means the specification defining the application programming interface, naming and coding conventions for the Cortex-M processor cores.
-\par \'94}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid488451 \hich\af1\dbch\af37\loch\f1 CMSIS-DRIVER}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 \'94}{\rtlch\fcs1 \af0 \ltrch\fcs0 
-\insrsid11754636 \hich\af37\dbch\af37\loch\f37  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid488451 \hich\af1\dbch\af37\loch\f1 means the specification defining }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\hich\af1\dbch\af37\loch\f1 a generic}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid488451 \hich\af1\dbch\af37\loch\f1  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 p}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid488451 \hich\af1\dbch\af37\loch\f1 eripheral }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 d}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\insrsid11754636\charrsid488451 \hich\af1\dbch\af37\loch\f1 river application programming interface, naming and coding conventions}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11754636 .
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  \'93CMSIS-DSP\'94
- means the digital signal process (DSP) library specification defining the application programming interface of a DSP library implementation}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15023647 .}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\tx0\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 \'93}{
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid13240697 \hich\af1\dbch\af37\loch\f1 CMSIS-PACK}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 \'94}{\rtlch\fcs1 \af0 \ltrch\fcs0 
-\insrsid11754636\charrsid13240697 \hich\af37\dbch\af37\loch\f37  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid13240697 \hich\af1\dbch\af37\loch\f1 means the specification defining a software pack file format}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 , verification utility, }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid13240697 \hich\af1\dbch\af37\loch\f1 and the associated XML schema file}{\rtlch\fcs1 
-\af0 \ltrch\fcs0 \insrsid11754636\charrsid13240697 .}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11754636 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 \'93CMSIS-RTOS API\'94 means the
- real-time operating system (RTOS) specification defining a generic application programming interface layer for a RTOS system}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15023647 .}{
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4029239 \hich\af1\dbch\af37\loch\f1 
-Notwithstanding the foregoing, }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4730869 \hich\af1\dbch\af37\loch\f1 the CMSIS D}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 eliverables}{
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4730869 \hich\af1\dbch\af37\loch\f1  shall not}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4029239 \hich\af1\dbch\af37\loch\f1  include}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 :}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4029239 \hich\af1\dbch\af37\loch\f1  (i) the implementation of other published specification
-\hich\af1\dbch\af37\loch\f1 s }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 referenced }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4029239 \hich\af1\dbch\af37\loch\f1 in th}{
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 e}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4029239 \hich\af1\dbch\af37\loch\f1  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 CMSIS Deliverables }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4029239 \hich\af1\dbch\af37\loch\f1 
-; (ii) any enabling technologies that may be necessary to make or use any product or portion thereof that }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4283548 \hich\af1\dbch\af37\loch\f1 complies with the }{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4283548 \hich\af1\dbch\af37\loch\f1 , but are not themselves expressly set forth in the }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 CMSIS Deliverables }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4283548 \hich\af1\dbch\af37\loch\f1  (e.\hich\af1\dbch\af37\loch\f1 
-g. compiler front ends, code generators, back ends, libraries or other compiler, assembler or linker technologies; validation or debug software or hardware; applications, operating system or driver software; RISC architecture; processor microarchitecture)
-\hich\af1\dbch\af37\loch\f1 ;\hich\af1\dbch\af37\loch\f1  (iii) maskworks and physical layouts of integrated circuit designs; or (iv) RTL or other high}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid4029239 
-\hich\af1\dbch\af37\loch\f1  level representations of integrated circuit designs.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  \'93CMSIS-SVD\'94 }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid9306407 means }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 the specification defining the System View Description (SVD), verification utility, }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf17\lang1033\langfe2057\langnp1033\langfenp2057\insrsid11754636\charrsid9306407 and associated XML}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf17\lang1033\langfe2057\langnp1033\langfenp2057\insrsid11754636  schema}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\cf17\lang1033\langfe2057\langnp1033\langfenp2057\insrsid11754636\charrsid9306407  files. }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid9306407 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  \'93Separate Files\'94 means the components in }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid10227990 the CMSIS reference implementation identified}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
- in the Schedule that demonstrate the usage of the CMSIS-CORE, CMSIS-DRIVER, CMSIS-DSP, CMSIS-PACK and CMSIS-RTOS API, }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid3618484  for microprocessors 
-or device specific software applications that are for use with microprocessors.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  
-\par }\pard \ltrpar\qj \li0\ri0\sa240\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 1. LICENCE GRANTS.
-\par }\pard \ltrpar\qj \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 1.1}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS DELIVERABLES 
-\par 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 ARM hereby grants to you, subject to the terms and conditions of this Licence, a non-exclusive, non-transferable }{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid1317547 licence, to use and copy the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS D}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 eliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 for the purpose of: }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar
-\tx426\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 (i) subject to clause 1.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 2}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 , developing, having developed, manufacturing, having manufactured, offering to sell, selling, supplying or otherwise distributing products that comply with the }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS D}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 eliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 ; and 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid1317547 (ii) distributing and having distributed (directly or through your customers and authorised distributors) the CMSIS-D}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 eliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid1317547  unmodified, with the products}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135  you have developed under }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 Clause 1.1 (i) }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 provided you preserve any copyright notices which are included with the CMSIS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  D}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 eliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid6756135 . 
-\par }\pard \ltrpar\qj \li0\ri0\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 1.2}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  CONDITIONS ON REDISTRIBUTION}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 .}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-\par 
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 
-\cbpat8 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid1928237 \hich\af1\dbch\af37\loch\f1 
-If you distribute (directly or through your customers and authorised distributors) the products you have created pursuant to Clauses 1.1}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 \hich\af1\dbch\af37\loch\f1  
-}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid1928237 \hich\af1\dbch\af37\loch\f1 (i) you agree: (a) not to use ARM\hich\f1 \rquote \loch\f1 s name\hich\af1\dbch\af37\loch\f1 
-, logo or trademarks to market any or all of the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid1928237 products created under Clause 1.1 (i); }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid1928237 \hich\af1\dbch\af37\loch\f1 (b) }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 \hich\af1\dbch\af37\loch\f1 to }{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid1928237 \hich\af1\dbch\af37\loch\f1 pr}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 \hich\af1\dbch\af37\loch\f1 e}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid1928237 \hich\af1\dbch\af37\loch\f1 serve any copyright notices included in the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 
-\hich\af1\dbch\af37\loch\f1 CMSIS D}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 eliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid1928237 
-\hich\af1\dbch\af37\loch\f1 ; and (c) to ensure your customers and authorised distributors comply with this Clause 1.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 \hich\af1\dbch\af37\loch\f1 2}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid1928237 .}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 \hich\af1\dbch\af37\loch\f1     }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-\par }\pard \ltrpar\qj \li0\ri0\sa240\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 2. RESTRICTIONS ON USE OF THE}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
- CMSIS DELIVERABLES}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 .
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 
-\cbpat8 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 PERMITTED USERS: The }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-CMSIS Deliverables }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 shall be used only by you (either a single individual, or single legal entity) your employees, or by your }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 on-site }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-bona fide sub-contractors for whose acts and omissions you hereby agree to be responsible to ARM}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  for}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  to the same extent as }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 you are for }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 your employees, and provided always that such sub-contractors}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 :}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  (i) are contractually obligated to use the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-CMSIS Deliverables }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 only for your benefit}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-;}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  and (i}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 i}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 ) agree to assign all their work product and any rights they create therein in the supply of such work to you.
-\par COPYRIGHT AND RESERVATION OF RIGHTS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid14488502 : The }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid14488502 
- are owned by ARM or its licensors and are protected by copyright and other intellectual property laws and international treaties. The }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables}{
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid14488502  are licensed not sold. Except as expressly licensed herein, you acquire no right, title or interest in the }{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid14488502 
- or any intellectual property therein. In no event shall the licences granted herein be construed as granting you, expressly or by implication, estoppels or otherwise, a licence to use any ARM technology except the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid14488502 .}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-\par }\pard \ltrpar\qj \li0\ri0\sa240\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 3}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 . SUPPORT.
-\par ARM is not obligated to support the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables but}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  may do so entirely at ARM's discretion. 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 4}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 . }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 NO }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 WARRANT}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 Y.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-\par YOU AGREE THAT THE }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS DELIVERABLES ARE}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
- LICENSED "AS IS", AND THAT ARM EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS OR OTHER TERMS, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION THE IMPLIED WARR
-ANTIES OF NON-INFRINGEMENT, SATISFACTORY QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  THE CMSIS DELIVERABLES MAY CONTAIN ERRORS.  }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 5}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 . LIMITATION OF LIABILITY.
-\par THE MAXIMUM LIABILITY OF ARM TO YOU IN AGGREGATE FOR ALL CLAIMS MADE AGAINST ARM IN CONTRACT}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 ,}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  TORT OR OTHERWISE UNDER OR IN CONNECTION WITH THE SUBJECT MATTER OF THIS LICENCE SHALL NOT EXCEED }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 THE GREATER OF (I) }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-THE TOTAL OF SUMS PAID BY YOU TO ARM (IF ANY) FOR THIS LICENCE}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  AND (II) US$10.00}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 .}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636   THE LIMITATIONS, EXCLUSIONS AND DISCLAIMERS IN THIS LICEN
-CE SHALL APPLY TO THE MAXIMUM EXTENT ALLOWED BY APPLICABLE LAW.
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 \hich\af1\dbch\af37\loch\f1 6
-}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid13830602 \hich\af1\dbch\af37\loch\f1 . THIRD PARTY RIGHTS.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid13830602 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid13830602 \hich\af1\dbch\af37\loch\f1 
-The Separate Files are delivered subject to and your use is governed by their own separate licence agreements. This Licence does not apply to such Separate Files and the\hich\af1\dbch\af37\loch\f1 \hich\f1 y are not included in the term \'93}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636 \hich\af1\dbch\af37\loch\f1 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\lang1024\langfe1024\noproof\insrsid11754636\charrsid13830602 
-\loch\af1\dbch\af37\hich\f1 \'94\loch\f1 \hich\f1  under this Licence. You agree to comply with all terms and conditions imposed on you in respect of such Separate Files including those identified in the Schedule (\'93\loch\f1 \hich\f1 Third Party Terms
-\'94\loch\f1 ).  
-\par \hich\af1\dbch\af37\loch\f1 ARM HEREBY DISCLA\hich\af1\dbch\af37\loch\f1 \hich\f1 
-IMS ANY AND ALL WARRANTIES EXPRESS OR IMPLIED FROM ANY THIRD PARTIES REGARDING ANY SEPARATE FILES, ANY THIRD PARTY MATERIALS INCLUDED IN THE SOFTWARE, ANY THIRD PARTY MATERIALS FROM WHICH THE SOFTWARE IS DERIVED (COLLECTIVELY \'93\loch\f1 \hich\f1 
-OTHER CODE\'94\loch\f1 ), AND THE USE OF\hich\af1\dbch\af37\loch\f1  \hich\af1\dbch\af37\loch\f1 
-ANY OR ALL THE OTHER CODE IN CONNECTION WITH THE SOFTWARE, INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE.
-\par \hich\af1\dbch\af37\loch\f1 NO THIRD PARTY LICENSORS OF OTHER CODE SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, \hich\af1\dbch\af37\loch\f1 
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND WHETHER MADE UNDER CONTRACT, TORT OR OTHER LEGAL THEORY, ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE OTHER CODE OR THE EX
-\hich\af1\dbch\af37\loch\f1 E\hich\af1\dbch\af37\loch\f1 RCISE OF ANY RIGHTS GRANTED UNDER EITHER OR BOTH THIS LICENCE AND THE LEGAL TERMS APPLICABLE TO ANY SEPARATE FILES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-\par }\pard \ltrpar\qj \li0\ri0\sa240\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 7}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 . U.S. GOVERNMENT END USERS.
-\par US Government Restrictions: Use, duplication, reproduction, release, modification, disclosure or transfer of this commercial product and accompanying documentation is restricted in accordance with the terms of this Licence.
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 8}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 . TERM AND TERMINATION.
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 8.1 }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-This Licence shall remain in force until terminated }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 in accordance with the terms of Clause 8.2 or Clause 8.3 below}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 . }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-\par 8.2 }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
-Without prejudice to any of its other rights if you are in breach of any of the terms and conditions of this Licence then ARM may terminate this Licence immediately upon giving written notice to you}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid7630822 .  You may terminate this Licence at any time. }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7106724 \hich\af1\dbch\af37\loch\f1 
-8.3 This Licence shall immediately terminate and shall be unavailable to you if you or any party affiliated to you asserts any patents against ARM, ARM affiliates, third parties who have a valid licence fro\hich\af1\dbch\af37\loch\f1 
-m ARM for the CMSIS Deliverables, or any customers or distributors of any of them based upon a claim that your (or your affiliate) patent is Necessary to implement the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\hich\af1\dbch\af37\loch\f1 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7106724 \hich\af1\dbch\af37\loch\f1 . In this Licence}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\hich\af1\dbch\af37\loch\f1 :}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7106724 \hich\af1\dbch\af37\loch\f1  (i) "affiliate" means any entity controlling, contr\hich\af1\dbch\af37\loch\f1 
-olled by or under common control with a party (in fact or in law, via voting securities, management control or otherwise) and "affiliated" shall be construed accordingly; (ii) "assert" means to allege infringement in legal or administrative proceedings, o
-\hich\af1\dbch\af37\loch\f1 r\hich\af1\dbch\af37\loch\f1  proceedings before any other competent trade, arbitral or international authority; }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 and }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7106724 \hich\af1\dbch\af37\loch\f1 \hich\f1 (iii) \'93\loch\f1 \hich\f1 Necessary\'94\loch\f1 
- means with respect to any claims of any patent, those claims which, without the appropriate permission of the patent owner, will be infringed when imp\hich\af1\dbch\af37\loch\f1 lementing the CMSIS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1  Deliverables }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7106724 \hich\af1\dbch\af37\loch\f1 
-because no alternative, commercially reasonable, non-infringing way of implementing the CMSIS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1  Deliverables }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\insrsid11754636\charrsid7106724 \hich\af1\dbch\af37\loch\f1 is known.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid5900444 \hich\af1\dbch\af37\loch\f1  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\par }\pard \ltrpar\qj \li0\ri0\sa240\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 8.4 }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid7630822 Upon termination of this Licence,}{
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636  you shall stop }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15098396 
-using the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15098396 
- and destroy all copies of the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15098396  in your possession. The provisions of clauses 5, 6, 7, 8 and 9 shall survive termination of this Licence.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636   
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 9}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 . GENERAL.
-\par This Licence is governed by English Law. Except where ARM agrees otherwise in a written contract signed by you and ARM, this is the only agreement between you and ARM relating to the }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 CMSIS Deliverables}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15280636 
- and it may only be modified by written agreement between you and ARM. Except as expressly agreed in writing, this Licence may not be modified by purchase orders, ad
-vertising or other representation by any person. If any clause or sentence in this Licence is held by a court of law to be illegal or unenforceable the remaining provisions of this Licence shall not be affected thereby. The failure by ARM to enforce any o
-f the provisions of this Licence, unless waived in writing, shall not constitute a waiver of ARM's rights to enforce such provision or any other provision of this Licence in the future.}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636   This Licence may not be assigned without the prior written consent of ARM.
-\par }\pard \ltrpar\qc \li0\ri0\sa240\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 \page SCHEDULE
-\par }\pard \ltrpar\qj \li0\ri0\sa240\widctlpar\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \cbpat8 {
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 Separate Files
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 The }{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15098396 package }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 also }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15098396 includes the components}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636  contained in the following directories}{\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15098396 :}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 
-\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\insrsid11754636 \hich\af1\dbch\af0\loch\f1 (a)\tab}}\pard \ltrpar
-\qj \fi-360\li720\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls16\adjustright\rin0\lin720\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 ./}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 \hich\af1\dbch\af37\loch\f1 CMSIS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 /}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 
-\hich\af1\dbch\af37\loch\f1 DSP_Lib}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1  -  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636\charrsid15098396 
-DSP Library sources and examples}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 ; 
-\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\insrsid11754636 \hich\af1\dbch\af0\loch\f1 (b)\tab}}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 ./}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 \hich\af1\dbch\af37\loch\f1 CMSIS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 /}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 
-\hich\af1\dbch\af37\loch\f1 Include}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1  - Header files; 
-\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\insrsid11754636 \hich\af1\dbch\af0\loch\f1 (c)\tab}}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 ./}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 \hich\af1\dbch\af37\loch\f1 CMSIS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 /}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 
-\hich\af1\dbch\af37\loch\f1 Lib}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1  - }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 \hich\af1\dbch\af37\loch\f1 
-DSP Library build for various toolchains}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 ; 
-\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\insrsid11754636 \hich\af1\dbch\af0\loch\f1 (d)\tab}}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 ./}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 \hich\af1\dbch\af37\loch\f1 CMSIS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 /}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 
-\hich\af1\dbch\af37\loch\f1 RTOS}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1  - }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid7090778 \hich\af1\dbch\af37\loch\f1 
-Header file template for CMSIS-RTOS implementation}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 ; and 
-\par {\listtext\pard\plain\ltrpar \rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\insrsid11754636 \hich\af1\dbch\af0\loch\f1 (e)\tab}}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\cf1\lang2057\langfe2057\langfenp2057\insrsid11754636 .}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 /Device - T}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid14488502 \hich\af1\dbch\af37\loch\f1 emplate files and implementations for Cortex-M class processors}{
-\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 . 
-\par }\pard \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\par \hich\af1\dbch\af37\loch\f1 All of the above components (a\hich\f1 \endash \loch\f1  e) are licensed to you under the terms of the BSD licence, which is incorp\hich\af1\dbch\af37\loch\f1 orated within or alongside the above components.  
-\par }\pard \ltrpar\qj \li284\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin284\itap0\pararsid11754636 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1   }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 
-\f1\fs18\insrsid11754636\charrsid13975144 \hich\af1\dbch\af37\loch\f1 (f)}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1    }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid13975144 
-\hich\af1\dbch\af37\loch\f1 ./CMSIS/Driver \hich\f1 \endash \loch\f1  CMSIS-Driver header files}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid13975144 \hich\af1\dbch\af37\loch\f1   (g)}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1  }{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11754636 
-\hich\af37\dbch\af37\loch\f37  }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 ./CMSIS/Pack \hich\f1 \endash \loch\f1  Example Device Family Pack}{\rtlch\fcs1 \af0 \ltrch\fcs0 \insrsid11754636\charrsid13975144 
-
-\par }\pard\plain \ltrpar\s32\ql \li0\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \rtlch\fcs1 \af0\afs21\alang1025 \ltrch\fcs0 \f39\fs21\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 
-\af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\par The above components (f \endash  g) are licensed to you under the terms of the zlib licence, which is incorporated within or alongside the above components.
-\par 
-\par }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid14488502        }{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636 
-\par 
-\par 
-\par }\pard\plain \ltrpar\qj \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid11754636 \rtlch\fcs1 \af0\afs22\alang1025 \ltrch\fcs0 
-\fs22\lang2057\langfe1033\loch\af37\hich\af37\dbch\af37\cgrid\langnp2057\langfenp1033 {\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid2958685 \hich\af1\dbch\af37\loch\f1 ARM contract reference LEC-PRE-00489}{\rtlch\fcs1 \af1\afs18 
-\ltrch\fcs0 \f1\fs18\insrsid11754636 \hich\af1\dbch\af37\loch\f1 - v3.0}{\rtlch\fcs1 \af1\afs18 \ltrch\fcs0 \f1\fs18\insrsid11754636\charrsid2958685 
-\par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a
-9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad
-5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6
-b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0
-0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6
-a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f
-c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512
-0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462
-a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865
-6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b
-4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b
-4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f
-7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87
-615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad
-79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b
-5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab
-999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9
-699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586
-8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6
-0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f
-9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be
-15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979
-3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d
-32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a
-f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86
-e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90
-fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2
-ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae
-a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1
-399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5
-4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84
-0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b
-c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7
-689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20
-5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0
-aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d
-316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840
-545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a
-c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100
-0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7
-8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89
-d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500
-1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f
-bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6
-a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a
-0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021
-0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008
-00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000}
-{\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d
-617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169
-6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363
-656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e}
-{\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4;
-\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9;
-\lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7;
-\lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdpriority0 \lsdlocked0 footer;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdpriority0 \lsdlocked0 page number;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;
-\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;
-\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;
-\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;
-\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 0105000002000000180000004d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000560000
-d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff0900060000000000000000000000010000000100000000000000001000000200000001000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-fffffffffffffffffdffffff09000000feffffff04000000050000000600000007000000080000000a0000000c0000000b0000000d0000000f0000000e00000028000000feffffff1100000012000000130000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e00
-00001f0000002000000021000000220000002300000024000000250000002600000027000000feffffff29000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffff010000000c6ad98892f1d411a65f0040963251e500000000000000000000000010aa
-35ab2e7ecf0103000000c0160000000000004d0073006f004400610074006100530074006f0072006500000000000000000000000000000000000000000000000000000000000000000000000000000000001a000101ffffffffffffffff05000000000000000000000000000000000000000000000010aa35ab2e7ecf01
-10aa35ab2e7ecf0100000000000000000000000033005800c800dd00d0004e00c500d300540055003400df00c9005500df00db00cb0045004200d200df00d0003d003d000000000000000000000000000000000032000101ffffffffffffffff03000000000000000000000000000000000000000000000010aa35ab2e7e
-cf0110aa35ab2e7ecf010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff04000000ffffffff000000000000000000000000000000000000000000000000
-00000000000000000000000000000000f40b0000000000000100000002000000030000000400000005000000060000000700000008000000090000000a0000000b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000190000001a00
-00001b0000001c0000001d0000001e0000001f000000200000002100000022000000230000002400000025000000260000002700000028000000290000002a0000002b0000002c0000002d0000002e0000002f000000feffffff3100000032000000330000003400000035000000feffffff370000003800000039000000
-feffffff3b0000003c0000003d0000003e0000003f000000feffffff410000004200000043000000feffffff4500000046000000470000004800000049000000feffffff4b0000004c0000004d0000004e0000004f0000005000000051000000520000005300000054000000550000005600000057000000580000005900
-00005a000000feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
-ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d38223f3e3c4c6f6e6750726f7065727469657320786d6c6e733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f666669
-63652f323030362f6d657461646174612f6c6f6e6750726f70657274696573223e3c4c6f6e6750726f7020786d6c6e733d2222206e616d653d2250726f70657274795f78303032305f426167223e3c215b43444154415b7674695f636f6e74656e7476657273696f6e697364697274793a42577c66616c73650d0a767469
-5f70617273657276657273696f6e3a53527c31342e302e302e363032390d0a4558543a53577c646f630d0a4f726465723a49577c3637323330300d0a7674695f636f6e74656e747461673a53577c7b45443045303635312d303831342d344533382d423741412d3834373844334342463538467d2c3132332c34380d0a5f
-43617465676f72793a53577c0d0a524553504f4e53455f53454e4445525f4e414d453a53577c6741414164796137364239396434684c4755523172512b385478547630474745506469780d0a7674695f617574686f723a53527c454d45415c5c656d6964726530310d0a4e6f746573506172743a53577c4c45432d505245
-2d30303438392e646f630d0a53696465204c6574746572733a49577c300d0a7674695f63617465676f726965733a56577c0d0a48696464656e55706c6f61643a53577c0d0a50726f7065727479204261673a53577c7674695f636f6e74656e7476657273696f6e697364697274793a42577c66616c73655c725c6e767469
-5f70617273657276657273696f6e3a53527c31342e302e302e363032395c725c6e4558543a53577c646f635c725c6e4f726465723a49577c3637323330305c725c6e7674695f636f6e74656e747461673a53577c7b33384143303341362d393444362d344142302d394543322d4445424631343146333837437d2c313131
-2c37335c725c6e5f43617465676f72793a53577c5c725c6e524553504f4e53455f53454e4445525f4e414d453a53577c6741414164796137364239396434684c4755523172512b385478547630474745506469785c725c6e7674695f617574686f723a53527c0d0a5469746c653a53577c4c45432d5052452d3030343839
-207e2045554c4120666f7220434d5349532044656c6976657261626c65730d0a7674695f61737369676e6564746f3a53577c0d0a4b6579776f7264733a53577c0d0a436f6d7075746564436f6d70616e793a53577c41524d2f0d0a436f6d70757465644c523a53577c41502f0d0a437265617465643a53577c323031342d
-30322d31385431343a32393a31315a0d0a7674695f6d6f64696669656462793a53527c454d45415c5c656d6964726530310d0a436f6e74656e745479706549643a53577c307830313031303030394135453436413142414235363438423443423131314343384143453237440d0a5f417574686f723a53577c0d0a436865
-636b20496e20436f6d6d656e743a53577c4d616a6f722056657273696f6e205075626c6973680d0a4e616d653a53577c4c45432d5052452d30303438392e646f630d0a5f436f6d6d656e74733a53577c0d0a436f6d6d656e74733a53577c0d0a446f634e756d6265723a53577c4c45432d5052452d30303438390d0a446f
-6d696e6f20417574686f723a53577c0d0a4d41494c5f4d53475f4944323a53577c6335437874476e46534a724e5069464153377542612f4d64344d2f474b624c477a4c6e755455566c4c5568595047624d52684f6135524734766e375c725c6e527664486b6a54306a2b4b4277557958304a3054696a664165524d2f6339
-2b336b5779676d513d3d0d0a7674695f73796e6375706461746568696464656e76657273696f6e3a49577c3131390d0a5375626a6563743a53577c0d0a646973706c61795f75726e5c3a736368656d61732d6d6963726f736f66742d636f6d5c3a6f66666963655c3a6f666669636523456469746f723a53577c456d696c
-7920447265610d0a437265617465642042793a53577c36323b23456d696c7920447265612c23454d45415c5c656d6964726530312c23456d696c792e447265614061726d2e636f6d2c232c23456d696c7920447265610d0a7674695f666f6c6465726974656d636f756e743a49527c300d0a4d41494c5f4d53475f494431
-3a53577c41424141564f41666f5372516f7977567a2b6e3839526b483876636b4a683268583958314c65494a524c58706b682b5843744a6d7a4e52664964766344647443432b43570d0a4d6f6469666965643a53577c323031342d30322d31395431333a32363a34355a0d0a436f6d70757465644e756d6265723a53577c
-4c45432d5052452d30303438392d56362e300d0a4d6f6469666965642042793a53577c36323b23456d696c7920447265612c23454d45415c5c656d6964726530312c23456d696c792e447265614061726d2e636f6d2c232c23456d696c7920447265610d0a7674695f617070726f76616c6c6576656c3a53577c0d0a4469
-766973696f6e3a53577c5344440d0a48696464656e44656c6574653a53577c0d0a4e6f746573554e49443a53577c32383939374630443531443738304644383032353736433630303736363041310d0a7674695f666f6c646572737562666f6c6465726974656d636f756e743a49527c300d0a5f5374617475733a53577c
-0d0a646973706c61795f75726e5c3a736368656d61732d6d6963726f736f66742d636f6d5c3a6f66666963655c3a6f666669636523417574686f723a53577c456d696c7920447265610d0a446f63547970653a53577c507265636564656e740d0a446f6d696e6f2056657273696f6e3a53577c0d0a454d41494c5f4f574e
-45525f414444524553533a53577c7341414155597479416b654e575234632f6879763833646a446467542f2f536c6652666a3079756c304e796d7535383d0d0a7674695f636163686564637573746f6d70726f70733a56587c5375626a65637420646973706c61795f75726e3a736368656d61732d6d6963726f736f6674
-2d636f6d3a6f66666963653a6f666669636523456469746f7220455854204d41494c5f4d53475f494431204f72646572205f43617465676f727920524553504f4e53455f53454e4445525f4e414d45204d6f64696669656420436f6d70757465644e756d626572204e6f7465735061727420536964655c5c204c65747465
-7273207674695f617070726f76616c6c6576656c207674695f63617465676f72696573204469766973696f6e2048696464656e44656c6574652048696464656e55706c6f6164204e6f746573554e49442050726f70657274795c5c20426167207674695f61737369676e6564746f204b6579776f726473205f5374617475
-7320436f6d7075746564436f6d70616e7920436f6d70757465644c52204372656174656420646973706c61795f75726e3a736368656d61732d6d6963726f736f66742d636f6d3a6f66666963653a6f666669636523417574686f7220446f635479706520446f6d696e6f5c5c2056657273696f6e20454d41494c5f4f574e
-45525f41444452455353207674695f7469746c65205f417574686f7220436865636b5c5c20496e5c5c20436f6d6d656e742046696c654c656166526566204e6f74657354696d655374616d70205f436f6d6d656e7473204e616d6520436f6d6d656e747320446f634e756d62657220446f6d696e6f5c5c20417574686f72
-204d41494c5f4d53475f4944320d0a7674695f646f6373746f726576657273696f6e3a49527c3132330d0a7674695f6d657461696e666f76657273696f6e3a49577c3136390d0a7674695f636f6e74656e746368616e6765756e69743a53577c0d0a7674695f6361636865647469746c653a53527c4c45432d5052452d30
-30343839207e2045554c4120666f7220434d5349532044656c6976657261626c65730d0a7674695f7469746c653a53577c4c45432d5052452d3030343839207e2045554c4120666f7220434d5349532044656c6976657261626c65730d0a46696c654c6561665265663a53577c4c45432d5052452d30303438390d0a4e6f
-74657354696d655374616d703a53577c30332f31322f323031302032323a34303a33360d0a5d5d3e3c2f4c6f6e6750726f703e3c2f4c6f6e6750726f706572746965733e000000000000000000000000500072006f0070006500720074006900650073000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000300000006c010000000000003500de005900ca00c700ce003400dd00d600c400ce0042005500d1003200ce005300c700480030004f00c000
-3d003d000000000000000000000000000000000032000101020000000800000006000000000000000000000000000000000000000000000010aa35ab2e7ecf0110aa35ab2e7ecf010000000000000000000000004900740065006d0000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000a000201ffffffff07000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000036000000d700000000000000500072006f0070006500720074006900650073000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000003a0000004e010000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d38222073
-74616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b43303344374137352d373344392d343734442d424641352d3446464241433430373246467d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d617473
-2e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f6c6f6e
-6750726f70657274696573222f3e3c64733a736368656d615265662064733a7572693d22222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e00000000000000000000000000000000000000003c3f6d736f2d636f6e74656e74547970653f3e3c637573746f6d58736e20786d
-6c6e733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f637573746f6d58736e223e3c78736e4c6f636174696f6e3e3c2f78736e4c6f636174696f6e3e3c6361636865643e547275653c2f6361636865643e3c6f70656e42794465666175
-6c743e46616c73653c2f6f70656e427944656661756c743e3c78736e53636f70653e3c2f78736e53636f70653e3c2f637573746f6d58736e3e00000000000000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e67
-3d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b39453241453637462d424445372d344244412d383135332d3137324534413731444133417d2220786d6c6e733a64733d22687474703a2f2f736368656d61732e6f70656e
-786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d65
-7461646174612f637573746f6d58736e222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e0051003400c500d200da00dc005700c400d4003000
-cb00cd0043004600d700cd00d900da004a00c40041003d003d000000000000000000000000000000000032000101ffffffff0b00000009000000000000000000000000000000000000000000000010aa35ab2e7ecf0110aa35ab2e7ecf010000000000000000000000004900740065006d00000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff0a000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000040000000db00000000000000500072006f00700065007200740069006500
-7300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000440000004f01000000000000c700d80030003300550054004a00d000
-34005500c600c0005500cc0057005900c60033004900c0004b0051003d003d000000000000000000000000000000000032000100ffffffffffffffff0c000000000000000000000000000000000000000000000010aa35ab2e7ecf0110aa35ab2e7ecf010000000000000000000000003c3f6d736f2d636f6e74656e7454
-7970653f3e3c466f726d54656d706c6174657320786d6c6e733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f7368617265706f696e742f76332f636f6e74656e74747970652f666f726d73223e3c446973706c61793e446f63756d656e744c696272617279466f726d3c2f446973706c6179
-3e3c456469743e446f63756d656e744c696272617279466f726d3c2f456469743e3c4e65773e446f63756d656e744c696272617279466f726d3c2f4e65773e3c2f466f726d54656d706c617465733e000000000000000000000000000000000000000000000000000000000000000000000000003c3f786d6c2076657273
-696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b43424135303733352d313641462d343639332d414242342d3231373742373945383939307d2220786d6c6e733a64733d2268
-7474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e
-636f6d2f7368617265706f696e742f76332f636f6e74656e74747970652f666f726d73222f3e3c2f64733a736368656d61526566733e3c2f64733a6461746173746f72654974656d3e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003c3f786d
-6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d226e6f223f3e0d0a3c64733a6461746173746f72654974656d2064733a6974656d49443d227b35313944383639462d373033322d343937392d413035322d4335393839394432323032397d2220786d6c6e73
-3a64733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f6f6666696365446f63756d656e742f323030362f637573746f6d586d6c223e3c64733a736368656d61526566733e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d696372
-6f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f636f6e74656e7454797065222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f706572746965
-732f4900740065006d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000201ffffffff0d000000ffffffff00000000000000000000000000000000000000000000000000000000000000000000000010000000cc2f0000
-00000000500072006f007000650072007400690065007300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000200ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000004a0000004004
-0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000003c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d38223f3e3c63743a636f6e74656e7454797065536368656d612063743a5f3d2222206d613a5f3d2222206d613a636f6e74656e74547970654e616d653d22446f63756d656e7422206d613a636f6e74656e74
-5479706549443d223078303130313030303941354534364131424142353634384234434231313143433841434532374422206d613a636f6e74656e745479706556657273696f6e3d22343122206d613a636f6e74656e74547970654465736372697074696f6e3d224372656174652061206e657720646f63756d656e742e
-22206d613a636f6e74656e745479706553636f70653d2222206d613a76657273696f6e49443d2237663466393737643166663565326331623933313539653339336638616237612220786d6c6e733a63743d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d65
-7461646174612f636f6e74656e74547970652220786d6c6e733a6d613d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f706572746965732f6d65746141747472696275746573223e0d0a3c7873643a736368656d61207461726765
-744e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f7065727469657322206d613a726f6f743d227472756522206d613a6669656c647349443d22353938653565303963363230653761646330626239323935
-306563333638303522206e73323a5f3d222220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a78733d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a703d22687474703a2f2f7363
-68656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f706572746965732220786d6c6e733a6e73323d2232656334313736362d353237652d346338342d623438342d646633663235393966643061223e0d0a3c7873643a696d706f7274206e616d6573706163653d
-2232656334313736362d353237652d346338342d623438342d646633663235393966643061222f3e0d0a3c7873643a656c656d656e74206e616d653d2270726f70657274696573223e0d0a3c7873643a636f6d706c6578547970653e0d0a3c7873643a73657175656e63653e0d0a3c7873643a656c656d656e74206e616d
-653d22646f63756d656e744d616e6167656d656e74223e0d0a3c7873643a636f6d706c6578547970653e0d0a3c7873643a616c6c3e0d0a3c7873643a656c656d656e74207265663d226e73323a45585422206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a446f635479
-706522206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4469766973696f6e22206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a436f6d6d656e747322206d696e4f63637572733d2230222f3e0d0a3c7873643a656c
-656d656e74207265663d226e73323a446f6d696e6f5f78303032305f56657273696f6e22206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a446f6d696e6f5f78303032305f417574686f7222206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74
-207265663d226e73323a446f634e756d62657222206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4e6f746573554e494422206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4e6f74657354696d655374616d702220
-6d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a4e6f7465735061727422206d696e4f63637572733d2230222f3e0d0a3c7873643a656c656d656e74207265663d226e73323a536964655f78303032305f4c65747465727322206d696e4f63637572733d2230222f3e0d0a
-3c2f7873643a616c6c3e0d0a3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c2f7873643a73657175656e63653e0d0a3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c2f7873643a736368656d613e0d0a3c7873643a736368656d
-61207461726765744e616d6573706163653d2232656334313736362d353237652d346338342d623438342d6466336632353939666430612220656c656d656e74466f726d44656661756c743d227175616c69666965642220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c53
-6368656d612220786d6c6e733a78733d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a646d733d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d656e744d616e6167656d656e742f74797065
-732220786d6c6e733a70633d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f696e666f706174682f323030372f506172746e6572436f6e74726f6c73223e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f73
-6f66742e636f6d2f6f66666963652f323030362f646f63756d656e744d616e6167656d656e742f7479706573222f3e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f696e666f706174682f323030372f50617274
-6e6572436f6e74726f6c73222f3e0d0a3c7873643a656c656d656e74206e616d653d2245585422206d613a696e6465783d223122206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2245585422206d613a6465736372697074696f6e3d2246696c6520457874656e73696f6e22206d613a68
-696464656e3d227472756522206d613a696e7465726e616c4e616d653d2245585422206d613a726561644f6e6c793d2266616c7365223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874223e0d0a3c7873643a6d61784c656e6774682076
-616c75653d223130222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22446f635479706522206d613a696e6465783d223222206e696c6c61626c653d227472756522206d
-613a646973706c61794e616d653d22446f635479706522206d613a64656661756c743d22507265636564656e7422206d613a666f726d61743d2244726f70646f776e22206d613a68696464656e3d227472756522206d613a696e7465726e616c4e616d653d22446f635479706522206d613a726561644f6e6c793d226661
-6c7365223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a43686f696365223e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22507265636564656e74222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d225369
-6465204c6574746572202d20537562222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224469766973696f6e22206d613a696e6465783d223422206e696c6c61626c653d
-227472756522206d613a646973706c61794e616d653d224469766973696f6e22206d613a666f726d61743d2244726f70646f776e22206d613a696e7465726e616c4e616d653d224469766973696f6e223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d
-733a43686f696365223e0d0a3c7873643a656e756d65726174696f6e2076616c75653d2241726368697665222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22415344222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22436f72706f72617465222f3e0d0a3c7873643a656e75
-6d65726174696f6e2076616c75653d22446174612050726f74656374696f6e222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22446576656c6f706d656e742053797374656d73222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22454441222f3e0d0a3c7873643a656e756d65
-726174696f6e2076616c75653d224852222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d224c6567616c204f7065726174696f6e73222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22506174656e7473222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22
-5044202d20417263686974656374757265222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d225044202d20436f726573222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22504420e2809320435353222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d225044
-202d204d5044222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d2250444547222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22504445472046726565204c69627261727920416e6e65786573222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d2250444547
-2046726565204c69627261727920436f6e747261637473222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d2250495044222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22504950442046726565204c69627261727920416e6e65786573222f3e0d0a3c7873643a656e756d6572
-6174696f6e2076616c75653d22504950442046726565204c69627261727920436f6e747261637473222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22534444222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22535344222f3e0d0a3c7873643a656e756d65726174696f6e20
-76616c75653d224d61726b6574696e67222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d225044202d204661627269632028617070726f76616c20726571756972656420627920436f6e74726163742d617070726f76616c2d504429222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75
-653d225374616e6461726473222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d225275737369616e207472616e73616374696f6e73222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d225765627369746520506f6c6963696573222f3e0d0a3c7873643a656e756d65726174696f
-6e2076616c75653d225472616465204d61726b73222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22496f54204255222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22504547202870726576696f75736c792041534429222f3e0d0a3c7873643a656e756d65726174696f6e20
-76616c75653d224d5047202870726576696f75736c79206b6e6f776e206173205044202d204d504429222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22435047202870726576696f75736c79206b6e6f776e20617320e2809c5044202d20436f72657329222f3e0d0a3c7873643a656e756d657261
-74696f6e2076616c75653d22445347202870726576696f75736c79206b6e6f776e2061732053444429222f3e0d0a3c7873643a656e756d65726174696f6e2076616c75653d22415447202870726576696f75736c79206b6e6f776e206173205044202d2041726368697465637475726529222f3e0d0a3c7873643a656e75
-6d65726174696f6e2076616c75653d22535347202d2053797374656d20495020616e6420436f72655369676874202870726576696f75736c79206b6e6f776e206173205044202d2046616272696329222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f78
-73643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22436f6d6d656e747322206d613a696e6465783d223522206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d22436f6d6d656e747322206d613a696e7465726e616c4e616d653d22436f6d6d656e7473223e0d0a
-3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a4e6f7465223e0d0a3c7873643a6d61784c656e6774682076616c75653d22323535222f3e0d0a3c2f7873643a7265737472696374696f6e3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873
-643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22446f6d696e6f5f78303032305f56657273696f6e22206d613a696e6465783d223622206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d22446f6d696e6f2056657273696f6e22206d613a68696464656e3d2274
-72756522206d613a696e7465726e616c4e616d653d22446f6d696e6f5f78303032305f56657273696f6e22206d613a726561644f6e6c793d2266616c7365223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874222f3e0d0a3c2f7873643a
-73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22446f6d696e6f5f78303032305f417574686f7222206d613a696e6465783d223722206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d22446f6d696e6f20417574686f
-7222206d613a68696464656e3d227472756522206d613a696e7465726e616c4e616d653d22446f6d696e6f5f78303032305f417574686f7222206d613a726561644f6e6c793d2266616c7365223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54
-657874222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22446f634e756d62657222206d613a696e6465783d223822206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d22446f634e756d6265
-7222206d613a68696464656e3d227472756522206d613a696e7465726e616c4e616d653d22446f634e756d62657222206d613a726561644f6e6c793d2266616c7365223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874222f3e0d0a3c2f
-7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d224e6f746573554e494422206d613a696e6465783d22313422206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224e6f746573554e494422206d613a686964
-64656e3d227472756522206d613a696e7465726e616c4e616d653d224e6f746573554e4944223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e
-743e0d0a3c7873643a656c656d656e74206e616d653d224e6f74657354696d655374616d7022206d613a696e6465783d22313522206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224e6f74657354696d655374616d7022206d613a68696464656e3d227472756522206d613a696e746572
-6e616c4e616d653d224e6f74657354696d655374616d70223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a4461746554696d65222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a65
-6c656d656e74206e616d653d224e6f7465735061727422206d613a696e6465783d22313622206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d224e6f7465735061727422206d613a68696464656e3d227472756522206d613a696e7465726e616c4e616d653d224e6f74657350617274223e
-0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a54657874222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d22536964655f78303032305f4c65747465
-727322206d613a696e6465783d22313822206e696c6c61626c653d227472756522206d613a646973706c61794e616d653d2253696465204c65747465727322206d613a64656661756c743d223022206d613a68696464656e3d227472756522206d613a696e7465726e616c4e616d653d22536964655f78303032305f4c65
-747465727322206d613a726561644f6e6c793d2266616c736522206d613a70657263656e746167653d2246414c5345223e0d0a3c7873643a73696d706c65547970653e0d0a3c7873643a7265737472696374696f6e20626173653d22646d733a4e756d626572222f3e0d0a3c2f7873643a73696d706c65547970653e0d0a
-3c2f7873643a656c656d656e743e0d0a3c2f7873643a736368656d613e0d0a3c7873643a736368656d61207461726765744e616d6573706163653d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f7065
-72746965732220656c656d656e74466f726d44656661756c743d227175616c69666965642220617474726962757465466f726d44656661756c743d22756e7175616c69666965642220626c6f636b44656661756c743d2223616c6c2220786d6c6e733d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d
-6174732e6f72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f706572746965732220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f
-584d4c536368656d612d696e7374616e63652220786d6c6e733a64633d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f2220786d6c6e733a64637465726d733d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f2220786d6c6e733a6f646f633d22687474703a2f2f73
-6368656d61732e6d6963726f736f66742e636f6d2f696e7465726e616c2f6f6264223e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f2220736368656d614c6f636174696f6e3d22687474703a2f2f6475626c696e636f72
-652e6f72672f736368656d61732f786d6c732f7164632f323030332f30342f30322f64632e787364222f3e0d0a3c7873643a696d706f7274206e616d6573706163653d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f2220736368656d614c6f636174696f6e3d22687474703a2f2f6475626c696e636f
-72652e6f72672f736368656d61732f786d6c732f7164632f323030332f30342f30322f64637465726d732e787364222f3e0d0a3c7873643a656c656d656e74206e616d653d22636f726550726f706572746965732220747970653d2243545f636f726550726f70657274696573222f3e0d0a3c7873643a636f6d706c6578
-54797065206e616d653d2243545f636f726550726f70657274696573223e0d0a3c7873643a616c6c3e0d0a3c7873643a656c656d656e74207265663d2264633a63726561746f7222206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74207265663d2264637465
-726d733a6372656174656422206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6964656e74696669657222206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74206e616d653d
-22636f6e74656e745479706522206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e6722206d613a696e6465783d223922206d613a646973706c61794e616d653d22436f6e74656e742054797065222f3e0d0a3c7873643a656c656d656e74207265663d226463
-3a7469746c6522206d696e4f63637572733d223022206d61784f63637572733d223122206d613a696e6465783d223322206d613a646973706c61794e616d653d225469746c65222f3e0d0a3c7873643a656c656d656e74207265663d2264633a7375626a65637422206d696e4f63637572733d223022206d61784f636375
-72733d2231222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6465736372697074696f6e22206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74206e616d653d226b6579776f72647322206d696e4f63637572733d223022206d61784f63637572
-733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74207265663d2264633a6c616e677561676522206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74206e616d653d2263617465676f727922206d696e4f63637572
-733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74206e616d653d2276657273696f6e22206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c65
-6d656e74206e616d653d227265766973696f6e22206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67223e0d0a3c7873643a616e6e6f746174696f6e3e0d0a3c7873643a646f63756d656e746174696f6e3e0d0a202020202020202020202020202020202020
-202020202020546869732076616c756520696e6469636174657320746865206e756d626572206f66207361766573206f72207265766973696f6e732e20546865206170706c69636174696f6e20697320726573706f6e7369626c6520666f72207570646174696e6720746869732076616c75652061667465722065616368
-207265766973696f6e2e0d0a20202020202020202020202020202020202020203c2f7873643a646f63756d656e746174696f6e3e0d0a3c2f7873643a616e6e6f746174696f6e3e0d0a3c2f7873643a656c656d656e743e0d0a3c7873643a656c656d656e74206e616d653d226c6173744d6f646966696564427922206d69
-6e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c7873643a656c656d656e74207265663d2264637465726d733a6d6f64696669656422206d696e4f63637572733d223022206d61784f63637572733d2231222f3e0d0a3c7873643a656c656d656e74
-206e616d653d22636f6e74656e7453746174757322206d696e4f63637572733d223022206d61784f63637572733d22312220747970653d227873643a737472696e67222f3e0d0a3c2f7873643a616c6c3e0d0a3c2f7873643a636f6d706c6578547970653e0d0a3c2f7873643a736368656d613e0d0a3c78733a73636865
-6d61207461726765744e616d6573706163653d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f696e666f706174682f323030372f506172746e6572436f6e74726f6c732220656c656d656e74466f726d44656661756c743d227175616c696669656422206174747269627574
-65466f726d44656661756c743d22756e7175616c69666965642220786d6c6e733a70633d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f696e666f706174682f323030372f506172746e6572436f6e74726f6c732220786d6c6e733a78733d22687474703a2f2f7777772e77
-332e6f72672f323030312f584d4c536368656d61223e0d0a3c78733a656c656d656e74206e616d653d22506572736f6e223e0d0a3c78733a636f6d706c6578547970653e0d0a3c78733a73657175656e63653e0d0a3c78733a656c656d656e74207265663d2270633a446973706c61794e616d6522206d696e4f63637572
-733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a4163636f756e74496422206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a4163636f756e745479706522206d696e4f63637572733d2230
-223e3c2f78733a656c656d656e743e0d0a3c2f78733a73657175656e63653e0d0a3c2f78733a636f6d706c6578547970653e0d0a3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d22446973706c61794e616d652220747970653d2278733a737472696e67223e3c2f78733a656c656d656e
-743e0d0a3c78733a656c656d656e74206e616d653d224163636f756e7449642220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d224163636f756e74547970652220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e
-0d0a3c78733a656c656d656e74206e616d653d224244434173736f636961746564456e74697479223e0d0a3c78733a636f6d706c6578547970653e0d0a3c78733a73657175656e63653e0d0a3c78733a656c656d656e74207265663d2270633a424443456e7469747922206d696e4f63637572733d223022206d61784f63
-637572733d22756e626f756e646564223e3c2f78733a656c656d656e743e0d0a3c2f78733a73657175656e63653e0d0a3c78733a617474726962757465207265663d2270633a456e746974794e616d657370616365223e3c2f78733a6174747269627574653e0d0a3c78733a617474726962757465207265663d2270633a
-456e746974794e616d65223e3c2f78733a6174747269627574653e0d0a3c78733a617474726962757465207265663d2270633a53797374656d496e7374616e63654e616d65223e3c2f78733a6174747269627574653e0d0a3c78733a617474726962757465207265663d2270633a4173736f63696174696f6e4e616d6522
-3e3c2f78733a6174747269627574653e0d0a3c2f78733a636f6d706c6578547970653e0d0a3c2f78733a656c656d656e743e0d0a3c78733a617474726962757465206e616d653d22456e746974794e616d6573706163652220747970653d2278733a737472696e67223e3c2f78733a6174747269627574653e0d0a3c7873
-3a617474726962757465206e616d653d22456e746974794e616d652220747970653d2278733a737472696e67223e3c2f78733a6174747269627574653e0d0a3c78733a617474726962757465206e616d653d2253797374656d496e7374616e63654e616d652220747970653d2278733a737472696e67223e3c2f78733a61
-74747269627574653e0d0a3c78733a617474726962757465206e616d653d224173736f63696174696f6e4e616d652220747970653d2278733a737472696e67223e3c2f78733a6174747269627574653e0d0a3c78733a656c656d656e74206e616d653d22424443456e74697479223e0d0a3c78733a636f6d706c65785479
-70653e0d0a3c78733a73657175656e63653e0d0a3c78733a656c656d656e74207265663d2270633a456e74697479446973706c61794e616d6522206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a456e74697479496e7374616e636552656665
-72656e636522206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a456e7469747949643122206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a456e7469747949643222
-206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a456e7469747949643322206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a456e7469747949643422206d696e4f63
-637572733d2230223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a456e7469747949643522206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c2f78733a73657175656e63653e0d0a3c2f78733a636f6d706c6578547970653e0d0a3c2f78733a656c
-656d656e743e0d0a3c78733a656c656d656e74206e616d653d22456e74697479446973706c61794e616d652220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d22456e74697479496e7374616e63655265666572656e63652220747970653d22
-78733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d22456e746974794964312220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d22456e746974794964322220747970653d2278733a73
-7472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d22456e746974794964332220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d22456e746974794964342220747970653d2278733a737472696e
-67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d22456e746974794964352220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d225465726d73223e0d0a3c78733a636f6d706c6578547970653e0d0a3c78
-733a73657175656e63653e0d0a3c78733a656c656d656e74207265663d2270633a5465726d496e666f22206d696e4f63637572733d223022206d61784f63637572733d22756e626f756e646564223e3c2f78733a656c656d656e743e0d0a3c2f78733a73657175656e63653e0d0a3c2f78733a636f6d706c657854797065
-3e0d0a3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d225465726d496e666f223e0d0a3c78733a636f6d706c6578547970653e0d0a3c78733a73657175656e63653e0d0a3c78733a656c656d656e74207265663d2270633a5465726d4e616d6522206d696e4f63637572733d2230223e3c
-2f78733a656c656d656e743e0d0a3c78733a656c656d656e74207265663d2270633a5465726d496422206d696e4f63637572733d2230223e3c2f78733a656c656d656e743e0d0a3c2f78733a73657175656e63653e0d0a3c2f78733a636f6d706c6578547970653e0d0a3c2f78733a656c656d656e743e0d0a3c78733a65
-6c656d656e74206e616d653d225465726d4e616d652220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c78733a656c656d656e74206e616d653d225465726d49642220747970653d2278733a737472696e67223e3c2f78733a656c656d656e743e0d0a3c2f78733a736368656d613e0d
-0a3c2f63743a636f6e74656e7454797065536368656d613e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d65746141747472696275746573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7777772e
-77332e6f72672f323030312f584d4c536368656d61222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f6d657461646174612f70726f70657274696573222f3e3c64733a736368656d615265662064733a
-7572693d2232656334313736362d353237652d346338342d623438342d646633663235393966643061222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f323030362f646f63756d656e744d616e6167656d656e742f
-7479706573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f6f66666963652f696e666f706174682f323030372f506172746e6572436f6e74726f6c73222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f
-2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f7061636b6167652f323030362f6d657461646174612f636f72652d70726f70657274696573222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f7075726c2e6f72672f64632f656c656d656e74732f312e312f222f3e3c
-64733a736368656d615265662064733a7572693d22687474703a2f2f7075726c2e6f72672f64632f7465726d732f222f3e3c64733a736368656d615265662064733a7572693d22687474703a2f2f736368656d61732e6d6963726f736f66742e636f6d2f696e7465726e616c2f6f6264222f3e3c2f64733a736368656d61
-526566733e3c2f64733a6461746173746f72654974656d3e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105000000000000}}

+ 0 - 11
bsp/es32f0334/libraries/CMSIS/Include/SConscript

@@ -1,11 +0,0 @@
-Import('ES32_SDK_ROOT')
-
-from building import *
-
-cwd = GetCurrentDir()
-src = Glob('*.c')
-include_path  = [cwd]
-
-group = DefineGroup('CMSIS2', src, depend = [''], CPPPATH = include_path)
-
-Return('group')

+ 0 - 14
bsp/es32f0334/libraries/CMSIS/index.html

@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>Redirect to the CMSIS main page after 0 seconds</title>
-<meta http-equiv="refresh" content="0; URL=Documentation/General/html/index.html">
-<meta name="keywords" content="automatic redirection">
-</head>
-
-<body>
-
-If the automatic redirection is failing, click <a href="Documentation/General/html/index.html">open CMSIS Documentation</a>.
-
-</body>
-</html>

BIN
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/EASTSOFT_ES32F033x_ALD.chm


+ 0 - 356
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_acmp.h

@@ -1,356 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_acmp.h
-  * @brief   Header file of ACMP module driver.
-  *
-  * @version V1.0
-  * @date    13 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_ACMP_H__
-#define __ALD_ACMP_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup ACMP
-  * @{
-  */
-
-/** @defgroup ACMP_Public_Types ACMP Public Types
-  * @{
-  */
-
-/**
-  * @brief Acmp interrupt
-  */
-typedef enum {
-	ACMP_IT_EDGE   = (1U << 0),	/**< Edge interrupt bit */
-	ACMP_IT_WARMUP = (1U << 1),	/**< Warm up interrupt bit */
-} acmp_it_t;
-
-/**
-  * @brief Acmp interrupt
-  */
-typedef enum {
-	ACMP_FLAG_EDGE   = (1U << 0),	/**< Edge interrupt flag */
-	ACMP_FLAG_WARMUP = (1U << 1),	/**< Warm up interrupt flag */	
-} acmp_flag_t;
-
-/**
-  * @brief Acmp interrupt flag
-  */
-typedef enum {
-	ACMP_STATUS_EDGE    = (1U << 0),	/**< Edge interrupt flag */
-	ACMP_STATUS_WARMUP  = (1U << 1),	/**< Warm up interrupt flag */
-} acmp_status_t;
-
-/**
-  * @brief Acmp positive input
-  */
-typedef enum {
-	ACMP_POS_CH0 = 0,	/**< Channel 0 as positive input */
-	ACMP_POS_CH1 = 1,	/**< Channel 1 as positive input */
-	ACMP_POS_CH2 = 2,	/**< Channel 2 as positive input */
-	ACMP_POS_CH3 = 3,	/**< Channel 3 as positive input */
-	ACMP_POS_CH4 = 4,	/**< Channel 4 as positive input */
-	ACMP_POS_CH5 = 5,	/**< Channel 5 as positive input */
-	ACMP_POS_CH6 = 6,	/**< Channel 6 as positive input */
-	ACMP_POS_CH7 = 7,	/**< Channel 7 as positive input */
-} acmp_pos_input_t;
-
-/**
-  * @brief Acmp negative input
-  */
-typedef enum {
-	ACMP_NEG_CH0      = 0, 	/**< Channel 0 as negative input */
-	ACMP_NEG_CH1      = 1, 	/**< Channel 1 as negative input */
-	ACMP_NEG_CH2      = 2, 	/**< Channel 2 as negative input */
-	ACMP_NEG_CH3      = 3, 	/**< Channel 3 as negative input */
-	ACMP_NEG_CH4      = 4, 	/**< Channel 4 as negative input */
-	ACMP_NEG_CH5      = 5, 	/**< Channel 5 as negative input */
-	ACMP_NEG_CH6      = 6, 	/**< Channel 6 as negative input */
-	ACMP_NEG_CH7      = 7, 	/**< Channel 7 as negative input */
-	ACMP_NEG_1V25     = 8, 	/**< 1.25v as negative input */
-	ACMP_NEG_2V5      = 9, 	/**< 2.5v as negative input */
-	ACMP_NEG_VDD      = 10,	/**< VDD as negative input */
-	ACMP_NEG_CAP      = 11,	/**< Capacitive as negative input */
-	ACMP_NEG_DAC0_CH0 = 12,	/**< DAC0 channel 0 as negative input */
-	ACMP_NEG_DAC0_CH1 = 13,	/**< DAC0 channel 1 as negative input */
-} acmp_neg_input_t;
-
-/**
-  * @brief Acmp mode
-  */
-typedef enum {
-	ACMP_ULTRA_LOW_POWER = 0,	/**< Ultra low power mode */
-	ACMP_LOW_POWER       = 1,	/**< Low power mode */
-	ACMP_MIDDLE_POWER    = 2,	/**< Middle power mode */
-	ACMP_HIGH_POWER      = 3,	/**< High power mode */
-} acmp_mode_t;
-
-/**
-  * @brief Acmp warm-up time
-  */
-typedef enum {
-	ACMP_4_PCLK   = 0,	/**< 4 hfperclk cycles */
-	ACMP_8_PCLK   = 1,	/**< 4 hfperclk cycles */
-	ACMP_16_PCLK  = 2,	/**< 4 hfperclk cycles */
-	ACMP_32_PCLK  = 3,	/**< 4 hfperclk cycles */
-	ACMP_64_PCLK  = 4,	/**< 4 hfperclk cycles */
-	ACMP_128_PCLK = 5,	/**< 4 hfperclk cycles */
-	ACMP_256_PCLK = 6,	/**< 4 hfperclk cycles */
-	ACMP_512_PCLK = 7,	/**< 4 hfperclk cycles */
-} acmp_warm_time_t;
-
-/**
-  * @brief Acmp hysteresis level
-  */
-typedef enum {
-	ACMP_HYST_0  = 0,	/**< No hysteresis */
-	ACMP_HYST_15 = 1,	/**< 15mV hysteresis */
-	ACMP_HYST_22 = 2,	/**< 22mV hysteresis */
-	ACMP_HYST_29 = 3,	/**< 29mV hysteresis */
-	ACMP_HYST_36 = 4,	/**< 36mV hysteresis */
-	ACMP_HYST_43 = 5,	/**< 43mV hysteresis */
-	ACMP_HYST_50 = 6,	/**< 50mV hysteresis */
-	ACMP_HYST_57 = 7,	/**< 57mV hysteresis */
-} acmp_hystsel_t;
-
-/**
-  * @brief Acmp inactive state
-  */
-typedef enum {
-	ACMP_INACTVAL_LOW  = 0,	/**< The inactive value is 0 */
-	ACMP_INACTVAL_HIGH = 1,	/**< The inactive value is 1 */
-} acmp_inactval_t;
-
-/**
-  * @brief which edges set up interrupt
-  */
-typedef enum {
-	ACMP_EDGE_NONE = 0,	/**< Disable EDGE interrupt */
-	ACMP_EDGE_FALL = 1,	/**< Falling edges set EDGE interrupt */
-	ACMP_EDGE_RISE = 2,	/**< rise edges set EDGE interrupt */
-	ACMP_EDGE_ALL  = 3,	/**< Falling edges and rise edges set EDGE interrupt */
-} acmp_edge_t;
-
-/**
-  * @brief Acmp output function
-  */
-typedef enum {
-	ACMP_OUT_DISABLE = 0,	/**< Disable acmp output */
-	ACMP_OUT_ENABLE  = 1,	/**< Enable acmp output */
-} acmp_out_func_t;
-
-/**
-  * @brief Acmp warm-up interrupt function
-  */
-typedef enum {
-	ACMP_WARM_DISABLE = 0,	/**< Disable acmp warm-up interrupt */
-	ACMP_WARM_ENABLE  = 1,	/**< Enable acmp warm-up interrupt */
-} acmp_warm_it_func;
-
-/**
-  * @brief Acmp gpio output invert
-  */
-typedef enum {
-	ACMP_GPIO_NO_INV = 0,	/**< Acmp output to gpio is not inverted */
-	ACMP_GPIO_INV    = 1,	/**< Acmp output to gpio is inverted */
-} acmp_invert_t;
-
-/**
-  * @brief The location of the acmp i/o pin
-  */
-typedef enum {
-	ACMP_LOCATION_O = 0,	/**< Location 0 */
-	ACMP_LOCATION_1 = 1,	/**< Location 1 */
-	ACMP_LOCATION_2 = 2,	/**< Location 2 */
-} acmp_location_t;
-
-/**
-  * @brief Acmp output config structure definition
-  */
-typedef struct {
-	acmp_out_func_t out_func;	/**< Acmp output function */
-	acmp_invert_t gpio_inv;   	/**< If invert gpio output */
-	acmp_location_t location;	/**< The location of acmp I/0 pin */
-} acmp_output_config_t;
-
-/**
-  * @brief Acmp init structure definition
-  */
-typedef struct {
-	acmp_mode_t mode;           	/**< Acmp operation mode */
-	acmp_warm_time_t warm_time; 	/**< Acmp warm up time */
-	acmp_hystsel_t hystsel;     	/**< Acmp hysteresis level */
-	acmp_warm_it_func warm_func;	/**< Acmp warm-up interrupt enable/disable */
-	acmp_pos_input_t pos_port;  	/**< Acmp positive port select */
-	acmp_neg_input_t neg_port;  	/**< Acmp negative port select */
-	acmp_inactval_t inactval;   	/**< Acmp inavtive output value */
-	acmp_edge_t edge;           	/** Select edges to set interrupt flag */
-	uint8_t vdd_level;          	/** Select scaling factor for CDD reference level, MAX is 63 */
-} acmp_init_t;
-
-/**
-  * @brief  ACMP Handle Structure definition
-  */
-typedef struct acmp_handle_s {
-	ACMP_TypeDef *perh;	/**< Register base address */
-	acmp_init_t init;  	/**< ACMP required parameters */
-	lock_state_t lock; 	/**< Locking object */
-
-	void (*acmp_warmup_cplt_cbk)(struct acmp_handle_s *arg);	/**< Acmp warm-up complete callback */
-	void (*acmp_edge_cplt_cbk)(struct acmp_handle_s *arg);  	/**< Acmp edge trigger callback */
-} acmp_handle_t;
-/**
-  * @}
-  */
-
-/** @defgroup ACMP_Public_Macros ACMP Public Macros
-  * @{
-  */
-#define ACMP_ENABLE(handle) 	(SET_BIT((handle)->perh->CON, ACMP_CON_EN_MSK))
-#define ACMP_DISABLE(handle)	(CLEAR_BIT((handle)->perh->CON, ACMP_CON_EN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup ACMP_Private_Macros   ACMP Private Macros
-  * @{
-  */
-#define IS_ACMP_TYPE(x) 		(((x) == ACMP0) || \
-				         ((x) == ACMP1))
-#define IS_ACMP_MODE_TYPE(x)		(((x) == ACMP_ULTRA_LOW_POWER) || \
-					 ((x) == ACMP_LOW_POWER)       || \
-					 ((x) == ACMP_MIDDLE_POWER)    || \
-					 ((x) == ACMP_HIGH_POWER))
-#define IS_ACMP_IT_TYPE(x) 		(((x) == ACMP_IT_EDGE)  || \
-				         ((x) == ACMP_IT_WARMUP))
-#define IS_ACMP_FLAG_TYPE(x) 		(((x) == ACMP_FLAG_EDGE)  || \
-				         ((x) == ACMP_FLAG_WARMUP))
-#define IS_ACMP_STATUS_TYPE(x) 	        (((x) == ACMP_STATUS_EDGE)  || \
-				         ((x) == ACMP_STATUS_WARMUP))
-#define IS_ACMP_POS_INPUT_TYPE(x) 	(((x) == ACMP_POS_CH0) || \
-				         ((x) == ACMP_POS_CH1) || \
-				         ((x) == ACMP_POS_CH2) || \
-				         ((x) == ACMP_POS_CH3) || \
-				         ((x) == ACMP_POS_CH4) || \
-				         ((x) == ACMP_POS_CH5) || \
-				         ((x) == ACMP_POS_CH6) || \
-				         ((x) == ACMP_POS_CH7))
-#define IS_ACMP_NEG_INPUT_TYPE(x) 	(((x) == ACMP_NEG_CH0)      || \
-				         ((x) == ACMP_NEG_CH1)      || \
-				         ((x) == ACMP_NEG_CH2)      || \
-				         ((x) == ACMP_NEG_CH3)      || \
-				         ((x) == ACMP_NEG_CH4)      || \
-				         ((x) == ACMP_NEG_CH5)      || \
-				         ((x) == ACMP_NEG_CH6)      || \
-				         ((x) == ACMP_NEG_CH7)      || \
-				         ((x) == ACMP_NEG_1V25)     || \
-				         ((x) == ACMP_NEG_2V5)      || \
-				         ((x) == ACMP_NEG_VDD)      || \
-				         ((x) == ACMP_NEG_CAP)      || \
-				         ((x) == ACMP_NEG_DAC0_CH0) || \
-				         ((x) == ACMP_NEG_DAC0_CH1))
-#define IS_ACMP_WARM_UP_TIME_TYPE(x)    (((x) == ACMP_4_PCLK)   || \
-				         ((x) == ACMP_8_PCLK)   || \
-				         ((x) == ACMP_16_PCLK)  || \
-				         ((x) == ACMP_32_PCLK)  || \
-				         ((x) == ACMP_64_PCLK)  || \
-				         ((x) == ACMP_128_PCLK) || \
-				         ((x) == ACMP_256_PCLK) || \
-				         ((x) == ACMP_512_PCLK))
-#define IS_ACMP_HYSTSEL_TYPE(x)         (((x) == ACMP_HYST_0)  || \
-				         ((x) == ACMP_HYST_15) || \
-				         ((x) == ACMP_HYST_22) || \
-				         ((x) == ACMP_HYST_29) || \
-				         ((x) == ACMP_HYST_36) || \
-				         ((x) == ACMP_HYST_43) || \
-				         ((x) == ACMP_HYST_50) || \
-				         ((x) == ACMP_HYST_57))
-#define IS_ACMP_INACTVAL_TYPE(x) 	(((x) == ACMP_INACTVAL_LOW) || \
-				         ((x) == ACMP_INACTVAL_HIGH))
-#define IS_ACMP_EDGE_TYPE(x) 	        (((x) == ACMP_EDGE_NONE) || \
-					 ((x) == ACMP_EDGE_FALL) || \
-				         ((x) == ACMP_EDGE_RISE) || \
-					 ((x) == ACMP_EDGE_ALL))
-#define IS_ACMP_OUT_FUNC_TYPE(x)	(((x) == ACMP_OUT_DISABLE) || \
-					 ((x) == ACMP_OUT_ENABLE))
-#define IS_ACMP_INVERT_TYPE(x)		(((x) == ACMP_GPIO_NO_INV) || \
-					 ((x) == ACMP_GPIO_INV))
-#define IS_ACMP_LOCATION_TYPE(x)	(((x) == ACMP_LOCATION_O) || \
-					 ((x) == ACMP_LOCATION_1) || \
-					 ((x) == ACMP_LOCATION_2))
-#define IS_ACMP_WARM_FUNC_TYPE(x)	(((x) == ACMP_WARM_DISABLE) || \
-					 ((x) == ACMP_WARM_ENABLE))
-/**
-  * @}
-  */
-
-/** @addtogroup ACMP_Public_Functions
-  * @{
-  */
-
-/** @addtogroup ACMP_Public_Functions_Group1
-  * @{
-  */
-ald_status_t acmp_init(acmp_handle_t *hperh);
-
-/**
-  * @}
-  */
-
-/** @addtogroup ACMP_Public_Functions_Group2
-  * @{
-  */
-ald_status_t acmp_interrupt_config(acmp_handle_t *hperh, acmp_it_t it, type_func_t state);
-ald_status_t acmp_set_interrupt_mask(acmp_handle_t *hperh, acmp_it_t it);
-it_status_t acmp_get_flag_status(acmp_handle_t *hperh, acmp_flag_t it);
-ald_status_t acmp_clear_flag_status(acmp_handle_t *hperh, acmp_flag_t it);
-flag_status_t acmp_get_status(acmp_handle_t *hperh, acmp_status_t flag);
-
-/**
-  * @}
-  */
-
-/** @addtogroup ACMP_Public_Functions_Group3
-  * @{
-  */
-void acmp_irq_handle(acmp_handle_t *hperh);
-ald_status_t acmp_out_config(acmp_handle_t *hperh, acmp_output_config_t *config);
-uint8_t acmp_out_result(acmp_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
- extern "C" }
-#endif
-
-#endif

+ 0 - 557
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_adc.h

@@ -1,557 +0,0 @@
-/**
-  ******************************************************************************
- * @file    ald_adc.h
- * @brief   Header file of ADC Module library.
- *
- * @version V1.0
- * @date    15 Dec 2017
- * @author  AE Team
- * @note
- *
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
- *
- ******************************************************************************
- */
-
-#ifndef __ALD_ADC_H__
-#define __ALD_ADC_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-#include "ald_pis.h"
-#include "ald_timer.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup ADC
-  * @{
-  */
-
-/** @defgroup ADC_Pubulic_Types ADC Pubulic Types
-  * @{
-  */
-
-/**
-  * @brief ADC  State structures definition
-  */
-typedef enum {
-	ADC_STATE_RESET         = 0x0,    	/**< ADC not yet initialized or disabled */
-	ADC_STATE_READY         = 0x1,    	/**< ADC peripheral ready for use */
-	ADC_STATE_BUSY_INTERNAL = 0x2,    	/**< ADC is busy to internal process */
-	ADC_STATE_TIMEOUT       = 0x4,    	/**< TimeOut occurrence */
-	ADC_STATE_ERROR         = 0x10,   	/**< Internal error occurrence */
-	ADC_STATE_NM_BUSY       = 0x100,  	/**< Conversion on group normal is ongoing or can occur */
-	ADC_STATE_NM_EOC        = 0x200,  	/**< Conversion data available on group normal */
-	ADC_STATE_IST_BUSY      = 0x1000, 	/**< Conversion on group insert is ongoing or can occur */
-	ADC_STATE_IST_EOC       = 0x2000, 	/**< Conversion data available on group insert */
-	ADC_STATE_AWD           = 0x10000,	/**< Out-of-window occurrence of analog watchdog */
-} adc_state_t;
-
-/**
-  *@brief ADC Error Code
-  */
-typedef enum {
-	ADC_ERROR_NONE     = 0x0,	/**< No error */
-	ADC_ERROR_INTERNAL = 0x1,	/**< ADC IP internal error*/
-	ADC_ERROR_OVR      = 0x2,	/**< Overrun error */
-	ADC_ERROR_DMA      = 0x4, 	/**< DMA transfer error */
-} adc_error_t;
-
-/**
-  *@brief ADC data alignment
-  */
-typedef enum {
-	ADC_DATAALIGN_RIGHT = 0x0,	/**< ADC data alignment right */
-	ADC_DATAALIGN_LEFT  = 0x1,	/**< ADC data alignment left */
-} adc_align_t;
-
-/**
-  *@brief ADC scan mode
-  */
-typedef enum {
-	ADC_SCAN_DISABLE = 0x0,	/**< ADC scan disable */
-	ADC_SCAN_ENABLE  = 0x1,	/**< ADC scan enable */
-} adc_scan_t;
-
-/**
-  *@brief ADC config  hannal trigger the EOC IT mode
-  */
-typedef enum {
-	ADC_NCHESEL_MODE_ALL = 0x0,	/**< ADC set RCHE after convert sequence finish */
-	ADC_NCHESEL_MODE_ONE = 0x1,	/**< ADC set RCHE after one convert finish */
-} adc_nchesel_t;
-
-/**
-  *@brief  ADC channels
-  */
-typedef enum {
-	ADC_CHANNEL_0  = 0x0, 	/**< ADC channel 0 */
-	ADC_CHANNEL_1  = 0x1, 	/**< ADC channel 1 */
-	ADC_CHANNEL_2  = 0x2, 	/**< ADC channel 2 */
-	ADC_CHANNEL_3  = 0x3, 	/**< ADC channel 3 */
-	ADC_CHANNEL_4  = 0x4, 	/**< ADC channel 4 */
-	ADC_CHANNEL_5  = 0x5, 	/**< ADC channel 5 */
-	ADC_CHANNEL_6  = 0x6, 	/**< ADC channel 6 */
-	ADC_CHANNEL_7  = 0x7, 	/**< ADC channel 7 */
-	ADC_CHANNEL_8  = 0x8, 	/**< ADC channel 8 */
-	ADC_CHANNEL_9  = 0x9, 	/**< ADC channel 9 */
-	ADC_CHANNEL_10 = 0xA, 	/**< ADC channel 10 */
-	ADC_CHANNEL_11 = 0xB, 	/**< ADC channel 11 */
-	ADC_CHANNEL_12 = 0xC, 	/**< ADC channel 12 */
-	ADC_CHANNEL_13 = 0xD, 	/**< ADC channel 13 */
-	ADC_CHANNEL_14 = 0xE, 	/**< ADC channel 14 */
-	ADC_CHANNEL_15 = 0xF, 	/**< ADC channel 15 */
-	ADC_CHANNEL_16 = 0x10,	/**< ADC channel 16 */
-	ADC_CHANNEL_17 = 0x11,	/**< ADC channel 17 */
-	ADC_CHANNEL_18 = 0x12,	/**< ADC channel 18 */
-	ADC_CHANNEL_19 = 0x13,	/**< ADC channel 19 */
-} adc_channel_t;
-
-/**
-  *@brief  ADC sampling times
-  */
-typedef enum {
-	ADC_SAMPLETIME_1  = 0x0,	/**< ADC sampling times 1 clk */
-	ADC_SAMPLETIME_2  = 0x1,	/**< ADC sampling times 2 clk */
-	ADC_SAMPLETIME_4  = 0x2,	/**< ADC sampling times 4 clk */
-	ADC_SAMPLETIME_15 = 0x3,	/**< ADC sampling times 15 clk */
-} adc_samp_t;
-
-/**
-  *@brief   ADC rank into normal group
-  */
-typedef enum {
-	ADC_NC_RANK_1  = 0x1, 	/**< ADC normal channel rank 1 */
-	ADC_NC_RANK_2  = 0x2, 	/**< ADC normal channel rank 2 */
-	ADC_NC_RANK_3  = 0x3, 	/**< ADC normal channel rank 3 */
-	ADC_NC_RANK_4  = 0x4, 	/**< ADC normal channel rank 4 */
-	ADC_NC_RANK_5  = 0x5, 	/**< ADC normal channel rank 5 */
-	ADC_NC_RANK_6  = 0x6, 	/**< ADC normal channel rank 6 */
-	ADC_NC_RANK_7  = 0x7, 	/**< ADC normal channel rank 7 */
-	ADC_NC_RANK_8  = 0x8, 	/**< ADC normal channel rank 8 */
-	ADC_NC_RANK_9  = 0x9, 	/**< ADC normal channel rank 9 */
-	ADC_NC_RANK_10 = 0xA, 	/**< ADC normal channel rank 10 */
-	ADC_NC_RANK_11 = 0xB, 	/**< ADC normal channel rank 11 */
-	ADC_NC_RANK_12 = 0xC, 	/**< ADC normal channel rank 12 */
-	ADC_NC_RANK_13 = 0xD, 	/**< ADC normal channel rank 13 */
-	ADC_NC_RANK_14 = 0xE, 	/**< ADC normal channel rank 14 */
-	ADC_NC_RANK_15 = 0xF, 	/**< ADC normal channel rank 15 */
-	ADC_NC_RANK_16 = 0x10,	/**< ADC normal channel rank 16 */
-} adc_nc_rank_t;
-
-/**
-  * @brief ADC rank into insert group
-  */
-typedef enum {
-	ADC_IH_RANK_1 = 0x1,	/**< ADC insert channel rank 1 */
-	ADC_IH_RANK_2 = 0x2,	/**< ADC insert channel rank 2 */
-	ADC_IH_RANK_3 = 0x3,	/**< ADC insert channel rank 3 */
-	ADC_IH_RANK_4 = 0x4,	/**< ADC insert channel rank 4 */
-} adc_ih_rank_t;
-
-/**
-  * @brief ADC analog watchdog mode
-  */
-typedef enum {
-	ADC_ANAWTD_NONE       = 0x0,     	/**< No watch dog */
-	ADC_ANAWTD_SING_NM    = 0x800200,	/**< One normal channel watch dog */
-	ADC_ANAWTD_SING_IST   = 0x400200,	/**< One inset channel Injec watch dog */
-	ADC_ANAWTD_SING_NMIST = 0xC00200,	/**< One normal and inset channel watch dog */
-	ADC_ANAWTD_ALL_NM     = 0x800000,	/**< All normal channel watch dog */
-	ADC_ANAWTD_ALL_IST    = 0x400000,	/**< All inset channel watch dog */
-	ADC_ANAWTD_ALL_NMIST  = 0xC00000,	/**< All normal and inset channel watch dog */
-} adc_ana_wtd_t;
-
-/**
-  * @brief ADC Event type
-  */
-typedef enum {
-	ADC_AWD_EVENT = (1U << 0),	/**< ADC analog watch dog event */
-} adc_event_type_t;
-
-/**
-  * @brief ADC interrupts definition
-  */
-typedef enum {
-	ADC_IT_NH  = (1U << 5), 	/**< ADC it normal */
-	ADC_IT_AWD = (1U << 6), 	/**< ADC it awd */
-	ADC_IT_IH  = (1U << 7), 	/**< ADC it insert */
-	ADC_IT_OVR = (1U << 26),	/**< ADC it overring */
-} adc_it_t;
-
-/**
-  * @brief ADC flags definition
-  */
-typedef enum {
-	ADC_FLAG_AWD = (1U << 0),	/**<ADC flag awd */
-	ADC_FLAG_NH  = (1U << 1),	/**<ADC flag normal mode */
-	ADC_FLAG_IH  = (1U << 2),	/**<ADC flag inset mode */
-	ADC_FLAG_OVR = (1U << 3),	/**<ADC flag ovr */
-	ADC_FLAG_NHS = (1U << 8),	/**<ADC flag normal start */
-	ADC_FLAG_IHS = (1U << 9),	/**<ADC flag inset start */
-} adc_flag_t;
-
-/**
-  * @brief ADC CLD DIV definition
-  */
-typedef enum {
-	ADC_CKDIV_1   = 0x0,	/**< ADC CLK DIV 1 */
-	ADC_CKDIV_2   = 0x1,	/**< ADC CLK DIV 2 */
-	ADC_CKDIV_4   = 0x2,	/**< ADC CLK DIV 4 */
-	ADC_CKDIV_8   = 0x3,	/**< ADC CLK DIV 8 */
-	ADC_CKDIV_16  = 0x4,	/**< ADC CLK DIV 16 */
-	ADC_CKDIV_32  = 0x5,	/**< ADC CLK DIV 32 */
-	ADC_CKDIV_64  = 0x6,	/**< ADC CLK DIV 64 */
-	ADC_CKDIV_128 = 0x7,	/**< ADC CLK DIV 128 */
-} adc_clk_div_t;
-
-/**
-  * @brief ADC negative reference voltage definition
-  */
-typedef enum {
-	ADC_NEG_REF_VSS   = 0x0,	/**< ADC negative regerence voltage vss */
-	ADC_NEG_REF_VREFN = 0x1,	/**< ADC negative regerence voltage vrefn */
-} adc_neg_ref_t;
-
-/**
-  * @brief ADC positive reference voltage definition
-  */
-typedef enum {
-	ADC_POS_REF_VDD        = 0x0,	/**< ADC posotove reference is VDD */
-	ADC_POS_REF_2V         = 0x1,	/**< ADC posotove reference is internal 2V */
-	ADC_POS_REF_VREEFP     = 0x2,	/**< ADC posotove reference is VREEFP */
-	ADC_POS_REF_VREEFP_BUF = 0x3,	/**< ADC posotove reference is VREEFP BUFFER */
-} adc_pos_ref_t;
-
-/**
-  * @brief ADC numbers of normal conversion channals
-  */
-typedef enum {
-	ADC_NM_NBR_1  = 0x0,	/**< ADC number of normal conversion 1 */
-	ADC_NM_NBR_2  = 0x1,	/**< ADC number of normal conversion 2 */
-	ADC_NM_NBR_3  = 0x2,	/**< ADC number of normal conversion 3 */
-	ADC_NM_NBR_4  = 0x3,	/**< ADC number of normal conversion 4 */
-	ADC_NM_NBR_5  = 0x4,	/**< ADC number of normal conversion 5 */
-	ADC_NM_NBR_6  = 0x5,	/**< ADC number of normal conversion 6 */
-	ADC_NM_NBR_7  = 0x6,	/**< ADC number of normal conversion 7 */
-	ADC_NM_NBR_8  = 0x7,	/**< ADC number of normal conversion 8 */
-	ADC_NM_NBR_9  = 0x8,	/**< ADC number of normal conversion 9 */
-	ADC_NM_NBR_10 = 0x9,	/**< ADC number of normal conversion 10 */
-	ADC_NM_NBR_11 = 0xA,	/**< ADC number of normal conversion 11 */
-	ADC_NM_NBR_12 = 0xB,	/**< ADC number of normal conversion 12 */
-	ADC_NM_NBR_13 = 0xC,	/**< ADC number of normal conversion 13 */
-	ADC_NM_NBR_14 = 0xD,	/**< ADC number of normal conversion 14 */
-	ADC_NM_NBR_15 = 0xE,	/**< ADC number of normal conversion 15 */
-	ADC_NM_NBR_16 = 0xF,	/**< ADC number of normal conversion 16 */
-} adc_nm_nbr_t;
-
-/**
-  * @brief ADC numbers of insert conversion channals
-  */
-typedef enum {
-	ADC_IST_NBR_1 = 0x0,	/**< ADC number of insert conversion 1 */
-	ADC_IST_NBR_2 = 0x1,	/**< ADC number of insert conversion 2 */
-	ADC_IST_NBR_3 = 0x2,	/**< ADC number of insert conversion 3 */
-	ADC_IST_NBR_4 = 0x3,	/**< ADC number of insert conversion 4 */
-} adc_ist_nbr_t;
-
-/**
-  * @brief ADC numbers of channals in discontinuous conversion mode
-  */
-typedef enum {
-	ADC_DISC_NBR_1 = 0x0,	/**< ADC number of discontinuous conversion 1 */
-	ADC_DISC_NBR_2 = 0x1,	/**< ADC number of discontinuous conversion 2 */
-	ADC_DISC_NBR_3 = 0x2,	/**< ADC number of discontinuous conversion 3 */
-	ADC_DISC_NBR_4 = 0x3,	/**< ADC number of discontinuous conversion 4 */
-	ADC_DISC_NBR_5 = 0x4,	/**< ADC number of discontinuous conversion 5 */
-	ADC_DISC_NBR_6 = 0x5,	/**< ADC number of discontinuous conversion 6 */
-	ADC_DISC_NBR_7 = 0x6,	/**< ADC number of discontinuous conversion 7 */
-	ADC_DISC_NBR_8 = 0x7,	/**< ADC number of discontinuous conversion 8 */
-} adc_disc_nbr_t;
-
-/**
-  * @brief ADC resolution of conversion
-  */
-typedef enum {
-	ADC_CONV_RES_6  = 0x0,	/**< ADC resolution of conversion 6 */
-	ADC_CONV_RES_8  = 0x1,	/**< ADC resolution of conversion 8 */
-	ADC_CONV_RES_10 = 0x2,	/**< ADC resolution of conversion 10 */
-	ADC_CONV_RES_12 = 0x3,	/**< ADC resolution of conversion 12 */
-} adc_conv_res_t;
-
-/**
-  * @brief ADC trigger conversion mode
-  */
-typedef enum {
-	ADC_TRIG_SOFT     = 0x0,	/**< ADC tirgger conversion soft */
-	ADC_TRIG_PIS      = 0x1,	/**< ADC tirgger conversion pis */
-	ADC_TRIG_PIS_SOFT = 0x2,	/**< ADC tirgger conversion all */
-} adc_trig_mode_t;
-
-/**
-  * @brief  Structure definition of ADC and normal group initialization
-  */
-typedef struct {
-	adc_align_t data_align;		/**< Specifies ADC data alignment */
-	adc_scan_t scan_mode;         	/**< Choose scan mode enable or not */
-	type_func_t cont_mode;       	/**< Choose continuous mode enable or not */
-	adc_nm_nbr_t conv_nbr;  	/**< Number of normal ranks will be converted */
-	type_func_t disc_mode;    	/**< Discontinuous mode enable or not */
-	adc_disc_nbr_t disc_nbr;	/**< Number of discontinuous conversions channel */
-	adc_conv_res_t conv_res;   	/**< The precision of conversion */
-	adc_clk_div_t clk_div;		/**< ADCCLK divider */
-	adc_nchesel_t nche_mode;	/**< Trigger the NCHE FALG mode */
-	adc_neg_ref_t neg_ref;    	/**< The negative reference voltage*/
-	adc_pos_ref_t pos_ref;    	/**< The positive reference voltage*/
-} adc_init_t;
-
-/**
-  * @brief  Structure definition of ADC channel for normal group
-  */
-typedef struct {
-	adc_channel_t channel;        	/**< The channel to configure into ADC normal group */
-	adc_nc_rank_t rank;       	/**< The rank in the normal group sequencer */
-	adc_samp_t sampling_time;	/**< Sampling time value to be set */
-} adc_channel_conf_t;
-
-/**
-  * @brief  ADC Configuration analog watchdog definition
-  */
-typedef struct {
-	adc_ana_wtd_t watchdog_mode;		/**< Configures the ADC analog watchdog mode*/
-	adc_channel_t channel;			/**< Selects which ADC channel to monitor by analog watchdog */
-	type_func_t it_mode;             	/**< Whether the analog watchdog is configured in interrupt */
-	uint32_t high_threshold;     	 	/**< The ADC analog watchdog High threshold value. */
-	uint32_t low_threshold;      	 	/**< The ADC analog watchdog Low threshold value. */
-} adc_analog_wdg_conf_t;
-
-/**
-  * @brief  ADC Configuration insert Channel structure definition
-  */
-typedef struct {
-	adc_channel_t channel;	/**< Selection of ADC channel to configure */
-	adc_ih_rank_t rank;	/**< Rank in the insert group sequencer */
-	adc_samp_t samp_time;	/**< Sampling time value for selected channel */
-	uint32_t offset;	/**< The offset about converted data */
-	adc_ist_nbr_t nbr;	/**< The number of insert ranks */
-	type_func_t disc_mode;	/**< insert sequence's Discontinuous function */
-	type_func_t auto_inj;	/**< insert sequence's auto function */
-} adc_ih_conf_t;
-
-/**
-  * @brief  ADC handle Structure definition
-  */
-typedef struct adc_handle_s {
-	ADC_TypeDef *perh;			/**< Register base address */
-	adc_init_t init;			/**< ADC required parameters */
-#ifdef ALD_DMA
-	dma_handle_t hdma;			/**< Pointer DMA Handler */
-	pis_handle_t hpis;			/**< Pointer PIS Handler for connect adc and dma */
-#endif
-	lock_state_t lock;			/**< ADC locking object */
-	adc_state_t state;			/**< ADC communication state  */
-	adc_error_t error_code;			/**< ADC Error code */
-	pis_handle_t reg_pis_handle;		/**< PIS for connect normal channel and trigger */
-	pis_handle_t inj_pis_handle;		/**< PIS for connect insert channel and trigger */
-	adc_trig_mode_t nm_trig_mode;		/**< ADC normal channel trigger mode */
-	adc_trig_mode_t ist_trig_mode;		/**< ADC insert channel trigger mode */
-
-	void (*adc_reg_cplt_cbk)( struct adc_handle_s *arg);  	/**< Regluar Conversion complete callback */
-	void (*adc_inj_cplt_cbk)( struct adc_handle_s *arg);  	/**< insert Conversion complete callback */
-	void (*adc_out_of_win_cbk)( struct adc_handle_s *arg);	/**< Level out of window callback */
-	void (*adc_error_cbk)(struct adc_handle_s *arg);      	/**< adc error callback */
-	void (*adc_ovr_cbk)(struct adc_handle_s *arg);	      	/**< adc ovr callback */
-} adc_handle_t;
-
-/**
-  * @brief Timer trigger adc config structure definition
-  */
-typedef struct {
-	uint32_t time;						/**< Timer period time uint: us */	
-	uint16_t size;						/**< Adc convert times */	
-	uint16_t *buf;						/**< Convert data buffer */	
-	adc_neg_ref_t n_ref;					/**< The negative reference voltage for adc*/
-	adc_pos_ref_t p_ref;					/**< The positive reference voltage for adc*/
-	adc_channel_t adc_ch;					/**< Adc channel */	
-	uint8_t dma_ch;						/**< Dma channel */	
-	TIMER_TypeDef *p_timer;					/**< Adc peripheral */	
-	ADC_TypeDef *p_adc;					/**< Dma peripheral */	
-	void (*adc_cplt_cbk)( struct adc_handle_s *arg);	/**< Conversion complete callback */
-	
-	/* private variable */
-	lock_state_t lock;		/**< Locking object */
-	pis_handle_t lh_pis;		/**< Handle of PIS module */
-	dma_handle_t lh_dma;		/**< Handle of DMA module */
-	timer_handle_t lh_timer;	/**< Handle of TIMER module */
-	adc_handle_t lh_adc;		/**< Handle of ADC module */
-	adc_channel_conf_t lnm_config;	/**< Struct for chanel configure */
-} adc_timer_config_t;
-/**
-  * @}
-  */
-
-/** @defgroup ADC_Public_Macros ADC Public Macros
-  * @{
-  */
-#define ADC_ENABLE(handle) 			(SET_BIT((handle)->perh->CON1, ADC_CON1_ADCEN_MSK))
-#define ADC_DISABLE(handle) 			(CLEAR_BIT((handle)->perh->CON1, ADC_CON1_ADCEN_MSK))
-#define ADC_NH_TRIG_BY_SOFT(handle)		(SET_BIT((handle)->perh->CON1, ADC_CON1_NCHTRG_MSK))
-#define ADC_IH_TRIG_BY_SOFT(handle)		(SET_BIT((handle)->perh->CON1, ADC_CON1_ICHTRG_MSK))
-#define ADC_RESET_HANDLE_STATE(handle)		((handle)->state = ADC_STATE_RESET)
-#define ADC_VREF_OUT_ENABLE(handle)		(SET_BIT((handle)->perh->CCR, ADC_CCR_VREFOEN_MSK))
-#define ADC_VREF_OUT_DISABLE(handle)		(CLEAR_BIT((handle)->perh->CCR, ADC_CCR_VREFOEN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup ADC_Private_Macros ADC Private Macros
-  * @{
-  */
-#define IS_ADC_IH_RANK_TYPE(x)			((x) <= ADC_IH_RANK_4)
-#define IS_ADC_NC_RANK_TYPE(x)			((x) <= ADC_NC_RANK_16)
-#define IS_ADC_SAMPLING_TIMES_TYPE(x)		(((x) == ADC_SAMPLETIME_1) || \
-                                                 ((x) == ADC_SAMPLETIME_2) || \
-					         ((x) == ADC_SAMPLETIME_4) || \
-					         ((x) == ADC_SAMPLETIME_15))
-#define IS_ADC_CHANNELS_TYPE(x)			((x) <= ADC_CHANNEL_19)
-#define IS_ADC_SCAN_MODE_TYPE(x)		(((x) == ADC_SCAN_DISABLE) || \
-                                                 ((x) ==  ADC_SCAN_ENABLE) )
-#define IS_ADC_DATA_ALIGN_TYPE(x)		(((x) == ADC_DATAALIGN_RIGHT) || \
-                                                 ((x) == ADC_DATAALIGN_LEFT))
-#define IS_ADC_ANALOG_WTD_MODE_TYPE(x)  	(((x) == ADC_ANAWTD_NONE)       || \
-						 ((x) == ADC_ANAWTD_SING_NM)    || \
-						 ((x) == ADC_ANAWTD_SING_IST)   || \
-						 ((x) == ADC_ANAWTD_SING_NMIST) || \
-						 ((x) == ADC_ANAWTD_ALL_NM)     || \
-						 ((x) == ADC_ANAWTD_ALL_IST)    || \
-						 ((x) == ADC_ANAWTD_ALL_NMIST))
-#define IS_ADC_IT_TYPE(x)			(((x) == ADC_IT_NH) || \
-						 ((x) == ADC_IT_AWD)  || \
-						 ((x) == ADC_IT_IH) ||  \
-						 ((x) == ADC_IT_OVR ))
-#define IS_ADC_FLAGS_TYPE(x)			(((x) == ADC_FLAG_AWD)   || \
-						 ((x) == ADC_FLAG_NH)  || \
-						 ((x) == ADC_FLAG_IH)  || \
-						 ((x) == ADC_FLAG_OVR)   || \
-						 ((x) == ADC_FLAG_NHS) || \
-						 ((x) == ADC_FLAG_IHS))
-#define IS_ADC_CLK_DIV_TYPE(x)			(((x) == ADC_CKDIV_1)   || \
-						 ((x) == ADC_CKDIV_2)   || \
-						 ((x) == ADC_CKDIV_4)   || \
-						 ((x) == ADC_CKDIV_8)   || \
-						 ((x) == ADC_CKDIV_16)  || \
-						 ((x) == ADC_CKDIV_32)  || \
-						 ((x) == ADC_CKDIV_64)  || \
-						 ((x) == ADC_CKDIV_128))
-#define IS_ADC_NEG_REF_VOLTAGE_TYPE(x)		(((x) == ADC_NEG_REF_VSS ) || \
-                                                 ((x) == ADC_NEG_REF_VREFN ))
-#define IS_POS_REF_VOLTAGE_TYPE(x)		(((x) == ADC_POS_REF_VDD)    || \
-						 ((x) == ADC_POS_REF_2V)     || \
-						 ((x) == ADC_POS_REF_VREEFP) || \
-						 ((x) == ADC_POS_REF_VREEFP_BUF))
-#define IS_ADC_NBR_OF_NM_TYPE(x)		((x) <= ADC_NM_NBR_16)
-#define IS_ADC_NBR_OF_IST_TYPE(x)		((x) <= ADC_IST_NBR_4)
-#define IS_ADC_DISC_NBR_TYPE(x)			((x) <= ADC_DISC_NBR_8)
-#define IS_ADC_CONV_RES_TYPE(x)			(((x) == ADC_CONV_RES_12) || \
-                                                 ((x) == ADC_CONV_RES_6)  || \
-						 ((x) == ADC_CONV_RES_8)  || \
-						 ((x) == ADC_CONV_RES_10))
-#define IS_ADC_TRIG_MODE_TYPE(x)		(((x) == ADC_TRIG_SOFT) || \
-                                                 ((x) == ADC_TRIG_PIS)  || \
-                                                 ((x) == ADC_TRIG_PIS_SOFT))
-#define IS_ADC_TYPE(x) 				(((x) == ADC0) || \
-						 ((x) == ADC1))
-#define IS_ADC_NCHESEL_MODE_TYPE(x)		(((x) == ADC_NCHESEL_MODE_ALL) || \
-						 ((x) == ADC_NCHESEL_MODE_ONE))
-#define IS_ADC_EVENT_TYPE(x)			((x) == ADC_AWD_EVENT)
-#define IS_ADC_IST_OFFSET_TYPE(x)		((x) <= 0xfff)
-#define IS_HTR_TYPE(x)				((x) <= 0xfff)
-#define IS_LTR_TYPE(x)				((x) <= 0xfff)
-/**
-  * @}
-  */
-
-/** @addtogroup ADC_Public_Functions
-  * @{
-  */
-
-/** @addtogroup ADC_Public_Functions_Group1
-  * @{
-  */
-ald_status_t adc_init(adc_handle_t *hperh);
-ald_status_t adc_reset(adc_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup ADC_Public_Functions_Group2
-  * @{
-  */
-ald_status_t adc_normal_start(adc_handle_t *hperh);
-ald_status_t adc_normal_stop(adc_handle_t *hperh);
-ald_status_t adc_normal_poll_for_conversion(adc_handle_t *hperh, uint32_t timeout);
-ald_status_t adc_poll_for_event(adc_handle_t *hperh, adc_event_type_t event_type, uint32_t timeout);
-ald_status_t adc_normal_start_by_it(adc_handle_t *hperh);
-ald_status_t adc_normal_stop_by_it(adc_handle_t *hperh);
-#ifdef ALD_DMA
-ald_status_t adc_start_by_dma(adc_handle_t *hperh, uint16_t *buf, uint16_t size, uint8_t channel);
-ald_status_t adc_stop_by_dma(adc_handle_t *hperh);
-ald_status_t adc_timer_trigger_adc_by_dma(adc_timer_config_t *config);
-#endif
-uint32_t adc_normal_get_value(adc_handle_t *hperh);
-ald_status_t adc_insert_start(adc_handle_t *hperh);
-ald_status_t adc_insert_stop(adc_handle_t *hperh);
-ald_status_t adc_insert_poll_for_conversion(adc_handle_t *hperh, uint32_t timeout);
-ald_status_t adc_insert_start_by_it(adc_handle_t *hperh);
-ald_status_t adc_insert_stop_by_it(adc_handle_t *hperh);
-uint32_t adc_insert_get_value(adc_handle_t *hperh, adc_ih_rank_t ih_rank);
-void adc_irq_handler(adc_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup ADC_Public_Functions_Group3
-  * @{
-  */
-ald_status_t adc_normal_channel_config(adc_handle_t *hperh, adc_channel_conf_t *config);
-ald_status_t adc_insert_channel_config(adc_handle_t *hperh, adc_ih_conf_t *config);
-ald_status_t adc_analog_wdg_config(adc_handle_t *hperh, adc_analog_wdg_conf_t *config);
-void adc_interrupt_config(adc_handle_t *hperh, adc_it_t it, type_func_t state);
-it_status_t adc_get_it_status(adc_handle_t *hperh, adc_it_t it);
-flag_status_t adc_get_flag_status(adc_handle_t *hperh, adc_flag_t flag);
-void adc_clear_flag_status(adc_handle_t *hperh, adc_flag_t flag);
-/**
-  * @}
-  */
-
-/** @addtogroup ADC_Public_Functions_Group4
-  * @{
-  */
-uint32_t adc_get_state(adc_handle_t *hperh);
-uint32_t adc_get_error(adc_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
- extern "C" }
-#endif
-
-#endif /* __ALD_ADC_H */

+ 0 - 184
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_bkpc.h

@@ -1,184 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_bkpc.h
-  * @brief   Header file of BKPC module driver.
-  *
-  * @version V1.0
-  * @date    15 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  */
-
-#ifndef __ALD_BKPC_H__
-#define __ALD_BKPC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup BKPC
-  * @{
-  */
-
-/** @defgroup BKPC_Public_Macros BKPC Public Macros
-  * @{
-  */
-#define BKPC_LOCK()		(WRITE_REG(BKPC->PROT, 0))
-#define BKPC_UNLOCK()		(WRITE_REG(BKPC->PROT, 0x9669AA55))
-#define BKPC_LRC_ENABLE()			\
-do {						\
-	BKPC_UNLOCK();				\
-	SET_BIT(BKPC->CR, BKPC_CR_LRCEN_MSK);	\
-	BKPC_LOCK();				\
-} while (0)
-#define BKPC_LRC_DISABLE()			\
-do {						\
-	BKPC_UNLOCK();				\
-	CLEAR_BIT(BKPC->CR, BKPC_CR_LRCEN_MSK);	\
-	BKPC_LOCK();				\
-} while (0)
-#define BKPC_LOSM_ENABLE()			\
-do {						\
-	BKPC_UNLOCK();				\
-	SET_BIT(BKPC->CR, BKPC_CR_LOSMEN_MSK);	\
-	BKPC_LOCK();				\
-} while (0)
-#define BKPC_LOSM_DISABLE()			\
-do {						\
-	BKPC_UNLOCK();				\
-	CLEAR_BIT(BKPC->CR, BKPC_CR_LOSMEN_MSK);\
-	BKPC_LOCK();				\
-} while (0)
-#define BKPC_LOSC_ENABLE()			\
-do {						\
-	BKPC_UNLOCK();				\
-	SET_BIT(BKPC->CR, BKPC_CR_LOSCEN_MSK);	\
-	BKPC_LOCK();				\
-} while (0)
-#define BKPC_LOSC_DISABLE()			\
-do {						\
-	BKPC_UNLOCK();				\
-	CLEAR_BIT(BKPC->CR, BKPC_CR_LOSCEN_MSK);\
-	BKPC_LOCK();				\
-} while (0)
-/**
-  * @}
-  */
-
-/** @defgroup BKPC_Public_Types BKPC Public Types
-  * @{
-  */
-/**
-  * @brief BKPC ldo output select
-  */
-typedef enum {
-	BKPC_LDO_OUTPUT_1_6 = 0x0,	/**< 1.6V */
-	BKPC_LDO_OUTPUT_1_3 = 0x1,	/**< 1.3V */
-	BKPC_LDO_OUTPUT_1_4 = 0x2,	/**< 1.4V */
-	BKPC_LDO_OUTPUT_1_5 = 0x4,	/**< 1.5V */
-} bkpc_ldo_output_t;
-
-/**
-  * @brief BKPC BOR voltage select
-  */
-typedef enum {
-	BKPC_BOR_VOL_1_7  = 0x0,	/**< 1.7V */
-	BKPC_BOR_VOL_2_0  = 0x1,	/**< 2.0V */
-	BKPC_BOR_VOL_2_1  = 0x2,	/**< 2.1V */
-	BKPC_BOR_VOL_2_2  = 0x3,	/**< 2.2V */
-	BKPC_BOR_VOL_2_3  = 0x4,	/**< 2.3V */
-	BKPC_BOR_VOL_2_4  = 0x5,	/**< 2.4V */
-	BKPC_BOR_VOL_2_5  = 0x6,	/**< 2.5V */
-	BKPC_BOR_VOL_2_6  = 0x7,	/**< 2.6V */
-	BKPC_BOR_VOL_2_8  = 0x8,	/**< 2.8V */
-	BKPC_BOR_VOL_3_0  = 0x9,	/**< 3.0V */
-	BKPC_BOR_VOL_3_1  = 0xA,	/**< 3.1V */
-	BKPC_BOR_VOL_3_3  = 0xB,	/**< 3.3V */
-	BKPC_BOR_VOL_3_6  = 0xC,	/**< 3.6V */
-	BKPC_BOR_VOL_3_7  = 0xD,	/**< 3.7V */
-	BKPC_BOR_VOL_4_0  = 0xE,	/**< 4.0V */
-	BKPC_BOR_VOL_4_3  = 0xF,	/**< 4.3V */
-} bkpc_bor_vol_t;
-
-/**
-  * @}
-  */
-
-/**
-  * @defgroup BKPC_Private_Macros BKPC Private Macros
-  * @{
-  */
-#define IS_BKPC_LDO_OUTPUT(x)	(((x) == BKPC_LDO_OUTPUT_1_6) || \
-                                 ((x) == BKPC_LDO_OUTPUT_1_3) || \
-                                 ((x) == BKPC_LDO_OUTPUT_1_4) || \
-                                 ((x) == BKPC_LDO_OUTPUT_1_5))
-#define IS_BKPC_BOR_VOL(x)	(((x) == BKPC_BOR_VOL_1_7) || \
-                                 ((x) == BKPC_BOR_VOL_2_0) || \
-                                 ((x) == BKPC_BOR_VOL_2_1) || \
-                                 ((x) == BKPC_BOR_VOL_2_2) || \
-                                 ((x) == BKPC_BOR_VOL_2_3) || \
-                                 ((x) == BKPC_BOR_VOL_2_4) || \
-                                 ((x) == BKPC_BOR_VOL_2_5) || \
-                                 ((x) == BKPC_BOR_VOL_2_6) || \
-                                 ((x) == BKPC_BOR_VOL_2_8) || \
-                                 ((x) == BKPC_BOR_VOL_3_0) || \
-                                 ((x) == BKPC_BOR_VOL_3_1) || \
-                                 ((x) == BKPC_BOR_VOL_3_3) || \
-                                 ((x) == BKPC_BOR_VOL_3_6) || \
-                                 ((x) == BKPC_BOR_VOL_3_7) || \
-                                 ((x) == BKPC_BOR_VOL_4_0) || \
-                                 ((x) == BKPC_BOR_VOL_4_3))
-#define IS_BKPC_RAM_IDX(x)	((x) < 32)
-/**
-  * @}
-  */
-
-/** @addtogroup BKPC_Public_Functions
-  * @{
-  */
-/** @addtogroup BKPC_Public_Functions_Group1
-  * @{
-  */
-/* control functions */
-extern void bkpc_ldo_config(bkpc_ldo_output_t output, type_func_t state);
-extern void bkpc_bor_config(bkpc_bor_vol_t vol, type_func_t state);
-/**
-  * @}
-  */
-/** @addtogroup BKPC_Public_Functions_Group2
-  * @{
-  */
-/* IO operation functions */
-extern void bkpc_write_ram(uint8_t idx, uint32_t value);
-extern uint32_t bkpc_read_ram(uint8_t idx);
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_BKPC_H__ */

+ 0 - 615
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_cmu.h

@@ -1,615 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_cmu.h
-  * @brief   Header file of CMU module driver.
-  *
-  * @version V1.0
-  * @date    22 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  */
-
-#ifndef __ALD_CMU_H__
-#define __ALD_CMU_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_syscfg.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup CMU
-  * @{
-  */
-
-/** @defgroup CMU_Public_Macros CMU Public Macros
-  * @{
-  */
-#define CMU_LOSC_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LOSC_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LRC_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(CMU->CLKENR, CMU_CLKENR_LRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LRC_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_LRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_ULRC_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(CMU->CLKENR, CMU_CLKENR_ULRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_ULRC_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_ULRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-
-/* Low power mode control */
-#define CMU_LP_LRC_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(CMU->LPENR, CMU_LPENR_LRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LP_LRC_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(CMU->LPENR, CMU_LPENR_LRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LP_LOSC_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(CMU->LPENR, CMU_LPENR_LOSCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LP_LOSC_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(CMU->LPENR, CMU_LPENR_LOSCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LP_HRC_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(CMU->LPENR, CMU_LPENR_HRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LP_HRC_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(CMU->LPENR, CMU_LPENR_HRCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LP_HOSC_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(CMU->LPENR, CMU_LPENR_HOSCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define CMU_LP_HOSC_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(CMU->LPENR, CMU_LPENR_HOSCEN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-/**
-  * @}
-  */
-
-
-/** @defgroup CMU_Public_Types CMU Public Types
-  * @{
-  */
-/**
-  * @brief CMU state structure definition
-  */
-typedef	enum {
-	CMU_CLOCK_HRC  = 0x1,	/**< HRC */
-	CMU_CLOCK_LRC  = 0x2,	/**< LRC */
-	CMU_CLOCK_LOSC = 0x3,	/**< LOSC */
-	CMU_CLOCK_PLL1 = 0x4,	/**< PLL1 */
-	CMU_CLOCK_HOSC = 0x5,	/**< HOSC */
-} cmu_clock_t;
-
-/**
-  * @brief PLL1 output clock
-  */
-typedef enum {
-	CMU_PLL1_OUTPUT_32M = 0x0,	/**< x8  (32MHz) */
-	CMU_PLL1_OUTPUT_48M = 0x1,	/**< x12 (48MHz) */
-} cmu_pll1_output_t;
-
-/**
-  * @brief PLL1 referance clock
-  */
-typedef enum {
-	CMU_PLL1_INPUT_HRC_6  = 0x0,	/**< HRC  / 6 */
-	CMU_PLL1_INPUT_PLL2   = 0x1,	/**< PLL2 */
-	CMU_PLL1_INPUT_HOSC   = 0x2,	/**< HOSC / 1 */
-	CMU_PLL1_INPUT_HOSC_2 = 0x3,	/**< HOSC / 2 */
-	CMU_PLL1_INPUT_HOSC_3 = 0x4,	/**< HOSC / 3 */
-	CMU_PLL1_INPUT_HOSC_4 = 0x5,	/**< HOSC / 4 */
-	CMU_PLL1_INPUT_HOSC_5 = 0x6,	/**< HOSC / 5 */
-	CMU_PLL1_INPUT_HOSC_6 = 0x7,	/**< HOSC / 6 */
-} cmu_pll1_input_t;
-
-/**
-  * @brief HOSC range
-  */
-typedef enum {
-	CMU_HOSC_2M  = 0x0,
-	CMU_HOSC_4M  = 0x1,
-	CMU_HOSC_8M  = 0x2,
-	CMU_HOSC_16M = 0x3,
-	CMU_HOSC_24M = 0x4,
-} cmu_hosc_range_t;
-
-/**
-  * @brief Auto-calibrate input
-  */
-typedef enum {
-	CMU_AUTO_CALIB_INPUT_LOSE = 0x0,
-	CMU_AUTO_CALIB_INPUT_HOSE = 0x1,
-} cmu_auto_calib_input_t;
-
-/**
-  * @brief Auto-calibrate output
-  */
-typedef enum {
-	CMU_AUTO_CALIB_OUTPUT_24M = 0x0,
-	CMU_AUTO_CALIB_OUTPUT_2M  = 0x1,
-} cmu_auto_calib_output_t;
-
-/**
-  * @brief Frequency division select bit
-  */
-typedef enum {
-	CMU_DIV_1    = 0x0,		/**< Division by 1 */
-	CMU_DIV_2    = 0x1,		/**< Division by 2 */
-	CMU_DIV_4    = 0x2,		/**< Division by 4 */
-	CMU_DIV_8    = 0x3,		/**< Division by 8 */
-	CMU_DIV_16   = 0x4,		/**< Division by 16 */
-	CMU_DIV_32   = 0x5,		/**< Division by 32 */
-	CMU_DIV_64   = 0x6,		/**< Division by 64 */
-	CMU_DIV_128  = 0x7,		/**< Division by 128 */
-	CMU_DIV_256  = 0x8,		/**< Division by 256 */
-	CMU_DIV_512  = 0x9,		/**< Division by 512 */
-	CMU_DIV_1024 = 0xA,		/**< Division by 1024 */
-	CMU_DIV_2048 = 0xB,		/**< Division by 2048 */
-	CMU_DIV_4096 = 0xC,		/**< Division by 4096 */
-} cmu_div_t;
-
-/**
-  * @brief Bus type
-  */
-typedef enum {
-	CMU_HCLK_1 = 0x0,		/**< AHB1 bus */
-	CMU_SYS    = 0x1,		/**< SYS bus */
-	CMU_PCLK_1 = 0x2,		/**< APB1 bus */
-	CMU_PCLK_2 = 0x3,		/**< APB2 bus */
-} cmu_bus_t;
-
-/**
-  * @brief Output high clock select
-  */
-typedef enum {
-	CMU_OUTPUT_HIGH_SEL_HOSC   = 0x0,	/**< Select HOSC */
-	CMU_OUTPUT_HIGH_SEL_LOSC   = 0x1,	/**< Select LOSC */
-	CMU_OUTPUT_HIGH_SEL_HRC    = 0x2,	/**< Select HRC */
-	CMU_OUTPUT_HIGH_SEL_LRC    = 0x3,	/**< Select LRC */
-	CMU_OUTPUT_HIGH_SEL_HOSM   = 0x4,	/**< Select HOSM */
-	CMU_OUTPUT_HIGH_SEL_PLL1   = 0x5,	/**< Select PLL1 */
-	CMU_OUTPUT_HIGH_SEL_PLL2   = 0x6,	/**< Select PLL2 */
-	CMU_OUTPUT_HIGH_SEL_SYSCLK = 0x7,	/**< Select SYSCLK */
-} cmu_output_high_sel_t;
-
-/**
-  * @brief Output frequency division
-  */
-typedef enum {
-	CMU_OUTPUT_DIV_1   = 0x0,	/**< Division by 1 */
-	CMU_OUTPUT_DIV_2   = 0x1,	/**< Division by 2 */
-	CMU_OUTPUT_DIV_4   = 0x2,	/**< Division by 4 */
-	CMU_OUTPUT_DIV_8   = 0x3,	/**< Division by 8 */
-	CMU_OUTPUT_DIV_16  = 0x4,	/**< Division by 16 */
-	CMU_OUTPUT_DIV_32  = 0x5,	/**< Division by 32 */
-	CMU_OUTPUT_DIV_64  = 0x6,	/**< Division by 64 */
-	CMU_OUTPUT_DIV_128 = 0x7,	/**< Division by 128 */
-} cmu_output_high_div_t;
-
-/**
-  * @brief Output low clock select
-  */
-typedef enum {
-	CMU_OUTPUT_LOW_SEL_LOSC = 0x0,	/**< Select LOSC */
-	CMU_OUTPUT_LOW_SEL_LRC  = 0x1,	/**< Select LRC */
-	CMU_OUTPUT_LOW_SEL_LOSM = 0x2,	/**< Select LOSM */
-	CMU_OUTPUT_LOW_SEL_BUZZ = 0x3,	/**< Select BUZZ */
-	CMU_OUTPUT_LOW_SEL_ULRC = 0x4,	/**< Select ULRC */
-} cmu_output_low_sel_t;
-
-/**
-  * @brief BUZZ frequency division
-  */
-typedef enum {
-	CMU_BUZZ_DIV_2   = 0x0,		/**< Division by 2 */
-	CMU_BUZZ_DIV_4   = 0x1,		/**< Division by 4 */
-	CMU_BUZZ_DIV_8   = 0x2,		/**< Division by 8 */
-	CMU_BUZZ_DIV_16  = 0x3,		/**< Division by 16 */
-	CMU_BUZZ_DIV_32  = 0x4,		/**< Division by 32 */
-	CMU_BUZZ_DIV_64  = 0x5,		/**< Division by 64 */
-	CMU_BUZZ_DIV_128 = 0x6,		/**< Division by 128 */
-	CMU_BUZZ_DIV_256 = 0x7,		/**< Division by 256 */
-} cmu_buzz_div_t;
-
-/**
-  * @brief Low power peripheral clock select
-  */
-typedef enum {
-	CMU_LP_PERH_CLOCK_SEL_PCLK2   = 0x0,	/**< Select PCLK2 */
-	CMU_LP_PERH_CLOCK_SEL_PLL1    = 0x1,	/**< Select PLL1 */
-	CMU_LP_PERH_CLOCK_SEL_PLL2    = 0x2,	/**< Select PLL2 */
-	CMU_LP_PERH_CLOCK_SEL_HRC     = 0x3,	/**< Select HRC */
-	CMU_LP_PERH_CLOCK_SEL_HOSC    = 0x4,	/**< Select HOSC */
-	CMU_LP_PERH_CLOCK_SEL_LRC     = 0x5,	/**< Select LRC */
-	CMU_LP_PERH_CLOCK_SEL_LOSC    = 0x6,	/**< Select LOSC */
-	CMU_LP_PERH_CLOCK_SEL_ULRC    = 0x7,	/**< Select ULRC */
-	CMU_LP_PERH_CLOCK_SEL_HRC_1M  = 0x8,	/**< Select HRC down to 1MHz */
-	CMU_LP_PERH_CLOCK_SEL_HOSC_1M = 0x9,	/**< Select HOSC down to 1MHz  */
-	CMU_LP_PERH_CLOCK_SEL_LOSM    = 0xA,	/**< Select LOSM */
-	CMU_LP_PERH_CLOCK_SEL_HOSM    = 0xB,	/**< Select HOSM */
-} cmu_lp_perh_clock_sel_t;
-
-/**
-  * @brief LCD clock select
-  */
-typedef enum {
-	CMU_LCD_SEL_LOSM    = 0x0,	/**< Select LOSM */
-	CMU_LCD_SEL_LOSC    = 0x1,	/**< Select LOSC */
-	CMU_LCD_SEL_LRC     = 0x2,	/**< Select LRC */
-	CMU_LCD_SEL_ULRC    = 0x3,	/**< Select ULRC */
-	CMU_LCD_SEL_HRC_1M  = 0x4,	/**< Select HRC down to 1MHz */
-	CMU_LCD_SEL_HOSC_1M = 0x5,	/**< Select HOSC down to 1MHz */
-} cmu_lcd_clock_sel_t;
-
-/**
-  * @brief Peripheral clock enable/disable
-  */
-typedef enum {
-	CMU_PERH_GPIO    = (1U << 0),			/**< GPIO */
-	CMU_PERH_CRC     = (1U << 1),			/**< CRC */
-	CMU_PERH_CALC    = (1U << 2),			/**< CALC */
-	CMU_PERH_CRYPT   = (1U << 3),			/**< CRYPT */
-	CMU_PERH_TRNG    = (1U << 4),			/**< TRNG */
-	CMU_PERH_PIS     = (1U << 5),			/**< PIS */
-	CMU_PERH_TIM0    = (1U << 0)  | (1U << 27),	/**< TIM0 */
-	CMU_PERH_TIM1    = (1U << 1)  | (1U << 27),	/**< TIM1 */
-	CMU_PERH_TIM2    = (1U << 2)  | (1U << 27),	/**< TIM2 */
-	CMU_PERH_TIM3    = (1U << 3)  | (1U << 27),	/**< TIM3 */
-	CMU_PERH_TIM4    = (1U << 4)  | (1U << 27),	/**< TIM4 */
-	CMU_PERH_TIM5    = (1U << 5)  | (1U << 27),	/**< TIM5 */
-	CMU_PERH_TIM6    = (1U << 6)  | (1U << 27),	/**< TIM6 */
-	CMU_PERH_TIM7    = (1U << 7)  | (1U << 27),	/**< TIM7 */
-	CMU_PERH_UART0   = (1U << 8)  | (1U << 27),	/**< UART0 */
-	CMU_PERH_UART1   = (1U << 9)  | (1U << 27),	/**< UART1 */
-	CMU_PERH_UART2   = (1U << 10) | (1U << 27),	/**< UART2 */
-	CMU_PERH_UART3   = (1U << 11) | (1U << 27),	/**< UART3 */
-	CMU_PERH_USART0  = (1U << 12) | (1U << 27),	/**< USART0 */
-	CMU_PERH_USART1  = (1U << 13) | (1U << 27),	/**< USART1 */
-	CMU_PERH_SPI0    = (1U << 16) | (1U << 27),	/**< SPI0 */
-	CMU_PERH_SPI1    = (1U << 17) | (1U << 27),	/**< SPI1 */
-	CMU_PERH_SPI2    = (1U << 18) | (1U << 27),	/**< SPI2 */
-	CMU_PERH_I2C0    = (1U << 20) | (1U << 27),	/**< I2C0 */
-	CMU_PERH_I2C1    = (1U << 21) | (1U << 27),	/**< I2C1 */
-	CMU_PERH_CAN     = (1U << 24) | (1U << 27),	/**< CAN */
-	CMU_PERH_LPTIM0  = (1U << 0)  | (1U << 28),	/**< LPTIM0 */
-	CMU_PERH_LPUART0 = (1U << 2)  | (1U << 28),	/**< LPUART0 */
-	CMU_PERH_ADC0    = (1U << 4)  | (1U << 28),	/**< ADC0 */
-	CMU_PERH_ADC1    = (1U << 5)  | (1U << 28),	/**< ADC1 */
-	CMU_PERH_ACMP0   = (1U << 6)  | (1U << 28),	/**< ACMP0 */
-	CMU_PERH_ACMP1   = (1U << 7)  | (1U << 28),	/**< ACMP1 */
-	CMU_PERH_OPAMP   = (1U << 8)  | (1U << 28),	/**< OPAMP */
-	CMU_PERH_DAC0    = (1U << 9)  | (1U << 28),	/**< DAC0 */
-	CMU_PERH_WWDT    = (1U << 12) | (1U << 28),	/**< WWDT */
-	CMU_PERH_LCD     = (1U << 13) | (1U << 28),	/**< LCD */
-	CMU_PERH_IWDT    = (1U << 14) | (1U << 28),	/**< IWDT */
-	CMU_PERH_RTC     = (1U << 15) | (1U << 28),	/**< RTC */
-	CMU_PERH_TEMP    = (1U << 16) | (1U << 28),	/**< TEMP */
-	CMU_PERH_BKPC    = (1U << 17) | (1U << 28),	/**< BKPC */
-	CMU_PERH_BKRPAM  = (1U << 18) | (1U << 28),	/**< BKPRAM */
-	CMU_PERH_DBGC    = (1U << 19) | (1U << 28),	/**< DBGC */
-	CMU_PERH_ALL     = (0x7FFFFFFF),		/**< ALL */
-} cmu_perh_t;
-
-/**
-  * @brief CMU interrupt type
-  */
-typedef enum {
-	CMU_LOSC_STOP    = 0x0,	/**< LOSC STOP INTERRUPT */
-	CMU_HOSC_STOP    = 0x1,	/**< HOSC STOP INTERRUPT */
-	CMU_PLL1_UNLOCK  = 0x2,	/**< PLL1 UNLOCK INTERRUPT */
-	CMU_LOSC_START   = 0x3,	/**< LOSC START INTERRUPT */
-	CMU_HOSC_START   = 0x4,	/**< HOSC START INTERRUPT */
-} cmu_security_t;
-
-/**
-  * @brief CMU clock state type
-  */
-typedef enum {
-	CMU_CLOCK_STATE_HOSCACT = (1U << 0),	/**< HOSC active */
-	CMU_CLOCK_STATE_LOSCACT = (1U << 1),	/**< LOSC active */
-	CMU_CLOCK_STATE_HRCACT  = (1U << 2),	/**< HRC active */
-	CMU_CLOCK_STATE_LRCACT  = (1U << 3),	/**< LRC active */
-	CMU_CLOCK_STATE_ULRCACT = (1U << 4),	/**< ULRC active */
-	CMU_CLOCK_STATE_PLLACT  = (1U << 8),	/**< PLL active */
-	CMU_CLOCK_STATE_HOSCRDY = (1U << 16),	/**< HOSC ready */
-	CMU_CLOCK_STATE_LOSCRDY = (1U << 17),	/**< LOSC ready */
-	CMU_CLOCK_STATE_HRCRDY  = (1U << 18),	/**< HRC ready */
-	CMU_CLOCK_STATE_LRCRDY  = (1U << 19),	/**< LRC ready */
-	CMU_CLOCK_STATE_PLLRDY  = (1U << 24),	/**< PLL ready */
-} cmu_clock_state_t;
-/**
-  * @}
-  */
-
-/**
-  * @defgroup CMU_Private_Macros CMU Private Macros
-  * @{
-  */
-#define IS_CMU_CLOCK(x)		(((x) == CMU_CLOCK_HRC)  || \
-                                 ((x) == CMU_CLOCK_LRC)  || \
-                                 ((x) == CMU_CLOCK_LOSC) || \
-                                 ((x) == CMU_CLOCK_PLL1) || \
-                                 ((x) == CMU_CLOCK_HOSC))
-#define IS_CMU_PLL1_OUTPUT(x)	(((x) == CMU_PLL1_OUTPUT_32M) || \
-                                 ((x) == CMU_PLL1_OUTPUT_48M))
-#define IS_CMU_PLL1_INPUT(x)	(((x) == CMU_PLL1_INPUT_HRC_6)  || \
-                                 ((x) == CMU_PLL1_INPUT_PLL2)   || \
-                                 ((x) == CMU_PLL1_INPUT_HOSC)   || \
-                                 ((x) == CMU_PLL1_INPUT_HOSC_2) || \
-                                 ((x) == CMU_PLL1_INPUT_HOSC_3) || \
-                                 ((x) == CMU_PLL1_INPUT_HOSC_4) || \
-                                 ((x) == CMU_PLL1_INPUT_HOSC_5) || \
-                                 ((x) == CMU_PLL1_INPUT_HOSC_6))
-#define IS_CMU_HOSC_RANGE(x)	(((x) == CMU_HOSC_2M)  || \
-                                 ((x) == CMU_HOSC_4M)  || \
-                                 ((x) == CMU_HOSC_8M)  || \
-                                 ((x) == CMU_HOSC_16M) || \
-                                 ((x) == CMU_HOSC_24M))
-#define IS_CMU_DIV(x)		(((x) == CMU_DIV_1)    || \
-                                 ((x) == CMU_DIV_2)    || \
-                                 ((x) == CMU_DIV_4)    || \
-                                 ((x) == CMU_DIV_8)    || \
-                                 ((x) == CMU_DIV_16)   || \
-                                 ((x) == CMU_DIV_32)   || \
-                                 ((x) == CMU_DIV_64)   || \
-                                 ((x) == CMU_DIV_128)  || \
-                                 ((x) == CMU_DIV_256)  || \
-                                 ((x) == CMU_DIV_512)  || \
-                                 ((x) == CMU_DIV_1024) || \
-                                 ((x) == CMU_DIV_2048) || \
-                                 ((x) == CMU_DIV_4096))
-#define IS_CMU_BUS(x)		(((x) == CMU_HCLK_1) || \
-                                 ((x) == CMU_SYS)    || \
-                                 ((x) == CMU_PCLK_1) || \
-                                 ((x) == CMU_PCLK_2))
-#define IS_CMU_OUTPUT_HIGH_SEL(x)	(((x) == CMU_OUTPUT_HIGH_SEL_HOSC) || \
-                                         ((x) == CMU_OUTPUT_HIGH_SEL_LOSC) || \
-                                         ((x) == CMU_OUTPUT_HIGH_SEL_HRC)  || \
-                                         ((x) == CMU_OUTPUT_HIGH_SEL_LRC)  || \
-                                         ((x) == CMU_OUTPUT_HIGH_SEL_HOSM) || \
-                                         ((x) == CMU_OUTPUT_HIGH_SEL_PLL1) || \
-                                         ((x) == CMU_OUTPUT_HIGH_SEL_PLL2) || \
-                                         ((x) == CMU_OUTPUT_HIGH_SEL_SYSCLK))
-#define IS_CMU_OUTPUT_HIGH_DIV(x)	(((x) == CMU_OUTPUT_DIV_1)  || \
-                                         ((x) == CMU_OUTPUT_DIV_2)  || \
-                                         ((x) == CMU_OUTPUT_DIV_4)  || \
-                                         ((x) == CMU_OUTPUT_DIV_8)  || \
-                                         ((x) == CMU_OUTPUT_DIV_16) || \
-                                         ((x) == CMU_OUTPUT_DIV_32) || \
-                                         ((x) == CMU_OUTPUT_DIV_64) || \
-                                         ((x) == CMU_OUTPUT_DIV_128))
-#define IS_CMU_OUTPUT_LOW_SEL(x)	(((x) == CMU_OUTPUT_LOW_SEL_LOSC) || \
-                                         ((x) == CMU_OUTPUT_LOW_SEL_LRC ) || \
-                                         ((x) == CMU_OUTPUT_LOW_SEL_LOSM) || \
-                                         ((x) == CMU_OUTPUT_LOW_SEL_BUZZ) || \
-                                         ((x) == CMU_OUTPUT_LOW_SEL_ULRC))
-#define IS_CMU_AUTO_CALIB_INPUT(x)	(((x) == CMU_AUTO_CALIB_INPUT_LOSE) || \
-                                         ((x) == CMU_AUTO_CALIB_INPUT_HOSE))
-#define IS_CMU_AUTO_CALIB_OUTPUT(x)	(((x) == CMU_AUTO_CALIB_OUTPUT_24M) || \
-                                         ((x) == CMU_AUTO_CALIB_OUTPUT_2M))
-#define IS_CMU_BUZZ_DIV(x)	(((x) == CMU_BUZZ_DIV_2)   || \
-                                 ((x) == CMU_BUZZ_DIV_4)   || \
-                                 ((x) == CMU_BUZZ_DIV_8)   || \
-                                 ((x) == CMU_BUZZ_DIV_16)  || \
-                                 ((x) == CMU_BUZZ_DIV_32)  || \
-                                 ((x) == CMU_BUZZ_DIV_64)  || \
-                                 ((x) == CMU_BUZZ_DIV_128) || \
-                                 ((x) == CMU_BUZZ_DIV_256))
-#define IS_CMU_LP_PERH_CLOCK_SEL(x)	(((x) == CMU_LP_PERH_CLOCK_SEL_PCLK2)   || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_PLL1)    || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_PLL2)    || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_HRC)     || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_HOSC)    || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_LRC)     || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_LOSC)    || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_ULRC)    || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_HRC_1M)  || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_HOSC_1M) || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_LOSM)    || \
-                                         ((x) == CMU_LP_PERH_CLOCK_SEL_HOSM))
-#define IS_CMU_LCD_CLOCK_SEL(x)	(((x) == CMU_LCD_SEL_LOSM)   || \
-                                 ((x) == CMU_LCD_SEL_LOSC)   || \
-                                 ((x) == CMU_LCD_SEL_LRC)    || \
-                                 ((x) == CMU_LCD_SEL_ULRC)   || \
-                                 ((x) == CMU_LCD_SEL_HRC_1M) || \
-                                 ((x) == CMU_LCD_SEL_HOSC_1M))
-#define IS_CMU_PERH(x)		(((x) == CMU_PERH_GPIO)    || \
-                                 ((x) == CMU_PERH_CRC)     || \
-                                 ((x) == CMU_PERH_CALC)    || \
-                                 ((x) == CMU_PERH_CRYPT)   || \
-                                 ((x) == CMU_PERH_TRNG)    || \
-                                 ((x) == CMU_PERH_PIS)     || \
-                                 ((x) == CMU_PERH_TIM0)    || \
-                                 ((x) == CMU_PERH_TIM1)    || \
-                                 ((x) == CMU_PERH_TIM2)    || \
-                                 ((x) == CMU_PERH_TIM3)    || \
-                                 ((x) == CMU_PERH_TIM4)    || \
-                                 ((x) == CMU_PERH_TIM5)    || \
-                                 ((x) == CMU_PERH_TIM6)    || \
-                                 ((x) == CMU_PERH_TIM7)    || \
-                                 ((x) == CMU_PERH_UART0)   || \
-                                 ((x) == CMU_PERH_UART1)   || \
-                                 ((x) == CMU_PERH_UART2)   || \
-                                 ((x) == CMU_PERH_UART3)   || \
-                                 ((x) == CMU_PERH_USART0)  || \
-                                 ((x) == CMU_PERH_USART1)  || \
-                                 ((x) == CMU_PERH_SPI0)    || \
-                                 ((x) == CMU_PERH_SPI1)    || \
-                                 ((x) == CMU_PERH_SPI2)    || \
-                                 ((x) == CMU_PERH_I2C0)    || \
-                                 ((x) == CMU_PERH_I2C1)    || \
-                                 ((x) == CMU_PERH_CAN)     || \
-                                 ((x) == CMU_PERH_LPTIM0)  || \
-                                 ((x) == CMU_PERH_LPUART0) || \
-                                 ((x) == CMU_PERH_ADC0)    || \
-                                 ((x) == CMU_PERH_ADC1)    || \
-                                 ((x) == CMU_PERH_ACMP0)   || \
-                                 ((x) == CMU_PERH_ACMP1)   || \
-                                 ((x) == CMU_PERH_OPAMP)   || \
-                                 ((x) == CMU_PERH_DAC0)    || \
-                                 ((x) == CMU_PERH_WWDT)    || \
-                                 ((x) == CMU_PERH_LCD)     || \
-                                 ((x) == CMU_PERH_IWDT)    || \
-                                 ((x) == CMU_PERH_RTC)     || \
-                                 ((x) == CMU_PERH_TEMP)    || \
-                                 ((x) == CMU_PERH_BKPC)    || \
-                                 ((x) == CMU_PERH_BKRPAM ) || \
-                                 ((x) == CMU_PERH_DBGC)    || \
-                                 ((x) == CMU_PERH_ALL))
-#define IS_CMU_CLOCK_STATE(x)	(((x) == CMU_CLOCK_STATE_HOSCACT) || \
-                                 ((x) == CMU_CLOCK_STATE_LOSCACT) || \
-				 ((x) == CMU_CLOCK_STATE_HRCACT) || \
-				 ((x) == CMU_CLOCK_STATE_LRCACT) || \
-				 ((x) == CMU_CLOCK_STATE_ULRCACT) || \
-				 ((x) == CMU_CLOCK_STATE_PLLACT) || \
-				 ((x) == CMU_CLOCK_STATE_HOSCRDY) || \
-				 ((x) == CMU_CLOCK_STATE_LOSCRDY) || \
-				 ((x) == CMU_CLOCK_STATE_HRCRDY) || \
-				 ((x) == CMU_CLOCK_STATE_LRCRDY) || \
-				 ((x) == CMU_CLOCK_STATE_PLLRDY))
-/**
-  * @}
-  */
-
-/** @addtogroup CMU_Public_Functions
-  * @{
-  */
-/** @addtogroup CMU_Public_Functions_Group1
-  * @{
-  */
-/* System clock configure */
-ald_status_t cmu_clock_config_default(void);
-ald_status_t cmu_clock_config(cmu_clock_t clk, uint32_t clock);
-void cmu_pll1_config(cmu_pll1_input_t input, cmu_pll1_output_t output);
-uint32_t cmu_get_clock(void);
-int32_t cmu_auto_calib_clock(cmu_auto_calib_input_t input, cmu_auto_calib_output_t freq);
-/**
-  * @}
-  */
-
-/** @addtogroup CMU_Public_Functions_Group2
-  * @{
-  */
-/* BUS division control */
-void cmu_div_config(cmu_bus_t bus, cmu_div_t div);
-uint32_t cmu_get_hclk1_clock(void);
-uint32_t cmu_get_sys_clock(void);
-uint32_t cmu_get_pclk1_clock(void);
-uint32_t cmu_get_pclk2_clock(void);
-/**
-  * @}
-  */
-
-/** @addtogroup CMU_Public_Functions_Group3
-  * @{
-  */
-/* Clock safe configure */
-void cmu_hosc_safe_config(cmu_hosc_range_t clock, type_func_t status);
-void cmu_losc_safe_config(type_func_t status);
-void cmu_pll_safe_config(type_func_t status);
-flag_status_t cmu_get_clock_state(cmu_clock_state_t sr);
-void cmu_irq_cbk(cmu_security_t se);
-/**
-  * @}
-  */
-
-/** @addtogroup CMU_Public_Functions_Group4
-  * @{
-  */
-/* Clock output configure */
-void cmu_output_high_clock_config(cmu_output_high_sel_t sel,
-		cmu_output_high_div_t div, type_func_t status);
-void cmu_output_low_clock_config(cmu_output_low_sel_t sel, type_func_t status);
-/**
-  * @}
-  */
-
-/** @addtogroup CMU_Public_Functions_Group5
-  * @{
-  */
-/* Peripheral Clock configure */
-void cmu_buzz_config(cmu_buzz_div_t div, uint16_t dat, type_func_t status);
-void cmu_lptim0_clock_select(cmu_lp_perh_clock_sel_t clock);
-void cmu_lpuart0_clock_select(cmu_lp_perh_clock_sel_t clock);
-void cmu_lcd_clock_select(cmu_lcd_clock_sel_t clock);
-void cmu_perh_clock_config(cmu_perh_t perh, type_func_t status);
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_CMU_H__ */

+ 0 - 191
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_crc.h

@@ -1,191 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_crc.h
-  * @brief   Header file of CRC module driver.
-  *
-  * @version V1.0
-  * @date    6 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_CRC_H__
-#define __ALD_CRC_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup CRC
-  * @{
-  */
-
-/** @defgroup CRC_Public_Types CRC Public Types
-  * @{
-  */
-
-/**
-  * @brief CRC mode
-  */
-typedef enum {
-	CRC_MODE_CCITT = 0,	/**< Ccitt */
-	CRC_MODE_8     = 1,	/**< Crc8 */
-	CRC_MODE_16    = 2,	/**< Crc16 */
-	CRC_MODE_32    = 3,	/**< Crc32 */
-} crc_mode_t;
-
-/**
-  * @brief CRC input length
-  */
-typedef enum {
-	CRC_LEN_AUTO    = 0,	/**< Auto */
-	CRC_DATASIZE_8  = 1,	/**< Byte */
-	CRC_DATASIZE_16 = 2,	/**< Half word */
-	CRC_DATASIZE_32 = 3,	/**< Word */
-} crc_datasize_t;
-
-/**
-  * @brief CRC whether write error or no
-  */
-typedef enum {
-	CRC_WERR_NO  = 0,	/**< No error */
-	CRC_WERR_ERR = 1,	/**< Error */
-} crc_werr_t;
-
-/**
-  * @brief CRC state structures definition
-  */
-typedef enum {
-	CRC_STATE_RESET = 0x0,	/**< Peripheral is not initialized */
-	CRC_STATE_READY = 0x1,	/**< Peripheral Initialized and ready for use */
-	CRC_STATE_BUSY  = 0x2,	/**< An internal process is ongoing */
-	CRC_STATE_ERROR = 0x4,	/**< Error */
-} crc_state_t;
-
-/**
-  * @brief CRC init structure definition
-  */
-typedef struct {
-	crc_mode_t mode;	/**< CRC mode */
-	type_func_t data_rev;	/**< CRC data reverse or no */
-	type_func_t data_inv;	/**< CRC data inverse or no */
-	type_func_t chs_rev; 	/**< CRC check sum reverse or no */
-	type_func_t chs_inv; 	/**< CRC check sum inverse or no */
-	uint32_t seed;		/**< CRC seed */
-} crc_init_t;
-
-/**
-  * @brief  CRC Handle Structure definition
-  */
-typedef struct crc_handle_s {
-	CRC_TypeDef *perh;	/**< Register base address */
-	crc_init_t init;  	/**< CRC required parameters */
-	uint8_t *cal_buf; 	/**< The pointer of preparing buffer */
-	uint32_t *cal_res;	/**< The pointer of result */
-#ifdef ALD_DMA
-	dma_handle_t hdma;	/**< CRC DMA handle parameters */
-#endif
-	lock_state_t lock;	/**< Locking object */
-	crc_state_t state;	/**< CRC operation state */
-
-	void (*cal_cplt_cbk)(struct crc_handle_s *arg);	/**< Calculate completed callback */
-	void (*err_cplt_cbk)(struct crc_handle_s *arg);	/**< Calculate error callback */
-} crc_handle_t;
-/**
-  * @}
-  */
-
-/** @defgroup CRC_Public_Macros CRC Public Macros
-  * @{
-  */
-#define CRC_ENABLE(handle)		(SET_BIT((handle)->perh->CR, CRC_CR_EN_MSK))
-#define CRC_DISABLE(handle)		(CLEAR_BIT((handle)->perh->CR, CRC_CR_EN_MSK))
-#define CRC_RESET(handle)		(SET_BIT((handle)->perh->CR, CRC_CR_RST_MSK))
-#define CRC_DMA_ENABLE(handle) 		(SET_BIT((handle)->perh->CR, CRC_CR_DMAEN_MSK))
-#define CRC_DMA_DISABLE(handle) 	(CLEAR_BIT((handle)->perh->CR, CRC_CR_DMAEN_MSK))
-#define CRC_CLEAR_ERROR_FLAG(handle)	(SET_BIT((handle)->perh->CR, CRC_CR_WERR_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup CRC_Private_Macros   CRC Private Macros
-  * @{
-  */
-#define IS_CRC(x) 	((x) == CRC)
-#define IS_CRC_MODE(x) 	(((x) == CRC_MODE_CCITT) || \
-			 ((x) == CRC_MODE_8)     || \
-			 ((x) == CRC_MODE_16)    || \
-			 ((x) == CRC_MODE_32))
-/**
-  * @}
-  */
-
-/** @addtogroup CRC_Public_Functions
-  * @{
-  */
-
-/** @addtogroup CRC_Public_Functions_Group1
-  * @{
-  */
-ald_status_t crc_init(crc_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup CRC_Public_Functions_Group2
-  * @{
-  */
-uint32_t crc_calculate(crc_handle_t *hperh, uint8_t *buf, uint32_t size);
-/**
-  * @}
-  */
-
-#ifdef ALD_DMA
-/** @addtogroup CRC_Public_Functions_Group3
-  * @{
-  */
-ald_status_t crc_calculate_by_dma(crc_handle_t *hperh, uint8_t *buf, uint32_t *res, uint16_t size, uint8_t channel);
-ald_status_t crc_dma_pause(crc_handle_t *hperh);
-ald_status_t crc_dma_resume(crc_handle_t *hperh);
-ald_status_t crc_dma_stop(crc_handle_t *hperh);
-/**
-  * @}
-  */
-#endif
-/** @addtogroup CRC_Public_Functions_Group4
-  * @{
-  */
-crc_state_t crc_get_state(crc_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_CRC_H__ */

+ 0 - 255
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_crypt.h

@@ -1,255 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_crypt.h
-  * @brief   Header file of CRYPT module driver.
-  *
-  * @version V1.0
-  * @date    7 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_CRYPT_H__
-#define __ALD_CRYPT_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup CRYPT
-  * @{
-  */
-
-/** @defgroup CRYPT_Public_Types CRYPT Public Types
-  * @{
-  */
-
-/**
-  * @brief CRYPT encrypt or decrypt select
-  */
-typedef enum {
-	CRYPT_DECRYPT = 0,	/**< Decrypt */
-	CRYPT_ENCRYPT = 1,	/**< Encrypt */
-} crypt_encs_t;
-
-/**
-  * @brief CRYPT mode select
-  */
-typedef enum {
-	CRYPT_MODE_ECB = 0,	/**< ECB */
-	CRYPT_MODE_CBC = 1,	/**< CBC */
-	CRYPT_MODE_CTR = 2,	/**< CTR */
-} crypt_mode_t;
-
-/**
-  * @brief CRYPT data type
-  */
-typedef enum {
-	CRYPT_DATA_CHANGE_NO = 0,	/**< No exchange */
-	CRYPT_DATA_CHANGE_16 = 1,	/**< 16bit exchange */
-	CRYPT_DATA_CHANGE_8  = 2,	/**< 8bit exchange */
-	CRYPT_DATA_CHANGE_1  = 3,	/**< 1bit exchange */
-} crypt_datatype_t;
-
-/**
-  * @brief CRYPT interrupt
-  */
-typedef enum {
-	CRYPT_IT_IT = 0x80,	/**< Interrupt */
-} crypt_it_t;
-
-/**
-  * @brief CRYPT interrupt flag
-  */
-typedef enum {
-	CRYPT_FLAG_AESIF = 0x1,  	/**< Aes flag */
-	CRYPT_FLAG_DONE  = 0x100,	/**< Complete flag */
-} crypt_flag_t;
-
-/**
-  * @brief CRYPT state structures definition
-  */
-typedef enum {
-	CRYPT_STATE_RESET = 0x0,	/**< Peripheral is not initialized */
-	CRYPT_STATE_READY = 0x1,	/**< Peripheral Initialized and ready for use */
-	CRYPT_STATE_BUSY  = 0x2,	/**< An internal process is ongoing */
-	CRYPT_STATE_ERROR = 0x4,	/**< Error */
-} crypt_state_t;
-
-/**
-  * @brief CRYPT data type
-  */
-typedef enum {
-	DATA_32_BIT = 0,	/**< 32 bit data,don't swap */
-	DATA_16_BIT = 1,	/**< 16 bit data,swap */
-	DATA_8_BIT  = 2,	/**< 8 bit data,swap */
-	DATA_1_BIT  = 3,	/**< 1 bit data, swap */
-} crypt_data_t;
-
-/**
-  * @brief CRYPT init structure definition
-  */
-typedef struct {
-	crypt_mode_t mode;    	/**< Crypt mode */
-	crypt_data_t type;    	/**< Data type select */
-} crypt_init_t;
-
-/**
-  * @brief  CRYPT Handle Structure definition
-  */
-typedef struct crypt_handle_s {
-	CRYPT_TypeDef *perh;	/**< Register base address */
-	crypt_init_t init;  	/**< CRYPT required parameters */
-#ifdef ALD_DMA
-	dma_handle_t hdma_m2p;	/**< CRYPT DMA handle parameters memory to crypt module */
-	dma_handle_t hdma_p2m;	/**< CRYPT DMA handle parameters crypt module to memory */
-#endif
-	uint8_t *plain_text; 	/**< Pointer to plain text */
-	uint8_t *cipher_text;	/**< Pointer to cipher text */
-	uint32_t size;       	/**< The size of crypt data buf */
-	uint32_t count;      	/**< The count of crypt data buf */
-	uint32_t step;       	/**< The step of once crypt 4(aes) */
-	uint32_t dir;        	/**< ENCRYPT or DECRYPT */
-	uint32_t iv[4];     	/**< The iv of crypt */
-	uint32_t key[4];     	/**< The key of crypt */
-	lock_state_t lock;   	/**< Locking object */
-	crypt_state_t state; 	/**< CRYPT operation state */
-
-	void (*crypt_cplt_cbk)(struct crypt_handle_s *arg);	/**< Crypt completed callback */
-	void (*err_cplt_cbk)(struct crypt_handle_s *arg);  	/**< Crypt error callback */
-} crypt_handle_t;
-/**
-  * @}
-  */
-
-/** @defgroup CRYPT_Public_Macros CRYPT Public Macros
-  * @{
-  */
-#define CRYPT_GO(handle) 		(SET_BIT((handle)->perh->CON, CRYPT_CON_GO_MSK))
-#define CRYPT_FIFOEN_ENABLE(handle) 	(SET_BIT((handle)->perh->CON, CRYPT_CON_FIFOEN_MSK))
-#define CRYPT_FIFOEN_DISABLE(handle) 	(CLEAR_BIT(handle)->perh->CON, CRYPT_CON_FIFOEN_MSK))
-#define CRYPT_IVEN_ENABLE(handle) 	(SET_BIT((handle)->perh->CON, CRYPT_CON_IVEN_MSK))
-#define CRYPT_IVEN_DISABLE(handle) 	(CLEAR_BIT((handle)->perh->CON, CRYPT_CON_IVEN_MSK))
-#define CRYPT_IE_ENABLE(handle)		(SET_BIT((handle)->perh->CON, CRYPT_CON_IE_MSK))
-#define CRYPT_IE_DISABLE(handle)	(CLEAR_BIT((handle)->perh->CON, CRYPT_CON_IE_MSK))
-#define CRYPT_DMA_ENABLE(handle)	(SET_BIT((handle)->perh->CON, CRYPT_CON_DMAEN_MSK))
-#define CRYPT_DMA_DISABLE(handle)	(CLEAR_BIT((handle)->perh->CON, CRYPT_CON_DMAEN_MSK))
-#define CRYPT_SETDIR(handle, dir)	do {(handle)->perh->CON &= ~(0x1 << CRYPT_CON_ENCS_POS);	\
-					   (handle)->perh->CON |= (dir << CRYPT_CON_ENCS_POS);} while (0)
-#define CRYPT_WRITE_FIFO(handle, data)  ((handle)->perh->FIFO = (data))
-#define CRYPT_READ_FIFO(handle)		((handle)->perh->FIFO)
-/**
-  * @}
-  */
-
-/** @defgroup CRYPT_Private_Macros   CRYPT Private Macros
-  * @{
-  */
-#define IS_CRYPT(x)		((x) == CRYPT)
-#define IS_CRYPT_MODE(x) 	(((x) == CRYPT_MODE_ECB) ||   \
-				 ((x) == CRYPT_MODE_CBC) ||   \
-				 ((x) == CRYPT_MODE_CTR))
-#define IS_CRYPT_IT(x)		((x) == CRYPT_IT_IT)
-#define IS_CRYPT_FLAG(x) 	(((x) == CRYPT_FLAG_AESIF) || \
-				 ((x) == CRYPT_FLAG_DONE))
-#define IS_CRYPT_IV_LEN(x)	(((x) == IV_2_LEN) || \
-				 ((x) == IV_4_LEN))
-/**
-  * @}
-  */
-
-/** @addtogroup CRYPT_Public_Functions
-  * @{
-  */
-
-/** @addtogroup CRYPT_Public_Functions_Group1
-  * @{
-  */
-ald_status_t crypt_init(crypt_handle_t *hperh);
-ald_status_t crypt_write_key(crypt_handle_t *hperh, uint32_t *key);
-ald_status_t crypt_read_key(crypt_handle_t *hperh, uint32_t *key);
-ald_status_t crypt_write_ivr(crypt_handle_t *hperh, uint32_t *iv);
-ald_status_t crypt_read_ivr(crypt_handle_t *hperh, uint32_t *iv);
-/**
-  * @}
-  */
-
-/** @addtogroup CRYPT_Public_Functions_Group2
-  * @{
-  */
-ald_status_t crypt_encrypt(crypt_handle_t *hperh, uint8_t *plain_text, uint8_t *cipher_text, uint32_t size);
-ald_status_t crypt_decrypt(crypt_handle_t *hperh, uint8_t *cipher_text, uint8_t *plain_text, uint32_t size);
-ald_status_t crypt_gcm_verify(crypt_handle_t *hperh, uint8_t *cipher_text, uint32_t size, uint8_t *aadata, uint32_t alen, uint8_t *tag);
-ald_status_t crypt_encrypt_by_it(crypt_handle_t *hperh, uint8_t *plain_text, uint8_t *cipher_text, uint32_t size);
-ald_status_t crypt_decrypt_by_it(crypt_handle_t *hperh, uint8_t *cipher_text, uint8_t *plain_text, uint32_t size);
-#ifdef ALD_DMA
-ald_status_t crypt_encrypt_by_dma(crypt_handle_t *hperh, uint8_t *plain_text,
-             uint8_t *cipher_text, uint32_t size, uint8_t channel_m2p, uint8_t channel_p2m);
-ald_status_t crypt_decrypt_by_dma(crypt_handle_t *hperh, uint8_t *cipher_text,
-               uint8_t *plain_text, uint32_t size, uint8_t channel_m2p, uint8_t channel_p2m);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup CRYPT_Public_Functions_Group3
-  * @{
-  */
-#ifdef ALD_DMA
-ald_status_t crypt_dma_pause(crypt_handle_t *hperh);
-ald_status_t crypt_dma_resume(crypt_handle_t *hperh);
-ald_status_t crypt_dma_stop(crypt_handle_t *hperh);
-#endif
-void crypt_irq_handle(crypt_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup CRYPT_Public_Functions_Group4
-  * @{
-  */
-void crypt_interrupt_config(crypt_handle_t *hperh, crypt_it_t it, type_func_t state);
-flag_status_t crypt_get_flag_status(crypt_handle_t *hperh, crypt_flag_t flag);
-void crypt_clear_flag_status(crypt_handle_t *hperh, crypt_flag_t flag);
-it_status_t crypt_get_it_status(crypt_handle_t *hperh, crypt_it_t it);
-/**
-  * @}
-  */
-
-/** @addtogroup CRYPT_Public_Functions_Group5
-  * @{
-  */
-crypt_state_t crypt_get_state(crypt_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 156
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_dbgc.h

@@ -1,156 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_dbgc.h
-  * @brief   DEBUGCON module driver.
-  *
-  * @version V1.0
-  * @date    04 Jun 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_DBGC_H__
-#define __ALD_DBGC_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup DBGC DBGC
-  * @brief DBGC module driver
-  * @{
-  */
-
-
-
-/** @defgroup DBGC_Public_Types DBGC Public Types
-  * @{
-  */
-/**
-  * @brief Debug mode select
-  */
-typedef enum {
-	DEBC_MODE_SLEEP   = (1u << 0),	/**< Sleep mode */
-	DEBC_MODE_STOP1   = (1u << 1),	/**< STOP1 mode */
-	DEBC_MODE_STOP2   = (1u << 2),	/**< STOP2 mode */
-	DEBC_MODE_STANDBY = (1u << 3),	/**< Standby mode */
-} dbgc_mode_t;
-
-/**
-  * @brief Debug peripheral select
-  */
-typedef enum {
-	DEBC_PERH_TIMER0  = (1u << 0),			/**< AD16C4T0 */
-	DEBC_PERH_TIMER1  = (1u << 1),			/**< BS16T0 */
-	DEBC_PERH_TIMER2  = (1u << 2),			/**< GP16C2T0 */
-	DEBC_PERH_TIMER3  = (1u << 3),			/**< GP16C2T1 */
-	DEBC_PERH_TIMER4  = (1u << 4),			/**< BS16T1 */
-	DEBC_PERH_TIMER5  = (1u << 5),			/**< BS16T2 */
-	DEBC_PERH_TIMER6  = (1u << 6),			/**< GP16C4T0 */
-	DEBC_PERH_TIMER7  = (1u << 7),			/**< BS16T3 */
-	DEBC_PERH_I2C0    = (1u << 8),			/**< I2C0 SMBUS */
-	DEBC_PERH_I2C1    = (1u << 9),			/**< I2C1 SMBUS */
-	DEBC_PERH_CAN     = (1u << 12),			/**< CAN */
-	DEBC_PERH_LPTIM0  = (1u << 0)  | (1u << 16),	/**< LPTIM0 */
-	DEBC_PERH_IWDT    = (1u << 8)  | (1u << 16),	/**< IWDT */
-	DEBC_PERH_WWDT    = (1u << 9)  | (1u << 16),	/**< WWDT */
-	DEBC_PERH_RTC     = (1u << 10) | (1u << 16),	/**< RTC */
-} dbgc_perh_t;
-/**
-  * @}
-  */
-
-/** @defgroup DBGC_Public_Functions DBGC Public Functions
-  * @{
-  */
-/**
-  * @brief  Gets version.
-  * @retval Version
-  */
-__INLINE uint32_t dbgc_get_rev_id(void)
-{
-	return (DBGC->IDCODE >> 16);
-}
-
-/**
-  * @brief  Gets core id.
-  * @retval Core id
-  */
-__INLINE uint32_t dbgc_get_core_id(void)
-{
-	return (DBGC->IDCODE >> 12) & 0xF;
-}
-
-/**
-  * @brief  Gets device id
-  * @retval device id
-  */
-__INLINE uint32_t dbgc_get_device_id(void)
-{
-	return DBGC->IDCODE & 0xFFF;
-}
-
-/**
-  * @brief  Configures low power debug mode
-  * @param  mode: The mode of low power.
-  * @param  state: ENABLE/DISABLE
-  * @retval None
-  */
-__INLINE void dbgc_mode_config(dbgc_mode_t mode, type_func_t state)
-{
-	if (state)
-		SET_BIT(DBGC->CR, mode);
-	else
-		CLEAR_BIT(DBGC->CR, mode);
-}
-
-/**
-  * @brief  Configures peripheral debug mode
-  * @param  perh: The peripheral.
-  * @param  state: ENABLE/DISABLE
-  * @retval None
-  */
-__INLINE void dbgc_perh_config(dbgc_perh_t perh, type_func_t state)
-{
-	if ((perh >> 16) & 0x1) {
-		if (state)
-			SET_BIT(DBGC->APB2FZ, perh);
-		else
-			CLEAR_BIT(DBGC->APB2FZ, perh);
-	}
-	else {
-		if (state)
-			SET_BIT(DBGC->APB1FZ, perh);
-		else
-			CLEAR_BIT(DBGC->APB1FZ, perh);
-	}
-}
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 377
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_dma.h

@@ -1,377 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_dma.h
-  * @brief   DMA module Library.
-  *
-  * @version V1.0
-  * @date    09 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_DMA_H__
-#define __ALD_DMA_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup DMA
-  * @{
-  */
-
-/**
-  * @defgroup DMA_Public_Macros DMA Public Macros
-  * @{
-  */
-#define DMA_CH_COUNT	6
-#define DMA_ERR		31
-/**
-  * @}
-  */
-
-/**
-  * @defgroup DMA_Public_Types DMA Public Types
-  * @{
-  */
-
-/**
-  * @brief Input source to DMA channel
-  */
-typedef enum {
-	DMA_MSEL_NONE    = 0x0,		/**< NONE */
-	DMA_MSEL_GPIO    = 0x1,		/**< GPIO */
-	DMA_MSEL_CRYPT   = 0x2,		/**< CRYPT */
-	DMA_MSEL_ACMP    = 0x3,		/**< ACMP */
-	DMA_MSEL_DAC0    = 0x4,		/**< DAC0 */
-	DMA_MSEL_ADC0    = 0x6,		/**< ADC0 */
-	DMA_MSEL_CRC     = 0x7,		/**< CRC */
-	DMA_MSEL_UART0   = 0x8,		/**< UART0 */
-	DMA_MSEL_UART1   = 0x9,		/**< UART1 */
-	DMA_MSEL_UART2   = 0xA,		/**< UART2 */
-	DMA_MSEL_UART3   = 0xB,		/**< UART3 */
-	DMA_MSEL_USART0  = 0xC,		/**< USART0 */
-	DMA_MSEL_USART1  = 0xD,		/**< USART1 */
-	DMA_MSEL_SPI0    = 0xE,		/**< SPI0 */
-	DMA_MSEL_SPI1    = 0xF,		/**< SPI1 */
-	DMA_MSEL_I2C0    = 0x10,	/**< I2C0 */
-	DMA_MSEL_I2C1    = 0x11,	/**< I2C1 */
-	DMA_MSEL_TIMER0  = 0x12,	/**< TIMER0 */
-	DMA_MSEL_TIMER1  = 0x13,	/**< TIMER1 */
-	DMA_MSEL_TIMER2  = 0x14,	/**< TIMER2 */
-	DMA_MSEL_TIMER3  = 0x15,	/**< TIMER3 */
-	DMA_MSEL_RTC     = 0x16,	/**< RTC */
-	DMA_MSEL_LPTIM0  = 0x17,	/**< LPTIM0 */
-	DMA_MSEL_LPUART0 = 0x18,	/**< LPUART0 */
-	DMA_MSEL_DMA     = 0x19,	/**< DMA */
-	DMA_MSEL_SPI2    = 0x1A,	/**< SPI2 */
-	DMA_MSEL_TIMER4  = 0x1B,	/**< TIMER4 */
-	DMA_MSEL_TIMER5  = 0x1C,	/**< TIMER5 */
-	DMA_MSEL_TIMER6  = 0x1D,	/**< TIMER6 */
-	DMA_MSEL_TIMER7  = 0x1E,	/**< TIMER7 */
-	DMA_MSEL_ADC1    = 0x1F,	/**< ADC1 */
-	DMA_MSEL_PIS     = 0x20,	/**< PIS */
-	DMA_MSEL_TRNG    = 0x21,	/**< TRNG */
-} dma_msel_t;
-
-/**
-  * @brief Input signal to DMA channel
-  */
-typedef enum {
-	DMA_MSIGSEL_NONE           = 0x0,	/**< NONE */
-	DMA_MSIGSEL_EXTI_0         = 0x0,	/**< External interrupt 0 */
-	DMA_MSIGSEL_EXTI_1         = 0x1,	/**< External interrupt 1 */
-	DMA_MSIGSEL_EXTI_2         = 0x2,	/**< External interrupt 2 */
-	DMA_MSIGSEL_EXTI_3         = 0x3,	/**< External interrupt 3 */
-	DMA_MSIGSEL_EXTI_4         = 0x4,	/**< External interrupt 4 */
-	DMA_MSIGSEL_EXTI_5         = 0x5,	/**< External interrupt 5 */
-	DMA_MSIGSEL_EXTI_6         = 0x6,	/**< External interrupt 6 */
-	DMA_MSIGSEL_EXTI_7         = 0x7,	/**< External interrupt 7 */
-	DMA_MSIGSEL_EXTI_8         = 0x8,	/**< External interrupt 8 */
-	DMA_MSIGSEL_EXTI_9         = 0x9,	/**< External interrupt 9 */
-	DMA_MSIGSEL_EXTI_10        = 0xA,	/**< External interrupt 10 */
-	DMA_MSIGSEL_EXTI_11        = 0xB,	/**< External interrupt 11 */
-	DMA_MSIGSEL_EXTI_12        = 0xC,	/**< External interrupt 12 */
-	DMA_MSIGSEL_EXTI_13        = 0xD,	/**< External interrupt 13 */
-	DMA_MSIGSEL_EXTI_14        = 0xE,	/**< External interrupt 14 */
-	DMA_MSIGSEL_EXTI_15        = 0xF,	/**< External interrupt 15 */
-	DMA_MSIGSEL_CRYPT_WRITE    = 0x0,	/**< CRYPT write mode */
-	DMA_MSIGSEL_CRYPT_READ     = 0x1,	/**< CRYPT read mode */
-	DMA_MSIGSEL_CALC_WRITE     = 0x0,	/**< CALC write mode */
-	DMA_MSIGSEL_CALC_READ      = 0x1,	/**< CALC read mode */
-	DMA_MSIGSEL_DAC0_CH0       = 0x0,	/**< DAC0 channel 0 complete */
-	DMA_MSIGSEL_DAC0_CH1       = 0x1,	/**< DAC0 channel 1 complete */
-	DMA_MSIGSEL_ADC       	   = 0x0,	/**< ADC mode */
-	DMA_MSIGSEL_UART_TXEMPTY   = 0x0,	/**< UART transmit */
-	DMA_MSIGSEL_UART_RNR       = 0x1,	/**< UART receive */
-	DMA_MSIGSEL_USART_RNR      = 0x0,	/**< USART reveive */
-	DMA_MSIGSEL_USART_TXEMPTY  = 0x1,	/**< USART transmit */
-	DMA_MSIGSEL_SPI_RNR        = 0x0,	/**< SPI receive */
-	DMA_MSIGSEL_SPI_TXEMPTY    = 0x1,	/**< SPI transmit */
-	DMA_MSIGSEL_I2C_RNR        = 0x0,	/**< I2C receive */
-	DMA_MSIGSEL_I2C_TXEMPTY    = 0x1,	/**< I2C transmit */
-	DMA_MSIGSEL_TIMER_CH1      = 0x0,	/**< TIM channal 1 */
-	DMA_MSIGSEL_TIMER_CH2      = 0x1,	/**< TIM channal 2 */
-	DMA_MSIGSEL_TIMER_CH3      = 0x2,	/**< TIM channal 3 */
-	DMA_MSIGSEL_TIMER_CH4      = 0x3,	/**< TIM channal 4 */
-	DMA_MSIGSEL_TIMER_TRI      = 0x4,	/**< TIM trigger */
-	DMA_MSIGSEL_TIMER_COMP     = 0x5,	/**< TIM compare */
-	DMA_MSIGSEL_TIMER_UPDATE   = 0x6,	/**< TIM update */
-	DMA_MSIGSEL_LPUART_RNR     = 0x0,	/**< LPUART receive */
-	DMA_MSIGSEL_LPUART_TXEMPTY = 0x1,	/**< LPUART transmit */
-	DMA_MSIGSEL_PIS_CH0        = 0x0,	/**< PIS channal 0 */
-	DMA_MSIGSEL_PIS_CH1        = 0x1,	/**< PIS channal 1 */
-	DMA_MSIGSEL_PIS_CH2        = 0x2,	/**< PIS channal 2 */
-	DMA_MSIGSEL_PIS_CH3        = 0x3,	/**< PIS channal 3 */
-	DMA_MSIGSEL_PIS_CH4        = 0x4,	/**< PIS channal 4 */
-	DMA_MSIGSEL_PIS_CH5        = 0x5,	/**< PIS channal 5 */
-	DMA_MSIGSEL_PIS_CH6        = 0x6,	/**< PIS channal 6 */
-	DMA_MSIGSEL_PIS_CH7        = 0x7,	/**< PIS channal 7 */
-	DMA_MSIGSEL_PIS_CH8        = 0x8,	/**< PIS channal 8 */
-	DMA_MSIGSEL_PIS_CH9        = 0x9,	/**< PIS channal 9 */
-	DMA_MSIGSEL_PIS_CH10       = 0xA,	/**< PIS channal 10 */
-	DMA_MSIGSEL_PIS_CH11       = 0xB,	/**< PIS channal 11 */
-	DMA_MSIGSEL_PIS_CH12       = 0xC,	/**< PIS channal 12 */
-	DMA_MSIGSEL_PIS_CH13       = 0xD,	/**< PIS channal 13 */
-	DMA_MSIGSEL_PIS_CH14       = 0xE,	/**< PIS channal 14 */
-	DMA_MSIGSEL_PIS_CH15       = 0xF,	/**< PIS channal 15 */
-} dma_msigsel_t;
-
-/**
-  * @brief DMA Descriptor control type
-  */
-typedef union {
-	struct {
-		uint32_t cycle_ctrl    :3;	/**< DMA operating mode @ref dma_cycle_ctrl_t */
-		uint32_t next_useburst :1;	/**< Uses the alternate data structure when complete a DMA cycle */
-		uint32_t n_minus_1     :10;	/**< Represent the total number of DMA transfers that DMA cycle contains. */
-		uint32_t R_power       :4;	/**< Control how many DMA transfers can occur before re-arbitrates. @ref dma_arbiter_config_t */
-		uint32_t src_prot_ctrl :3;	/**< Control the state of HPROT when reads the source data. */
-		uint32_t dst_prot_ctrl :3;	/**< Control the state of HPROT when writes the destination data */
-		uint32_t src_size      :2;	/**< Source data size @ref dma_data_size_t */
-		uint32_t src_inc       :2;	/**< Control the source address increment. @ref dma_data_inc_t */
-		uint32_t dst_size      :2;	/**< Destination data size. @ref dma_data_size_t */
-		uint32_t dst_inc       :2;	/**< Destination address increment. @ref dma_data_inc_t */
-	};
-	uint32_t word;
-} dma_ctrl_t;
-
-/**
-  * @brief Channel control data structure
-  */
-typedef struct {
-	void *src;		/**< Source data end pointer */
-	void *dst;		/**< Destination data end pointer */
-	dma_ctrl_t ctrl;	/**< Control data configuration @ref dma_ctrl_t */
-	uint32_t use;		/**< Reserve for user */
-} dma_descriptor_t;
-
-/**
-  * @brief data increment
-  */
-typedef enum {
-	DMA_DATA_INC_BYTE     = 0x0,	/**< Address increment by byte */
-	DMA_DATA_INC_HALFWORD = 0x1,	/**< Address increment by halfword */
-	DMA_DATA_INC_WORD     = 0x2,	/**< Address increment by word */
-	DMA_DATA_INC_NONE     = 0x3,	/**< No increment */
-} dma_data_inc_t;
-
-/**
-  * @brief Data size
-  */
-typedef enum {
-	DMA_DATA_SIZE_BYTE     = 0x0,	/**< Byte */
-	DMA_DATA_SIZE_HALFWORD = 0x1,	/**< Halfword */
-	DMA_DATA_SIZE_WORD     = 0x2,	/**< Word */
-} dma_data_size_t;
-
-/**
-  * @brief The operating mode of the DMA cycle
-  */
-typedef enum {
-	DMA_CYCLE_CTRL_NONE               = 0x0,	/**< Stop */
-	DMA_CYCLE_CTRL_BASIC              = 0x1,	/**< Basic */
-	DMA_CYCLE_CTRL_AUTO               = 0x2,	/**< Auto-request */
-	DMA_CYCLE_CTRL_PINGPONG           = 0x3,	/**< Ping-pong */
-	DMA_CYCLE_CTRL_MEM_SCATTER_GATHER = 0x4,	/**< Memory scatter/gather */
-	DMA_CYCLE_CTRL_PER_SCATTER_GATHER = 0x6,	/**< Peripheral scatter/gather */
-} dma_cycle_ctrl_t;
-
-/**
-  * @brief Control how many DMA transfers can occur
-  *        before the controller re-arbitrates
-  */
-typedef enum {
-	DMA_R_POWER_1    = 0x0,		/**< Arbitrates after each DMA transfer */
-	DMA_R_POWER_2    = 0x1,		/**< Arbitrates after 2 DMA transfer */
-	DMA_R_POWER_4    = 0x2,		/**< Arbitrates after 4 DMA transfer */
-	DMA_R_POWER_8    = 0x3,		/**< Arbitrates after 8 DMA transfer */
-	DMA_R_POWER_16   = 0x4,		/**< Arbitrates after 16 DMA transfer */
-	DMA_R_POWER_32   = 0x5,		/**< Arbitrates after 32 DMA transfer */
-	DMA_R_POWER_64   = 0x6,		/**< Arbitrates after 64 DMA transfer */
-	DMA_R_POWER_128  = 0x7,		/**< Arbitrates after 128 DMA transfer */
-	DMA_R_POWER_256  = 0x8,		/**< Arbitrates after 256 DMA transfer */
-	DMA_R_POWER_512  = 0x9,		/**< Arbitrates after 512 DMA transfer */
-	DMA_R_POWER_1024 = 0xA,		/**< Arbitrates after 1024 DMA transfer */
-} dma_arbiter_config_t;
-
-/**
-  * @brief Callback function pointer and param
-  */
-typedef struct {
-	void (*cplt_cbk)(void *arg);	/**< DMA transfers complete callback */
-	void (*err_cbk)(void* arg);	/**< DMA occurs error callback */
-	void *cplt_arg;			/**< The parameter of cplt_cbk() */
-	void *err_arg;			/**< The parameter of err_cbk() */
-} dma_call_back_t;
-
-/**
-  * @brief DMA channal configure structure
-  */
-typedef struct {
-	void *src;			/**< Source data begin pointer */
-	void *dst;			/**< Destination data begin pointer */
-	uint16_t size;			/**< The total number of DMA transfers that DMA cycle contains */
-	dma_data_size_t data_width;	/**< Data width, @ref dma_data_size_t */
-	dma_data_inc_t src_inc;		/**< Source increment type. @ref dma_data_inc_t */
-	dma_data_inc_t dst_inc;		/**< Destination increment type. @ref dma_data_inc_t */
-	dma_arbiter_config_t R_power;	/**< Control how many DMA transfers can occur before re-arbitrates. @ref dma_arbiter_config_t */
-	type_func_t primary;		/**< Use primary descriptor or alternate descriptor */
-	type_func_t burst;		/**< Uses the alternate data structure when complete a DMA cycle */
-	type_func_t high_prio;		/**< High priority or default priority */
-	type_func_t iterrupt;		/**< Enable/disable interrupt */
-	dma_msel_t msel;		/**< Input source to DMA channel @ref dma_msel_t */
-	dma_msigsel_t msigsel;		/**< Input signal to DMA channel @ref dma_msigsel_t */
-	uint8_t channel;		/**< Channel index */
-} dma_config_t;
-
-/**
-  * @brief DMA handle structure definition
-  */
-typedef struct {
-	DMA_TypeDef *perh;		/**< DMA registers base address */
-	dma_config_t config;		/**< Channel configure structure. @ref dma_config_t */
-	void (*cplt_cbk)(void *arg);	/**< DMA transfers complete callback */
-	void (*err_cbk)(void *arg);	/**< DMA bus occurs error callback */
-	void *cplt_arg;			/**< The parameter of cplt_cbk() */
-	void *err_arg;			/**< The parameter of err_cbk() */
-} dma_handle_t;
-/**
-  * @}
-  */
-
-/**
-  * @defgroup DMA_Private_Macros DMA Private Macros
-  * @{
-  */
-#define IS_DMA_MSEL_TYPE(x)	((x) <= DMA_MSEL_TRNG)
-#define IS_DMA_MSIGSEL_TYPE(x)	((x) <= 0xF)
-#define IS_DMA_DATAINC_TYPE(x)  (((x) == DMA_DATA_INC_BYTE)     || \
-                                 ((x) == DMA_DATA_INC_HALFWORD) || \
-                                 ((x) == DMA_DATA_INC_WORD)     || \
-                                 ((x) == DMA_DATA_INC_NONE))
-#define IS_DMA_DATASIZE_TYPE(x)  (((x) == DMA_DATA_SIZE_BYTE)     || \
-                                  ((x) == DMA_DATA_SIZE_HALFWORD) || \
-                                  ((x) == DMA_DATA_SIZE_WORD))
-#define IS_CYCLECTRL_TYPE(x)  (((x) == DMA_CYCLE_CTRL_NONE)               || \
-                               ((x) == DMA_CYCLE_CTRL_BASIC)              || \
-                               ((x) == DMA_CYCLE_CTRL_AUTO)               || \
-                               ((x) == DMA_CYCLE_CTRL_PINGPONG)           || \
-                               ((x) == DMA_CYCLE_CTRL_MEM_SCATTER_GATHER) || \
-                               ((x) == DMA_CYCLE_CTRL_PER_SCATTER_GATHER))
-#define IS_DMA_ARBITERCONFIG_TYPE(x)  (((x) == DMA_R_POWER_1)   || \
-                                       ((x) == DMA_R_POWER_2)   || \
-                                       ((x) == DMA_R_POWER_4)   || \
-                                       ((x) == DMA_R_POWER_8)   || \
-                                       ((x) == DMA_R_POWER_16)  || \
-                                       ((x) == DMA_R_POWER_32)  || \
-                                       ((x) == DMA_R_POWER_64)  || \
-                                       ((x) == DMA_R_POWER_128) || \
-                                       ((x) == DMA_R_POWER_256) || \
-                                       ((x) == DMA_R_POWER_512) || \
-                                       ((x) == DMA_R_POWER_1024))
-#define IS_DMA(x)		((x) == DMA0)
-#define IS_DMA_CHANNEL(x)	((x) <= 5)
-#define IS_DMA_DATA_SIZE(x)	((x) <= 1024)
-#define IS_DMA_IT_TYPE(x)	(((x) <= 5) || ((x) == 31))
-/**
-  * @}
-  */
-
-/**
-  * @addtogroup DMA_Public_Functions
-  * @{
-  */
-
-/** @addtogroup DMA_Public_Functions_Group1
-  * @{
-  */
-/* Initialization functions */
-extern void dma_reset(DMA_TypeDef *DMAx);
-extern void dma_init(DMA_TypeDef *DMAx);
-extern void dma_config_struct(dma_config_t *p);
-/**
-  * @}
-  */
-
-
-/** @addtogroup DMA_Public_Functions_Group2
-  * @{
-  */
-/* Configure DMA channel functions */
-extern void dma_config_auto(dma_handle_t *hperh);
-extern void dma_restart_auto(dma_handle_t *hperh, void *src, void *dst, uint16_t size);
-extern void dma_config_auto_easy(DMA_TypeDef *DMAx, void *src, void *dst,
-                                        uint16_t size, uint8_t channel, void (*cbk)(void *arg));
-extern void dma_config_basic(dma_handle_t *hperh);
-extern void dma_restart_basic(dma_handle_t *hperh, void *src, void *dst, uint16_t size);
-extern void dma_config_basic_easy(DMA_TypeDef *DMAx, void *src, void *dst, uint16_t size, dma_msel_t msel,
-                                 dma_msigsel_t msigsel, uint8_t channel, void (*cbk)(void *arg));
-/**
-  * @}
-  */
-
-/** @addtogroup DMA_Public_Functions_Group3
-  * @{
-  */
-/* DMA control functions */
-extern void dma_channel_config(DMA_TypeDef *DMAx, uint8_t channel, type_func_t state);
-extern void dma_interrupt_config(DMA_TypeDef *DMAx, uint8_t channel, type_func_t state);
-extern it_status_t dma_get_it_status(DMA_TypeDef *DMAx, uint8_t channel);
-extern flag_status_t dma_get_flag_status(DMA_TypeDef *DMAx, uint8_t channel);
-extern void dma_clear_flag_status(DMA_TypeDef *DMAx, uint8_t channel);
-void dma0_irq_cbk(void);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif	/*__ALD_DMA_H__ */

+ 0 - 277
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_gpio.h

@@ -1,277 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_gpio.h
-  * @brief   Header file of GPIO module driver
-  *
-  * @version V1.0
-  * @date    07 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_GPIO_H__
-#define __ALD_GPIO_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup GPIO
-  * @{
-  */
-
-/**
-  * @defgroup GPIO_Public_Macros GPIO Public Macros
-  * @{
-  */
-#define GPIO_PIN_0	(1U << 0)
-#define GPIO_PIN_1	(1U << 1)
-#define GPIO_PIN_2	(1U << 2)
-#define GPIO_PIN_3	(1U << 3)
-#define GPIO_PIN_4	(1U << 4)
-#define GPIO_PIN_5	(1U << 5)
-#define GPIO_PIN_6	(1U << 6)
-#define GPIO_PIN_7	(1U << 7)
-#define GPIO_PIN_8	(1U << 8)
-#define GPIO_PIN_9	(1U << 9)
-#define GPIO_PIN_10	(1U << 10)
-#define GPIO_PIN_11	(1U << 11)
-#define GPIO_PIN_12	(1U << 12)
-#define GPIO_PIN_13	(1U << 13)
-#define GPIO_PIN_14	(1U << 14)
-#define GPIO_PIN_15	(1U << 15)
-#define GPIO_PIN_ALL	(0xFFFF)
-/**
-  * @}
-  */
-
-/**
-  * @defgroup GPIO_Public_Types GPIO Public Types
-  * @{
-  */
-
-/**
-  * @brief GPIO mode
-  */
-typedef enum {
-	GPIO_MODE_CLOSE  = 0x0,	/**< Digital close  Analog open */
-	GPIO_MODE_INPUT  = 0x1,	/**< Input */
-	GPIO_MODE_OUTPUT = 0x2,	/**< Output */
-} gpio_mode_t;
-
-/**
-  * @brief GPIO open-drain or push-pull
-  */
-typedef enum {
-	GPIO_PUSH_PULL   = 0x0,	/**< Push-Pull */
-	GPIO_OPEN_DRAIN  = 0x2,	/**< Open-Drain */
-	GPIO_OPEN_SOURCE = 0x3,	/**< Open-Source */
-} gpio_odos_t;
-
-/**
-  * @brief GPIO push-up or push-down
-  */
-typedef enum {
-	GPIO_FLOATING     = 0x0,/**< Floating */
-	GPIO_PUSH_UP      = 0x1,/**< Push-Up */
-	GPIO_PUSH_DOWN    = 0x2,/**< Push-Down */
-	GPIO_PUSH_UP_DOWN = 0x3,/**< Push-Up and Push-Down */
-} gpio_push_t;
-
-/**
-  * @brief GPIO output drive
-  */
-typedef enum {
-	GPIO_OUT_DRIVE_NORMAL = 0x0,	/**< Normal current flow */
-	GPIO_OUT_DRIVE_STRONG = 0x1,	/**< Strong current flow */
-} gpio_out_drive_t;
-
-/**
-  * @brief GPIO filter
-  */
-typedef enum {
-	GPIO_FILTER_DISABLE = 0x0,	/**< Disable filter */
-	GPIO_FILTER_ENABLE  = 0x1,	/**< Enable filter */
-} gpio_filter_t;
-
-/**
-  * @brief GPIO type
-  */
-typedef enum {
-	GPIO_TYPE_CMOS = 0x0,	/**< CMOS Type */
-	GPIO_TYPE_TTL  = 0x1,	/**< TTL Type */
-} gpio_type_t;
-
-/**
-  * @brief GPIO functions
-  */
-typedef enum {
-	GPIO_FUNC_0 = 0,	/**< function #0 */
-	GPIO_FUNC_1 = 1,	/**< function #1 */
-	GPIO_FUNC_2 = 2,	/**< function #2 */
-	GPIO_FUNC_3 = 3,	/**< function #3 */
-	GPIO_FUNC_4 = 4,	/**< function #4 */
-	GPIO_FUNC_5 = 5,	/**< function #5 */
-	GPIO_FUNC_6 = 6,	/**< function #6 */
-	GPIO_FUNC_7 = 7,	/**< function #7 */
-} gpio_func_t;
-
-
-/**
-  * @brief GPIO Init Structure definition
-  */
-typedef struct {
-	gpio_mode_t mode;	/**< Specifies the operating mode for the selected pins.
-				     This parameter can be any value of @ref gpio_mode_t */
-	gpio_odos_t odos;	/**< Specifies the Open-Drain or Push-Pull for the selected pins.
-				     This parameter can be a value of @ref gpio_odos_t */
-	gpio_push_t pupd;	/**< Specifies the Pull-up or Pull-Down for the selected pins.
-				     This parameter can be a value of @ref gpio_push_t */
-	gpio_out_drive_t odrv;	/**< Specifies the output driver for the selected pins.
-				     This parameter can be a value of @ref gpio_out_drive_t */
-	gpio_filter_t flt;	/**< Specifies the input filter for the selected pins.
-				     This parameter can be a value of @ref gpio_filter_t */
-	gpio_type_t type;	/**< Specifies the type for the selected pins.
-				     This parameter can be a value of @ref gpio_type_t */
-	gpio_func_t func;	/**< Specifies the function for the selected pins.
-				     This parameter can be a value of @ref gpio_func_t */
-} gpio_init_t;
-
-/**
-  * @brief EXTI trigger style
-  */
-typedef enum {
-	EXTI_TRIGGER_RISING_EDGE   = 0,	/**< Rising edge trigger */
-	EXTI_TRIGGER_TRAILING_EDGE = 1,	/**< Trailing edge trigger */
-	EXTI_TRIGGER_BOTH_EDGE     = 2,	/**< Rising and trailing edge trigger */
-} exti_trigger_style_t;
-
-/**
-  * @brief EXTI filter clock select
-  */
-typedef enum {
-	EXTI_FILTER_CLOCK_10K = 0,	/**< cks = 10KHz */
-	EXTI_FILTER_CLOCK_32K = 1,	/**< cks = 32KHz */
-} exti_filter_clock_t;
-
-/**
-  * @brief EXTI Init Structure definition
-  */
-typedef struct {
-	type_func_t filter;		/**< Enable filter. */
-	exti_filter_clock_t cks;	/**< Filter clock select. */
-	uint8_t filter_time;		/**< Filter duration */
-} exti_init_t;
-/**
-  * @}
-  */
-
-/**
-  * @defgroup GPIO_Private_Macros GPIO Private Macros
-  * @{
-  */
-#define PIN_MASK	0xFFFF
-#define UNLOCK_KEY	0x55AA
-
-#define IS_GPIO_PIN(x)	((((x) & (uint16_t)0x00) == 0) && ((x) != (uint16_t)0x0))
-#define IS_GPIO_PORT(GPIOx)	((GPIOx == GPIOA) || \
-				 (GPIOx == GPIOB) || \
-				 (GPIOx == GPIOC) || \
-				 (GPIOx == GPIOD) || \
-				 (GPIOx == GPIOE) || \
-				 (GPIOx == GPIOF) || \
-				 (GPIOx == GPIOG) || \
-				 (GPIOx == GPIOH))
-#define IS_GPIO_MODE(x)		(((x) == GPIO_MODE_CLOSE) || \
-                                 ((x) == GPIO_MODE_INPUT) || \
-                                 ((x) == GPIO_MODE_OUTPUT))
-#define IS_GPIO_ODOS(x)		(((x) == GPIO_PUSH_PULL)  || \
-                                 ((x) == GPIO_OPEN_DRAIN) || \
-                                 ((x) == GPIO_OPEN_SOURCE))
-#define IS_GPIO_PUPD(x)		(((x) == GPIO_FLOATING)  || \
-                                 ((x) == GPIO_PUSH_UP)   || \
-                                 ((x) == GPIO_PUSH_DOWN) || \
-                                 ((x) == GPIO_PUSH_UP_DOWN))
-#define IS_GPIO_ODRV(x)		(((x) == GPIO_OUT_DRIVE_NORMAL) || \
-                                 ((x) == GPIO_OUT_DRIVE_STRONG))
-#define IS_GPIO_FLT(x)		(((x) == GPIO_FILTER_DISABLE) || \
-                                 ((x) == GPIO_FILTER_ENABLE))
-#define IS_GPIO_TYPE(x)		(((x) == GPIO_TYPE_TTL) || \
-                                 ((x) == GPIO_TYPE_CMOS))
-#define IS_TRIGGER_STYLE(x)	(((x) == EXTI_TRIGGER_RISING_EDGE)   || \
-                                 ((x) == EXTI_TRIGGER_TRAILING_EDGE) || \
-                                 ((x) == EXTI_TRIGGER_BOTH_EDGE))
-#define IS_EXTI_FLTCKS_TYPE(x)	(((x) == EXTI_FILTER_CLOCK_10K) || \
-                                 ((x) == EXTI_FILTER_CLOCK_32K))
-#define IS_GPIO_FUNC(x)		((x) <= 7)
-/**
-  * @}
-  */
-
-/** @addtogroup GPIO_Public_Functions
-  * @{
-  */
-
-/** @addtogroup GPIO_Public_Functions_Group1
-  * @{
-  */
-void gpio_init(GPIO_TypeDef *GPIOx, uint16_t pin, gpio_init_t *init);
-void gpio_init_default(GPIO_TypeDef *GPIOx, uint16_t pin);
-void gpio_func_default(GPIO_TypeDef *GPIOx);
-void gpio_exti_init(GPIO_TypeDef *GPIOx, uint16_t pin, exti_init_t *init);
-/**
-  * @}
-  */
-
-/** @addtogroup GPIO_Public_Functions_Group2
-  * @{
-  */
-uint8_t gpio_read_pin(GPIO_TypeDef *GPIOx, uint16_t pin);
-void gpio_write_pin(GPIO_TypeDef *GPIOx, uint16_t pin, uint8_t val);
-void gpio_toggle_pin(GPIO_TypeDef *GPIOx, uint16_t pin);
-void gpio_toggle_dir(GPIO_TypeDef *GPIOx, uint16_t pin);
-void gpio_lock_pin(GPIO_TypeDef *GPIOx, uint16_t pin);
-uint16_t gpio_read_port(GPIO_TypeDef *GPIOx);
-void gpio_write_port(GPIO_TypeDef *GPIOx, uint16_t val);
-/**
-  * @}
-  */
-
-/** @addtogroup GPIO_Public_Functions_Group3
-  * @{
-  */
-void gpio_exti_interrupt_config(uint16_t pin, exti_trigger_style_t style, type_func_t status);
-flag_status_t gpio_exti_get_flag_status(uint16_t pin);
-void gpio_exti_clear_flag_status(uint16_t pin);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_GPIO_H__ */

+ 0 - 513
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_i2c.h

@@ -1,513 +0,0 @@
-/**
- *********************************************************************************
- *
- * @file    ald_i2c.h
- * @brief   Header file of I2C driver
- *
- * @version V1.0
- * @date    15 Nov 2017
- * @author  AE Team
- * @note
- *
- * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
- *
- ********************************************************************************
- */
-
-#ifndef __ALD_I2C_H__
-#define __ALD_I2C_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-#include "ald_cmu.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup I2C
-  * @{
-  */
-
-/** @defgroup I2C_Public_Types I2C Public Types
-  * @{
-  */
-/**
-  * @brief I2C Error Code
-  */
-typedef enum {
-	I2C_ERROR_NONE    = 0x0, 	/**< No error */
-	I2C_ERROR_BERR    = 0x1, 	/**< Berr error */
-	I2C_ERROR_ARLO    = 0x2, 	/**< Arlo error */
-	I2C_ERROR_AF      = 0x4, 	/**< Af error */
-	I2C_ERROR_OVR     = 0x8, 	/**< Ovr error */
-	I2C_ERROR_DMA     = 0x10,	/**< Dma error */
-	I2C_ERROR_TIMEOUT = 0x20,	/**< Timeout error */
-} i2c_error_t;
-
-/**
-  * @brief I2C state structure definition
-  */
-typedef enum {
-	I2C_STATE_RESET   = 0x0, 	/**< Peripheral is not yet Initialized */
-	I2C_STATE_READY   = 0x1,	/**< Peripheral Initialized and ready for use */
-	I2C_STATE_BUSY    = 0x2,	/**< An internal process is ongoing */
-	I2C_STATE_BUSY_TX = 0x3,	/**< Data Transmission process is ongoing */
-	I2C_STATE_BUSY_RX = 0x4,	/**< Data Reception process is ongoing */
-	I2C_STATE_TIMEOUT = 0x5,	/**< timeout state */
-	I2C_STATE_ERROR   = 0x6,	/**< Error */
-} i2c_state_t;
-
-/**
-  * @brief I2C Duty Cycle
-  */
-typedef enum {
-	I2C_DUTYCYCLE_2    = 0x0,   	/**< duty cycle is 2 */
-	I2C_DUTYCYCLE_16_9 = 0x4000,	/**< duty cycle is 16/9 */
-} i2c_duty_t;
-
-/**
-  * @brief I2C Addressing Mode
-  */
-typedef enum {
-	I2C_ADDR_7BIT  = 0x1,	/**< 7 bit address */
-	I2C_ADDR_10BIT = 0x2,	/**< 10 bit address */
-} i2c_addr_t;
-
-/**
-  * @brief I2C Dual Addressing Mode
-  */
-typedef enum {
-	I2C_DUALADDR_DISABLE = 0x0,	/**< dual address is disable */
-	I2C_DUALADDR_ENABLE  = 0x1,	/**< dual address is enable */
-} i2c_dual_addr_t;
-
-/**
-  * @brief I2C General Call Addressing mode
-  */
-typedef enum {
-	I2C_GENERALCALL_DISABLE = 0x0, 	/**< feneral call address is disable */
-	I2C_GENERALCALL_ENABLE  = 0x40,	/**< feneral call address is enable */
-} i2c_general_addr_t;
-
-/**
-  * @brief I2C Nostretch Mode
-  */
-typedef enum {
-	I2C_NOSTRETCH_DISABLE = 0x0, 	/**< Nostretch disable */
-	I2C_NOSTRETCH_ENABLE  = 0x80,	/**< Nostretch enable */
-} i2c_nostretch_t;
-
-/**
-  * @brief I2C Memory Address Size
-  */
-typedef enum {
-	I2C_MEMADD_SIZE_8BIT  = 0x1,	/**< 8 bit memory address size */
-	I2C_MEMADD_SIZE_16BIT = 0x10	/**< 10 bit memory address size */
-} i2c_addr_size_t;
-
-/**
-  * @brief I2C Flag Definition
-  */
-typedef enum {
-	I2C_FLAG_SB         = (1U << 0),
-	I2C_FLAG_ADDR       = (1U << 1),
-	I2C_FLAG_BTF        = (1U << 2),
-	I2C_FLAG_ADD10      = (1U << 3),
-	I2C_FLAG_STOPF      = (1U << 4),
-	I2C_FLAG_RXNE       = (1U << 6),
-	I2C_FLAG_TXE        = (1U << 7),
-	I2C_FLAG_BERR       = (1U << 8),
-	I2C_FLAG_ARLO       = (1U << 9),
-	I2C_FLAG_AF         = (1U << 10),
-	I2C_FLAG_OVR        = (1U << 11),
-	I2C_FLAG_PECERR     = (1U << 12),
-	I2C_FLAG_TIMEOUT    = (1U << 14),
-	I2C_FLAG_SMBALERT   = (1U << 15),
-	I2C_FLAG_MSL        = (1U << 16),
-	I2C_FLAG_BUSY       = (1U << 17),
-	I2C_FLAG_TRA        = (1U << 18),
-	I2C_FLAG_GENCALL    = (1U << 20),
-	I2C_FLAG_SMBDEFAULT = (1U << 21),
-	I2C_FLAG_SMBHOST    = (1U << 22),
-	I2C_FLAG_DUALF      = (1U << 23),
-} i2c_flag_t;
-
-/**
-  * @brief I2C mode structure definition
-  */
-typedef enum
-{
-	I2C_MODE_NONE   = 0x0, 	/**< No I2C communication on going */
-	I2C_MODE_MASTER = 0x10,	/**< I2C communication is in Master mode */
-	I2C_MODE_SLAVE  = 0x20,	/**< I2C communication is in Slave mode */
-	I2C_MODE_MEM    = 0x40,	/**< I2C communication is in Memory mode */
-} i2c_mode_t;
-
-/**
-  * @brief I2C Clock
-  */
-typedef enum {
-	I2C_STANDARD_MODE_MAX_CLK = 100000,	/**< Standard mode clock */
-	I2C_FAST_MODE_MAX_CLK     = 400000,	/**< Fast mode clock */
-} i2c_clock_t;
-
-/**
-  * @brief Interrupt Configuration Definition
-  */
-typedef enum {
-	I2C_IT_BUF = (1U << 10),	/**< Buffer interrupt */
-	I2C_IT_EVT = (1U << 9), 	/**< Event interrupt */
-	I2C_IT_ERR = (1U << 8), 	/**< Error interrupt */
-} i2c_interrupt_t;
-
-/**
-  * @brief I2C CON1 Register
-  */
-typedef enum {
-	I2C_CON1_PEN    = (1U << 0), 	/**< PEN BIT */
-	I2C_CON1_PMOD   = (1U << 1), 	/**< PMOD BIT */
-	I2C_CON1_SMBMOD = (1U << 3), 	/**< SMBMOD  BIT */
-	I2C_CON1_ARPEN  = (1U << 4), 	/**< ARPEN BIT */
-	I2C_CON1_PECEN  = (1U << 5), 	/**< PECEN BIT */
-	I2C_CON1_GCEN   = (1U << 6), 	/**< GCEN  BIT */
-	I2C_CON1_DISCS  = (1U << 7), 	/**< DISCS BIT */
-	I2C_CON1_START  = (1U << 8), 	/**< START BIT */
-	I2C_CON1_STOP   = (1U << 9), 	/**< STOP BIT */
-	I2C_CON1_ACKEN  = (1U << 10),	/**< ACKEN  BIT */
-	I2C_CON1_POSAP  = (1U << 11),	/**< POSAP BIT */
-	I2C_CON1_TRPEC  = (1U << 12),	/**< TRPEC  BIT */
-	I2C_CON1_ALARM  = (1U << 13),	/**< ALARM BIT */
-	I2C_CON1_SRST   = (1U << 15),	/**< SRST BIT */
-} i2c_con1_t;
-
-/**
-  * @brief I2C CON2 Register
-  */
-typedef enum {
-	I2C_CON2_CLKF    =  0x3F,     	/**< CLKF BITS */
-	I2C_CON2_CLKF_0  = (1U << 0), 	/**< CLKF_0 BIT */
-	I2C_CON2_CLKF_1  = (1U << 1), 	/**< CLKF_1 BIT */
-	I2C_CON2_CLKF_2  = (1U << 2), 	/**< CLKF_2 BIT */
-	I2C_CON2_CLKF_3  = (1U << 3), 	/**< CLKF_3 BIT */
-	I2C_CON2_CLKF_4  = (1U << 4), 	/**< CLKF_4 BIT */
-	I2C_CON2_CLKF_5  = (1U << 5), 	/**< CLKF_5 BIT */
-	I2C_CON2_ERRIE   = (1U << 8), 	/**< ERRIE BIT */
-	I2C_CON2_EVTIE   = (1U << 9), 	/**< EVTIE BIT */
-	I2C_CON2_BUFIE   = (1U << 10),	/**< BUFIE BIT */
-	I2C_CON2_DMAEN   = (1U << 11),	/**< DMAEN BIT */
-	I2C_CON2_LDMA    = (1U << 12),	/**< LDMA BIT */
-} i2c_con2_t;
-
-/**
-  * @brief I2C ADDR1 Register
-  */
-typedef enum {
-	I2C_ADDR1_ADDH0   = (1U << 0), 	/**< ADDH0 BIT */
-	I2C_ADDR1_ADDH1   = (1U << 1), 	/**< ADDH1 BIT */
-	I2C_ADDR1_ADDH2   = (1U << 2), 	/**< ADDH2 BIT */
-	I2C_ADDR1_ADDH3   = (1U << 3), 	/**< ADDH3 BIT */
-	I2C_ADDR1_ADDH4   = (1U << 4), 	/**< ADDH4 BIT */
-	I2C_ADDR1_ADDH5   = (1U << 5), 	/**< ADDH5 BIT */
-	I2C_ADDR1_ADDH6   = (1U << 6), 	/**< ADDH6 BIT */
-	I2C_ADDR1_ADDH7   = (1U << 7), 	/**< ADDH7 BIT */
-	I2C_ADDR1_ADDH8   = (1U << 8), /**< ADDH8 BIT */
-	I2C_ADDR1_ADDH9   = (1U << 9),	/**< ADDH9 BIT */
-	I2C_ADDR1_ADDTYPE = (1U << 15),	/**< ADDTYPE BIT */
-} i2c_addr1_t;
-
-/**
-  * @brief I2C ADDR2 Register
-  */
-typedef enum {
-	I2C_ADDR2_DUALEN = (1U << 0),	/**< DUALEN BIT */
-	I2C_ADDR2_ADD    = (1U << 1),	/**< ADD BIT */
-} i2c_addr2_t;
-
-/**
-  * @brief I2C STAT1 Register
-  */
-typedef enum {
-	I2C_STAT1_SB        = (1U << 0), 	/**< SB BIT */
-	I2C_STAT1_ADDR      = (1U << 1), 	/**< ADDR  BIT */
-	I2C_STAT1_BTC       = (1U << 2), 	/**< BTC BIT */
-	I2C_STAT1_SENDADD10 = (1U << 3), 	/**< SENDADD10 BIT */
-	I2C_STAT1_DETSTP    = (1U << 4), 	/**< DETSTP BIT */
-	I2C_STAT1_RXBNE     = (1U << 6), 	/**< RXBNE BIT */
-	I2C_STAT1_TXBE      = (1U << 7), 	/**< TXBE BIT */
-	I2C_STAT1_BUSERR    = (1U << 8), 	/**< BUSERR BIT */
-	I2C_STAT1_LARB      = (1U << 9), 	/**< LARB BIT */
-	I2C_STAT1_ACKERR    = (1U << 10),	/**< ACKERR BIT */
-	I2C_STAT1_ROUERR    = (1U << 11),	/**< ROUERR BIT */
-	I2C_STAT1_PECERR    = (1U << 12),	/**< PECERR BIT */
-	I2C_STAT1_SMBTO     = (1U << 14),	/**< SMBTO BIT */
-	I2C_STAT1_SMBALARM  = (1U << 15),	/**< SMBALARM BIT */
-} i2c_stat1_t;
-
-/**
-  * @brief I2C STAT2 Register
-  */
-typedef enum {
-	I2C_STAT2_MASTER = (1U << 0),	/**< MASTER BIT */
-	I2C_STAT2_BSYF   = (1U << 1),	/**< BSYF  BIT */
-	I2C_STAT2_TRF    = (1U << 2),	/**< TRF BIT */
-	I2C_STAT2_RXGCF  = (1U << 4),	/**< RXGCF BIT */
-	I2C_STAT2_SMBDEF = (1U << 5),	/**< SMBDEF BIT */
-	I2C_STAT2_SMBHH  = (1U << 6),	/**< SMBHH BIT */
-	I2C_STAT2_DUALF  = (1U << 7),	/**< DMF BIT */
-	I2C_STAT2_PECV   = (1U << 8),	/**< PECV BIT */
-} i2c_stat2_t;
-
-/**
-  * @brief I2C CKCFG Register
-  */
-typedef enum {
-	I2C_CKCFG_CLKSET =  0xFFF,    	/**< CLKSET BITS */
-	I2C_CKCFG_DUTY   = (1U << 14),	/**< DUTY BIT */
-	I2C_CKCFG_CLKMOD = (1U << 15),	/**< CLKMOD BIT */
-} i2c_ckcfg_t;
-
-/**
-  * @brief I2C RT Register
-  */
-typedef enum {
-	I2C_RT_RISET = 0x3F,	/**< RISET BITS */
-} i2c_trise_t;
-
-/**
- * @brief I2C Configuration Structure definition
- */
-typedef struct {
-	uint32_t clk_speed;                	/**< Specifies the clock frequency */
-	i2c_duty_t duty;			/**< Specifies the I2C fast mode duty cycle */
-	uint32_t own_addr1;               	/**< Specifies the first device own address */
-	i2c_addr_t addr_mode;			/**< Specifies addressing mode */
-	i2c_dual_addr_t dual_addr;		/**< Specifies if dual addressing mode is selected */
-	uint32_t own_addr2;               	/**< Specifies the second device own address */
-	i2c_general_addr_t general_call;	/**< Specifies if general call mode is selected */
-	i2c_nostretch_t no_stretch;     	/**< Specifies if nostretch mode is selected */
-} i2c_init_t;
-
-/**
-  * @brief  I2C handle Structure definition
-  */
-typedef struct i2c_handle_s {
-	I2C_TypeDef *perh;       	/**< I2C registers base address */
-	i2c_init_t init;         	/**< I2C communication parameters */
-	uint8_t *p_buff;         	/**< Pointer to I2C transfer buffer */
-	uint16_t xfer_size;      	/**< I2C transfer size */
-	__IO uint16_t xfer_count;	/**< I2C transfer counter */
-#ifdef ALD_DMA
-	dma_handle_t hdmatx;		/**< I2C Tx DMA handle parameters */
-	dma_handle_t hdmarx;		/**< I2C Rx DMA handle parameters */
-#endif
-	lock_state_t lock;       	/**< I2C locking object */
-	__IO i2c_state_t state;  	/**< I2C communication state */
-	__IO i2c_mode_t mode;    	/**< I2C communication mode */
-	__IO uint32_t error_code;	/**< I2C Error code */
-
-	void (*master_tx_cplt_cbk)(struct i2c_handle_s *arg);	/**< Master Tx completed callback */
-	void (*master_rx_cplt_cbk)(struct i2c_handle_s *arg);	/**< Master Rx completed callback */
-	void (*slave_tx_cplt_cbk)(struct i2c_handle_s *arg); 	/**< Slave Tx completed callback */
-	void (*slave_rx_cplt_cbk)(struct i2c_handle_s *arg); 	/**< Slave Rx completed callback */
-	void (*mem_tx_cplt_cbk)(struct i2c_handle_s *arg);   	/**< Tx to Memory completed callback */
-	void (*mem_rx_cplt_cbk)(struct i2c_handle_s *arg);   	/**< Rx from Memory completed callback */
-	void (*error_callback)(struct i2c_handle_s *arg);    	/**< Error callback */
-} i2c_handle_t;
-
-/**
- * @}
- */
-
-/** @defgroup I2C_Public_Macro I2C Public Macros
-  * @{
-  */
-#define I2C_RESET_HANDLE_STATE(x) ((x)->state = I2C_STATE_RESET)
-#define I2C_CLEAR_ADDRFLAG(x)		\
-do {					\
-	__IO uint32_t tmpreg;		\
-	tmpreg = (x)->perh->STAT1;	\
-	tmpreg = (x)->perh->STAT2;	\
-	UNUSED(tmpreg);			\
-} while (0)
-#define __I2C_CLEAR_STOPFLAG(x)					\
-do {								\
-	__IO uint32_t tmpreg;					\
-	tmpreg = (x)->perh->STAT1;				\
-	tmpreg = SET_BIT((x)->perh->CON1, I2C_CON1_PEN);	\
-	UNUSED(tmpreg);						\
-} while (0)
-#define I2C_ENABLE(x)  (SET_BIT((x)->perh->CON1, I2C_CON1_PEN_MSK))
-#define I2C_DISABLE(x) (CLEAR_BIT((x)->perh->CON1, I2C_CON1_PEN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup I2C_Private_Macro I2C Private Macros
-  * @{
-  */
-#define IS_I2C_TYPE(x)						(((x) == I2C0) || \
-								 ((x) == I2C1))
-#define IS_I2C_ADDRESSING_MODE(x)				(((x) == I2C_ADDR_7BIT) || \
-								 ((x) == I2C_ADDR_10BIT))
-#define IS_I2C_DUAL_ADDRESS(x)					(((x) == I2C_DUALADDR_DISABLE) || \
-								 ((x) == I2C_DUALADDR_ENABLE))
-#define IS_I2C_GENERAL_CALL(x)					(((x) == I2C_GENERALCALL_DISABLE) || \
-								 ((x) == I2C_GENERALCALL_ENABLE))
-#define IS_I2C_MEMADD_size(x)					(((x) == I2C_MEMADD_SIZE_8BIT) || \
-								 ((x) == I2C_MEMADD_SIZE_16BIT))
-#define IS_I2C_NO_STRETCH(x)					(((x) == I2C_NOSTRETCH_DISABLE) || \
-								 ((x) == I2C_NOSTRETCH_ENABLE))
-#define IS_I2C_OWN_ADDRESS1(x)					(((x) & (uint32_t)(0xFFFFFC00)) == 0)
-#define IS_I2C_OWN_ADDRESS2(x)					(((x) & (uint32_t)(0xFFFFFF01)) == 0)
-#define IS_I2C_CLOCK_SPEED(x)					(((x) > 0) && ((x) <= I2C_FAST_MODE_MAX_CLK))
-#define IS_I2C_DUTY_CYCLE(x)					(((x) == I2C_DUTYCYCLE_2) || \
-								 ((x) == I2C_DUTYCYCLE_16_9))
-#define IS_I2C_IT_TYPE(x)					(((x) == I2C_IT_BUF) || \
-								 ((x) == I2C_IT_EVT) || \
-								 ((x) == I2C_IT_ERR))
-#define IS_I2C_FLAG(x)						(((x) == I2C_FLAG_SB)         || \
-								 ((x) == I2C_FLAG_ADDR)       || \
-								 ((x) == I2C_FLAG_BTF)        || \
-								 ((x) == I2C_FLAG_ADD10)      || \
-								 ((x) == I2C_FLAG_STOPF)      || \
-								 ((x) == I2C_FLAG_RXNE)       || \
-								 ((x) == I2C_FLAG_TXE)        || \
-								 ((x) == I2C_FLAG_BERR)       || \
-								 ((x) == I2C_FLAG_ARLO)       || \
-								 ((x) == I2C_FLAG_AF)         || \
-								 ((x) == I2C_FLAG_OVR)        || \
-								 ((x) == I2C_FLAG_PECERR)     || \
-								 ((x) == I2C_FLAG_TIMEOUT)    || \
-								 ((x) == I2C_FLAG_SMBALERT)   || \
-								 ((x) == I2C_FLAG_MSL)        || \
-								 ((x) == I2C_FLAG_BUSY)       || \
-								 ((x) == I2C_FLAG_TRA)        || \
-								 ((x) == I2C_FLAG_GENCALL)    || \
-								 ((x) == I2C_FLAG_SMBDEFAULT) || \
-								 ((x) == I2C_FLAG_SMBHOST)    || \
-								 ((x) == I2C_FLAG_DUALF))
-
-#define I2C_FREQ_RANGE(x)					((x) / 1000000)
-#define I2C_RISE_TIME(x, u)					(((u) <= I2C_STANDARD_MODE_MAX_CLK) ? ((x) + 1) :\
-        ((((x) * 300) / 1000) + 1))
-#define I2C_SPEED_STANDARD(x, y)				(((((x) / ((y) << 1)) & I2C_CKCFG_CLKSET) < 4) ? 4:\
-	((x) / ((y) << 1)))
-#define I2C_SPEED_FAST(x, y, z)					(((z) == I2C_DUTYCYCLE_2) ? ((x) / ((y) * 3)) :\
-        (((x) / ((y) * 25)) | I2C_DUTYCYCLE_16_9))
-#define I2C_SPEED(x, y, z)					(((y) <= 100000) ? (I2C_SPEED_STANDARD((x), (y))) :\
-	((I2C_SPEED_FAST((x), (y), (z)) & I2C_CKCFG_CLKSET) == 0) ? 1 : \
-        ((I2C_SPEED_FAST((x), (y), (z))) | I2C_CKCFG_CLKMOD))
-#define I2C_MEM_ADD_MSB(x)					((uint8_t)((uint16_t)(((uint16_t)((x) &\
-        (uint16_t)(0xFF00))) >> 8)))
-#define I2C_MEM_ADD_LSB(x)					((uint8_t)((uint16_t)((x) & (uint16_t)(0x00FF))))
-#define I2C_7BIT_ADD_WRITE(x)					((uint8_t)((x) & (~I2C_ADDR1_ADDH0)))
-#define I2C_7BIT_ADD_READ(x)					((uint8_t)((x) | I2C_ADDR1_ADDH0))
-#define I2C_10BIT_ADDRESS(x)					((uint8_t)((uint16_t)((x) & (uint16_t)(0x00FF))))
-#define I2C_10BIT_HEADER_WRITE(x)				((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((x) &\
-        (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF0))))
-#define I2C_10BIT_HEADER_READ(x)				((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((x) &\
-       (uint16_t)(0x0300))) >> 7) | (uint16_t)(0xF1))))
-/**
-  * @}
-  */
-
-/** @addtogroup I2C_Public_Functions
-  * @{
-  */
-
-/** @addtogroup I2C_Public_Functions_Group1
-  * @{
-  */
-ald_status_t i2c_init(i2c_handle_t *hperh);
-ald_status_t i2c_reset(i2c_handle_t *hperh);
-
-/**
- * @}
- */
-
-/** @addtogroup I2C_Public_Functions_Group2
- * @{
- */
- /** Blocking mode: Polling */
-ald_status_t i2c_master_send(i2c_handle_t *hperh, uint16_t dev_addr,
-                                 uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t i2c_master_recv(i2c_handle_t *hperh, uint16_t dev_addr,
-                                uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t i2c_slave_send(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t i2c_slave_recv(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t i2c_mem_write(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                           i2c_addr_size_t add_size, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t i2c_mem_read(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                          i2c_addr_size_t add_size, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t i2c_is_device_ready(i2c_handle_t *hperh, uint16_t dev_addr, uint32_t trials, uint32_t timeout);
-
- /** Non-Blocking mode: Interrupt */
-ald_status_t i2c_master_send_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf, uint16_t size);
-ald_status_t i2c_master_recv_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf, uint16_t size);
-ald_status_t i2c_slave_send_by_it(i2c_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t i2c_slave_recv_by_it(i2c_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t i2c_mem_write_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                              i2c_addr_size_t add_size, uint8_t *buf, uint16_t size);
-ald_status_t i2c_mem_read_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                             i2c_addr_size_t add_size, uint8_t *buf, uint16_t size);
-
-#ifdef ALD_DMA
- /** Non-Blocking mode: DMA */
-ald_status_t i2c_master_send_by_dma(i2c_handle_t *hperh, uint16_t dev_addr,
-                                     uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t i2c_master_recv_by_dma(i2c_handle_t *hperh, uint16_t dev_addr,
-                                    uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t i2c_slave_send_by_dma(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t i2c_slave_recv_by_dma(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t i2c_mem_write_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr, i2c_addr_size_t add_size,
-                                 uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t i2c_mem_read_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                                i2c_addr_size_t add_size, uint8_t *buf, uint16_t size, uint8_t channel);
-#endif
-/**
- * @}
- */
-
-/** @addtogroup I2C_Public_Functions_Group3
-  * @{
-  */
-i2c_state_t i2c_get_state(i2c_handle_t *hperh);
-uint32_t    i2c_get_error(i2c_handle_t *hperh);
-flag_status_t i2c_get_flag_status(i2c_handle_t *hperh, i2c_flag_t flag);
-flag_status_t i2c_get_it_status(i2c_handle_t *hperh, i2c_interrupt_t it);
-void i2c_clear_flag_status(i2c_handle_t *hperh, i2c_flag_t flag);
-/**
- * @}
- */
-
-/** @addtogroup I2C_Public_Functions_Group4
- * @{
- */
-void i2c_interrupt_config(i2c_handle_t *hperh, i2c_interrupt_t it, type_func_t state);
-void i2c_ev_irq_handler(i2c_handle_t *hperh);
-void i2c_er_irq_handler(i2c_handle_t *hperh);
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-/**
-  * @}
-  */
-
-/**
- * @}
- */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_I2C_H__ */

+ 0 - 496
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_lcd.h

@@ -1,496 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_lcd.h
-  * @brief   Header file of LCD module driver.
-  *
-  * @version V1.0
-  * @date    29 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  */
-
-#ifndef __ALD_LCD_H__
-#define __ALD_LCD_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_cmu.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup LCD
-  * @{
-  */
-
-/** @defgroup LCD_Public_Types LCD Public Types
-  * @{
-  */
-/**
-  * @brief Lcd vlcd voltage type
-  */
-typedef enum {
-	LCD_VCHPS_3V2 = 0,	/**< 3.2V */
-	LCD_VCHPS_3V8 = 1,	/**< 3.8V */
-	LCD_VCHPS_4V8 = 2,	/**< 4.8V */
-	LCD_VCHPS_5V4 = 3,	/**< 5.4V */
-} lcd_vchps_t;
-
-/**
-  * @brief Lcd function type
-  */
-typedef enum {
-	LCD_FUNC_DISABLE = 0,	/**< Lcd's function disable */
-	LCD_FUNC_ENABLE  = 1,	/**< Lcd's function enable */
-} lcd_func_t;
-
-/**
-  * @brief Lcd voltage type
-  */
-typedef enum {
-	LCD_VSEL_VDD  = 0,	/**< VDD */
-	LCD_VSEL_CP   = 1,	/**< Charge pump output */
-	LCD_VSEL_VLCD = 2,	/**< VLCD input */
-} lcd_vsel_t;
-
-/**
-  * @brief Lcd resistance select bit
-  */
-typedef enum {
-	LCD_RES_1MOHM = 0,	/**< 1M ohm */
-	LCD_RES_2MOHM = 1,	/**< 2M ohm */
-	LCD_RES_3MOHM = 2,	/**< 3M ohm */
-} lcd_res_t;
-
-/**
-  * @brief Lcd bias selector
-  */
-typedef enum {
-	LCD_BIAS_1_4 = 0,	/**< 1/4 bias */
-	LCD_BIAS_1_2 = 2,	/**< 1/2 bias */
-	LCD_BIAS_1_3 = 3,	/**< 1/3 bias */
-} lcd_bias_t;
-
-/**
-  * @brief Lcd duty
-  */
-typedef enum {
-	LCD_DUTY_STATIC = 0,	/**< Static duty (COM0) */
-	LCD_DUTY_1_2    = 1,	/**< 1/2 duty (COM0~COM1) */
-	LCD_DUTY_1_3    = 2,	/**< 1/3 duty (COM0~COM2) */
-	LCD_DUTY_1_4    = 3,	/**< 1/4 duty (COM0~COM3) */
-	LCD_DUTY_1_6    = 4,	/**< 1/6 duty (COM0~COM5) */
-	LCD_DUTY_1_8    = 5,	/**< 1/8 duty (COM0~COM7) */
-} lcd_duty_t;
-
-/**
-  * @brief Lcd prescaler
-  */
-typedef enum {
-	LCD_PRS_1     = 0, 	/**< CLKPRS = LCDCLK / 1 */
-	LCD_PRS_2     = 1, 	/**< CLKPRS = LCDCLK / 2 */
-	LCD_PRS_4     = 2, 	/**< CLKPRS = LCDCLK / 4 */
-	LCD_PRS_8     = 3, 	/**< CLKPRS = LCDCLK / 8 */
-	LCD_PRS_16    = 4, 	/**< CLKPRS = LCDCLK / 16 */
-	LCD_PRS_32    = 5, 	/**< CLKPRS = LCDCLK / 32 */
-	LCD_PRS_64    = 6, 	/**< CLKPRS = LCDCLK / 64 */
-	LCD_PRS_128   = 7, 	/**< CLKPRS = LCDCLK / 128 */
-	LCD_PRS_256   = 8, 	/**< CLKPRS = LCDCLK / 256 */
-	LCD_PRS_512   = 9, 	/**< CLKPRS = LCDCLK / 512 */
-	LCD_PRS_1024  = 10,	/**< CLKPRS = LCDCLK / 1024 */
-	LCD_PRS_2048  = 11,	/**< CLKPRS = LCDCLK / 2048 */
-	LCD_PRS_4096  = 12,	/**< CLKPRS = LCDCLK / 4096 */
-	LCD_PRS_8192  = 13,	/**< CLKPRS = LCDCLK / 8192 */
-	LCD_PRS_16384 = 14,	/**< CLKPRS = LCDCLK / 16384 */
-	LCD_PRS_32768 = 15,	/**< CLKPRS = LCDCLK / 32768 */
-} lcd_prs_t;
-
-/**
-  * @brief Lcd divider
-  */
-typedef enum {
-	LCD_DIV_16 = 0, 	/**< DIVCLK = CLKPRS / 16 */
-	LCD_DIV_17 = 1, 	/**< DIVCLK = CLKPRS / 17 */
-	LCD_DIV_18 = 2, 	/**< DIVCLK = CLKPRS / 18 */
-	LCD_DIV_19 = 3, 	/**< DIVCLK = CLKPRS / 19 */
-	LCD_DIV_20 = 4, 	/**< DIVCLK = CLKPRS / 20 */
-	LCD_DIV_21 = 5, 	/**< DIVCLK = CLKPRS / 21 */
-	LCD_DIV_22 = 6, 	/**< DIVCLK = CLKPRS / 22 */
-	LCD_DIV_23 = 7, 	/**< DIVCLK = CLKPRS / 23 */
-	LCD_DIV_24 = 8, 	/**< DIVCLK = CLKPRS / 24 */
-	LCD_DIV_25 = 9, 	/**< DIVCLK = CLKPRS / 25 */
-	LCD_DIV_26 = 10,	/**< DIVCLK = CLKPRS / 26 */
-	LCD_DIV_27 = 11,	/**< DIVCLK = CLKPRS / 27 */
-	LCD_DIV_28 = 12,	/**< DIVCLK = CLKPRS / 28 */
-	LCD_DIV_29 = 13,	/**< DIVCLK = CLKPRS / 29 */
-	LCD_DIV_30 = 14,	/**< DIVCLK = CLKPRS / 30 */
-	LCD_DIV_31 = 15,	/**< DIVCLK = CLKPRS / 31 */
-} lcd_div_t;
-
-/**
-  * @brief Lcd blink mode
-  */
-typedef enum {
-	LCD_BLINK_OFF           = 0,	/**< Blink disabled */
-	LCD_BLINK_SEG0_COM0     = 1,	/**< Blink enabled on SEG0, COM0 */
-	LCD_BLINK_SEG0_COMX2    = 2,	/**< Blink enabled on SEG0, COMx2 */
-	LCD_BLINK_ALLSEG_ALLCOM = 3,	/**< Blink enabled on all SEG and all COM */
-} lcd_blink_t;
-
-/**
-  * @brief Lcd blink frequency
-  */
-typedef enum {
-	LCD_BLFRQ_8    = 0,	/**< DIVCLK / 8 */
-	LCD_BLFRQ_16   = 1,	/**< DIVCLK / 16 */
-	LCD_BLFRQ_32   = 2,	/**< DIVCLK / 32 */
-	LCD_BLFRQ_64   = 3,	/**< DIVCLK / 64 */
-	LCD_BLFRQ_128  = 4,	/**< DIVCLK / 128 */
-	LCD_BLFRQ_256  = 5,	/**< DIVCLK / 256 */
-	LCD_BLFRQ_512  = 6,	/**< DIVCLK / 512 */
-	LCD_BLFRQ_1024 = 7,	/**< DIVCLK / 1024 */
-} lcd_blfrq_t;
-
-/**
-  * @brief Lcd dead time
-  */
-typedef enum {
-	LCD_DEAD_TIME_NONE     = 0,	/**< No dead time */
-	LCD_DEAD_TIME_1_DIVCLK = 1,	/**< Dead time is 1 divclk */
-	LCD_DEAD_TIME_2_DIVCLK = 2,	/**< Dead time is 2 divclk */
-	LCD_DEAD_TIME_3_DIVCLK = 3,	/**< Dead time is 3 divclk */
-	LCD_DEAD_TIME_4_DIVCLK = 4,	/**< Dead time is 4 divclk */
-	LCD_DEAD_TIME_5_DIVCLK = 5,	/**< Dead time is 5 divclk */
-	LCD_DEAD_TIME_6_DIVCLK = 6,	/**< Dead time is 6 divclk */
-	LCD_DEAD_TIME_7_DIVCLK = 7,	/**< Dead time is 7 divclk */
-} lcd_dead_t;
-
-/**
-  * @brief Lcd pulse keep time
-  */
-typedef enum {
-	LCD_PON_NONE     = 0,	/**< No pulse keep time */
-	LCD_PON_1_PRSCLK = 1,	/**< Pulse keep 1 prsclk */
-	LCD_PON_2_PRSCLK = 2,	/**< Pulse keep 2 prsclk */
-	LCD_PON_3_PRSCLK = 3,	/**< Pulse keep 3 prsclk */
-	LCD_PON_4_PRSCLK = 4,	/**< Pulse keep 4 prsclk */
-	LCD_PON_5_PRSCLK = 5,	/**< Pulse keep 5 prsclk */
-	LCD_PON_6_PRSCLK = 6,	/**< Pulse keep 6 prsclk */
-	LCD_PON_7_PRSCLK = 7,	/**< Pulse keep 7 prsclk */
-} lcd_pluse_on_t;
-
-/**
-  * @brief Lcd vgs select
-  */
-typedef enum {
-	LCD_VGS_0  = 0, 	/**< Grey level display voltage is 30/45 vlcd */
-	LCD_VGS_1  = 1, 	/**< Grey level display voltage is 31/45 vlcd */
-	LCD_VGS_2  = 2, 	/**< Grey level display voltage is 32/45 vlcd */
-	LCD_VGS_3  = 3, 	/**< Grey level display voltage is 33/45 vlcd */
-	LCD_VGS_4  = 4, 	/**< Grey level display voltage is 34/45 vlcd */
-	LCD_VGS_5  = 5, 	/**< Grey level display voltage is 35/45 vlcd */
-	LCD_VGS_6  = 6, 	/**< Grey level display voltage is 36/45 vlcd */
-	LCD_VGS_7  = 7, 	/**< Grey level display voltage is 37/45 vlcd */
-	LCD_VGS_8  = 8, 	/**< Grey level display voltage is 38/45 vlcd */
-	LCD_VGS_9  = 9, 	/**< Grey level display voltage is 39/45 vlcd */
-	LCD_VGS_10 = 10,	/**< Grey level display voltage is 40/45 vlcd */
-	LCD_VGS_11 = 11,	/**< Grey level display voltage is 41/45 vlcd */
-	LCD_VGS_12 = 12,	/**< Grey level display voltage is 42/45 vlcd */
-	LCD_VGS_13 = 13,	/**< Grey level display voltage is 43/45 vlcd */
-	LCD_VGS_14 = 14,	/**< Grey level display voltage is 44/45 vlcd */
-	LCD_VGS_15 = 15,	/**< Grey level display voltage is equal to vlcd */
-} lcd_vgs_t;
-
-/**
-  * @brief Lcd wave choose
-  */
-typedef enum {
-	LCD_WAVE_A = 0,	/**< Wave type is A */
-	LCD_WAVE_B = 1,	/**< Wave type is B */
-} lcd_wfs_t;
-
-/**
-  * @brief Lcd status select bit
-  */
-typedef enum {
-	LCD_STATUS_RDY   = (1U << 0),	/**< VLCD voltage state flag */
-	LCD_STATUS_ENS   = (1U << 1),	/**< LCD Enable state flag*/
-	LCD_STATUS_UDR   = (1U << 2),	/**< Update display request state flag */
-	LCD_STATUS_FCRSF = (1U << 3),	/**< LCD frame control sync flag */
-	LCD_STATUS_ALL   = 0xFFFFFFF,	/**< All flag */
-} lcd_status_t;
-
-/**
-  * @brief Lcd interrupt type
-  */
-typedef enum {
-	LCD_IT_SOF = (1U << 0),	/**< Start of frame interrupt enable */
-	LCD_IT_UDD = (1U << 1),	/**< Update display done interrupt enable*/
-} lcd_it_t;
-
-/**
-  * @brief Lcd interrupt flag
-  */
-typedef enum {
-	LCD_FLAG_SOF = (1U << 0), /**< Start of frame interrupt enable flag*/
-	LCD_FLAG_UDD = (1U << 1), /**< Update display done interrupt enable flag*/
-} lcd_flag_t;
-
-/**
-  * @brief Lcd interrupt type
-  */
-typedef enum {
-	SEG_0_TO_31  = 0,	/**< Segment 0 to 31 to be set */
-	SEG_32_TO_59 = 1,	/**< Segment 32 to 59 to be set */
-} lcd_seg_t;
-
-/**
-  * @brief Lcd configure
-  */
-typedef struct
-{
-	lcd_vsel_t lcd_vsel;      	/**< Lcd power choose */
-	lcd_vchps_t lcd_vchps;    	/**< Charge pump voltage choose */
-	lcd_func_t lcd_vbufld;    	/**< Low drive mode function */
-	lcd_func_t lcd_vbufhd;    	/**< High drive mode function */
-	uint32_t lcd_dsld;        	/**< Low drive mode level */
-	uint32_t lcd_dshd;        	/**< High drive mode level */
-	lcd_res_t lcd_resld;      	/**< Low dirve mode resistance choose */
-	lcd_res_t lcd_reshd;      	/**< High dirve mode resistance choose */
-	lcd_bias_t lcd_bias;      	/**< LCD bias */
-	lcd_duty_t lcd_duty;      	/**< LCD duty */
-	lcd_wfs_t lcd_wfs;        	/**< Wave choose */
-	lcd_prs_t lcd_prs;        	/**< Lcd clock prs */
-	lcd_div_t lcd_div;        	/**< Lcd div */
-	lcd_dead_t lcd_dead;      	/**< Lcd dead time */
-	lcd_pluse_on_t lcd_pon;   	/**< Lcd pluse on time */
-	lcd_vgs_t lcd_vgs;        	/**< Lcd gray level display voltage */
-	cmu_lcd_clock_sel_t clock;	/**< Lcd clock choose */
-} lcd_init_t;
-
-/**
-  * @brief  Lcd handle Structure definition
-  */
-typedef struct lcd_handle_s {
-	LCD_TypeDef *perh;	/**< LCD registers base address */
-	lcd_init_t init;  	/**< LCD initialize parameters */
-	lock_state_t lock;	/**< Locking object */
-
-	void (*display_cplt_cbk)(struct lcd_handle_s *arg);	/**< Display completed callback */
-	void (*frame_start_cbk)(struct lcd_handle_s *arg); 	/**< Frame start callback */
-} lcd_handle_t;
-
-/**
-  * @}
-  */
-
-/** @defgroup LCD_Public_Macro LCD Public Macros
-  * @{
-  */
-#define LCD_HD_ENABLE(x)	(SET_BIT((x)->perh->FCR, LCD_FCR_HD_MSK))
-#define LCD_HD_DISABLE(x)	(CLEAR_BIT((x)->perh->FCR, LCD_FCR_HD_MSK))
-/**
-  * @}
-  */
-
-/**
-  * @defgroup LCD_Private_Macros LCD Private Macros
-  * @{
-  */
-#define IS_LCD_PERH_TYPE(x)	((x) == LCD)
-#define IS_LCD_VCHPS_TYPE(x)    (((x) == LCD_VCHPS_3V2) || \
-				 ((x) == LCD_VCHPS_3V8) || \
-				 ((x) == LCD_VCHPS_4V8) || \
-				 ((x) == LCD_VCHPS_5V4))
-#define IS_LCD_VSEL_TYPE(x)     (((x) == LCD_VSEL_VDD) || \
-				 ((x) == LCD_VSEL_CP)  || \
-				 ((x) == LCD_VSEL_VLCD))
-#define IS_LCD_FUNC_TYPE(x)	(((x) == LCD_FUNC_DISABLE) || \
-				 ((x) == LCD_FUNC_ENABLE))
-#define IS_LCD_LEVEL_TYPE(x)	(((x) > 0) | ((x) <= 0xF))
-#define IS_LCD_RES_TYPE(x)      (((x) == LCD_RES_1MOHM) || \
-				 ((x) == LCD_RES_2MOHM) || \
-				 ((x) == LCD_RES_3MOHM))
-#define IS_LCD_BIAS_TYPE(x)     (((x) == LCD_BIAS_1_4) || \
-				 ((x) == LCD_BIAS_1_2) || \
-				 ((x) == LCD_BIAS_1_3))
-#define IS_LCD_DUTY_TYPE(x)     (((x) == LCD_DUTY_STATIC) || \
-				 ((x) == LCD_DUTY_1_2)    || \
-				 ((x) == LCD_DUTY_1_3)    || \
-				 ((x) == LCD_DUTY_1_4)    || \
-				 ((x) == LCD_DUTY_1_6)    || \
-				 ((x) == LCD_DUTY_1_8))
-#define IS_LCD_WFS_TYPE(x)	(((x) == LCD_WAVE_A) || \
-				 ((x) == LCD_WAVE_B))
-#define IS_LCD_PRS_TYPE(x)      (((x) == LCD_PRS_1)     || \
-				 ((x) == LCD_PRS_2)     || \
-				 ((x) == LCD_PRS_4)     || \
-				 ((x) == LCD_PRS_8)     || \
-				 ((x) == LCD_PRS_16)    || \
-				 ((x) == LCD_PRS_32)    || \
-				 ((x) == LCD_PRS_64)    || \
-				 ((x) == LCD_PRS_128)   || \
-				 ((x) == LCD_PRS_256)   || \
-				 ((x) == LCD_PRS_512)   || \
-				 ((x) == LCD_PRS_1024)  || \
-				 ((x) == LCD_PRS_2048)  || \
-				 ((x) == LCD_PRS_4096)  || \
-				 ((x) == LCD_PRS_8192)  || \
-				 ((x) == LCD_PRS_16384) || \
-				 ((x) == LCD_PRS_32768))
-#define IS_LCD_DIV_TYPE(x)      (((x) == LCD_DIV_16) || \
-				 ((x) == LCD_DIV_17) || \
-				 ((x) == LCD_DIV_18) || \
-				 ((x) == LCD_DIV_19) || \
-				 ((x) == LCD_DIV_20) || \
-				 ((x) == LCD_DIV_21) || \
-				 ((x) == LCD_DIV_22) || \
-				 ((x) == LCD_DIV_23) || \
-				 ((x) == LCD_DIV_24) || \
-				 ((x) == LCD_DIV_25) || \
-				 ((x) == LCD_DIV_26) || \
-				 ((x) == LCD_DIV_27) || \
-				 ((x) == LCD_DIV_28) || \
-				 ((x) == LCD_DIV_29) || \
-				 ((x) == LCD_DIV_30) || \
-				 ((x) == LCD_DIV_31))
-#define IS_LCD_BLINK_MODE(x)    (((x) == LCD_BLINK_OFF)        || \
-				 ((x) == LCD_BLINK_SEG0_COM0)  || \
-				 ((x) == LCD_BLINK_SEG0_COMX2) || \
-				 ((x) == LCD_BLINK_ALLSEG_ALLCOM))
-#define IS_LCD_BLFRQ_TYPE(x)    (((x) == LCD_BLFRQ_8)   || \
-				 ((x) == LCD_BLFRQ_16)  || \
-				 ((x) == LCD_BLFRQ_32)  || \
-				 ((x) == LCD_BLFRQ_64)  || \
-				 ((x) == LCD_BLFRQ_128) || \
-				 ((x) == LCD_BLFRQ_256) || \
-				 ((x) == LCD_BLFRQ_512) || \
-				 ((x) == LCD_BLFRQ_1024))
-#define IS_LCD_STATUS_TYPE(x) 	(((x) == LCD_STATUS_RDY)   || \
-                                 ((x) == LCD_STATUS_ENS)   || \
-                                 ((x) == LCD_STATUS_UDR)   || \
-				 ((x) == LCD_STATUS_FCRSF) || \
-                                 ((x) == LCD_STATUS_ALL))
-#define IS_LCD_CLEARFLAG_TYPE(x)(((x) == LCD_FLAG_SOF) || \
-                                 ((x) == LCD_FLAG_UDD) || \
-                                 ((x) == LCD_STATUS_ALL))
-#define IS_LCD_IT_TYPE(x)      	(((x) == LCD_IT_SOF) || \
-                                 ((x) == LCD_IT_UDD))
-#define IS_LCD_FLAG_TYPE(x)	(((x) == LCD_FLAG_SOF) || \
-				 ((x) == LCD_FLAG_UDD))
-#define IS_LCD_SEG_TYPE(x)	(((x) == SEG_0_TO_31) || \
-				 ((x) == SEG_32_TO_59))
-#define IS_LCD_DEAD_TYPE(x)	(((x) == LCD_DEAD_TIME_NONE)     || \
-				 ((x) == LCD_DEAD_TIME_1_DIVCLK) || \
-				 ((x) == LCD_DEAD_TIME_2_DIVCLK) || \
-				 ((x) == LCD_DEAD_TIME_3_DIVCLK) || \
-				 ((x) == LCD_DEAD_TIME_4_DIVCLK) || \
-				 ((x) == LCD_DEAD_TIME_5_DIVCLK) || \
-				 ((x) == LCD_DEAD_TIME_6_DIVCLK) || \
-				 ((x) == LCD_DEAD_TIME_7_DIVCLK))
-#define IS_LCD_PON_TYPE(x)	(((x) == LCD_PON_NONE)     || \
-				 ((x) == LCD_PON_1_PRSCLK) || \
-				 ((x) == LCD_PON_2_PRSCLK) || \
-				 ((x) == LCD_PON_3_PRSCLK) || \
-				 ((x) == LCD_PON_4_PRSCLK) || \
-				 ((x) == LCD_PON_5_PRSCLK) || \
-				 ((x) == LCD_PON_6_PRSCLK) || \
-				 ((x) == LCD_PON_7_PRSCLK))
-#define IS_LCD_VGS_TYPE(x)	(((x) == LCD_VGS_0)  || \
-				 ((x) == LCD_VGS_1)  || \
-				 ((x) == LCD_VGS_2)  || \
-				 ((x) == LCD_VGS_3)  || \
-				 ((x) == LCD_VGS_4)  || \
-				 ((x) == LCD_VGS_5)  || \
-				 ((x) == LCD_VGS_6)  || \
-				 ((x) == LCD_VGS_7)  || \
-				 ((x) == LCD_VGS_8)  || \
-				 ((x) == LCD_VGS_9)  || \
-				 ((x) == LCD_VGS_10) || \
-				 ((x) == LCD_VGS_11) || \
-				 ((x) == LCD_VGS_12) || \
-				 ((x) == LCD_VGS_13) || \
-				 ((x) == LCD_VGS_14) || \
-				 ((x) == LCD_VGS_15))
-#define IS_LCD_BUFFER_TYPE(x)	((x) <= 15)
-
-/**
-  * @}
-  */
-
-/** @addtogroup LCD_Public_Functions
-  * @{
-  */
-
-/**
-  * @addtogroup LCD_Public_Functions_Group1
-  * @{
-  */
-/* Initialization and enable functions */
-ald_status_t lcd_init(lcd_handle_t *hperh);
-ald_status_t lcd_cmd(lcd_handle_t *hperh, type_func_t state);
-/**
-  * @}
-  */
-
-/**
-  * @addtogroup LCD_Public_Functions_Group2
-  * @{
-  */
-/* Config output and blink function */
-ald_status_t lcd_blink_config(lcd_handle_t *hperh, lcd_blink_t blink_mode, lcd_blfrq_t blink_freq);
-ald_status_t lcd_write(lcd_handle_t *hperh, uint8_t buf, uint32_t buf_data);
-ald_status_t lcd_write_seg(lcd_handle_t *hperh, lcd_seg_t seg, uint32_t seg_data);
-/**
-  * @}
-  */
-
-/**
-  * @addtogroup LCD_Public_Functions_Group3
-  * @{
-  */
-/* Query lcd status function */
-uint32_t lcd_get_status(lcd_handle_t *hperh, lcd_status_t lcd_flag);
-/**
-  * @}
-  */
-
-/**
-  * @addtogroup LCD_Public_Functions_Group4
-  * @{
-  */
-/* Interrupt function */
-ald_status_t lcd_interrupt_config(lcd_handle_t *hperh, lcd_it_t it, type_func_t state);
-flag_status_t lcd_get_it_status(lcd_handle_t *hperh, lcd_it_t it);
-it_status_t lcd_get_flag_status(lcd_handle_t *hperh, lcd_flag_t flag);
-ald_status_t lcd_clear_flag_status(lcd_handle_t *hperh, lcd_flag_t flag);
-void lcd_irq_handler(lcd_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_LCD_H__ */

+ 0 - 358
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_lptim.h

@@ -1,358 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_lptim.c
-  * @brief   LPTIM module driver.
-  *	     This is the common part of the LPTIM initialization
-  *
-  * @version V1.0
-  * @date    09 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_LPTIM_H__
-#define __ALD_LPTIM_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_cmu.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup LPTIM
-  * @{
-  */
-
-/** @defgroup LPTIM_Public_Types LPTIM Public Types
-  * @{
-  */
-
-/**
-  * @brief LPTIM clock select
-  */
-typedef enum {
-	LPTIM_CKSEL_INTERNAL = 0,	/**< Select internal clock */
-	LPTIM_CKSEL_EXTERNAL = 1,	/**< Select external clock */
-} lptim_cksel_t;
-
-/**
-  * @brief LPTIM clock pol
-  */
-typedef enum {
-	LPTIM_CKPOL_RISING  = 0,	/**< using rising edge */
-	LPTIM_CKPOL_FALLING = 1,	/**< using falling edge */
-} lptim_ckpol_t;
-
-/**
-  * @brief LPTIM clock fliter
-  */
-typedef enum {
-	LPTIM_CKFLT_0 = 0,	/**< not clock filter */
-	LPTIM_CKFLT_2 = 1,	/**< 2 cycle filter */
-	LPTIM_CKFLT_4 = 2,	/**< 4 cycle filter */
-	LPTIM_CKFLT_8 = 3,	/**< 8 cycle filter */
-} lptim_ckflt_t;
-
-/**
-  * @brief LPTIM trigger fliter
-  */
-typedef enum {
-	LPTIM_TRGFLT_0 = 0,	/**< not clock filter */
-	LPTIM_TRGFLT_2 = 1,	/**< 2 cycle filter */
-	LPTIM_TRGFLT_4 = 2,	/**< 4 cycle filter */
-	LPTIM_TRGFLT_8 = 3,	/**< 8 cycle filter */
-} lptim_trgflt_t;
-
-/**
-  * @brief LPTIM prescaler
-  */
-typedef enum {
-	LPTIM_PRESC_1   = 0,	/**< No prescaler is used */
-	LPTIM_PRESC_2   = 1,	/**< Clock is divided by 2 */
-	LPTIM_PRESC_4   = 2,	/**< Clock is divided by 4 */
-	LPTIM_PRESC_8   = 3,	/**< Clock is divided by 8 */
-	LPTIM_PRESC_16  = 4,	/**< Clock is divided by 16 */
-	LPTIM_PRESC_32  = 5,	/**< Clock is divided by 32 */
-	LPTIM_PRESC_64  = 6,	/**< Clock is divided by 64 */
-	LPTIM_PRESC_128 = 7,	/**< Clock is divided by 128 */
-} lptim_presc_t;
-
-/**
-  * @brief LPTIM trig select
-  */
-typedef enum {
-	LPTIM_TRIGSEL_EXT0 = 0,	/**< Trigger select external channel 0 */
-	LPTIM_TRIGSEL_EXT1 = 1,	/**< Trigger select external channel 1 */
-	LPTIM_TRIGSEL_EXT2 = 2,	/**< Trigger select external channel 2 */
-	LPTIM_TRIGSEL_EXT3 = 3,	/**< Trigger select external channel 3 */
-	LPTIM_TRIGSEL_EXT4 = 4,	/**< Trigger select external channel 4 */
-	LPTIM_TRIGSEL_EXT5 = 5,	/**< Trigger select external channel 5 */
-	LPTIM_TRIGSEL_EXT6 = 6,	/**< Trigger select external channel 6 */
-	LPTIM_TRIGSEL_EXT7 = 7,	/**< Trigger select external channel 7 */
-} lptim_trigsel_t;
-
-/**
-  * @brief LPTIM start mode select
-  */
-typedef enum {
-	LPTIM_MODE_SINGLE     = 0,	/**< Start single mode */
-	LPTIM_MODE_CONTINUOUS = 1,	/**< Start continuous mode */
-} lptim_mode_t;
-
-/**
-  * @brief LPTIM trig en
-  */
-typedef enum {
-	LPTIM_TRIGEN_SW      = 0,	/**< software trigger */
-	LPTIM_TRIGEN_RISING  = 1,	/**< rising edge trigger */
-	LPTIM_TRIGEN_FALLING = 2,	/**< falling edge trigger */
-	LPTIM_TRIGEN_BOTH    = 3,	/**< rising and falling edge trigger */
-} lptim_trigen_t;
-
-/**
-  * @brief LPTIM wave
-  */
-typedef enum {
-	LPTIM_WAVE_NONE   = 0,	/**< Output close */
-	LPTIM_WAVE_TOGGLE = 1,	/**< Output toggle */
-	LPTIM_WAVE_PULSE  = 2,	/**< Output pulse */
-	LPTIM_WAVE_PWM    = 3,	/**< Output PWM */
-} lptim_wave_t;
-
-/**
-  * @brief LPTIM interrupt
-  */
-typedef enum {
-	LPTIM_IT_CMPMAT  = 1,	/**< Compare interrupt bit */
-	LPTIM_IT_ARRMAT  = 2,	/**< Update interrupt bit */
-	LPTIM_IT_EXTTRIG = 4,	/**< external trigger interrupt bit */
-} lptim_it_t;
-
-/**
-  * @brief LPTIM Interrupt flag
-  */
-typedef enum {
-	LPTIM_FLAG_CMPMAT  = 1,	/**< Compare interrupt flag */
-	LPTIM_FLAG_ARRMAT  = 2,	/**< Update interrupt flag */
-	LPTIM_FLAG_EXTTRIG = 4,	/**< Update interrupt flag */
-} lptim_flag_t;
-
-/**
-  * @brief LPTIM state structures definition
-  */
-typedef enum {
-	LPTIM_STATE_RESET   = 0x00,	/**< Peripheral not yet initialized or disabled */
-	LPTIM_STATE_READY   = 0x01,	/**< Peripheral Initialized and ready for use */
-	LPTIM_STATE_BUSY    = 0x02,	/**< An internal process is ongoing */
-	LPTIM_STATE_TIMEOUT = 0x03,	/**< Timeout state */
-	LPTIM_STATE_ERROR   = 0x04,	/**< Reception process is ongoing */
-} lptim_state_t;
-
-/**
-  * @brief LPTIM Init Structure definition
-  */
-typedef struct {
-	lptim_presc_t psc;		/**< Specifies the prescaler value */
-	uint16_t arr;			/**< Specifies the update value */
-	uint16_t cmp;			/**< Specifies the compare value */
-	cmu_lp_perh_clock_sel_t clock;	/**< Specifies the clock choose */
-	lptim_mode_t mode;		/**< Specifies the start mode */
-} lptim_init_t;
-
-/**
-  * @brief LPTIM trigger Structure definition
-  */
-typedef struct {
-	lptim_trigen_t mode;	/**< Specifies the trigger mode */
-	lptim_trigsel_t sel;	/**< Specifies the trigger source select */
-} lptim_trigger_init_t;
-
-/**
-  * @brief LPTIM trigger Structure definition
-  */
-typedef struct {
-	lptim_cksel_t sel;	/**< Specifies the clock select */
-	lptim_ckpol_t polarity;	/**< Specifies the clock polarity */
-} lptim_clock_source_init_t;
-
-/**
-  * @brief  LPTIM Handle Structure definition
-  */
-typedef struct lptim_handle_s {
-	LPTIM_TypeDef *perh;	/**< Register base address */
-	lptim_init_t init;	/**< LPTIM Time required parameters */
-	lock_state_t lock;	/**< Locking object */
-	lptim_state_t state;	/**< LPTIM operation state */
-
-	void (*trig_cbk)(struct lptim_handle_s *arg);	/**< Trigger callback */
-	void (*update_cbk)(struct lptim_handle_s *arg);	/**< Update callback */
-	void (*cmp_cbk)(struct lptim_handle_s *arg);	/**< Compare callback */
-} lptim_handle_t;
-/**
-  * @}
-  */
-
-/** @defgroup LPTIM_Public_Macros LPTIM Public Macros
-  * @{
-  */
-#define LPTIM_ENABLE(x)			(SET_BIT((x)->perh->CON1, LP16T_CON1_ENABLE_MSK))
-#define LPTIM_DISABLE(x)		(CLEAR_BIT((x)->perh->CON1, LP16T_CON1_ENABLE_MSK))
-#define LPTIM_CNTSTART(x)		(SET_BIT((x)->perh->CON1, LP16T_CON1_CNTSTRT_MSK))
-#define LPTIM_SNGSTART(x)		(SET_BIT((x)->perh->CON1, LP16T_CON1_SNGSTRT_MSK))
-#define LPTIM_UPDATE_ENABLE(x)		(SET_BIT((x)->perh->UPDATE, LP16T_UPDATE_UDIS_MSK))
-#define LPTIM_UPDATE_DISABLE(x)		(CLEAR_BIT((x)->perh->UPDATE, LP16T_UPDATE_UDIS_MSK))
-#define LPTIM_PRELOAD_IMM(x)		(SET_BIT((x)->perh->CR0, LP16T_CON0_PRELOAD_MSK))
-#define LPTIM_PRELOAD_WAIT(x)		(CLEAR_BIT((x)->perh->CR0, LP16T_CON0_PRELOAD_MSK))
-#define LPTIM_WAVEPOL_NORMAL(x)		(MODIFY_REG((x)->perh->CR0, LP16T_CON0_WAVE_MSK, 0 << LP16T_CON0_WAVE_POSS))
-#define LPTIM_WAVEPOL_INVERSE(x)	(MODIFY_REG((x)->perh->CR0, LP16T_CON0_WAVE_MSK, 1 << LP16T_CON0_WAVE_POSS))
-/**
-  * @}
-  */
-
-/** @defgroup LPTIM_Private_Macros   LPTIM Private Macros
-  * @{
-  */
-#define IS_LPTIM(x)		((x) == LPTIM0)
-#define IS_LPTIM_CKSEL(x)	(((x) == LPTIM_CKSEL_INTERNAL) || \
-                                 ((x) == LPTIM_CKSEL_EXTERNAL))
-#define IS_LPTIM_CKPOL(x)	(((x) == LPTIM_CKPOL_RISING) || \
-                                 ((x) == LPTIM_CKPOL_FALLING))
-#define IS_LPTIM_MODE(x)	(((x) == LPTIM_MODE_SINGLE) || \
-                                 ((x) == LPTIM_MODE_CONTINUOUS))
-#define IS_LPTIM_CKFLT(x)	(((x) == LPTIM_CKFLT_0) || \
-                                 ((x) == LPTIM_CKFLT_2) || \
-                                 ((x) == LPTIM_CKFLT_4) || \
-                                 ((x) == LPTIM_CKFLT_8))
-#define IS_LPTIM_TRGFLT(x)	(((x) == LPTIM_TRGFLT_0) || \
-                                 ((x) == LPTIM_TRGFLT_2) || \
-                                 ((x) == LPTIM_TRGFLT_4) || \
-                                 ((x) == LPTIM_TRGFLT_8))
-#define IS_LPTIM_PRESC(x)	(((x) == LPTIM_PRESC_1)  || \
-                                 ((x) == LPTIM_PRESC_2)  || \
-                                 ((x) == LPTIM_PRESC_4)  || \
-                                 ((x) == LPTIM_PRESC_8)  || \
-                                 ((x) == LPTIM_PRESC_16) || \
-                                 ((x) == LPTIM_PRESC_32) || \
-                                 ((x) == LPTIM_PRESC_64) || \
-                                 ((x) == LPTIM_PRESC_128))
-#define IS_LPTIM_TRIGSEL(x)	(((x) == LPTIM_TRIGSEL_EXT0) || \
-                                 ((x) == LPTIM_TRIGSEL_EXT1) || \
-                                 ((x) == LPTIM_TRIGSEL_EXT2) || \
-                                 ((x) == LPTIM_TRIGSEL_EXT3) || \
-                                 ((x) == LPTIM_TRIGSEL_EXT4) || \
-                                 ((x) == LPTIM_TRIGSEL_EXT5) || \
-                                 ((x) == LPTIM_TRIGSEL_EXT6) || \
-                                 ((x) == LPTIM_TRIGSEL_EXT7))
-#define IS_LPTIM_TRIGEN(x)	(((x) == LPTIM_TRIGEN_SW)      || \
-                                 ((x) == LPTIM_TRIGEN_RISING)  || \
-                                 ((x) == LPTIM_TRIGEN_FALLING) || \
-                                 ((x) == LPTIM_TRIGEN_BOTH))
-#define IS_LPTIM_IT(x)		(((x) == LPTIM_IT_CMPMAT) || \
-                                 ((x) == LPTIM_IT_ARRMAT) || \
-                                 ((x) == LPTIM_IT_EXTTRIG))
-#define IS_LPTIM_FLAG(x)	(((x) == LPTIM_FLAG_CMPMAT) || \
-                                 ((x) == LPTIM_FLAG_ARRMAT) || \
-                                 ((x) == LPTIM_FLAG_EXTTRIG))
-/**
-  * @}
-  */
-
-/** @addtogroup LPTIM_Public_Functions
-  * @{
-  */
-
-/** @addtogroup LPTIM_Public_Functions_Group1
-  * @{
-  */
-void lptim_reset(lptim_handle_t *hperh);
-void lptim_trigger_config(lptim_handle_t *hperh, lptim_trigger_init_t *config);
-void lptim_clock_source_config(lptim_handle_t *hperh, lptim_clock_source_init_t *config);
-void lptim_trigger_filter_config(lptim_handle_t *hperh, lptim_trgflt_t flt);
-void lptim_clock_filter_config(lptim_handle_t *hperh, lptim_ckflt_t flt);
-/**
-  * @}
-  */
-
-/** @addtogroup LPTIM_Public_Functions_Group2
-  * @{
-  */
-ald_status_t lptim_toggle_init(lptim_handle_t *hperh);
-void lptim_toggle_start(lptim_handle_t *hperh);
-void lptim_toggle_stop(lptim_handle_t *hperh);
-void lptim_toggle_start_by_it(lptim_handle_t *hperh);
-void lptim_toggle_stop_by_it(lptim_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup LPTIM_Public_Functions_Group3
-  * @{
-  */
-ald_status_t lptim_pulse_init(lptim_handle_t *hperh);
-void lptim_pulse_start(lptim_handle_t *hperh);
-void lptim_pulse_stop(lptim_handle_t *hperh);
-void lptim_pulse_start_by_it(lptim_handle_t *hperh);
-void lptim_pulse_stop_by_it(lptim_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup LPTIM_Public_Functions_Group4
-  * @{
-  */
-ald_status_t lptim_pwm_init(lptim_handle_t *hperh);
-void lptim_pwm_start(lptim_handle_t *hperh);
-void lptim_pwm_stop(lptim_handle_t *hperh);
-void lptim_pwm_start_by_it(lptim_handle_t *hperh);
-void lptim_pwm_stop_by_it(lptim_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup LPTIM_Public_Functions_Group5
-  * @{
-  */
-void lptim_irq_handle(lptim_handle_t *hperh);
-void lptim_interrupt_config(lptim_handle_t *hperh, lptim_it_t it, type_func_t state);
-it_status_t lptim_get_it_status(lptim_handle_t *hperh, lptim_it_t it);
-flag_status_t lptim_get_flag_status(lptim_handle_t *hperh, lptim_flag_t flag);
-void lptim_clear_flag_status(lptim_handle_t *hperh, lptim_flag_t flag);
-/**
-  * @}
-  */
-
-/** @addtogroup LPTIM_Public_Functions_Group6
-  * @{
-  */
-lptim_state_t lptim_get_state(lptim_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_LPTIM_H__ */

+ 0 - 468
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_lpuart.h

@@ -1,468 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_lpuart.h
-  * @brief   Header file of Low Power UART module library.
-  *
-  * @version V1.0
-  * @date    30 May 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_LPUART_H__
-#define __ALD_LPUART_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-#include "ald_cmu.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup LPUART
-  * @{
-  */
-
-/**
-  * @defgroup LPUART_Public_Macros LPUART Public Macros
-  * @{
-  */
-
-/**
-  * @defgroup LPUART_Public_Macros1 LPUART FIFO Reset
-  * @{
-  */
-#define LPUART_FIFO_TX_RESET(hperh)	(SET_BIT((hperh)->perh->FIFOCON, LPUART_FIFOCON_TXRESET_MSK))
-#define LPUART_FIFO_RX_RESET(hperh)	(SET_BIT((hperh)->perh->FIFOCON, LPUART_FIFOCON_RXRESET_MSK))
-/**
-  * @}
-  */
-/**
-  * @defgroup LPUART_Public_Macros2 LPUART RS485 RX Enable
-  * @{
-  */
-#define LPUART_RS485_RX_DISABLE(hperh)	(SET_BIT((hperh)->perh->FIFOCON, LPUART_FIFOCON_NMPMRXDIS_MSK))
-#define LPUART_RS485_RX_ENABLE(hperh)	(CLEAR_BIT((hperh)->perh->FIFOCON, LPUART_FIFOCON_NMPMRXDIS_MSK))
-/**
-  * @}
-  */
-/**
-  * @defgroup LPUART_Public_Macros4 LPUART LoopMode Enable
-  * @{
-  */
-#define LPUART_LPBMOD_ENABLE(hperh)	(SET_BIT((hperh)->perh->CON0, LPUART_CON0_LPBMOD_MSK))
-#define LPUART_LPBMOD_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->CON0, LPUART_CON0_LPBMOD_MSK))
-/**
-  * @}
-  */
-/**
-  * @defgroup LPUART_Public_Macros5 LPUART IrDA TX Enable
-  * @{
-  */
-#define LPUART_IRTX_ENABLE(hperh)	(SET_BIT((hperh)->perh->CON1, LPUART_CON1_IRTXE_MSK))
-#define LPUART_IRTX_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->CON1, LPUART_CON1_IRTXE_MSK))
-/**
-  * @}
-  */
-/**
-  * @defgroup LPUART_Public_Macros6 LPUART IRWIDTH Enable
-  * @{
-  */
-#define LPUART_IRWIDTH_DISABLE(hperh)	(SET_BIT((hperh)->perh->CON1, LPUART_CON1_IRWIDTH_MSK))
-#define LPUART_IRWIDTH_ENABLE(hperh)	(CLEAR_BIT((hperh)->perh->CON1, LPUART_CON1_IRWIDTH_MSK))
-/**
-  * @}
-  */
-/**
-  * @defgroup LPUART_Public_Macros7 LPUART CTS/RTS Enable
-  * @{
-  */
-#define LPUART_CTS_ENABLE(hperh)	(SET_BIT((hperh)->perh->CON0, LPUART_CON0_ATCTSE_MSK))
-#define LPUART_CTS_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->CON0, LPUART_CON0_ATCTSE_MSK))
-#define LPUART_RTS_ENABLE(hperh)	(SET_BIT((hperh)->perh->CON0, LPUART_CON0_ATRTSE_MSK))
-#define LPUART_RTS_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->CON0, LPUART_CON0_ATRTSE_MSK))
-/**
-  * @}
-  */
-/**
-  * @defgroup LPUART_Public_Macros8 LPUART CTS/RTS Polarity
-  * @{
-  */
-#define LPUART_CTS_POL_LOW(hperh)	(SET_BIT((hperh)->perh->CON0, LPUART_CON0_CTSPOL_MSK))
-#define LPUART_CTS_POL_HIGH(hperh)	(CLEAR_BIT((hperh)->perh->CON0, LPUART_CON0_CTSPOL_MSK))
-#define LPUART_RTS_POL_LOW(hperh)	(SET_BIT((hperh)->perh->CON0, LPUART_CON0_RTSPOL_MSK))
-#define LPUART_RTS_POL_HIGH(hperh)	(CLEAR_BIT((hperh)->perh->CON0, LPUART_CON0_RTSPOL_MSK))
-/**
-  * @}
-  */
-/**
-  * @defgroup LPUART_Public_Macros10 LPUART Update Enable
-  * @{
-  */
-#define LPUART_UPDATE_ENABLE(hperh)	(CLEAR_BIT((hperh)->perh->UPDATE, LPUART_UPDATE_UDIS_MSK))
-#define LPUART_UPDATE_DISABLE(hperh)	(SET_BIT((hperh)->perh->UPDATE, LPUART_UPDATE_UDIS_MSK))
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup LPUART_Public_Types LPUART Public Types
-  * @{
-  */
-/**
-  * @brief LPUART Word Length
-  */
-typedef enum {
-	LPUART_WORD_LENGTH_5B = 0x0,	/**< 5-bits */
-	LPUART_WORD_LENGTH_6B = 0x1,	/**< 6-bits */
-	LPUART_WORD_LENGTH_7B = 0x2,	/**< 7-bits */
-	LPUART_WORD_LENGTH_8B = 0x3,	/**< 8-bits */
-	LPUART_WORD_LENGTH_9B = 0x4,	/**< 9-bits */
-} lpuart_word_length_t;
-
-/**
-  * @brief LPUART Stop Bits
-  */
-typedef enum {
-	LPUART_STOP_BITS_1 = 0x0,	/**< 1-bits */
-	LPUART_STOP_BITS_2 = 0x1,	/**< 2-bits */
-} lpuart_stop_bits_t;
-
-/**
-  * @brief LPUART Parity
-  */
-typedef enum {
-	LPUART_PARITY_NONE = 0x0,	/**< Not parity */
-	LPUART_PARITY_ODD  = 0x1,	/**< Odd parity */
-	LPUART_PARITY_EVEN = 0x3,	/**< Even parity */
-} lpuart_parity_t;
-
-/**
-  * @brief LPUART Mode
-  */
-typedef enum {
-	LPUART_MODE_UART  = 0x0,	/**< UART */
-	LPUART_MODE_IrDA  = 0x2,	/**< IrDA */
-	LPUART_MODE_RS485 = 0x3,	/**< RS485 */
-} lpuart_mode_t;
-
-/**
-  * @brief LPUART Hardware Flow Control
-  */
-typedef enum {
-	LPUART_HW_FLOW_CTL_NONE    = 0x0,	/**< None */
-	LPUART_HW_FLOW_CTL_RTS     = 0x1,	/**< RTS */
-	LPUART_HW_FLOW_CTL_CTS     = 0x2,	/**< CTS */
-	LPUART_HW_FLOW_CTL_RTS_CTS = 0x3,	/**< RTS & CTS */
-} lpuart_hw_flow_ctl_t;
-
-/**
-  * @brief ALD LPUART State
-  */
-typedef enum {
-	LPUART_STATE_RESET      = 0x00,	/**< Peripheral is not initialized */
-	LPUART_STATE_READY      = 0x01,	/**< Peripheral Initialized and ready for use */
-	LPUART_STATE_BUSY       = 0x02,	/**< an internal process is ongoing */
-	LPUART_STATE_BUSY_TX    = 0x11,	/**< Data Transmission process is ongoing */
-	LPUART_STATE_BUSY_RX    = 0x21,	/**< Data Reception process is ongoing */
-	LPUART_STATE_BUSY_TX_RX = 0x31,	/**< Data Transmission Reception process is ongoing */
-	LPUART_STATE_TIMEOUT    = 0x03,	/**< Timeout state */
-	LPUART_STATE_ERROR      = 0x04,	/**< Error */
-} lpuart_state_t;
-
-/**
-  * @brief LPUART Error Codes
-  */
-typedef enum {
-	LPUART_ERROR_NONE = ((uint32_t)0x00),	/**< No error */
-	LPUART_ERROR_PE   = ((uint32_t)0x01),	/**< Parity error */
-	LPUART_ERROR_NE   = ((uint32_t)0x02),	/**< Noise error */
-	LPUART_ERROR_FE   = ((uint32_t)0x04),	/**< frame error */
-	LPUART_ERROR_ORE  = ((uint32_t)0x08),	/**< Overrun error */
-	LPUART_ERROR_DMA  = ((uint32_t)0x10),	/**< DMA transfer error */
-} lpuart_error_t;
-
-/**
-  * @brief LPUART Init structure definition
-  */
-typedef struct {
-	uint32_t baud;				/**< Specifies the lpuart communication baud rate */
-	lpuart_word_length_t word_length;	/**< Specifies the number of data bits transmitted or received in a frame */
-	lpuart_stop_bits_t stop_bits;		/**< Specifies the number of stop bits transmitted */
-	lpuart_parity_t parity;			/**< Specifies the parity mode */
-	lpuart_mode_t mode;			/**< Specifies uart mode */
-	lpuart_hw_flow_ctl_t fctl;		/**< Specifies wether the hardware flow control mode is enabled or disabled */
-	cmu_lp_perh_clock_sel_t clock;		/**< Specifies clock, only support LOSC and LRC */
-} lpuart_init_t;
-
-/**
-  * @brief  LPUART handle structure definition
-  */
-typedef struct lpuart_handle_s {
-	LPUART_TypeDef *perh;		/**< LPUART registers base address */
-	lpuart_init_t init;		/**< LPUART communication parameters */
-	uint8_t *tx_buf;		/**< Pointer to LPUART Tx transfer Buffer */
-	uint16_t tx_size;		/**< LPUART Tx Transfer size */
-	uint16_t tx_count;		/**< LPUART Tx Transfer Counter */
-	uint8_t *rx_buf;		/**< Pointer to LPUART Rx transfer Buffer */
-	uint16_t rx_size;		/**< LPUART Rx Transfer size */
-	uint16_t rx_count;		/**< LPUART Rx Transfer Counter */
-#ifdef ALD_DMA
-	dma_handle_t hdmatx;		/**< LPUART Tx DMA Handle parameters */
-	dma_handle_t hdmarx;		/**< LPUART Rx DMA Handle parameters */
-#endif
-	lock_state_t lock;            	/**< Locking object */
-	lpuart_state_t state;		/**< LPUART communication state */
-	lpuart_error_t err_code;	/**< LPUART Error code */
-
-	void (*tx_cplt_cbk)(struct lpuart_handle_s *arg);	/**< Tx completed callback */
-	void (*rx_cplt_cbk)(struct lpuart_handle_s *arg);	/**< Rx completed callback */
-	void (*error_cbk)(struct lpuart_handle_s *arg);		/**< error callback */
-} lpuart_handle_t;
-
-/**
-  * @brief LPUART RS485 Configure Structure definition
-  */
-typedef struct {
-	type_func_t RS485_NMM;		/**< Normal Point Mode */
-	type_func_t RS485_AAD;		/**< Auto-Address Detect */
-	type_func_t RS485_AUD;		/**< Auto-Direction Mode */
-	type_func_t RS485_ADD_DET;	/**< Eable/Disable Address Detect */
-	uint8_t RS485_ADDCMP;		/**< Address for compare */
-} lpuart_rs485_config_t;
-
-/**
-  * @brief LPUART DMA Requests
-  */
-typedef enum {
-	LPUART_DMA_REQ_TX = 0x0,	/**< TX dma */
-	LPUART_DMA_REQ_RX = 0x1,	/**< RX dma */
-} lpuart_dma_req_t;
-
-/**
-  * @brief LPUART RXFIFO size
-  */
-typedef enum {
-	LPUART_RXFIFO_1BYTE  = 0x0,	/**< 1-Byte */
-	LPUART_RXFIFO_4BYTE  = 0x1,	/**< 4-Bytes */
-	LPUART_RXFIFO_8BYTE  = 0x2,	/**< 8-Bytes */
-	LPUART_RXFIFO_14BYTE = 0x3,	/**< 14-Bytes */
-} lpuart_rxfifo_t;
-
-/**
-  * @brief LPUART Interrupts Types
-  */
-typedef enum {
-	LPUART_IT_RBR    = (1U << 0),	/**< RBR */
-	LPUART_IT_TBEMP  = (1U << 1),	/**< TBEMP */
-	LPUART_IT_CTSDET = (1U << 2),	/**< CTSDET */
-	LPUART_IT_RXTO   = (1U << 3),	/**< RXTO */
-	LPUART_IT_RXOV   = (1U << 4),	/**< RXOV */
-	LPUART_IT_TXOV   = (1U << 5),	/**< TXOV */
-	LPUART_IT_CTSWK  = (1U << 7),	/**< CTSWK */
-	LPUART_IT_DATWK  = (1U << 8),	/**< DATWK */
-	LPUART_IT_PERR   = (1U << 9),	/**< PERR */
-	LPUART_IT_FERR   = (1U << 10),	/**< FERR */
-	LPUART_IT_BRKERR = (1U << 11),	/**< BRKERR */
-	LPUART_IT_ADET   = (1U << 12),	/**< ADET */
-	LPUART_IT_TC     = (1U << 15),	/**< TC */
-} lpuart_it_t;
-
-/**
-  * @brief LPUART Flags Types
-  */
-typedef enum {
-	LPUART_IF_RBR    = (1U << 0),	/**< RBR */
-	LPUART_IF_TBEMP  = (1U << 1),	/**< TBEMP */
-	LPUART_IF_CTSDET = (1U << 2),	/**< CTSDET */
-	LPUART_IF_RXTO   = (1U << 3),	/**< RXTO */
-	LPUART_IF_RXOV   = (1U << 4),	/**< RXOV */
-	LPUART_IF_TXOV   = (1U << 5),	/**< TXOV */
-	LPUART_IF_CTSWK  = (1U << 7),	/**< CTSWK */
-	LPUART_IF_DATWK  = (1U << 8),	/**< DATWK */
-	LPUART_IF_PERR   = (1U << 9),	/**< PERR */
-	LPUART_IF_FERR   = (1U << 10),	/**< FERR */
-	LPUART_IF_BRKERR = (1U << 11),	/**< BRKERR */
-	LPUART_IF_ADET   = (1U << 12),	/**< ADET */
-	LPUART_IF_TC     = (1U << 15),	/**< TC */
-} lpuart_flag_t;
-
-/**
-  * @brief LPUART Status Types
-  */
-typedef enum {
-	LPUART_STAT_RXEMP   = (1U << 6),	/**< RX FIFO empty */
-	LPUART_STAT_RXFULL  = (1U << 7),	/**< RX FIFO full */
-	LPUART_STAT_TXEMP   = (1U << 14),	/**< TX FIFO empty */
-	LPUART_STAT_TXFULL  = (1U << 15),	/**< TX FIFO full */
-	LPUART_STAT_TXIDLE  = (1U << 16),	/**< TX idle */
-	LPUART_STAT_CTSSTAT = (1U << 17),	/**< CTS status */
-	LPUART_STAT_RTSSTAT = (1U << 18),	/**< RTS status */
-} lpuart_status_t;
-/**
-  * @}
-  */
-
-/** @defgroup LPUART_Private_Macros   LPUART Private Macros
-  * @{
-  */
-#define IS_LPUART(x)  ((x) == LPUART0)
-#define IS_LPUART_DATA(x) ((x) <= 0x1FF)
-#define IS_LPUART_BAUDRATE(x) (((x) > 0) && ((x) <= 115200))
-#define IS_LPUART_WORD_LENGTH(x)  (((x) == LPUART_WORD_LENGTH_5B) || \
-                                   ((x) == LPUART_WORD_LENGTH_6B) || \
-                                   ((x) == LPUART_WORD_LENGTH_7B) || \
-                                   ((x) == LPUART_WORD_LENGTH_8B) || \
-                                   ((x) == LPUART_WORD_LENGTH_9B))
-#define IS_LPUART_STOPBITS(x)  (((x) == LPUART_STOP_BITS_1) || \
-                                ((x) == LPUART_STOP_BITS_2))
-#define IS_LPUART_PARITY(x)  (((x) == LPUART_PARITY_NONE)  || \
-                              ((x) == LPUART_PARITY_ODD) || \
-                              ((x) == LPUART_PARITY_EVEN))
-#define IS_LPUART_MODE(x)  (((x) == LPUART_MODE_UART) || \
-                            ((x) == LPUART_MODE_IrDA) || \
-                            ((x) == LPUART_MODE_RS485))
-#define IS_LPUART_HARDWARE_FLOW_CONTROL(x)\
-                              (((x) == LPUART_HW_FLOW_CTL_NONE) || \
-                               ((x) == LPUART_HW_FLOW_CTL_RTS)  || \
-                               ((x) == LPUART_HW_FLOW_CTL_CTS)  || \
-                               ((x) == LPUART_HW_FLOW_CTL_RTS_CTS))
-#define IS_LPUART_DMAREQ(x)  (((x) == LPUART_DMA_REQ_TX) || ((x) == LPUART_DMA_REQ_RX))
-#define IS_LPUART_RXFIFO(x)  (((x) == LPUART_RXFIFO_1BYTE) || \
-                              ((x) == LPUART_RXFIFO_4BYTE) || \
-                              ((x) == LPUART_RXFIFO_8BYTE) || \
-                              ((x) == LPUART_RXFIFO_14BYTE))
-#define IS_LPUART_IT(x)	(((x) == LPUART_IT_RBR)    || \
-                         ((x) == LPUART_IT_TBEMP)  || \
-                         ((x) == LPUART_IT_CTSDET) || \
-                         ((x) == LPUART_IT_RXTO)   || \
-                         ((x) == LPUART_IT_RXOV)   || \
-                         ((x) == LPUART_IT_TXOV)   || \
-                         ((x) == LPUART_IT_CTSWK)  || \
-                         ((x) == LPUART_IT_DATWK)  || \
-                         ((x) == LPUART_IT_PERR)   || \
-                         ((x) == LPUART_IT_FERR)   || \
-                         ((x) == LPUART_IT_BRKERR) || \
-                         ((x) == LPUART_IT_ADET)   || \
-                         ((x) == LPUART_IT_TC))
-#define IS_LPUART_IF(x)	(((x) == LPUART_IF_RBR)    || \
-                         ((x) == LPUART_IF_TBEMP)  || \
-                         ((x) == LPUART_IF_CTSDET) || \
-                         ((x) == LPUART_IF_RXTO)   || \
-                         ((x) == LPUART_IF_RXOV)   || \
-                         ((x) == LPUART_IF_TXOV)   || \
-                         ((x) == LPUART_IF_CTSWK)  || \
-                         ((x) == LPUART_IF_DATWK)  || \
-                         ((x) == LPUART_IF_PERR)   || \
-                         ((x) == LPUART_IF_FERR)   || \
-                         ((x) == LPUART_IF_BRKERR) || \
-                         ((x) == LPUART_IF_ADET)   || \
-                         ((x) == LPUART_IF_TC))
-#define IS_LPUART_STAT(x)	(((x) == LPUART_STAT_RXEMP)   || \
-                                 ((x) == LPUART_STAT_RXFULL)  || \
-                                 ((x) == LPUART_STAT_TXEMP)   || \
-                                 ((x) == LPUART_STAT_TXFULL)  || \
-                                 ((x) == LPUART_STAT_TXIDLE)  || \
-                                 ((x) == LPUART_STAT_CTSSTAT) || \
-                                 ((x) == LPUART_STAT_RTSSTAT))
-
-#define LPUART_STATE_TX_MASK	(1 << 4)
-#define LPUART_STATE_RX_MASK	(1 << 5)
-/**
-  * @}
-  */
-
-/** @addtogroup LPUART_Public_Functions
-  * @{
-  */
-
-/** @addtogroup LPUART_Public_Functions_Group1
-  * @{
-  */
-/* Initialization functions */
-void lpuart_init(lpuart_handle_t *hperh);
-void lpuart_reset(lpuart_handle_t *hperh);
-void lpuart_rs485_config(lpuart_handle_t *hperh, lpuart_rs485_config_t *config);
-/**
-  * @}
-  */
-
-/** @addtogroup LPUART_Public_Functions_Group2
-  * @{
-  */
-/* IO operation functions */
-ald_status_t lpuart_send(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t lpuart_recv(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t lpuart_send_by_it(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t lpuart_recv_by_it(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size);
-#ifdef ALD_DMA
-ald_status_t lpuart_send_by_dma(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t lpuart_recv_by_dma(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t lpuart_dma_pause(lpuart_handle_t *hperh);
-ald_status_t lpuart_dma_resume(lpuart_handle_t *hperh);
-ald_status_t lpuart_dma_stop(lpuart_handle_t *hperh);
-#endif
-void lpuart_irq_handle(lpuart_handle_t *hperh);
-
-/**
-  * @}
-  */
-
-/** @addtogroup LPUART_Public_Functions_Group3
-  * @{
-  */
-/* Peripheral Control functions */
-void lpuart_interrupt_config(lpuart_handle_t *hperh, lpuart_it_t it, type_func_t status);
-void lpuart_tx_interval_config(lpuart_handle_t *hperh, uint8_t val);
-void lpuart_dma_req_config(lpuart_handle_t *hperh, lpuart_dma_req_t req, type_func_t status);
-void lpuart_rx_fifo_it_config(lpuart_handle_t *hperh, lpuart_rxfifo_t config);
-void lpuart_rx_fifo_rts_config(lpuart_handle_t *hperh, lpuart_rxfifo_t config);
-ald_status_t lpuart_rs485_send_addr(lpuart_handle_t *hperh, uint16_t addr, uint32_t timeout);
-flag_status_t lpuart_get_status(lpuart_handle_t *hperh, lpuart_status_t flag);
-flag_status_t lpuart_get_flag_status(lpuart_handle_t *hperh, lpuart_flag_t flag);
-void lpuart_clear_flag_status(lpuart_handle_t *hperh, lpuart_flag_t flag);
-it_status_t lpuart_get_it_status(lpuart_handle_t *hperh, lpuart_it_t it);
-/**
-  * @}
-  */
-
-/** @addtogroup LPUART_Public_Functions_Group4
-  * @{
-  */
-/* Peripheral State and Errors functions */
-lpuart_state_t lpuart_get_state(lpuart_handle_t *hperh);
-uint32_t lpuart_get_error(lpuart_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_LPUART_H__ */

+ 0 - 614
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_pis.h

@@ -1,614 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_pis.h
-  * @brief   Header file of PIS driver.
-  *
-  * @version V1.0
-  * @date    27 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_PIS_H__
-#define __ALD_PIS_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup PIS
-  * @{
-  */
-
-/** @defgroup PIS_Public_Types PIS Public Types
-  * @{
-  */
-
-/**
-  * @brief Producer entry
-  */
-typedef enum {
-	PIS_NON               = 0x0,	/**< No async */
-	PIS_GPIO_PIN0         = 0x10,	/**< Pin0, level,support async */
-	PIS_GPIO_PIN1         = 0x11,	/**< Pin1, level,support async */
-	PIS_GPIO_PIN2         = 0x12,	/**< Pin2, level,support async */
-	PIS_GPIO_PIN3         = 0x13,	/**< Pin3, level,support async */
-	PIS_GPIO_PIN4         = 0x14,	/**< Pin4, level,support async */
-	PIS_GPIO_PIN5         = 0x15,	/**< Pin5, level,support async */
-	PIS_GPIO_PIN6         = 0x16,	/**< Pin6, level,support async */
-	PIS_GPIO_PIN7         = 0x17,	/**< Pin7, level,support async */
-	PIS_GPIO_PIN8         = 0x18,	/**< Pin8, level,support async */
-	PIS_GPIO_PIN9         = 0x19,	/**< Pin9, level,support async */
-	PIS_GPIO_PIN10        = 0x1a,	/**< Pin10, level,support async */
-	PIS_GPIO_PIN11        = 0x1b,	/**< Pin11, level,support async */
-	PIS_GPIO_PIN12        = 0x1c,	/**< Pin12, level,support async */
-	PIS_GPIO_PIN13        = 0x1d,	/**< Pin13, level,support async */
-	PIS_GPIO_PIN14        = 0x1e,	/**< Pin14, level,support async */
-	PIS_GPIO_PIN15        = 0x1f,	/**< Pin15, level,support async */
-	PIS_ACMP_OUT0         = 0x30,	/**< Acmp0 output, level,support async */
-	PIS_ACMP_OUT1         = 0x31,	/**< Acmp1 output, level,support async */
-	PIS_DAC0_CH0          = 0x40,	/**< Dac0 channel 0, pclk2 pulse,support async */
-	PIS_DAC0_CH1          = 0x41,	/**< Dac0 channel 1, pclk2 pulse,support async */
-	PIS_ADC0_INJECT       = 0x60,	/**< Adc0 inject, pclk2 pulse,support async */
-	PIS_ADC0_REGULAT      = 0x61,	/**< Adc0 regulat, pclk2 pulse,support async */
-	PIS_ADC0_WINDOW       = 0x62,	/**< Adc0 window, no have */
-	PIS_LVD               = 0x70,	/**< Lvd, level,support async */
-	PIS_UART0_ASY_SEND    = 0x80,	/**< Uart0 asy send, pulse,support async */
-	PIS_UART0_ASY_RECV    = 0x81,	/**< Uart0 asy recv, pulse,support async */
-	PIS_UART0_IRDAOUT     = 0x82,	/**< Uart0 irdaout, level,support async */
-	PIS_UART0_RTSOUT      = 0x83,	/**< Uart0 rtsout, level,support async */
-	PIS_UART0_TXOUT       = 0x84,	/**< Uart0 txout, level,support async */
-	PIS_UART0_SYN_SEND    = 0x85,	/**< Uart0 syn send, pulse,support async */
-	PIS_UART0_SYN_RECV    = 0x86,	/**< Uart0 syn recv, pulse,support async */
-	PIS_UART1_ASY_SEND    = 0x90,	/**< Uart1 asy send, pulse,support async */
-	PIS_UART1_ASY_RECV    = 0x91,	/**< Uart1 asy recv, pulse,support async */
-	PIS_UART1_IRDA        = 0x92,	/**< Uart1 irdaout, level,support async */
-	PIS_UART1_RTS         = 0x93,	/**< Uart1 rtsout, level,support async */
-	PIS_UART1_TXOUT       = 0x94,	/**< Uart1 txout, level,support async */
-	PIS_UART1_SYN_SEND    = 0x95,	/**< Uart1 syn send, pulse,support async */
-	PIS_UART1_SYN_RECV    = 0x96,	/**< Uart1 syn recv, pulse,support async */
-	PIS_UART2_ASY_SEND    = 0xa0,	/**< Uart2 asy send, pulse,support async */
-	PIS_UART2_ASY_RECV    = 0xa1,	/**< Uart2 asy recv, pulse,support async */
-	PIS_UART2_IRDA        = 0xa2,	/**< Uart2 irdaout, level,support async */
-	PIS_UART2_RTS         = 0xa3,	/**< Uart2 rtsout, level,support async */
-	PIS_UART2_TXOUT       = 0xa4,	/**< Uart2 txout, level,support async */
-	PIS_UART2_SYN_SEND    = 0xa5,	/**< Uart2 syn send, pulse,support async */
-	PIS_UART2_SYN_RECV    = 0xa6,	/**< Uart2 syn recv, pulse,support async */
-	PIS_UART3_ASY_SEND    = 0xb1,	/**< Uart3 asy send, pulse,support async */
-	PIS_UART3_ASY_RECV    = 0xb2,	/**< Uart3 asy recv, pulse,support async */
-	PIS_UART3_IRDA        = 0xb3,	/**< Uart3 irdaout, level,support async */
-	PIS_UART3_RTS         = 0xb4,	/**< Uart3 rtsout, level,support async */
-	PIS_UART3_TXOUT       = 0xb5,	/**< Uart3 txout, level,support async */
-	PIS_UART3_SYN_SEND    = 0xb6,	/**< Uart3 syn send, pulse,support async */
-	PIS_UART3_SYN_RECV    = 0xb7,	/**< Uart3 syn recv, pulse,support async */
-	PIS_EUART0_RECV       = 0xc0,	/**< Euart0 recv, plck1 pulse */
-	PIS_EUART0_SEND       = 0xc1,	/**< Euart0 send, plck1 pulse */
-	PIS_EUART0_TXOUT      = 0xc2,	/**< Euart0 txout, plck1 level */
-	PIS_EUART1_RECV       = 0xd0,	/**< Euart1 recv, plck1 pulse */
-	PIS_EUART1_SEND       = 0xd1,	/**< Euart1 send, plck1 pulse */
-	PIS_EUART1_TXOUT      = 0xd2,	/**< Euart1 txout, plck1 level */
-	PIS_SPI0_RECV         = 0xe0,	/**< Spi0 recv, plck1 pulse */
-	PIS_SPI0_SEND         = 0xe1,	/**< Spi0 send, plck1 pulse */
-	PIS_SPI0_NE           = 0xe2,	/**< Spi0 ne, plck1 level */
-	PIS_SPI1_RECV         = 0xf0,	/**< Spi1 recv, plck1 pulse */
-	PIS_SPI1_SEND         = 0xf1,	/**< Spi1 send, plck1 pulse */
-	PIS_SPI1_NE           = 0xf2,	/**< Spi1 ne, plck1 level */
-	PIS_I2C0_RECV         = 0x100,	/**< I2c0 recv, plck1 level */
-	PIS_I2C0_SEND         = 0x101,	/**< I2c0 send, plck1 level */
-	PIS_I2C1_RECV         = 0x110,	/**< I2c1 recv, plck1 level */
-	PIS_I2C1_SEND         = 0x111,	/**< I2c1 send, plck1 level */
-	PIS_TIMER0_UPDATA     = 0x120,	/**< Timer0 updata, plck1 pulse */
-	PIS_TIMER0_TRIG       = 0x121,	/**< Timer0 trig, plck1 pulse */
-	PIS_TIMER0_INPUT      = 0x122,	/**< Timer0 input, plck1 pulse */
-	PIS_TIMER0_OUTPUT     = 0x123,	/**< Timer0 output, plck1 pulse */
-	PIS_TIMER1_UPDATA     = 0x130,	/**< Timer1 updata, plck1 pulse */
-	PIS_TIMER1_TRIG       = 0x131,	/**< Timer1 trig, plck1 pulse */
-	PIS_TIMER1_INPUT      = 0x132,	/**< Timer1 input, plck1 pulse */
-	PIS_TIMER1_OUTPUT     = 0x133,	/**< Timer1 output, plck1 pulse */
-	PIS_TIMER2_UPDATA     = 0x140,	/**< Timer2 updata, plck1 pulse */
-	PIS_TIMER2_TRIG       = 0x141,	/**< Timer2 trig, plck1 pulse */
-	PIS_TIMER2_INPUT      = 0x142,	/**< Timer2 input, plck1 pulse */
-	PIS_TIMER2_OUTPUT     = 0x143,	/**< Timer2 output, plck1 pulse */
-	PIS_TIMER3_UPDATA     = 0x150,	/**< Timer0 updata, plck1 pulse */
-	PIS_TIMER3_TRIG       = 0x151,	/**< Timer0 trig, plck1 pulse */
-	PIS_TIMER3_INPUT      = 0x152,	/**< Timer0 input, plck1 pulse */
-	PIS_TIMER3_OUTPUT     = 0x153,	/**< Timer0 output, plck1 pulse */
-	PIS_RTC_CLOCK         = 0x160,	/**< Rtc clock, pulse,support async */
-	PIS_RTC_ALARM         = 0x161,	/**< Rtc alarm, pulse,support async */
-	PIS_LPTIM0_SYN_UPDATA = 0x170,	/**< Lptimer0 syn updata, pulse,support async */
-	PIS_LPTIM0_ASY_UPDATA = 0x171,	/**< Lptimer0 asy updata, pulse,support async */
-	PIS_LPUART0_ASY_RECV  = 0x180,	/**< Lpuart0 asy recv, pulse,support async */
-	PIS_LPUART0_ASY_SEND  = 0x181,	/**< Lpuart0 asy send, pulse,support async */
-	PIS_LPUART0_SYN_RECV  = 0x182,	/**< Lpuart0 syn recv, pulse,support async */
-	PIS_LPUART0_SYN_SEND  = 0x183,	/**< Lpuart0 syn recv, pulse,support async */
-	PIS_DMA               = 0x190,	/**< Dma, pulse,support async */
-	PIS_ADC1_INJECT       = 0x1a0,	/**< Adc1 inject, pclk2 pulse,support async */
-	PIS_ADC1_REGULAT      = 0x1a1,	/**< Adc1 regulat, pclk2 pulse,support async */
-	PIS_ADC1_WINDOW       = 0x1a2,	/**< Adc1 window, no have */
-} pis_src_t;
-
-/**
-  * @brief Consumer entry
-  */
-typedef enum {
-	PIS_CH0_TIMER0_BRKIN  = 0x4000,	/**< Timer0 brkin */
-	PIS_CH0_SPI1_CLK      = 0xF010,	/**< Spi1 clk */
-	PIS_CH0_LPTIM0_EXT0   = 0x0030,	/**< Lptimer0 ext0 */
-	PIS_CH0_ADC1_NORMAL   = 0x0030,	/**< Adc1 normal */
-	PIS_CH1_TIMER0_CH1IN  = 0x0001,	/**< Timer0 ch1in */
-	PIS_CH1_TIMER2_CH1IN  = 0x0101,	/**< Timer2 ch1in */
-	PIS_CH1_TIMER3_CH1IN  = 0x8101,	/**< Timer3 ch1in */
-	PIS_CH1_LPTIM0_EXT1   = 0x0031,	/**< Lptime0 ext1 */
-	PIS_CH1_UART0_RX_IRDA = 0x0011,	/**< Uart0 rx irda */
-	PIS_CH1_ADC1_INSERT   = 0x0031,	/**< Adc1 insert */
-	PIS_CH2_TIMER0_CH2IN  = 0x1002,	/**< Timer0 ch2in */
-	PIS_CH2_TIMER2_CH2IN  = 0x1102,	/**< Timer2 ch2in */
-	PIS_CH2_TIMER3_CH2IN  = 0x9102,	/**< Timer3 ch2in */
-	PIS_CH2_LPTIM0_EXT2   = 0x0032,	/**< Lptime0 ext2 */
-	PIS_CH2_UART1_RX_IRDA = 0x1012,	/**< Uart1 rx irda */
-	PIS_CH3_TIMER0_CH3IN  = 0x2003,	/**< Timer0 ch3in */
-	PIS_CH3_LPTIM0_EXT3   = 0x0033,	/**< Lptime0 ext3 */
-	PIS_CH3_UART2_RX_IRDA = 0x2013,	/**< Uart2 rx irda */
-	PIS_CH4_TIMER0_CH4IN  = 0x0004,	/**< Timer0 ch4in */
-	PIS_CH4_TIMER0_ITR0   = 0x0034,	/**< Timer0 itr0 */
-	PIS_CH4_TIMER2_ITR0   = 0x0034,	/**< Timer2 itr0 */
-	PIS_CH4_TIMER3_ITR0   = 0x0034,	/**< Timer3 itr0 */
-	PIS_CH4_LPTIM0_EXT4   = 0x4034,	/**< Lptime0 ext4 */
-	PIS_CH4_UART3_RX_IRDA = 0x3014,	/**< Uart3 rx irda */
-	PIS_CH5_SPI0_RX       = 0xC015,	/**< Spi0 rx */
-	PIS_CH5_LPTIM0_EXT5   = 0x0035,	/**< Lptime0 ext5 */
-	PIS_CH5_EUART0_RX     = 0x6015,	/**< Euart0 rx */
-	PIS_CH5_TIMER0_ITR1   = 0x0035,	/**< Timer0 itr1 */
-	PIS_CH5_TIMER2_ITR1   = 0x0035,	/**< Timer2 itr1 */
-	PIS_CH5_TIMER3_ITR1   = 0x0035,	/**< Timer3 itr1 */
-	PIS_CH6_SPI0_CLK      = 0xD016,	/**< Spi0 clk */
-	PIS_CH6_ADC0_NORMAL   = 0x0036,	/**< Adc0 normal */
-	PIS_CH6_LPTIM0_EXT6   = 0x0036,	/**< Lptime0 ext6 */
-	PIS_CH6_EUART1_RX     = 0x7016,	/**< Euart1 rx */
-	PIS_CH6_TIMER0_ITR2   = 0x0036,	/**< Timer0 itr2 */
-	PIS_CH6_TIMER2_ITR2   = 0x0036,	/**< Timer2 itr2 */
-	PIS_CH6_TIMER3_ITR2   = 0x0036,	/**< Timer3 itr2 */
-	PIS_CH6_DAC_CH1       = 0x0036,	/**< Dac channel 1 */
-	PIS_CH7_SPI1_RX       = 0xE017,	/**< Spi1 rx */
-	PIS_CH7_ADC0_INSERT   = 0x0037,	/**< Adc0 insert */
-	PIS_CH7_LPTIM0_EXT7   = 0x0037,	/**< Lptime0 ext7 */
-	PIS_CH7_DMA           = 0x0037,	/**< Dma */
-	PIS_CH7_TIMER0_ITR3   = 0x0037,	/**< Timer0 itr3 */
-	PIS_CH7_TIMER2_ITR3   = 0x0037,	/**< Timer2 itr3 */
-	PIS_CH7_TIMER3_ITR3   = 0x0037,	/**< Timer3 itr3 */
-	PIS_CH7_LPUART_RX     = 0x8017,	/**< Lpuart rx */
-	PIS_CH7_DAC_CH0       = 0x0037,	/**< Dac channel 0 */
-} pis_trig_t;
-
-/**
-  * @brief Clock select
-  */
-typedef enum {
-	PIS_CLK_PCLK1 = 0,	/**< Pclock1 */
-	PIS_CLK_PCLK2 = 1,	/**< Pclock2 */
-	PIS_CLK_SYS   = 2,	/**< Sys clock */
-	PIS_CLK_LP    = 3,	/**< Low power clock */
-} pis_clock_t;
-
-/**
-  * @brief Level select
-  */
-typedef enum {
-	PIS_EDGE_NONE    = 0,	/**< None edge */
-	PIS_EDGE_UP      = 1,	/**< Up edge */
-	PIS_EDGE_DOWN    = 2,	/**< Down edge */
-	PIS_EDGE_UP_DOWN = 3,	/**< Up and down edge */
-} pis_edge_t;
-
-/**
-  * @brief Output style
-  */
-typedef enum {
-	PIS_OUT_LEVEL = 0,	/**< Level */
-	PIS_OUT_PULSE = 1,	/**< Pulse */
-} pis_output_t;
-/**
-  * @brief Sync select
-  */
-typedef enum {
-	PIS_SYN_DIRECT      = 0,	/**< Direct */
-	PIS_SYN_ASY_PCLK1   = 1,	/**< Asy pclk1 */
-	PIS_SYN_ASY_PCLK2   = 2,	/**< Asy pclk2 */
-	PIS_SYN_ASY_PCLK    = 3,	/**< Asy pclk */
-	PIS_SYN_PCLK2_PCLK1 = 4,	/**< Pclk2 to pclk1 */
-	PIS_SYN_PCLK1_PCLK2 = 5,	/**< Pclk1 to pclk2 */
-	PIS_SYN_PCLK12_SYS  = 6,	/**< Pclk1 or pclk2 to sysclk */
-} pis_syncsel_t;
-
-/**
-  * @brief Pis channel
-  */
-typedef enum {
-	PIS_CH_0 = 0,	/**< Channel 0 */
-	PIS_CH_1 = 1,	/**< Channel 1 */
-	PIS_CH_2 = 2,	/**< Channel 2 */
-	PIS_CH_3 = 3,	/**< Channel 3 */
-	PIS_CH_4 = 4,	/**< Channel 4 */
-	PIS_CH_5 = 5,	/**< Channel 5 */
-	PIS_CH_6 = 6,	/**< Channel 6 */
-	PIS_CH_7 = 7,	/**< Channel 7 */
-} pis_ch_t;
-
-/**
-  * @brief Pis output channel
-  */
-typedef enum {
-	PIS_OUT_CH_0 = 0,	/**< Channel 0 */
-	PIS_OUT_CH_1 = 1,	/**< Channel 1 */
-	PIS_OUT_CH_2 = 2,	/**< Channel 2 */
-	PIS_OUT_CH_3 = 3,	/**< Channel 3 */
-} pis_out_ch_t;
-
-/**
-  * @brief Indirect value,no care of it.
-  */
-typedef enum {
-	PIS_CON_0    = 0,	/**< Con 0 */
-	PIS_CON_1    = 1,	/**< Con 1 */
-	PIS_CON_NONE = 2,	/**< None */
-} pis_con_t;
-
-/**
-  * @brief Indirect value,no care of it.
-  */
-typedef union {
-	struct {
-		uint8_t ch    :4;	/**< Channel */
-		uint8_t con   :4;	/**< Contorl */
-		uint8_t shift :8;	/**< Shift */
-	};
-	uint16_t HalfWord;
-} pis_divide_t;
-
-/**
-  * @brief PIS state structures definition
-  */
-typedef enum {
-	PIS_STATE_RESET   = 0x00,	/**< Peripheral is not initialized */
-	PIS_STATE_READY   = 0x01,	/**< Peripheral Initialized and ready for use */
-	PIS_STATE_BUSY    = 0x02,	/**< An internal process is ongoing */
-	PIS_STATE_TIMEOUT = 0x03,	/**< Timeout state */
-	PIS_STATE_ERROR   = 0x04,	/**< Error */
-} pis_state_t;
-
-/**
-  * @brief PIS modulate target
-  */
-typedef enum {
-	PIS_UART0_TX   = 0,	/**< Modulate uart0 tx */
-	PIS_UART1_TX   = 1,	/**< Modulate uart1 tx */
-	PIS_UART2_TX   = 2,	/**< Modulate uart2 tx */
-	PIS_UART3_TX   = 3,	/**< Modulate uart3 tx */
-	PIS_LPUART0_TX = 4,	/**< Modulate lpuart0 tx */
-} pis_modu_targ_t;
-
-/**
-  * @brief PIS modulate level
-  */
-typedef enum {
-	PIS_LOW_LEVEL  = 0,	/**< Modulate low level */
-	PIS_HIGH_LEVEL = 1,	/**< Modulate high level */
-} pis_modu_level_t;
-
-/**
-  * @brief PIS modulate source
-  */
-typedef enum {
-	PIS_SRC_NONE   = 0,	/**< Stop modulate */
-	PIS_SRC_TIMER0 = 1,	/**< Modulate source is TIMER0 */
-	PIS_SRC_TIMER1 = 2,	/**< Modulate source is TIMER1 */
-	PIS_SRC_TIMER2 = 3,	/**< Modulate source is TIMER2 */
-	PIS_SRC_TIMER3 = 4,	/**< Modulate source is TIMER3 */
-	PIS_SRC_TIMER6 = 5,	/**< Modulate source is TIMER6 */
-	PIS_SRC_TIMER7 = 6,	/**< Modulate source is TIMER7 */
-	PIS_SRC_LPTIM0 = 7,	/**< Modulate source is LPTIM0 */
-	PIS_SRC_BUZ    = 8,	/**< Modulate source is buz */
-} pis_modu_src_t;
-
-/**
-  * @brief PIS modulate channel
-  */
-typedef enum {
-	PIS_TIMER_CH1 = 0,	/**< Src is TIMERx and choose channel 1 */
-	PIS_TIMER_CH2 = 1,	/**< Src is TIMERx and choose channel 2 */
-	PIS_TIMER_CH3 = 2,	/**< Src is TIMERx and choose channel 3 */
-	PIS_TIMER_CH4 = 3,	/**< Src is TIMERx and choose channel 4 */
-} pis_modu_channel_t;
-
-/**
-  * @brief PIS init structure definition
-  */
-typedef struct {
-	pis_src_t producer_src;		/**< Producer entry */
-	pis_clock_t producer_clk;	/**< Producer module clock */
-	pis_edge_t producer_edge;	/**< Producer module pin output edge */
-	pis_trig_t consumer_trig;	/**< Consumer entry */
-	pis_clock_t consumer_clk;	/**< Consumer clock */
-} pis_init_t;
-
-/**
-  * @brief PIS modulate config structure definition
-  */
-typedef struct {
-	pis_modu_targ_t target;		/**< Modulate target */
-	pis_modu_level_t level;		/**< Modulate level */
-	pis_modu_src_t src;		/**< Modulate src */
-	pis_modu_channel_t channel;	/**< Modulate channel */
-} pis_modulate_config_t;
-
-/**
-  * @brief  PIS Handle Structure definition
-  */
-typedef struct pis_handle_s {
-	PIS_TypeDef *perh;		/**< Register base address */
-	pis_init_t init;		/**< PIS required parameters */
-	pis_ch_t consumer_ch;		/**< Indirect value, no care of it */
-	pis_con_t consumer_con;		/**< Indirect value, no care of it */
-	uint8_t consumer_pos;	        /**< Indirect value, no care of it */
-	uint32_t check_info;		/**< When destroy a handle ,user need check whether is right that ready to destroy */
-	lock_state_t lock;		/**< Locking object */
-	pis_state_t state;		/**< PIS operation state */
-} pis_handle_t;
-/**
-  * @}
-  */
-
-
-/** @defgroup PIS_Private_Macros PIS Private Macros
-  * @{
-  */
-#define IS_PIS(x) 		(((x) == PIS))
-#define IS_PIS_SRC(x) 		(((x) == PIS_NON)               || \
-				 ((x) == PIS_GPIO_PIN0)         || \
-				 ((x) == PIS_GPIO_PIN1)         || \
-				 ((x) == PIS_GPIO_PIN2)         || \
-				 ((x) == PIS_GPIO_PIN3)         || \
-				 ((x) == PIS_GPIO_PIN4)         || \
-				 ((x) == PIS_GPIO_PIN5)         || \
-				 ((x) == PIS_GPIO_PIN6)         || \
-				 ((x) == PIS_GPIO_PIN7)         || \
-				 ((x) == PIS_GPIO_PIN8)         || \
-				 ((x) == PIS_GPIO_PIN9)         || \
-				 ((x) == PIS_GPIO_PIN10)        || \
-				 ((x) == PIS_GPIO_PIN11)        || \
-				 ((x) == PIS_GPIO_PIN12)        || \
-				 ((x) == PIS_GPIO_PIN13)        || \
-				 ((x) == PIS_GPIO_PIN14)        || \
-				 ((x) == PIS_GPIO_PIN15)        || \
-				 ((x) == PIS_ACMP_OUT0)         || \
-				 ((x) == PIS_ACMP_OUT1)         || \
-				 ((x) == PIS_DAC0_CH1)          || \
-				 ((x) == PIS_ACMP_OUT1)         || \
-				 ((x) == PIS_ADC0_INJECT)       || \
-				 ((x) == PIS_ADC0_REGULAT)      || \
-				 ((x) == PIS_ADC0_WINDOW)       || \
-				 ((x) == PIS_LVD)               || \
-				 ((x) == PIS_UART0_ASY_SEND)    || \
-				 ((x) == PIS_UART0_ASY_RECV)    || \
-				 ((x) == PIS_UART0_IRDAOUT)     || \
-				 ((x) == PIS_UART0_RTSOUT)      || \
-				 ((x) == PIS_UART0_TXOUT)       || \
-				 ((x) == PIS_UART0_SYN_SEND)    || \
-				 ((x) == PIS_UART0_SYN_RECV)    || \
-				 ((x) == PIS_UART1_ASY_SEND)    || \
-				 ((x) == PIS_UART1_ASY_RECV)    || \
-				 ((x) == PIS_UART1_IRDA)        || \
-				 ((x) == PIS_UART1_RTS)         || \
-				 ((x) == PIS_UART1_TXOUT)       || \
-				 ((x) == PIS_UART1_SYN_SEND)    || \
-				 ((x) == PIS_UART1_SYN_RECV)    || \
-				 ((x) == PIS_UART2_ASY_SEND)    || \
-				 ((x) == PIS_UART2_ASY_RECV)    || \
-				 ((x) == PIS_UART2_IRDA)        || \
-				 ((x) == PIS_UART2_RTS)         || \
-				 ((x) == PIS_UART2_TXOUT)       || \
-				 ((x) == PIS_UART2_SYN_SEND)    || \
-				 ((x) == PIS_UART2_SYN_RECV)    || \
-				 ((x) == PIS_UART3_ASY_SEND)    || \
-				 ((x) == PIS_UART3_ASY_RECV)    || \
-				 ((x) == PIS_UART3_IRDA)        || \
-				 ((x) == PIS_UART3_RTS)         || \
-				 ((x) == PIS_UART3_TXOUT)       || \
-				 ((x) == PIS_UART3_SYN_SEND)    || \
-				 ((x) == PIS_UART3_SYN_RECV)    || \
-				 ((x) == PIS_EUART0_RECV)       || \
-				 ((x) == PIS_EUART0_SEND)       || \
-				 ((x) == PIS_EUART0_TXOUT)      || \
-				 ((x) == PIS_EUART1_RECV)       || \
-				 ((x) == PIS_EUART1_SEND)       || \
-				 ((x) == PIS_EUART1_TXOUT)      || \
-				 ((x) == PIS_SPI0_RECV)         || \
-				 ((x) == PIS_SPI0_SEND)         || \
-				 ((x) == PIS_SPI0_NE)           || \
-				 ((x) == PIS_SPI1_RECV)         || \
-				 ((x) == PIS_SPI1_SEND)         || \
-				 ((x) == PIS_SPI1_NE)           || \
-				 ((x) == PIS_I2C0_RECV)         || \
-				 ((x) == PIS_I2C0_SEND)         || \
-				 ((x) == PIS_I2C1_RECV)         || \
-				 ((x) == PIS_I2C1_SEND)         || \
-				 ((x) == PIS_TIMER0_UPDATA)       || \
-				 ((x) == PIS_TIMER0_TRIG)         || \
-				 ((x) == PIS_TIMER0_INPUT)        || \
-				 ((x) == PIS_TIMER0_OUTPUT)       || \
-				 ((x) == PIS_TIMER1_UPDATA)       || \
-				 ((x) == PIS_TIMER1_TRIG)         || \
-				 ((x) == PIS_TIMER1_INPUT)        || \
-				 ((x) == PIS_TIMER1_OUTPUT)       || \
-				 ((x) == PIS_TIMER2_UPDATA)       || \
-				 ((x) == PIS_TIMER2_TRIG)         || \
-				 ((x) == PIS_TIMER2_INPUT)        || \
-				 ((x) == PIS_TIMER2_OUTPUT)       || \
-				 ((x) == PIS_TIMER3_UPDATA)       || \
-				 ((x) == PIS_TIMER3_TRIG)         || \
-				 ((x) == PIS_TIMER3_INPUT)        || \
-				 ((x) == PIS_TIMER3_OUTPUT)       || \
-				 ((x) == PIS_RTC_CLOCK)         || \
-				 ((x) == PIS_RTC_ALARM)         || \
-				 ((x) == PIS_LPTIM0_SYN_UPDATA) || \
-				 ((x) == PIS_LPTIM0_ASY_UPDATA) || \
-				 ((x) == PIS_LPUART0_ASY_RECV)  || \
-				 ((x) == PIS_LPUART0_ASY_SEND)  || \
-				 ((x) == PIS_LPUART0_SYN_RECV)  || \
-				 ((x) == PIS_LPUART0_SYN_SEND)  || \
-				 ((x) == PIS_DMA)               || \
-				 ((x) == PIS_ADC1_INJECT)       || \
-				 ((x) == PIS_ADC1_REGULAT)      || \
-				 ((x) == PIS_ADC1_WINDOW))
-#define IS_PIS_TRIG(x) 		(((x) == PIS_CH0_TIMER0_BRKIN)    || \
-				 ((x) == PIS_CH0_SPI1_CLK)      || \
-				 ((x) == PIS_CH0_LPTIM0_EXT0)   || \
-				 ((x) == PIS_CH0_ADC1_NORMAL)   || \
-				 ((x) == PIS_CH1_TIMER0_CH1IN)    || \
-				 ((x) == PIS_CH1_TIMER2_CH1IN)    || \
-				 ((x) == PIS_CH1_TIMER3_CH1IN)    || \
-				 ((x) == PIS_CH1_UART0_RX_IRDA) || \
-				 ((x) == PIS_CH1_LPTIM0_EXT1)   || \
-				 ((x) == PIS_CH1_ADC1_INSERT)   || \
-				 ((x) == PIS_CH2_TIMER0_CH2IN)    || \
-				 ((x) == PIS_CH2_TIMER2_CH2IN)    || \
-				 ((x) == PIS_CH2_TIMER3_CH2IN)    || \
-				 ((x) == PIS_CH2_LPTIM0_EXT2)   || \
-				 ((x) == PIS_CH2_UART1_RX_IRDA) || \
-				 ((x) == PIS_CH3_TIMER0_CH3IN)    || \
-				 ((x) == PIS_CH3_LPTIM0_EXT3)   || \
-				 ((x) == PIS_CH3_UART2_RX_IRDA) || \
-				 ((x) == PIS_CH4_TIMER0_CH4IN)    || \
-				 ((x) == PIS_CH4_TIMER0_ITR0)     || \
-				 ((x) == PIS_CH4_TIMER2_ITR0)     || \
-				 ((x) == PIS_CH4_TIMER3_ITR0)     || \
-				 ((x) == PIS_CH4_LPTIM0_EXT4)   || \
-				 ((x) == PIS_CH4_UART3_RX_IRDA) || \
-				 ((x) == PIS_CH5_SPI0_RX)       || \
-				 ((x) == PIS_CH5_LPTIM0_EXT5)   || \
-				 ((x) == PIS_CH5_EUART0_RX)     || \
-				 ((x) == PIS_CH5_TIMER0_ITR1)     || \
-				 ((x) == PIS_CH5_TIMER2_ITR1)     || \
-				 ((x) == PIS_CH5_TIMER3_ITR1)     || \
-				 ((x) == PIS_CH6_SPI0_CLK)      || \
-				 ((x) == PIS_CH6_ADC0_NORMAL)   || \
-				 ((x) == PIS_CH6_LPTIM0_EXT6)   || \
-				 ((x) == PIS_CH6_EUART1_RX)     || \
-				 ((x) == PIS_CH6_TIMER0_ITR2)     || \
-				 ((x) == PIS_CH6_TIMER2_ITR2)     || \
-				 ((x) == PIS_CH6_TIMER3_ITR2)     || \
-				 ((x) == PIS_CH6_DAC_CH1)       || \
-				 ((x) == PIS_CH7_SPI1_RX)       || \
-				 ((x) == PIS_CH7_ADC0_INSERT)   || \
-				 ((x) == PIS_CH7_LPTIM0_EXT7)   || \
-				 ((x) == PIS_CH7_DMA)           || \
-				 ((x) == PIS_CH7_TIMER0_ITR3)     || \
-				 ((x) == PIS_CH7_TIMER2_ITR3)     || \
-				 ((x) == PIS_CH7_TIMER3_ITR3)     || \
-				 ((x) == PIS_CH7_DAC_CH0)       || \
-				 ((x) == PIS_CH7_LPUART_RX))
-#define IS_PIS_CLOCK(x) 	(((x) == PIS_CLK_PCLK1)  || \
-				 ((x) == PIS_CLK_PCLK2)  || \
-				 ((x) == PIS_CLK_SYS) || \
-				 ((x) == PIS_CLK_LP))
-#define IS_PIS_EDGE(x) 		(((x) == PIS_EDGE_NONE) || \
-				 ((x) == PIS_EDGE_UP)   || \
-				 ((x) == PIS_EDGE_DOWN) || \
-				 ((x) == PIS_EDGE_UP_DOWN))
-#define IS_PIS_OUTPUT(x) 	(((x) == PIS_OUT_LEVEL) || \
-				 ((x) == PIS_OUT_PULSE))
-#define IS_PIS_OUPUT_CH(x)	(((x) == PIS_OUT_CH_0) || \
-				 ((x) == PIS_OUT_CH_1) || \
-				 ((x) == PIS_OUT_CH_2) || \
-				 ((x) == PIS_OUT_CH_3))
-#define IS_PIS_MODU_TARGET(x)	(((x) == PIS_UART0_TX) || \
-				 ((x) == PIS_UART1_TX) || \
-				 ((x) == PIS_UART2_TX) || \
-				 ((x) == PIS_UART3_TX) || \
-				 ((x) == PIS_LPUART0_TX))
-#define IS_PIS_MODU_LEVEL(x)	(((x) == PIS_LOW_LEVEL) || \
-				 ((x) == PIS_HIGH_LEVEL))
-#define IS_PIS_MODU_SRC(x)	(((x) == PIS_SRC_NONE)   || \
-				 ((x) == PIS_SRC_TIMER0)   || \
-				 ((x) == PIS_SRC_TIMER1)   || \
-				 ((x) == PIS_SRC_TIMER2)   || \
-				 ((x) == PIS_SRC_TIMER3)   || \
-				 ((x) == PIS_SRC_TIMER6)   || \
-				 ((x) == PIS_SRC_TIMER7)   || \
-				 ((x) == PIS_SRC_LPTIM0) || \
-				 ((x) == PIS_SRC_BUZ))
-#define IS_PIS_MODU_CHANNEL(x)	(((x) == PIS_TIMER_CH1) || \
-				 ((x) == PIS_TIMER_CH2) || \
-				 ((x) == PIS_TIMER_CH3) || \
-				 ((x) == PIS_TIMER_CH4))
-/**
-  * @}
-  */
-
-/** @addtogroup PIS_Public_Functions
-  * @{
-  */
-
-/** @addtogroup PIS_Public_Functions_Group1
-  * @{
-  */
-ald_status_t pis_create(pis_handle_t *hperh);
-ald_status_t pis_destroy(pis_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup PIS_Public_Functions_Group2
-  * @{
-  */
-ald_status_t pis_output_start(pis_handle_t *hperh, pis_out_ch_t ch);
-ald_status_t pis_output_stop(pis_handle_t *hperh, pis_out_ch_t ch);
-/**
-  * @}
-  */
-
-/** @addtogroup PIS_Public_Functions_Group3
-  * @{
-  */
-pis_state_t pis_get_state(pis_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup PIS_Public_Functions_Group4
-  * @{
-  */
-ald_status_t pis_modu_config(pis_handle_t *hperh, pis_modulate_config_t *config);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_PIS_H__ */

+ 0 - 275
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_pmu.h

@@ -1,275 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_pmu.h
-  * @brief   Header file of PMU module driver.
-  *
-  * @version V1.0
-  * @date    04 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  */
-
-#ifndef __ALD_PMU_H__
-#define __ALD_PMU_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_syscfg.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup PMU
-  * @{
-  */
-
-/** @defgroup PMU_Public_Macros PMU Public Macros
-  * @{
-  */
-#define PMU_SRAM0_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(PMU->PWRCR, BIT(PMU_PWRCR_SRAM_POSS));	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define PMU_SRAM0_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(PMU->PWRCR, BIT(PMU_PWRCR_SRAM_POSS));\
-	SYSCFG_LOCK();					\
-} while (0)
-#define PMU_SRAM1_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(PMU->PWRCR, BIT(PMU_PWRCR_SRAM_POSE));	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define PMU_SRAM1_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(PMU->PWRCR, BIT(PMU_PWRCR_SRAM_POSE));\
-	SYSCFG_LOCK();					\
-} while (0)
-#define PMU_BXCAN_ENABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	SET_BIT(PMU->PWRCR, PMU_PWRCR_BXCAN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-#define PMU_BXCAN_DISABLE()				\
-do {							\
-	SYSCFG_UNLOCK();				\
-	CLEAR_BIT(PMU->PWRCR, PMU_PWRCR_BXCAN_MSK);	\
-	SYSCFG_LOCK();					\
-} while (0)
-
-#define PMU_LPSTOP_ENABLE()			\
-do {						\
-	SYSCFG_UNLOCK();			\
-	SET_BIT(PMU->CR, PMU_CR_LPSTOP_MSK);	\
-	SYSCFG_LOCK();				\
-} while (0)
-#define PMU_LPSTOP_DISABLE()			\
-do {						\
-	SYSCFG_UNLOCK();			\
-	CLEAR_BIT(PMU->CR, PMU_CR_LPSTOP_MSK);	\
-	SYSCFG_LOCK();				\
-} while (0)
-#define PMU_MTSTOP_ENABLE()			\
-do {						\
-	SYSCFG_UNLOCK();			\
-	SET_BIT(PMU->CR, PMU_CR_MTSTOP_MSK);	\
-	SYSCFG_LOCK();				\
-} while (0)
-#define PMU_MTSTOP_DISABLE()			\
-do {						\
-	SYSCFG_UNLOCK();			\
-	CLEAR_BIT(PMU->CR, PMU_CR_MTSTOP_MSK);	\
-	SYSCFG_LOCK();				\
-} while (0)
-
-#define PMU_GET_LVD_STATUS()	(READ_BITS(PMU->LVDCR, PMU_LVDCR_LVDO_MSK, PMU_LVDCR_LVDO_POS))
-/**
-  * @}
-  */
-
-
-/** @defgroup PMU_Public_Types PMU Public Types
-  * @{
-  */
-/**
-  * @brief Standby wakeup port select
-  */
-typedef enum {
-	PMU_STANDBY_PORT_SEL_PA0 = 0x0,	/**< PA0 */
-	PMU_STANDBY_PORT_SEL_PA1 = 0x1,	/**< PA1 */
-	PMU_STANDBY_PORT_SEL_PA2 = 0x2,	/**< PA2 */
-	PMU_STANDBY_PORT_SEL_PA3 = 0x3,	/**< PA3 */
-	PMU_STANDBY_PORT_SEL_PA4 = 0x4,	/**< PA4 */
-	PMU_STANDBY_PORT_SEL_PA5 = 0x5,	/**< PA5 */
-	PMU_STANDBY_PORT_SEL_PA6 = 0x6,	/**< PA6 */
-	PMU_STANDBY_PORT_SEL_PA7 = 0x7,	/**< PA7 */
-	PMU_STANDBY_PORT_NONE    = 0xF,	/**< NONE */
-} pmu_standby_wakeup_sel_t;
-
-/**
-  * @brief Low power mode
-  */
-typedef enum {
-	PMU_LP_STOP1   = 0x0,	/**< Stop1 */
-	PMU_LP_STOP2   = 0x1,	/**< Stop2 */
-	PMU_LP_STANDBY = 0x2,	/**< Standby */
-} pmu_lp_mode_t;
-
-typedef enum {
-	PMU_SR_WUF      = (1U << 0),
-	PMU_SR_STANDBYF = (1U << 1),
-} pmu_status_t;
-
-/**
-  * @brief LVD voltage select
-  */
-typedef enum {
-	PMU_LVD_VOL_SEL_2_0 = 0x0,	/**< 2.0V ~ 2.05V */
-	PMU_LVD_VOL_SEL_2_1 = 0x1,	/**< 2.1V ~ 2.15V */
-	PMU_LVD_VOL_SEL_2_2 = 0x2,	/**< 2.2V ~ 2.25V */
-	PMU_LVD_VOL_SEL_2_4 = 0x3,	/**< 2.4V ~ 2.45V */
-	PMU_LVD_VOL_SEL_2_6 = 0x4,	/**< 2.6V ~ 2.65V */
-	PMU_LVD_VOL_SEL_2_8 = 0x5,	/**< 2.8V ~ 2.85V */
-	PMU_LVD_VOL_SEL_3_0 = 0x6,	/**< 3.0V ~ 3.05V */
-	PMU_LVD_VOL_SEL_3_6 = 0x7,	/**< 3.6V ~ 3.65V */
-	PMU_LVD_VOL_SEL_4_0 = 0x8,	/**< 4.0V ~ 4.05V */
-	PMU_LVD_VOL_SEL_4_6 = 0x9,	/**< 4.6V ~ 4.65V */
-	PMU_LVD_VOL_SEL_2_3 = 0xA,	/**< 2.3V ~ 2.35V */
-	PMU_LVD_VOL_SEL_EXT = 0xF,	/**< Select external input. It must be 1.2V */
-} pmu_lvd_voltage_sel_t;
-
-/**
-  * @brief LVD trigger mode
-  */
-typedef enum {
-	PMU_LVD_TRIGGER_RISING_EDGE    = 0x0,	/**< Rising edge */
-	PMU_LVD_TRIGGER_FALLING_EDGE   = 0x1,	/**< Falling edge */
-	PMU_LVD_TRIGGER_HIGH_LEVEL     = 0x2,	/**< High level */
-	PMU_LVD_TRIGGER_LOW_LEVEL      = 0x3,	/**< Low level */
-	PMU_LVD_TRIGGER_RISING_FALLING = 0x4,	/**< Rising and falling edge */
-} pmu_lvd_trigger_mode_t;
-
-/**
-  * @brief LDO output voltage selest in low power mode
-  */
-typedef enum {
-	PMU_LDO_LPMODE_OUTPUT_1_5 = 0x0,	/**< 1.5V */
-	PMU_LDO_LPMODE_OUTPUT_1_4 = 0x1,	/**< 1.4V */
-	PMU_LDO_LPMODE_OUTPUT_1_3 = 0x2,	/**< 1.3V */
-	PMU_LDO_LPMODE_OUTPUT_1_2 = 0x4,	/**< 1.2V */
-} pmu_ldo_lpmode_output_t;
-/**
-  * @}
-  */
-
-/**
-  * @defgroup PMU_Private_Macros PMU Private Macros
-  * @{
-  */
-#define IS_PMU_STANDBY_PORT_SEL(x)	(((x) == PMU_STANDBY_PORT_SEL_PA0) || \
-                                         ((x) == PMU_STANDBY_PORT_SEL_PA1) || \
-                                         ((x) == PMU_STANDBY_PORT_SEL_PA2) || \
-                                         ((x) == PMU_STANDBY_PORT_SEL_PA3) || \
-                                         ((x) == PMU_STANDBY_PORT_SEL_PA4) || \
-                                         ((x) == PMU_STANDBY_PORT_SEL_PA5) || \
-                                         ((x) == PMU_STANDBY_PORT_SEL_PA6) || \
-                                         ((x) == PMU_STANDBY_PORT_SEL_PA7) || \
-                                         ((x) == PMU_STANDBY_PORT_NONE))
-#define IS_PMU_LP_MODE(x)		(((x) == PMU_LP_STOP1) || \
-                                         ((x) == PMU_LP_STOP2) || \
-                                         ((x) == PMU_LP_STANDBY))
-#define IS_PMU_STATUS(x)		(((x) == PMU_SR_WUF) || \
-                                         ((x) == PMU_SR_STANDBYF))
-#define IS_PMU_LVD_VOL_SEL(x)		(((x) == PMU_LVD_VOL_SEL_2_0) || \
-                                         ((x) == PMU_LVD_VOL_SEL_2_1) || \
-                                         ((x) == PMU_LVD_VOL_SEL_2_2) || \
-                                         ((x) == PMU_LVD_VOL_SEL_2_4) || \
-                                         ((x) == PMU_LVD_VOL_SEL_2_6) || \
-                                         ((x) == PMU_LVD_VOL_SEL_2_8) || \
-                                         ((x) == PMU_LVD_VOL_SEL_3_0) || \
-                                         ((x) == PMU_LVD_VOL_SEL_3_6) || \
-                                         ((x) == PMU_LVD_VOL_SEL_4_0) || \
-                                         ((x) == PMU_LVD_VOL_SEL_4_6) || \
-                                         ((x) == PMU_LVD_VOL_SEL_2_3) || \
-                                         ((x) == PMU_LVD_VOL_SEL_EXT))
-#define IS_PMU_LVD_TRIGGER_MODE(x)	(((x) == PMU_LVD_TRIGGER_RISING_EDGE)  || \
-                                         ((x) == PMU_LVD_TRIGGER_FALLING_EDGE) || \
-                                         ((x) == PMU_LVD_TRIGGER_HIGH_LEVEL)   || \
-                                         ((x) == PMU_LVD_TRIGGER_LOW_LEVEL)    || \
-                                         ((x) == PMU_LVD_TRIGGER_RISING_FALLING))
-#define IS_PMU_LDO_LPMODE_OUTPUT(x)	(((x) == PMU_LDO_LPMODE_OUTPUT_1_5) || \
-                                         ((x) == PMU_LDO_LPMODE_OUTPUT_1_4) || \
-                                         ((x) == PMU_LDO_LPMODE_OUTPUT_1_3) || \
-                                         ((x) == PMU_LDO_LPMODE_OUTPUT_1_2))
-/**
-  * @}
-  */
-
-/** @addtogroup PMU_Public_Functions
-  * @{
-  */
-/** @addtogroup PMU_Public_Functions_Group1
-  * @{
-  */
-/* Low power mode select */
-__STATIC_INLINE__ void __sleep()
-{
-	__WFI();
-}
-
-__STATIC_INLINE__ void __sleep_deep()
-{
-	SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
-	__WFI();
-}
-
-void pmu_stop1_enter(void);
-void pmu_stop2_enter(void);
-void pmu_standby_enter(pmu_standby_wakeup_sel_t port);
-void pmu_lprun_config(pmu_ldo_lpmode_output_t vol, type_func_t state);
-flag_status_t pmu_get_status(pmu_status_t sr);
-void pmu_clear_status(pmu_status_t sr);
-/**
-  * @}
-  */
-/** @addtogroup PMU_Public_Functions_Group2
-  * @{
-  */
-/* LVD configure */
-void pmu_lvd_config(pmu_lvd_voltage_sel_t sel, pmu_lvd_trigger_mode_t mode, type_func_t state);
-void lvd_irq_cbk(void);
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_PMU_H__ */

+ 0 - 261
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_rmu.h

@@ -1,261 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_rmu.h
-  * @brief   Header file of RMU module driver.
-  *
-  * @version V1.0
-  * @date    04 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  */
-
-#ifndef __ALD_RMU_H__
-#define __ALD_RMU_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup RMU
-  * @{
-  */
-
-/** @defgroup RMU_Public_Types RMU Public Types
-  * @{
-  */
-/**
-  * @brief RMU BOR fliter
-  */
-typedef enum {
-	RMU_BORFLT_1 = 0x1,	/**< 1 cycle  */
-	RMU_BORFLT_2 = 0x2,	/**< 2 cycles */
-	RMU_BORFLT_3 = 0x3,	/**< 3 cycles */
-	RMU_BORFLT_4 = 0x4,	/**< 4 cycles */
-	RMU_BORFLT_5 = 0x5,	/**< 5 cycles */
-	RMU_BORFLT_6 = 0x6,	/**< 6 cycles */
-	RMU_BORFLT_7 = 0x7,	/**< 7 cycles */
-} rmu_bor_filter_t;
-
-/**
-  * @brief RMU BOR voltage
-  */
-typedef enum {
-	RMU_VOL_1_7 = 0x0,	/**< 1.7V */
-	RMU_VOL_2_0 = 0x1,	/**< 2.0V */
-	RMU_VOL_2_1 = 0x2,	/**< 2.1V */
-	RMU_VOL_2_2 = 0x3,	/**< 2.2V */
-	RMU_VOL_2_3 = 0x4,	/**< 2.3V */
-	RMU_VOL_2_4 = 0x5,	/**< 2.4V */
-	RMU_VOL_2_5 = 0x6,	/**< 2.5V */
-	RMU_VOL_2_6 = 0x7,	/**< 2.6V */
-	RMU_VOL_2_8 = 0x8,	/**< 2.8V */
-	RMU_VOL_3_0 = 0x9,	/**< 3.0V */
-	RMU_VOL_3_1 = 0xA,	/**< 3.1V */
-	RMU_VOL_3_3 = 0xB,	/**< 3.3V */
-	RMU_VOL_3_6 = 0xC,	/**< 3.6V */
-	RMU_VOL_3_7 = 0xD,	/**< 3.7V */
-	RMU_VOL_4_0 = 0xE,	/**< 4.0V */
-	RMU_VOL_4_3 = 0xF,	/**< 4.3V */
-} rmu_bor_vol_t;
-
-/**
-  * @brief RMU reset status
-  */
-typedef enum {
-	RMU_RST_POR    = (1U << 0),	/**< POR */
-	RMU_RST_WAKEUP = (1U << 1),	/**< WAKEUP */
-	RMU_RST_BOR    = (1U << 2),	/**< BOR */
-	RMU_RST_NMRST  = (1U << 3),	/**< NMRST */
-	RMU_RST_IWDT   = (1U << 4),	/**< IWDT */
-	RMU_RST_WWDT   = (1U << 5),	/**< WWDT */
-	RMU_RST_LOCKUP = (1U << 6),	/**< LOCKUP */
-	RMU_RST_CHIP   = (1U << 7),	/**< CHIP */
-	RMU_RST_MCU    = (1U << 8),	/**< MCU */
-	RMU_RST_CPU    = (1U << 9),	/**< CPU */
-	RMU_RST_CFG    = (1U << 10),	/**< CFG */
-	RMU_RST_CFGERR = (1U << 16),	/**< CFG Error */
-} rmu_state_t;
-
-/**
-  * @brief RMU periperal select bit
-  */
-typedef enum {
-	RMU_PERH_GPIO    = (1U << 0),			/**< AHB1: GPIO */
-	RMU_PERH_CRC     = (1U << 1),			/**< AHB1: CRC */
-	RMU_PERH_CALC    = (1U << 2),			/**< AHB1: CALC */
-	RMU_PERH_CRYPT   = (1U << 3),			/**< AHB1: CRYPT */
-	RMU_PERH_TRNG    = (1U << 4),			/**< AHB1: TRNG */
-	RMU_PERH_PIS     = (1U << 5),			/**< AHB1: PIS */
-	RMU_PERH_CHIP    = (1U << 0)  | (1U << 27),	/**< AHB2: CHIP */
-	RMU_PERH_CPU     = (1U << 1)  | (1U << 27),	/**< AHB2: CPU */
-	RMU_PERH_TIM0    = (1U << 0)  | (1U << 28),	/**< APB1: TIM0 */
-	RMU_PERH_TIM1    = (1U << 1)  | (1U << 28),	/**< APB1: TIM1 */
-	RMU_PERH_TIM2    = (1U << 2)  | (1U << 28),	/**< APB1: TIM2 */
-	RMU_PERH_TIM3    = (1U << 3)  | (1U << 28),	/**< APB1: TIM3 */
-	RMU_PERH_TIM4    = (1U << 4)  | (1U << 28),	/**< APB1: TIM4 */
-	RMU_PERH_TIM5    = (1U << 5)  | (1U << 28),	/**< APB1: TIM5 */
-	RMU_PERH_TIM6    = (1U << 6)  | (1U << 28),	/**< APB1: TIM6 */
-	RMU_PERH_TIM7    = (1U << 7)  | (1U << 28),	/**< APB1: TIM7 */
-	RMU_PERH_UART0   = (1U << 8)  | (1U << 28),	/**< APB1: UART0 */
-	RMU_PERH_UART1   = (1U << 9)  | (1U << 28),	/**< APB1: UART1 */
-	RMU_PERH_UART2   = (1U << 10) | (1U << 28),	/**< APB1: UART2 */
-	RMU_PERH_UART3   = (1U << 11) | (1U << 28),	/**< APB1: UART3 */
-	RMU_PERH_USART0  = (1U << 12) | (1U << 28),	/**< APB1: EUART0 */
-	RMU_PERH_USART1  = (1U << 13) | (1U << 28),	/**< APB1: EUART1 */
-	RMU_PERH_SPI0    = (1U << 16) | (1U << 28),	/**< APB1: SPI0 */
-	RMU_PERH_SPI1    = (1U << 17) | (1U << 28),	/**< APB1: SPI1 */
-	RMU_PERH_SPI2    = (1U << 18) | (1U << 28),	/**< APB1: SPI2 */
-	RMU_PERH_I2C0    = (1U << 20) | (1U << 28),	/**< APB1: I2C0 */
-	RMU_PERH_I2C1    = (1U << 21) | (1U << 28),	/**< APB1: I2C1 */
-	RMU_PERH_CAN0    = (1U << 24) | (1U << 28),	/**< APB1: CAN0 */
-	RMU_PERH_LPTIM0  = (1U << 0)  | (1U << 29),	/**< APB2: LPTIM0 */
-	RMU_PERH_LPUART0 = (1U << 2)  | (1U << 29),	/**< APB2: LPUART */
-	RMU_PERH_ADC0    = (1U << 4)  | (1U << 29),	/**< APB2: ADC0 */
-	RMU_PERH_ADC1    = (1U << 5)  | (1U << 29),	/**< APB2: ADC1 */
-	RMU_PERH_ACMP0   = (1U << 6)  | (1U << 29),	/**< APB2: ACMP0 */
-	RMU_PERH_ACMP1   = (1U << 7)  | (1U << 29),	/**< APB2: ACMP1 */
-	RMU_PERH_OPAMP   = (1U << 8)  | (1U << 29),	/**< APB2: OPAMP */
-	RMU_PERH_DAC0    = (1U << 9)  | (1U << 29),	/**< APB2: DAC0 */
-	RMU_PERH_WWDT    = (1U << 12) | (1U << 29),	/**< APB2: WWDT */
-	RMU_PERH_LCD     = (1U << 13) | (1U << 29),	/**< APB2: LCD */
-	RMU_PERH_IWDT    = (1U << 14) | (1U << 29),	/**< APB2: IWDT */
-	RMU_PERH_RTC     = (1U << 15) | (1U << 29),	/**< APB2: RTC */
-	RMU_PERH_TEMP    = (1U << 16) | (1U << 29),	/**< APB2: TEMP */
-	RMU_PERH_BKPC    = (1U << 17) | (1U << 29),	/**< APB2: BKPC */
-	RMU_PERH_BKPRAM  = (1U << 18) | (1U << 29),	/**< APB2: BKPRAM */
-} rmu_peripheral_t;
-/**
-  * @}
-  */
-
-/**
-  * @defgroup RMU_Private_Macros RMU Private Macros
-  * @{
-  */
-#define IS_RMU_BORFLT(x)	(((x) == RMU_BORFLT_1) || \
-                                 ((x) == RMU_BORFLT_2) || \
-                                 ((x) == RMU_BORFLT_3) || \
-                                 ((x) == RMU_BORFLT_4) || \
-                                 ((x) == RMU_BORFLT_5) || \
-                                 ((x) == RMU_BORFLT_6) || \
-                                 ((x) == RMU_BORFLT_7))
-#define IS_RMU_BORVOL(x)	(((x) == RMU_VOL_1_7) || \
-                                 ((x) == RMU_VOL_2_0) || \
-                                 ((x) == RMU_VOL_2_1) || \
-                                 ((x) == RMU_VOL_2_2) || \
-                                 ((x) == RMU_VOL_2_3) || \
-                                 ((x) == RMU_VOL_2_4) || \
-                                 ((x) == RMU_VOL_2_5) || \
-                                 ((x) == RMU_VOL_2_6) || \
-                                 ((x) == RMU_VOL_2_8) || \
-                                 ((x) == RMU_VOL_3_0) || \
-                                 ((x) == RMU_VOL_3_1) || \
-                                 ((x) == RMU_VOL_3_3) || \
-                                 ((x) == RMU_VOL_3_6) || \
-                                 ((x) == RMU_VOL_3_7) || \
-                                 ((x) == RMU_VOL_4_0) || \
-                                 ((x) == RMU_VOL_4_3))
-#define IS_RMU_STATE(x)		(((x) == RMU_RST_POR)    || \
-                                 ((x) == RMU_RST_WAKEUP) || \
-                                 ((x) == RMU_RST_BOR)    || \
-                                 ((x) == RMU_RST_NMRST)  || \
-                                 ((x) == RMU_RST_IWDT)   || \
-                                 ((x) == RMU_RST_WWDT)   || \
-                                 ((x) == RMU_RST_LOCKUP) || \
-                                 ((x) == RMU_RST_CHIP)   || \
-                                 ((x) == RMU_RST_MCU)    || \
-                                 ((x) == RMU_RST_CPU)    || \
-                                 ((x) == RMU_RST_CFG)    || \
-                                 ((x) == RMU_RST_CFGERR))
-#define IS_RMU_STATE_CLEAR(x)	(((x) == RMU_RST_POR)    || \
-                                 ((x) == RMU_RST_WAKEUP) || \
-                                 ((x) == RMU_RST_BOR)    || \
-                                 ((x) == RMU_RST_NMRST)  || \
-                                 ((x) == RMU_RST_IWDT)   || \
-                                 ((x) == RMU_RST_WWDT)   || \
-                                 ((x) == RMU_RST_LOCKUP) || \
-                                 ((x) == RMU_RST_CHIP)   || \
-                                 ((x) == RMU_RST_MCU)    || \
-                                 ((x) == RMU_RST_CPU)    || \
-                                 ((x) == RMU_RST_CFG))
-#define IS_RMU_PERH(x)		(((x) == RMU_PERH_GPIO)    || \
-                                 ((x) == RMU_PERH_CRC)     || \
-                                 ((x) == RMU_PERH_CALC)    || \
-                                 ((x) == RMU_PERH_CRYPT)   || \
-                                 ((x) == RMU_PERH_TRNG)    || \
-                                 ((x) == RMU_PERH_PIS)     || \
-                                 ((x) == RMU_PERH_CHIP)    || \
-                                 ((x) == RMU_PERH_CPU)     || \
-                                 ((x) == RMU_PERH_TIM0)    || \
-                                 ((x) == RMU_PERH_TIM1)    || \
-                                 ((x) == RMU_PERH_TIM2)    || \
-                                 ((x) == RMU_PERH_TIM3)    || \
-                                 ((x) == RMU_PERH_TIM4)    || \
-                                 ((x) == RMU_PERH_TIM5)    || \
-                                 ((x) == RMU_PERH_TIM6)    || \
-                                 ((x) == RMU_PERH_TIM7)    || \
-                                 ((x) == RMU_PERH_UART0)   || \
-                                 ((x) == RMU_PERH_UART1)   || \
-                                 ((x) == RMU_PERH_UART2)   || \
-                                 ((x) == RMU_PERH_UART3)   || \
-                                 ((x) == RMU_PERH_USART0)  || \
-                                 ((x) == RMU_PERH_USART1)  || \
-                                 ((x) == RMU_PERH_SPI0)    || \
-                                 ((x) == RMU_PERH_SPI1)    || \
-                                 ((x) == RMU_PERH_SPI2)    || \
-                                 ((x) == RMU_PERH_I2C0)    || \
-                                 ((x) == RMU_PERH_I2C1)    || \
-                                 ((x) == RMU_PERH_CAN0)    || \
-                                 ((x) == RMU_PERH_LPTIM0)  || \
-                                 ((x) == RMU_PERH_LPUART0) || \
-                                 ((x) == RMU_PERH_ADC0)    || \
-                                 ((x) == RMU_PERH_ADC1)    || \
-                                 ((x) == RMU_PERH_ACMP0)   || \
-                                 ((x) == RMU_PERH_ACMP1)   || \
-                                 ((x) == RMU_PERH_OPAMP)   || \
-                                 ((x) == RMU_PERH_DAC0)    || \
-                                 ((x) == RMU_PERH_WWDT)    || \
-                                 ((x) == RMU_PERH_LCD)     || \
-                                 ((x) == RMU_PERH_IWDT)    || \
-                                 ((x) == RMU_PERH_RTC)     || \
-                                 ((x) == RMU_PERH_TEMP)    || \
-                                 ((x) == RMU_PERH_BKPC)    || \
-                                 ((x) == RMU_PERH_BKPRAM))
-/**
-  * @}
-  */
-
-/** @addtogroup RMU_Public_Functions
-  * @{
-  */
-void rmu_bor_config(rmu_bor_filter_t flt, rmu_bor_vol_t vol, type_func_t state);
-flag_status_t rmu_get_reset_status(rmu_state_t state);
-void rmu_clear_reset_status(rmu_state_t state);
-void rmu_reset_periperal(rmu_peripheral_t perh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_RMU_H__ */

+ 0 - 669
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_rtc.h

@@ -1,669 +0,0 @@
-/**
-  ******************************************************************************
-  * @file    ald_rtc.h
-  * @brief   Header file of RTC Module driver.
-  *
-  * @version V1.0
-  * @date    16 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *******************************************************************************
-  */
-
-#ifndef __ALD_RTC_H__
-#define __ALD_RTC_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup RTC
-  * @{
-  */
-
-/** @defgroup RTC_Public_Types RTC Public Types
-  * @{
-  */
-
-/**
-  * @brief Hours format
-  */
-typedef enum {
-	RTC_HOUR_FORMAT_24 = 0x0,	/**< 24-hours format */
-	RTC_HOUR_FORMAT_12 = 0x1,	/**< 12-hours format */
-} rtc_hour_format_t;
-
-/**
-  * @brief Output mode
-  */
-typedef enum {
-	RTC_OUTPUT_DISABLE = 0x0,	/**< Disable output */
-	RTC_OUTPUT_ALARM_A = 0x1,	/**< Output alarm_a signal */
-	RTC_OUTPUT_ALARM_B = 0x2,	/**< Output alarm_b signal */
-	RTC_OUTPUT_WAKEUP  = 0x3,	/**< Output wakeup signal */
-} rtc_output_select_t;
-
-/**
-  * @brief Output polarity
-  */
-typedef enum {
-	RTC_OUTPUT_POLARITY_HIGH = 0x0,	/**< Polarity is high */
-	RTC_OUTPUT_POLARITY_LOW  = 0x0,	/**< Polarity is low */
-} rtc_output_polarity_t;
-
-/**
-  * @brief Initialization structure
-  */
-typedef struct {
-	rtc_hour_format_t hour_format;		/**< Hours format */
-	uint32_t asynch_pre_div;		/**< Asynchronous predivider value */
-	uint32_t synch_pre_div;			/**< Synchronous predivider value */
-	rtc_output_select_t output;		/**< Output signal type */
-	rtc_output_polarity_t output_polarity;	/**< Output polarity */
-} rtc_init_t;
-
-/**
-  * @brief Source select
-  */
-typedef enum {
-	RTC_SOURCE_LOSC        = 0x0,	/**< LOSC */
-	RTC_SOURCE_LRC         = 0x1,	/**< LRC */
-	RTC_SOURCE_HRC_DIV_1M  = 0x2,	/**< HRC divide to 1MHz */
-	RTC_SOURCE_HOSC_DIV_1M = 0x3,	/**< HOSC divide to 1MHz */
-} rtc_source_sel_t;
-
-/**
-  * @brief Time structure
-  */
-typedef struct {
-	uint8_t hour;		/**< Hours */
-	uint8_t minute;		/**< Minutes */
-	uint8_t second;		/**< Seconds */
-	uint16_t sub_sec;	/**< Sub-seconds */
-} rtc_time_t;
-
-/**
-  * @brief Date structure
-  */
-typedef struct {
-	uint8_t week;	/**< Weeks */
-	uint8_t day;	/**< days */
-	uint8_t month;	/**< months */
-	uint8_t year;	/**< years */
-} rtc_date_t;
-
-/**
-  * @brief Data format
-  */
-typedef enum {
-	RTC_FORMAT_DEC = 0,
-	RTC_FORMAT_BCD = 1,
-} rtc_format_t;
-
-/**
-  * @brief Index of alarm
-  */
-typedef enum {
-	RTC_ALARM_A = 0x0,	/**< Alarm-A */
-	RTC_ALARM_B = 0x1,	/**< Alarm-B */
-} rtc_alarm_idx_t;
-
-/**
-  * @brief Alarm mask
-  */
-typedef enum {
-	RTC_ALARM_MASK_NONE     = 0x0,		/**< Mask is disable */
-	RTC_ALARM_MASK_WEEK_DAY = (1U << 30),	/**< Mask week or day */
-	RTC_ALARM_MASK_HOUR     = (1U << 23),	/**< Mask hour */
-	RTC_ALARM_MASK_MINUTE   = (1U << 15),	/**< Mask minute */
-	RTC_ALARM_MASK_SECOND   = (1U << 7),	/**< Mask second */
-	RTC_ALARM_MASK_ALL      = 0x40808080,	/**< Mask all */
-} rtc_alarm_mask_t;
-
-/**
-  * @brief Alarm sub-second mask
-  */
-typedef enum {
-	RTC_ALARM_SS_MASK_NONE  = 0xF,	/**< Mask is disable */
-	RTC_ALARM_SS_MASK_14_1  = 0x1,	/**< Mask bit(1-14) */
-	RTC_ALARM_SS_MASK_14_2  = 0x2,	/**< Mask bit(2-14) */
-	RTC_ALARM_SS_MASK_14_3  = 0x3,	/**< Mask bit(3-14) */
-	RTC_ALARM_SS_MASK_14_4  = 0x4,	/**< Mask bit(4-14) */
-	RTC_ALARM_SS_MASK_14_5  = 0x5,	/**< Mask bit(5-14) */
-	RTC_ALARM_SS_MASK_14_6  = 0x6,	/**< Mask bit(6-14) */
-	RTC_ALARM_SS_MASK_14_7  = 0x7,	/**< Mask bit(7-14) */
-	RTC_ALARM_SS_MASK_14_8  = 0x8,	/**< Mask bit(8-14) */
-	RTC_ALARM_SS_MASK_14_9  = 0x9,	/**< Mask bit(9-14) */
-	RTC_ALARM_SS_MASK_14_10 = 0xA,	/**< Mask bit(10-14) */
-	RTC_ALARM_SS_MASK_14_11 = 0xB,	/**< Mask bit(11-14) */
-	RTC_ALARM_SS_MASK_14_12 = 0xC,	/**< Mask bit(12-14) */
-	RTC_ALARM_SS_MASK_14_13 = 0xD,	/**< Mask bit(13-14) */
-	RTC_ALARM_SS_MASK_14    = 0xE,	/**< Mask bit14 */
-	RTC_ALARM_SS_MASK_ALL   = 0x0,	/**< Mask bit(0-14) */
-} rtc_sub_second_mask_t;
-
-/**
-  * @brief Alarm select week or day */
-typedef enum {
-	RTC_SELECT_DAY  = 0x0,	/**< Alarm select day */
-	RTC_SELECT_WEEK = 0x1,	/**< Alarm select week */
-} rtc_week_day_sel_t;
-
-/**
-  * @brief Alarm structure
-  */
-typedef struct {
-	rtc_alarm_idx_t idx;		/**< Index of alarm */
-	rtc_time_t time;		/**< Time structure */
-	uint32_t mask;			/**< Alarm mask */
-	rtc_sub_second_mask_t ss_mask;	/**< Alarm sub-second mask */
-	rtc_week_day_sel_t sel;		/**< Select week or day */
-
-	union {
-		uint8_t week;		/**< Alarm select week */
-		uint8_t day;		/**< Alarm select day */
-	};
-} rtc_alarm_t;
-
-/**
-  * @brief Time stamp signel select
-  */
-typedef enum {
-	RTC_TS_SIGNAL_SEL_TAMPER0 = 0,	/**< Select tamper0 */
-	RTC_TS_SIGNAL_SEL_TAMPER1 = 1,	/**< Select tamper1 */
-} rtc_ts_signal_sel_t;
-
-/**
-  * @brief Time stamp trigger style
-  */
-typedef enum {
-	RTC_TS_RISING_EDGE  = 0,	/**< Rising edge */
-	RTC_TS_FALLING_EDGE = 1,	/**< Falling edge */
-} rtc_ts_trigger_style_t;
-
-/**
-  * @brief Index of tamper
-  */
-typedef enum {
-	RTC_TAMPER_0 = 0,	/**< Tamper0 */
-	RTC_TAMPER_1 = 1,	/**< Tamper1 */
-} rtc_tamper_idx_t;
-
-/**
-  * @brief Tamper trigger type
-  */
-typedef enum {
-	RTC_TAMPER_TRIGGER_LOW  = 0,	/**< High trigger */
-	RTC_TAMPER_TRIGGER_HIGH = 1,	/**< Low trigger */
-} rtc_tamper_trigger_t;
-
-/**
-  * @brief Tamper sampling frequency
-  */
-typedef enum {
-	RTC_TAMPER_SAMPLING_FREQ_32768 = 0,	/**< RTCCLK / 32768 */
-	RTC_TAMPER_SAMPLING_FREQ_16384 = 1,	/**< RTCCLK / 16384 */
-	RTC_TAMPER_SAMPLING_FREQ_8192  = 2,	/**< RTCCLK / 8192 */
-	RTC_TAMPER_SAMPLING_FREQ_4096  = 3,	/**< RTCCLK / 4096 */
-	RTC_TAMPER_SAMPLING_FREQ_2048  = 4,	/**< RTCCLK / 2048 */
-	RTC_TAMPER_SAMPLING_FREQ_1024  = 5,	/**< RTCCLK / 1024 */
-	RTC_TAMPER_SAMPLING_FREQ_512   = 6,	/**< RTCCLK / 512 */
-	RTC_TAMPER_SAMPLING_FREQ_256   = 7,	/**< RTCCLK / 256 */
-} rtc_tamper_sampling_freq_t;
-
-/**
-  * @brief Tamper filter time
-  */
-typedef enum {
-	RTC_TAMPER_DURATION_1 = 0,	/**< Duration 1 sampling */
-	RTC_TAMPER_DURATION_2 = 1,	/**< Duration 2 sampling */
-	RTC_TAMPER_DURATION_4 = 2,	/**< Duration 4 sampling */
-	RTC_TAMPER_DURATION_8 = 3,	/**< Duration 8 sampling */
-} rtc_tamper_duration_t;
-
-/**
-  * @brief Tamper structure
-  */
-typedef struct {
-	rtc_tamper_idx_t idx;			/**< Index of tamper */
-	rtc_tamper_trigger_t trig;		/**< Trigger type */
-	rtc_tamper_sampling_freq_t freq;	/**< Sampling frequency */
-	rtc_tamper_duration_t dur;		/**< Filter time */
-	type_func_t ts;				/**< Enable/Disable trigger time stamp event */
-} rtc_tamper_t;
-
-/**
-  * @brief Wake-up clock
-  */
-typedef enum {
-	RTC_WAKEUP_CLOCK_DIV_16   = 0,	/**< RTCCLK / 16 */
-	RTC_WAKEUP_CLOCK_DIV_8    = 1,	/**< RTCCLK / 8 */
-	RTC_WAKEUP_CLOCK_DIV_4    = 2,	/**< RTCCLK / 4 */
-	RTC_WAKEUP_CLOCK_DIV_2    = 3,	/**< RTCCLK / 2 */
-	RTC_WAKEUP_CLOCK_1HZ      = 4,	/**< 1Hz */
-	RTC_WAKEUP_CLOCK_1HZ_PULS = 6,	/**< 1Hz and WUT + 65536 */
-} rtc_wakeup_clock_t;
-
-/**
-  * @brief RTC clock output type
-  */
-typedef enum {
-	RTC_CLOCK_OUTPUT_32768 = 0,	/**< 32768Hz */
-	RTC_CLOCK_OUTPUT_1024  = 1,	/**< 1024Hz */
-	RTC_CLOCK_OUTPUT_32    = 2,	/**< 32Hz */
-	RTC_CLOCK_OUTPUT_1     = 3,	/**< 1Hz */
-	RTC_CLOCK_OUTPUT_CAL_1 = 4,	/**< 1Hz after calibration */
-	RTC_CLOCK_OUTPUT_EXA_1 = 5,	/**< Exact 1Hz */
-} rtc_clock_output_t;
-
-/**
-  * @ Calibration frequency
-  */
-typedef enum {
-	RTC_CALI_FREQ_10_SEC = 0,	/**< Calibrate every 10 seconds */
-	RTC_CALI_FREQ_20_SEC = 1,	/**< Calibrate every 20 seconds */
-	RTC_CALI_FREQ_1_MIN  = 2,	/**< Calibrate every 1 minute */
-	RTC_CALI_FREQ_2_MIN  = 3,	/**< Calibrate every 2 minutes */
-	RTC_CALI_FREQ_5_MIN  = 4,	/**< Calibrate every 5 minutes */
-	RTC_CALI_FREQ_10_MIN = 5,	/**< Calibrate every 10 minutes */
-	RTC_CALI_FREQ_20_MIN = 6,	/**< Calibrate every 20 minutes */
-	RTC_CALI_FREQ_1_SEC  = 7,	/**< Calibrate every 1 second */
-} rtc_cali_freq_t;
-
-/**
-  * @brief Temperature compensate type
-  */
-typedef enum {
-	RTC_CALI_TC_NONE          = 0,	/**< Temperature compensate disable */
-	RTC_CALI_TC_AUTO_BY_HW    = 1,	/**< Temperature compensate by hardware */
-	RTC_CALI_TC_AUTO_BY_SF    = 2,	/**< Temperature compensate by software */
-	RTC_CALI_TC_AUTO_BY_HW_SF = 3,	/**< Temperature compensate by hardware, trigger by software */
-} rtc_cali_tc_t;
-
-/**
-  * @ Calculate frequency
-  */
-typedef enum {
-	RTC_CALI_CALC_FREQ_10_SEC = 0,	/**< Calculate every 10 seconds */
-	RTC_CALI_CALC_FREQ_20_SEC = 1,	/**< Calculate every 20 seconds */
-	RTC_CALI_CALC_FREQ_1_MIN  = 2,	/**< Calculate every 1 minute */
-	RTC_CALI_CALC_FREQ_2_MIN  = 3,	/**< Calculate every 2 minutes */
-	RTC_CALI_CALC_FREQ_5_MIN  = 4,	/**< Calculate every 5 minutes */
-	RTC_CALI_CALC_FREQ_10_MIN = 5,	/**< Calculate every 10 minutes */
-	RTC_CALI_CALC_FREQ_20_MIN = 6,	/**< Calculate every 20 minutes */
-	RTC_CALI_CALC_FREQ_1_HOUR = 7,	/**< Calculate every 1 hour */
-} rtc_cali_calc_freq_t;
-
-/**
-  * @brief Calibration algorithm
-  */
-typedef enum {
-	RTC_CALI_CALC_4 = 0,	/**< 4-polynomial */
-	RTC_CALI_CALC_2 = 1,	/**< 2-parabola */
-} rtc_cali_calc_t;
-
-/**
-  * @brief Calibration structure
-  */
-typedef struct {
-	rtc_cali_freq_t cali_freq;	/**< calibrate frequency */
-	rtc_cali_tc_t tc;		/**< Temperature compensate type */
-	rtc_cali_calc_freq_t calc_freq;	/**< Calculate frequency */
-	rtc_cali_calc_t calc;		/**< algorithm */
-	type_func_t acc;		/**< Enable/Disable decimal accumulate */
-} rtc_cali_t;
-
-/**
-  * @brief Interrupt type
-  */
-typedef enum {
-	RTC_IT_SEC  = (1U << 0),	/**< Second */
-	RTC_IT_MIN  = (1U << 1),	/**< Minute */
-	RTC_IT_HR   = (1U << 2),	/**< Hour */
-	RTC_IT_DAY  = (1U << 3),	/**< Day */
-	RTC_IT_MON  = (1U << 4),	/**< Month */
-	RTC_IT_YR   = (1U << 5),	/**< Year */
-	RTC_IT_ALMA = (1U << 8),	/**< Alarm-A */
-	RTC_IT_ALMB = (1U << 9),	/**< Alarm-B */
-	RTC_IT_TS   = (1U << 10),	/**< Time stamp */
-	RTC_IT_TSOV = (1U << 11),	/**< Time stamp overflow */
-	RTC_IT_TP0  = (1U << 12),	/**< Tamper-0 */
-	RTC_IT_TP1  = (1U << 13),	/**< Tamper-1 */
-	RTC_IT_RSC  = (1U << 16),	/**< Synchronous complete */
-	RTC_IT_SFC  = (1U << 17),	/**< Shift complete */
-	RTC_IT_WU   = (1U << 18),	/**< Wake-up */
-	RTC_IT_TCC  = (1U << 24),	/**< Temperature compensate complete */
-	RTC_IT_TCE  = (1U << 25),	/**< Temperature compensate error */
-} rtc_it_t;
-
-/**
-  * @brief Interrupt flag
-  */
-typedef enum {
-	RTC_IF_SEC  = (1U << 0),	/**< Second */
-	RTC_IF_MIN  = (1U << 1),	/**< Minute */
-	RTC_IF_HR   = (1U << 2),	/**< Hour */
-	RTC_IF_DAY  = (1U << 3),	/**< Day */
-	RTC_IF_MON  = (1U << 4),	/**< Month */
-	RTC_IF_YR   = (1U << 5),	/**< Year */
-	RTC_IF_ALMA = (1U << 8),	/**< Alarm-A */
-	RTC_IF_ALMB = (1U << 9),	/**< Alarm-B */
-	RTC_IF_TS   = (1U << 10),	/**< Time stamp */
-	RTC_IF_TSOV = (1U << 11),	/**< Time stamp overflow */
-	RTC_IF_TP0  = (1U << 12),	/**< Tamper-0 */
-	RTC_IF_TP1  = (1U << 13),	/**< Tamper-1 */
-	RTC_IF_RSC  = (1U << 16),	/**< Synchronous complete */
-	RTC_IF_SFC  = (1U << 17),	/**< Shift complete */
-	RTC_IF_WU   = (1U << 18),	/**< Wake-up */
-	RTC_IF_TCC  = (1U << 24),	/**< Temperature compensate complete */
-	RTC_IF_TCE  = (1U << 25),	/**< Temperature compensate error */
-} rtc_flag_t;
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Macro RTC Public Macros
-  * @{
-  */
-#define RTC_UNLOCK()		(WRITE_REG(RTC->WPR, 0x55AAAA55))
-#define RTC_LOCK()		(WRITE_REG(RTC->WPR, 0x0))
-#define RTC_BY_PASS_ENABLE()			\
-do {						\
-	RTC_UNLOCK();				\
-	SET_BIT(RTC->CON, RTC_CON_SHDBP_MSK);	\
-	RTC_LOCK();				\
-} while (0)
-#define RTC_BY_PASS_DISABLE()			\
-do {						\
-	RTC_UNLOCK();				\
-	CLEAR_BIT(RTC->CON, RTC_CON_SHDBP_MSK);	\
-	RTC_LOCK();				\
-} while (0)
-#define RTC_SUMMER_TIME_ENABLE()		\
-do {						\
-	RTC_UNLOCK();				\
-	SET_BIT(RTC->CON, RTC_CON_ADD1H_MSK);	\
-	RTC_LOCK();				\
-} while (0)
-#define RTC_SUMMER_TIME_DISABLE()		\
-do {						\
-	RTC_UNLOCK();				\
-	CLEAR_BIT(RTC->CON, RTC_CON_ADD1H_MSK);	\
-	RTC_LOCK();				\
-} while (0)
-#define RTC_WINTER_TIME_ENABLE()		\
-do {						\
-	RTC_UNLOCK();				\
-	SET_BIT(RTC->CON, RTC_CON_SUB1H_MSK);	\
-	RTC_LOCK();				\
-} while (0)
-#define RTC_WINTER_TIME_DISABLE()		\
-do {						\
-	RTC_UNLOCK();				\
-	CLEAR_BIT(RTC->CON, RTC_CON_SUB1H_MSK);	\
-	RTC_LOCK();				\
-} while (0)
-/**
- * @}
- */
-
-/** @defgroup CAN_Private_Macros CAN Private Macros
-  * @{
-  */
-#define RTC_CALI_UNLOCK()	(WRITE_REG(RTC->CALWPR, 0x699655AA))
-#define RTC_CALI_LOCK()		(WRITE_REG(RTC->CALWPR, 0x0))
-#define ALARM_MASK_ALL		0x40808080
-#define RTC_TIMEOUT_VALUE	100
-
-#define IS_SHIFT_SUB_SS(x)	((x) < (1U << 15))
-#define IS_RTC_HOUR_FORMAT(x)	(((x) == RTC_HOUR_FORMAT_24) || \
-                                 ((x) == RTC_HOUR_FORMAT_12))
-#define IS_RTC_OUTPUT_SEL(x)	(((x) == RTC_OUTPUT_DISABLE) || \
-                                 ((x) == RTC_OUTPUT_ALARM_A) || \
-                                 ((x) == RTC_OUTPUT_ALARM_B) || \
-                                 ((x) == RTC_OUTPUT_WAKEUP))
-#define IS_RTC_OUTPUT_POLARITY(x)	(((x) == RTC_OUTPUT_POLARITY_HIGH) || \
-                                         ((x) == RTC_OUTPUT_POLARITY_LOW))
-#define IS_RTC_SOURCE_SEL(x)	(((x) == RTC_SOURCE_LOSC)        || \
-                                 ((x) == RTC_SOURCE_LRC)         || \
-                                 ((x) == RTC_SOURCE_HRC_DIV_1M ) || \
-                                 ((x) == RTC_SOURCE_HOSC_DIV_1M))
-#define IS_RTC_ALARM(x)		(((x) == RTC_ALARM_A) || \
-                                 ((x) == RTC_ALARM_B))
-#define IS_RTC_ALARM_SEL(x)	(((x) == RTC_SELECT_DAY) || \
-                                 ((x) == RTC_SELECT_WEEK))
-#define IS_RTC_ALARM_MASK(x)	(((x) == RTC_ALARM_MASK_NONE)     || \
-                                 ((x) == RTC_ALARM_MASK_WEEK_DAY) || \
-                                 ((x) == RTC_ALARM_MASK_HOUR)     || \
-                                 ((x) == RTC_ALARM_MASK_MINUTE)   || \
-                                 ((x) == RTC_ALARM_MASK_SECOND)   || \
-                                 ((x) == RTC_ALARM_MASK_ALL))
-#define IS_RTC_ALARM_SS_MASK(x)	(((x) == RTC_ALARM_SS_MASK_NONE)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_1)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_2)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_3)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_4)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_5)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_6)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_7)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_8)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_9)  || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_10) || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_11) || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_12) || \
-                                 ((x) == RTC_ALARM_SS_MASK_14_13) || \
-                                 ((x) == RTC_ALARM_SS_MASK_14)    || \
-                                 ((x) == RTC_ALARM_SS_MASK_ALL))
-#define IS_RTC_TS_SIGNAL(x)	(((x) == RTC_TS_SIGNAL_SEL_TAMPER0) || \
-                                 ((x) == RTC_TS_SIGNAL_SEL_TAMPER1))
-#define IS_RTC_TS_STYLE(x)	(((x) == RTC_TS_RISING_EDGE) || \
-                                 ((x) == RTC_TS_FALLING_EDGE))
-#define IS_RTC_FORMAT(x)	(((x) == RTC_FORMAT_DEC) || \
-                                 ((x) == RTC_FORMAT_BCD))
-#define IS_RTC_TAMPER(x)	(((x) == RTC_TAMPER_0) || \
-                                 ((x) == RTC_TAMPER_1))
-#define IS_RTC_TAMPER_TRIGGER(x)	(((x) == RTC_TAMPER_TRIGGER_LOW) || \
-                                         ((x) == RTC_TAMPER_TRIGGER_HIGH))
-#define IS_RTC_TAMPER_SAMPLING_FREQ(x)	(((x) == RTC_TAMPER_SAMPLING_FREQ_32768) || \
-                                         ((x) == RTC_TAMPER_SAMPLING_FREQ_16384) || \
-                                         ((x) == RTC_TAMPER_SAMPLING_FREQ_8192)  || \
-                                         ((x) == RTC_TAMPER_SAMPLING_FREQ_4096)  || \
-                                         ((x) == RTC_TAMPER_SAMPLING_FREQ_2048)  || \
-                                         ((x) == RTC_TAMPER_SAMPLING_FREQ_1024)  || \
-                                         ((x) == RTC_TAMPER_SAMPLING_FREQ_512)   || \
-                                         ((x) == RTC_TAMPER_SAMPLING_FREQ_256))
-#define IS_RTC_TAMPER_DURATION(x)	(((x) == RTC_TAMPER_DURATION_1) || \
-                                         ((x) == RTC_TAMPER_DURATION_2) || \
-                                         ((x) == RTC_TAMPER_DURATION_4) || \
-                                         ((x) == RTC_TAMPER_DURATION_8))
-#define IS_RTC_WAKEUP_CLOCK(x)	(((x) == RTC_WAKEUP_CLOCK_DIV_16) || \
-                                 ((x) == RTC_WAKEUP_CLOCK_DIV_8)  || \
-                                 ((x) == RTC_WAKEUP_CLOCK_DIV_4)  || \
-                                 ((x) == RTC_WAKEUP_CLOCK_DIV_2)  || \
-                                 ((x) == RTC_WAKEUP_CLOCK_1HZ)    || \
-                                 ((x) == RTC_WAKEUP_CLOCK_1HZ_PULS))
-#define IS_RTC_CLOCK_OUTPUT(x)	(((x) == RTC_CLOCK_OUTPUT_32768) || \
-                                 ((x) == RTC_CLOCK_OUTPUT_1024)  || \
-                                 ((x) == RTC_CLOCK_OUTPUT_32)    || \
-                                 ((x) == RTC_CLOCK_OUTPUT_1)     || \
-                                 ((x) == RTC_CLOCK_OUTPUT_CAL_1) || \
-                                 ((x) == RTC_CLOCK_OUTPUT_EXA_1))
-#define IS_RTC_CALI_FREQ(x)	(((x) == RTC_CALI_FREQ_10_SEC) || \
-                                 ((x) == RTC_CALI_FREQ_20_SEC) || \
-                                 ((x) == RTC_CALI_FREQ_1_MIN)  || \
-                                 ((x) == RTC_CALI_FREQ_2_MIN)  || \
-                                 ((x) == RTC_CALI_FREQ_5_MIN)  || \
-                                 ((x) == RTC_CALI_FREQ_10_MIN) || \
-                                 ((x) == RTC_CALI_FREQ_20_MIN) || \
-                                 ((x) == RTC_CALI_FREQ_1_SEC))
-#define IS_RTC_CALI_TC(x)	(((x) == RTC_CALI_TC_NONE)       || \
-                                 ((x) == RTC_CALI_TC_AUTO_BY_HW) || \
-                                 ((x) == RTC_CALI_TC_AUTO_BY_SF) || \
-                                 ((x) == RTC_CALI_TC_AUTO_BY_HW_SF))
-#define IS_RTC_CALC_FREQ(x)	(((x) == RTC_CALI_CALC_FREQ_10_SEC) || \
-                                 ((x) == RTC_CALI_CALC_FREQ_20_SEC) || \
-                                 ((x) == RTC_CALI_CALC_FREQ_1_MIN)  || \
-                                 ((x) == RTC_CALI_CALC_FREQ_2_MIN)  || \
-                                 ((x) == RTC_CALI_CALC_FREQ_5_MIN)  || \
-                                 ((x) == RTC_CALI_CALC_FREQ_10_MIN) || \
-                                 ((x) == RTC_CALI_CALC_FREQ_20_MIN) || \
-                                 ((x) == RTC_CALI_CALC_FREQ_1_HOUR))
-#define IS_RTC_CALI_CALC(x)	(((x) == RTC_CALI_CALC_4) || \
-                                 ((x) == RTC_CALI_CALC_2))
-#define IS_RTC_IT(x)		(((x) == RTC_IT_SEC)  || \
-                                 ((x) == RTC_IT_MIN)  || \
-                                 ((x) == RTC_IT_HR)   || \
-                                 ((x) == RTC_IT_DAY)  || \
-                                 ((x) == RTC_IT_MON)  || \
-                                 ((x) == RTC_IT_YR)   || \
-                                 ((x) == RTC_IT_ALMA) || \
-                                 ((x) == RTC_IT_ALMB) || \
-                                 ((x) == RTC_IT_TS)   || \
-                                 ((x) == RTC_IT_TSOV) || \
-                                 ((x) == RTC_IT_TP0)  || \
-                                 ((x) == RTC_IT_TP1)  || \
-                                 ((x) == RTC_IT_RSC)  || \
-                                 ((x) == RTC_IT_SFC)  || \
-                                 ((x) == RTC_IT_WU)   || \
-                                 ((x) == RTC_IT_TCC)  || \
-                                 ((x) == RTC_IT_TCE))
-#define IS_RTC_IF(x)		(((x) == RTC_IF_SEC)  || \
-                                 ((x) == RTC_IF_MIN)  || \
-                                 ((x) == RTC_IF_HR)   || \
-                                 ((x) == RTC_IF_DAY)  || \
-                                 ((x) == RTC_IF_MON)  || \
-                                 ((x) == RTC_IF_YR)   || \
-                                 ((x) == RTC_IF_ALMA) || \
-                                 ((x) == RTC_IF_ALMB) || \
-                                 ((x) == RTC_IF_TS)   || \
-                                 ((x) == RTC_IF_TSOV) || \
-                                 ((x) == RTC_IF_TP0)  || \
-                                 ((x) == RTC_IF_TP1)  || \
-                                 ((x) == RTC_IF_RSC)  || \
-                                 ((x) == RTC_IF_SFC)  || \
-                                 ((x) == RTC_IF_WU)   || \
-                                 ((x) == RTC_IF_TCC)  || \
-                                 ((x) == RTC_IF_TCE))
-#define IS_RTC_SECOND(x)	((x) < 60)
-#define IS_RTC_MINUTE(x)	((x) < 60)
-#define IS_RTC_HOUR(x)		((x) < 24)
-#define IS_RTC_DAY(x)		(((x) > 0) && ((x) < 32))
-#define IS_RTC_MONTH(x)		(((x) > 0) && ((x) < 13))
-#define IS_RTC_YEAR(x)		((x) < 100)
-/**
-  * @}
-  */
-
-/** @addtogroup RTC_Public_Functions
-  * @{
-  */
-
-/** @addtogroup RTC_Public_Functions_Group1
-  *  @{
-  */
-/* Initialization functions */
-void rtc_reset(void);
-void rtc_init(rtc_init_t *init);
-void rtc_source_selcet(rtc_source_sel_t sel);
-/**
-  * @}
-  */
-/** @addtogroup RTC_Public_Functions_Group2
-  * @{
-  */
-/* Time and date operation functions */
-ald_status_t rtc_set_time(rtc_time_t *time, rtc_format_t format);
-ald_status_t rtc_set_date(rtc_date_t *date, rtc_format_t format);
-void rtc_get_time(rtc_time_t *time, rtc_format_t format);
-void rtc_get_date(rtc_date_t *date, rtc_format_t format);
-int32_t rtc_get_date_time(rtc_date_t *date, rtc_time_t *time, rtc_format_t format);
-/**
-  * @}
-  */
-/** @addtogroup RTC_Public_Functions_Group3
-  * @{
-  */
-/* Alarm functions */
-void rtc_set_alarm(rtc_alarm_t *alarm, rtc_format_t format);
-void rtc_get_alarm(rtc_alarm_t *alarm, rtc_format_t format);
-/**
-  * @}
-  */
-/** @addtogroup RTC_Public_Functions_Group4
-  * @{
-  */
-/* Time stamp functions */
-void rtc_set_time_stamp(rtc_ts_signal_sel_t sel, rtc_ts_trigger_style_t style);
-void rtc_cancel_time_stamp(void);
-void rtc_get_time_stamp(rtc_time_t *ts_time, rtc_date_t *ts_date, rtc_format_t format);
-/**
-  * @}
-  */
-/** @addtogroup RTC_Public_Functions_Group5
-  * @{
-  */
-/* Tamper functions */
-void rtc_set_tamper(rtc_tamper_t *tamper);
-void rtc_cancel_tamper(rtc_tamper_idx_t idx);
-/**
-  * @}
-  */
-/** @addtogroup RTC_Public_Functions_Group6
-  * @{
-  */
-/* Wakeup functions */
-void rtc_set_wakeup(rtc_wakeup_clock_t clock, uint16_t value);
-void rtc_cancel_wakeup(void);
-uint16_t rtc_get_wakeup_timer_value(void);
-/**
-  * @}
-  */
-/** @addtogroup RTC_Public_Functions_Group7
-  * @{
-  */
-/* Clock output functions */
-ald_status_t rtc_set_clock_output(rtc_clock_output_t clock);
-void rtc_cancel_clock_output(void);
-/**
-  * @}
-  */
-/** @addtogroup RTC_Public_Functions_Group8
-  * @{
-  */
-/* Control functions */
-void rtc_interrupt_config(rtc_it_t it, type_func_t state);
-void rtc_alarm_cmd(rtc_alarm_idx_t idx, type_func_t state);
-ald_status_t rtc_set_shift(type_func_t add_1s, uint16_t sub_ss);
-void rtc_set_cali(rtc_cali_t *config);
-void rtc_cancel_cali(void);
-ald_status_t rtc_get_cali_status(void);
-void rtc_write_temp(uint16_t temp);
-it_status_t rtc_get_it_status(rtc_it_t it);
-flag_status_t rtc_get_flag_status(rtc_flag_t flag);
-void rtc_clear_flag_status(rtc_flag_t flag);
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 274
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_smartcard.h

@@ -1,274 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_usart.h
-  * @brief   Header file of SMARTCARD driver module.
-  *
-  * @version V1.0
-  * @date    25 Apr 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_SMARTCARD_H__
-#define __ALD_SMARTCARD_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-#include "ald_usart.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup SMARTCARD
-  * @{
-  */
-
-/** @defgroup SMARTCARD_Public_Constants  SMARTCARD Public constants
-  * @{
-  */
-
-/**
-  * @brief SMARTCARD error codes
-  */
-typedef enum {
-	SMARTCARD_ERROR_NONE = ((uint32_t)0x00),	/**< No error */
-	SMARTCARD_ERROR_PE   = ((uint32_t)0x01),	/**< Parity error */
-	SMARTCARD_ERROR_NE   = ((uint32_t)0x02),	/**< Noise error */
-	SMARTCARD_ERROR_FE   = ((uint32_t)0x04),	/**< frame error */
-	SMARTCARD_ERROR_ORE  = ((uint32_t)0x08),	/**< Overrun error */
-	SMARTCARD_ERROR_DMA  = ((uint32_t)0x10),	/**< DMA transfer error */
-} smartcard_error_t;
-
-/**
-  * @brief SMARTCARD Prescaler
-  */
-typedef enum {
-	SMARTCARD_PRESCALER_SYSCLK_DIV2  = ((uint32_t)0x1),	/**< SYSCLK divided by 2 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV4  = ((uint32_t)0x2),	/**< SYSCLK divided by 4 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV6  = ((uint32_t)0x3),	/**< SYSCLK divided by 6 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV8  = ((uint32_t)0x4),	/**< SYSCLK divided by 8 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV10 = ((uint32_t)0x5),	/**< SYSCLK divided by 10 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV12 = ((uint32_t)0x6),	/**< SYSCLK divided by 12 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV14 = ((uint32_t)0x7),	/**< SYSCLK divided by 14 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV16 = ((uint32_t)0x8),	/**< SYSCLK divided by 16 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV18 = ((uint32_t)0x9),	/**< SYSCLK divided by 18 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV20 = ((uint32_t)0xA),	/**< SYSCLK divided by 20 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV22 = ((uint32_t)0xB),	/**< SYSCLK divided by 22 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV24 = ((uint32_t)0xC),	/**< SYSCLK divided by 24 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV26 = ((uint32_t)0xD),	/**< SYSCLK divided by 26 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV28 = ((uint32_t)0xE),	/**< SYSCLK divided by 28 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV30 = ((uint32_t)0xF),	/**< SYSCLK divided by 30 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV32 = ((uint32_t)0x10),	/**< SYSCLK divided by 32 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV34 = ((uint32_t)0x11),	/**< SYSCLK divided by 34 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV36 = ((uint32_t)0x12),	/**< SYSCLK divided by 36 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV38 = ((uint32_t)0x13),	/**< SYSCLK divided by 38 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV40 = ((uint32_t)0x14),	/**< SYSCLK divided by 40 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV42 = ((uint32_t)0x15),	/**< SYSCLK divided by 42 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV44 = ((uint32_t)0x16),	/**< SYSCLK divided by 44 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV46 = ((uint32_t)0x17),	/**< SYSCLK divided by 46 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV48 = ((uint32_t)0x18),	/**< SYSCLK divided by 48 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV50 = ((uint32_t)0x19),	/**< SYSCLK divided by 50 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV52 = ((uint32_t)0x1A),	/**< SYSCLK divided by 52 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV54 = ((uint32_t)0x1B),	/**< SYSCLK divided by 54 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV56 = ((uint32_t)0x1C),	/**< SYSCLK divided by 56 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV58 = ((uint32_t)0x1D),	/**< SYSCLK divided by 58 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV60 = ((uint32_t)0x1E),	/**< SYSCLK divided by 60 */
-	SMARTCARD_PRESCALER_SYSCLK_DIV62 = ((uint32_t)0x1F),	/**< SYSCLK divided by 62 */
-} smartcard_prescaler_t;
-
-/**
-  * @}
-  */
-
-/** @defgroup SMARTCARD_Public_Types SMARTCARD Public Types
-  * @{
-  */
-
-/**
-  * @brief SMARTCARD Init Structure definition
-  */
-typedef struct {
-	uint32_t baud;			/**< This member configures the SmartCard communication baud rate. */
-	usart_word_length_t word_length;/**< Specifies the number of data bits transmitted or received in a frame. */
-	usart_stop_bits_t stop_bits;	/**< Specifies the number of stop bits transmitted. */
-	usart_parity_t parity;		/**< Specifies the parity mode.
-						@note When parity is enabled, the computed parity is inserted
-                                                      at the MSB position of the transmitted data (9th bit when
-                                                      the word length is set to 9 data bits; 8th bit when the
-                                                      word length is set to 8 data bits).*/
-	usart_mode_t mode;		/**< Specifies whether the Receive or Transmit mode is enabled or disabled. */
-	usart_cpol_t polarity;		/**< Specifies the steady state of the serial clock. */
-	usart_cpha_t phase;		/**< Specifies the clock transition on which the bit capture is made.*/
-	usart_last_bit_t last_bit;	/**< Specifies whether the clock pulse corresponding to the last transmitted
-					     data bit (MSB) has to be output on the SCLK pin in synchronous mode.
-                                             This parameter can be a value of @ref usart_last_bit_t */
-	smartcard_prescaler_t prescaler;/**< Specifies the SmartCard Prescaler value used for dividing the system clock
-					     to provide the smartcard clock. The value given in the register (5 significant bits)
-					     is multiplied by 2 to give the division factor of the source clock frequency. */
-	uint32_t guard_time;		/**< Specifies the SmartCard Guard Time value in terms of number of baud clocks */
-	type_func_t nack;		/**< Specifies the SmartCard NACK Transmission state. */
-} smartcard_init_t;
-
-/**
-  * @brief ALD state structures definition
-  */
-typedef enum {
-	SMARTCARD_STATE_RESET      = 0x00,	/**< Peripheral is not yet Initialized */
-	SMARTCARD_STATE_READY      = 0x01,	/**< Peripheral Initialized and ready for use */
-	SMARTCARD_STATE_BUSY       = 0x02,	/**< an internal process is ongoing */
-	SMARTCARD_STATE_BUSY_TX    = 0x11,	/**< Data Transmission process is ongoing */
-	SMARTCARD_STATE_BUSY_RX    = 0x21,	/**< Data Reception process is ongoing */
-	SMARTCARD_STATE_BUSY_TX_RX = 0x31,	/**< Data Transmission and Reception process is ongoing */
-	SMARTCARD_STATE_TIMEOUT    = 0x03,	/**< Timeout state */
-	SMARTCARD_STATE_ERROR      = 0x04	/**< Error */
-} smartcard_state_t;
-
-
-/**
-  * @brief  SMARTCARD handle structure definition
-  */
-typedef struct smartcard_handle_s {
-	USART_TypeDef *perh;		/**< USART registers base address */
-	smartcard_init_t init;		/**< SmartCard communication parameters */
-	uint8_t *tx_buf;		/**< Pointer to SmartCard Tx transfer Buffer */
-	uint16_t tx_size;		/**< SmartCard Tx Transfer size */
-	uint16_t tx_count;		/**< SmartCard Tx Transfer Counter */
-	uint8_t *rx_buf;		/**< Pointer to SmartCard Rx transfer Buffer */
-	uint16_t rx_size;		/**< SmartCard Rx Transfer size */
-	uint16_t rx_count;		/**< SmartCard Rx Transfer Counter */
-#ifdef ALD_DMA
-	dma_handle_t hdmatx;		/**< SmartCard Tx DMA Handle parameters */
-	dma_handle_t hdmarx;		/**< SmartCard Rx DMA Handle parameters */
-#endif
-	lock_state_t lock;		/**< Locking object */
-	smartcard_state_t state;	/**< SmartCard communication state */
-	uint32_t  err_code;		/**< SmartCard Error code */
-
-	void (*tx_cplt_cbk)(struct smartcard_handle_s *arg);	/**< Tx completed callback */
-	void (*rx_cplt_cbk)(struct smartcard_handle_s *arg);	/**< Rx completed callback */
-	void (*error_cbk)(struct smartcard_handle_s *arg);	/**< error callback */
-} smartcard_handle_t;
-
-/**
-  * @}
-  */
-
-/** @defgroup SMARTCARD_Public_Macros SMARTCARD Public Macros
-  * @{
-  */
-
-/** @defgroup SMARTCARD_Public_Macros_1 SMARTCARD handle reset
-  * @{
-  */
-#define SMARTCARD_RESET_HANDLE_STATE(handle) ((handle)->state = SMARTCARD_STATE_RESET)
-/**
-  * @}
-  */
-
-/** @defgroup SMARTCARD_Public_Macros_2 SMARTCARD flush data
-  * @{
-  */
-#define SMARTCARD_FLUSH_DRREGISTER(handle) ((handle)->perh->DATA)
-/**
-  * @}
-  */
-
-/** @defgroup SMARTCARD_Public_Macros_3 SMARTCARD enable
-  * @{
-  */
-#define SMARTCARD_ENABLE(handle)	(SET_BIT((handle)->perh->CON0, USART_CON0_EN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup SMARTCARD_Public_Macros_4 SMARTCARD disable
-  * @{
-  */
-#define SMARTCARD_DISABLE(handle)	(CLEAR_BIT((handle)->perh->CON0, USART_CON0_EN_MSK))
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup SMARTCARD_Private_Macros SMARTCARD Private Macros
-  * @{
-  */
-
-#define IS_SMARTCARD_PRESCALER(x)   (((x) >= SMARTCARD_PRESCALER_SYSCLK_DIV2) && \
-				     ((x) <= SMARTCARD_PRESCALER_SYSCLK_DIV62))
-/**
-  * @}
-  */
-
-/** @addtogroup SMARTCARD_Public_Functions
-  * @{
-  */
-
-/** @addtogroup SMARTCARD_Public_Functions_Group1
-  * @{
-  */
-/* Initialization functions */
-ald_status_t smartcard_init(smartcard_handle_t *hperh);
-ald_status_t smartcard_reset(smartcard_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup SMARTCARD_Public_Functions_Group2
-  * @{
-  */
-/* IO operation functions */
-ald_status_t smartcard_send(smartcard_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t smartcard_recv(smartcard_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t smartcard_send_by_it(smartcard_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t smartcard_recv_by_it(smartcard_handle_t *hperh, uint8_t *buf, uint16_t size);
-#ifdef ALD_DMA
-ald_status_t smartcard_send_by_dma(smartcard_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t smartcard_recv_by_dma(smartcard_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-#endif
-void smartcard_irq_handle(smartcard_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup SMARTCARD_Public_Functions_Group3
-  * @{
-  */
-/* Peripheral State and Errors functions functions */
-smartcard_state_t smartcard_get_state(smartcard_handle_t *hperh);
-uint32_t smartcard_get_error(smartcard_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_SMARTCARD_H__ */

+ 0 - 362
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_spi.h

@@ -1,362 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_spi.c
-  * @brief   Header file of SPI module driver.
-  *
-  * @version V1.0
-  * @date    13 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_SPI_H__
-#define __ALD_SPI_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup SPI
-  * @{
-  */
-
-/** @defgroup SPI_Public_Types SPI Public Types
-  * @{
-  */
-
-/**
-  * @brief clock phase
-  */
-typedef enum {
-	SPI_CPHA_FIRST  = 0,	/**< Transiting data in the first edge */
-	SPI_CPHA_SECOND = 1,	/**< Transiting data in the seconde edge */
-} spi_cpha_t;
-
-/**
-  * @brief clock polarity
-  */
-typedef enum {
-	SPI_CPOL_LOW  = 0,	/**< Polarity hold low when spi-bus is idle */
-	SPI_CPOL_HIGH = 1,	/**< Polarity hold high when spi-bus is idle */
-} spi_cpol_t;
-
-/**
-  * @brief master selection
-  */
-typedef enum {
-	SPI_MODE_SLAVER = 0,	/**< Slave mode */
-	SPI_MODE_MASTER = 1,	/**< Master mode */
-} spi_mode_t;
-
-/**
-  * @brief baud rate control
-  */
-typedef enum {
-	SPI_BAUD_2   = 0,	/**< fpclk/2 */
-	SPI_BAUD_4   = 1,	/**< fpclk/4 */
-	SPI_BAUD_8   = 2,	/**< fpclk/8 */
-	SPI_BAUD_16  = 3,	/**< fpclk/16 */
-	SPI_BAUD_32  = 4,	/**< fpclk/32 */
-	SPI_BAUD_64  = 5,	/**< fpclk/64 */
-	SPI_BAUD_128 = 6,	/**< fpclk/128 */
-	SPI_BAUD_256 = 7,	/**< fpclk/256 */
-} spi_baud_t;
-
-/**
-  * @brief frame format
-  */
-typedef enum {
-	SPI_FIRSTBIT_MSB = 0,	/**< MSB transmitted first */
-	SPI_FIRSTBIT_LSB = 1,	/**< LSB transmitted first */
-} spi_firstbit_t;
-
-/**
-  * @brief data frame format
-  */
-typedef enum {
-	SPI_DATA_SIZE_8  = 0,	/**< 8-bit data frame format is selected for transmission/reception */
-	SPI_DATA_SIZE_16 = 1,	/**< 16-bit data frame format is selected for transmission/reception */
-} spi_datasize_t;
-
-/**
-  * @brief interrupt control
-  */
-typedef enum {
-	SPI_IT_ERR   = (1U << 5),	/**< error interrupt */
-	SPI_IT_RXBNE = (1U << 6),	/**< rx buffer not empty interrupt */
-	SPI_IT_TXBE  = (1U << 7),	/**< tx buffer empty interrupt */
-} spi_it_t;
-
-/**
-  * @brief interrupt flag
-  */
-typedef enum {
-	SPI_IF_RXBNE  = (1U << 0),	/**< receive buffer not empty */
-	SPI_IF_TXBE   = (1U << 1),	/**< transmit buffer empty */
-	SPI_IF_CRCERR = (1U << 4),	/**< crc error flag */
-	SPI_IF_MODF   = (1U << 5),	/**< mode fault */
-	SPI_IF_OVE    = (1U << 6),	/**< overrun flag */
-	SPI_IF_BUSY   = (1U << 7),	/**< busy flag */
-} spi_flag_t;
-
-/**
-  * @brief SPI error status
-  */
-typedef enum {
-	SPI_ERROR_NONE = 0,	/**< none */
-	SPI_ERROR_MODF = 1,	/**< mode fault */
-	SPI_ERROR_CRC  = 2,	/**< crc error */
-	SPI_ERROR_OVE  = 4,	/**< overrun error */
-	SPI_ERROR_DMA  = 8,	/**< dma error  */
-	SPI_ERROR_FLAG = 0x10,	/**< interrupt flag error */
-} spi_error_t;
-
-
-
-/**
-  * @brief SPI state structures definition
-  */
-typedef enum {
-	SPI_STATE_RESET      = 0x00,	/**< Peripheral is not initialized */
-	SPI_STATE_READY      = 0x01,	/**< Peripheral Initialized and ready for use */
-	SPI_STATE_BUSY       = 0x02,	/**< an internal process is ongoing */
-	SPI_STATE_BUSY_TX    = 0x11,	/**< transmit is ongoing */
-	SPI_STATE_BUSY_RX    = 0x21,	/**< receive is ongoing */
-	SPI_STATE_BUSY_TX_RX = 0x31,	/**< transmit and receive are ongoing */
-	SPI_STATE_TIMEOUT    = 0x03,	/**< Timeout state */
-	SPI_STATE_ERROR      = 0x04,	/**< Error */
-} spi_state_t;
-
-
-/**
-  * @brief SPI direction definition
-  */
-typedef enum {
-	SPI_DIRECTION_2LINES        = 0,	/**< 2 lines */
-	SPI_DIRECTION_2LINES_RXONLY = 1,	/**< 2 lines only rx */
-	SPI_DIRECTION_1LINE         = 2,	/**< 1 line */
-	SPI_DIRECTION_1LINE_RX      = 3,	/**< 1 line only rx */
-} spi_direction_t;
-
-/**
-  * @brief SPI dma request definition
-  */
-typedef enum {
-	SPI_DMA_REQ_TX = 0,	/**< TX dma request */
-	SPI_DMA_REQ_RX = 1,	/**< RX dma request */
-} spi_dma_req_t;
-
-/**
-  * @brief SPI TXE/RXNE status definition
-  */
-typedef enum {
-	SPI_SR_TXBE       = 0,	/**< SR.TXE set */
-	SPI_SR_RXBNE      = 1,	/**< SR.RXNE set */
-	SPI_SR_TXBE_RXBNE = 2,	/**< SR.TXE and SR.RXNE set */
-} spi_sr_status_t;
-
-/**
-  * @brief SPI init structure definition
-  */
-typedef struct {
-	spi_mode_t mode;		/**< SPI mode */
-	spi_direction_t dir;		/**< SPI direction */
-	spi_datasize_t data_size;	/**< SPI data size */
-	spi_baud_t baud;			/**< SPI baudrate prescaler */
-	spi_cpha_t phase;		/**< SPI clock phase */
-	spi_cpol_t polarity;		/**< SPI clock polarity */
-	spi_firstbit_t first_bit;	/**< SPI first bit */
-	type_func_t ss_en;		/**< SPI ssm enable or disable */
-	type_func_t crc_calc;		/**< SPI crc calculation */
-	uint16_t crc_poly;		/**< SPI crc polynomial */
-} spi_init_t;
-
-/**
-  * @brief  SPI handle structure definition
-  */
-typedef struct spi_handle_s {
-	SPI_TypeDef *perh;	/**< SPI registers base address */
-	spi_init_t init;	/**< SPI communication parameters */
-	uint8_t *tx_buf;	/**< Pointer to SPI Tx transfer buffer */
-	uint16_t tx_size;	/**< SPI Tx transfer size */
-	uint16_t tx_count;	/**< SPI Tx transfer counter */
-	uint8_t *rx_buf;	/**< Pointer to SPI Rx transfer buffer */
-	uint16_t rx_size;	/**< SPI Rx Transfer size */
-	uint16_t rx_count;	/**< SPI Rx Transfer Counter */
-#ifdef ALD_DMA
-	dma_handle_t hdmatx;	/**< SPI Tx DMA handle parameters */
-	dma_handle_t hdmarx;	/**< SPI Rx DMA handle parameters */
-#endif
-	lock_state_t lock;	/**< Locking object */
-	spi_state_t state;	/**< SPI communication state */
-	uint32_t err_code;	/**< SPI error code */
-
-	void (*tx_cplt_cbk)(struct spi_handle_s *arg);		/**< Tx completed callback */
-	void (*rx_cplt_cbk)(struct spi_handle_s *arg);		/**< Rx completed callback */
-	void (*tx_rx_cplt_cbk)(struct spi_handle_s *arg);	/**< Tx & Rx completed callback */
-	void (*err_cbk)(struct spi_handle_s *arg);		/**< error callback */
-} spi_handle_t;
-/**
-  * @}
-  */
-
-/** @defgroup SPI_Public_Macros SPI Public Macros
-  * @{
-  */
-#define SPI_RESET_HANDLE_STATE(x)	((x)->state = SPI_STATE_RESET)
-#define SPI_ENABLE(x)			((x)->perh->CON1 |= (1 << SPI_CON1_SPIEN_POS))
-#define SPI_DISABLE(x)			((x)->perh->CON1 &= ~(1 << SPI_CON1_SPIEN_POS))
-#define SPI_CRC_RESET(x)					\
-do {								\
-	CLEAR_BIT((x)->perh->CON1, SPI_CON1_CRCEN_MSK);		\
-	SET_BIT((x)->perh->CON1, SPI_CON1_CRCEN_MSK);		\
-} while (0)
-#define SPI_CRCNEXT_ENABLE(x)	(SET_BIT((x)->perh->CON1, SPI_CON1_NXTCRC_MSK))
-#define SPI_CRCNEXT_DISABLE(x)	(CLEAR_BIT((x)->perh->CON1, SPI_CON1_NXTCRC_MSK))
-#define SPI_RXONLY_ENABLE(x)	(SET_BIT((x)->perh->CON1, SPI_CON1_RXO_MSK))
-#define SPI_RXONLY_DISABLE(x)	(CLEAR_BIT((x)->perh->CON1, SPI_CON1_RXO_MSK))
-#define SPI_1LINE_TX(x)		(SET_BIT((x)->perh->CON1, SPI_CON1_BIDOEN_MSK))
-#define SPI_1LINE_RX(x)		(CLEAR_BIT((x)->perh->CON1, SPI_CON1_BIDOEN_MSK))
-#define SPI_SSI_HIGH(x)		(SET_BIT((x)->perh->CON1, SPI_CON1_SSOUT_MSK))
-#define SPI_SSI_LOW(x)		(CLEAR_BIT((x)->perh->CON1, SPI_CON1_SSOUT_MSK))
-#define SPI_SSOE_ENABLE(x)	(SET_BIT((x)->perh->CON2, SPI_CON2_NSSOE_MSK))
-#define SPI_SSOE_DISABLE(x)	(CLEAR_BIT((x)->perh->CON2, SPI_CON2_NSSOE_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup SPI_Private_Macros   SPI Private Macros
-  * @{
-  */
-#define IS_SPI(x)	(((x) == SPI0) || \
-                         ((x) == SPI1) || \
-                         ((x) == SPI2))
-#define IS_SPI_CPHA(x)	(((x) == SPI_CPHA_FIRST) || \
-                         ((x) == SPI_CPHA_SECOND))
-#define IS_SPI_CPOL(x)	(((x) == SPI_CPOL_LOW) || \
-                         ((x) == SPI_CPOL_HIGH))
-#define IS_SPI_MODE(x)	(((x) == SPI_MODE_SLAVER) || \
-                         ((x) == SPI_MODE_MASTER))
-#define IS_SPI_BAUD(x)	(((x) == SPI_BAUD_2)   || \
-                         ((x) == SPI_BAUD_4)   || \
-                         ((x) == SPI_BAUD_8)   || \
-                         ((x) == SPI_BAUD_16)  || \
-                         ((x) == SPI_BAUD_32)  || \
-                         ((x) == SPI_BAUD_64)  || \
-                         ((x) == SPI_BAUD_128) || \
-                         ((x) == SPI_BAUD_256))
-#define IS_SPI_DATASIZE(x)	(((x) == SPI_DATA_SIZE_8) || \
-                                 ((x) == SPI_DATA_SIZE_16))
-#define IS_SPI_BIDOE(x)		(((x) == SPI_BID_RX) || \
-                                 ((x) == SPI_BID_TX))
-#define IS_SPI_BIDMODE(x)	(((x) == SPI_BIDMODE_DUAL) || \
-                                 ((x) == SPI_BIDMODE_SOLE))
-#define IS_SPI_DIRECTION(x)	(((x) == SPI_DIRECTION_2LINES)         || \
-                                 ((x) == SPI_DIRECTION_2LINES_RXONLY)  || \
-                                 ((x) == SPI_DIRECTION_1LINE)          || \
-				 ((x) == SPI_DIRECTION_1LINE_RX))
-#define IS_SPI_DMA_REQ(x)	(((x) == SPI_DMA_REQ_TX) || \
-                                 ((x) == SPI_DMA_REQ_RX))
-#define IS_SPI_SR_STATUS(x)	(((x) == SPI_SR_TXBE)  || \
-                                 ((x) == SPI_SR_RXBNE) || \
-                                 ((x) == SPI_SR_TXBE_RXBNE))
-#define IS_SPI_IT(x)	(((x) == SPI_IT_ERR)   || \
-                         ((x) == SPI_IT_RXBNE) || \
-                         ((x) == SPI_IT_TXBE))
-#define IS_SPI_IF(x)	(((x) == SPI_IF_RXBNE)  || \
-                         ((x) == SPI_IF_TXBE)   || \
-                         ((x) == SPI_IF_CRCERR) || \
-                         ((x) == SPI_IF_MODF)   || \
-                         ((x) == SPI_IF_OVE)    || \
-                         ((x) == SPI_IF_BUSY))
-/**
-  * @}
-  */
-
-/** @addtogroup SPI_Public_Functions
-  * @{
-  */
-
-/** @addtogroup SPI_Public_Functions_Group1
-  * @{
-  */
-
-ald_status_t spi_init(spi_handle_t *hperh);
-void spi_reset(spi_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup SPI_Public_Functions_Group2
-  * @{
-  */
-int32_t spi_send_byte_fast(spi_handle_t *hperh, uint8_t data);
-uint8_t spi_recv_byte_fast(spi_handle_t *hperh);
-ald_status_t spi_send(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t spi_recv(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t spi_send_recv(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size, uint32_t timeout);
-ald_status_t spi_send_by_it(spi_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t spi_recv_by_it(spi_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t spi_send_recv_by_it(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size);
-#ifdef ALD_DMA
-ald_status_t spi_send_by_dma(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t spi_recv_by_dma(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t spi_send_recv_by_dma(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size, uint8_t tx_channel, uint8_t rx_channel);
-ald_status_t spi_dma_pause(spi_handle_t *hperh);
-ald_status_t spi_dma_resume(spi_handle_t *hperh);
-ald_status_t spi_dma_stop(spi_handle_t *hperh);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup SPI_Public_Functions_Group3
-  * @{
-  */
-void spi_irq_handle(spi_handle_t *hperh);
-void spi_interrupt_config(spi_handle_t *hperh, spi_it_t it, type_func_t state);
-void spi_speed_config(spi_handle_t *hperh, spi_baud_t speed);
-void spi_dma_req_config(spi_handle_t *hperh, spi_dma_req_t req, type_func_t state);
-it_status_t spi_get_it_status(spi_handle_t *hperh, spi_it_t it);
-flag_status_t spi_get_flag_status(spi_handle_t *hperh, spi_flag_t flag);
-void spi_clear_flag_status(spi_handle_t *hperh, spi_flag_t flag);
-/**
-  * @}
-  */
-
-/** @addtogroup SPI_Public_Functions_Group4
-  * @{
-  */
-spi_state_t spi_get_state(spi_handle_t *hperh);
-uint32_t spi_get_error(spi_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-#endif

+ 0 - 199
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_temp.h

@@ -1,199 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_temp.h
-  * @brief   Header file of TEMP module driver.
-  *
-  * @version V1.0
-  * @date    15 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  */
-
-#ifndef __ALD_TEMP_H__
-#define __ALD_TEMP_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup TEMP
-  * @{
-  */
-
-/** @defgroup TEMP_Public_Macros TEMP Public Macros
-  * @{
-  */
-#define TEMP_LOCK()		(WRITE_REG(TEMP->WPR, 0x0))
-#define TEMP_UNLOCK()		(WRITE_REG(TEMP->WPR, 0xA55A9669))
-#define TEMP_ENABLE()				\
-do {						\
-	TEMP_UNLOCK();				\
-	SET_BIT(TEMP->CR, TEMP_CR_EN_MSK);	\
-	TEMP_LOCK();				\
-} while (0)
-#define TEMP_DISABLE()				\
-do {						\
-	TEMP_UNLOCK();				\
-	CLEAR_BIT(TEMP->CR, TEMP_CR_EN_MSK);	\
-	TEMP_LOCK();				\
-} while (0)
-#define TEMP_REQ_ENABLE()			\
-do {						\
-	TEMP_UNLOCK();				\
-	SET_BIT(TEMP->CR, TEMP_CR_REQEN_MSK);	\
-	TEMP_LOCK();				\
-} while (0)
-#define TEMP_REQ_DISABLE()			\
-do {						\
-	TEMP_UNLOCK();				\
-	CLEAR_BIT(TEMP->CR, TEMP_CR_REQEN_MSK);	\
-	TEMP_LOCK();				\
-} while (0)
-#define TEMP_CTN_ENABLE()			\
-do {						\
-	TEMP_UNLOCK();				\
-	SET_BIT(TEMP->CR, TEMP_CR_CTN_MSK);	\
-	TEMP_LOCK();				\
-} while (0)
-#define TEMP_CTN_DISABLE()			\
-do {						\
-	TEMP_UNLOCK();				\
-	CLEAR_BIT(TEMP->CR, TEMP_CR_CTN_MSK);	\
-	TEMP_LOCK();				\
-} while (0)
-#define TEMP_RESET()				\
-do {						\
-	TEMP_UNLOCK();				\
-	SET_BIT(TEMP->CR, TEMP_CR_RST_MSK);	\
-	TEMP_LOCK();				\
-} while (0)
-/**
-  * @}
-  */
-
-/** @defgroup TEMP_Public_Types TEMP Public Types
-  * @{
-  */
-/**
-  * @brief Temperature update time
-  */
-typedef enum {
-	TEMP_UPDATE_CYCLE_3 = 0x3,	/**< 3 Cycles */
-	TEMP_UPDATE_CYCLE_4 = 0x4,	/**< 4 Cycles */
-	TEMP_UPDATE_CYCLE_5 = 0x5,	/**< 5 Cycles */
-	TEMP_UPDATE_CYCLE_6 = 0x6,	/**< 6 Cycles */
-	TEMP_UPDATE_CYCLE_7 = 0x7,	/**< 7 Cycles */
-} temp_update_cycle_t;
-
-/**
-  * @brief Temperature output mode
-  */
-typedef enum {
-	TEMP_OUTPUT_MODE_200  = 0x0,	/**< 200 cycles update one temperature */
-	TEMP_OUTPUT_MODE_400  = 0x1,	/**< 400 cycles update one temperature */
-	TEMP_OUTPUT_MODE_800  = 0x2,	/**< 800 cycles update one temperature */
-	TEMP_OUTPUT_MODE_1600 = 0x3,	/**< 1600 cycles update one temperature */
-	TEMP_OUTPUT_MODE_3200 = 0x4,	/**< 3200 cycles update one temperature */
-} temp_output_mode_t;
-
-/**
-  * @brief Source select
-  */
-typedef enum {
-	TEMP_SOURCE_LOSC        = 0x0,	/**< LOSC */
-	TEMP_SOURCE_LRC         = 0x1,	/**< LRC */
-	TEMP_SOURCE_HRC_DIV_1M  = 0x2,	/**< HRC divide to 1MHz */
-	TEMP_SOURCE_HOSC_DIV_1M = 0x3,	/**< HOSC divide to 1MHz */
-} temp_source_sel_t;
-
-
-/**
-  * @brief TEMP init structure definition
-  */
-typedef struct {
-	temp_update_cycle_t cycle;	/**< Temperature update time */
-	temp_output_mode_t mode;	/**< Temperature output mode */
-	uint8_t ctn;			/**< Continue mode */
-	uint8_t psc;			/**< Perscaler */
-} temp_init_t;
-
-/**
-  * @brief Define callback function type
-  */
-typedef void (*temp_cbk)(uint16_t value, ald_status_t status);
-/**
-  * @}
-  */
-
-/**
-  * @defgroup TEMP_Private_Macros TEMP Private Macros
-  * @{
-  */
-#define IS_TEMP_UPDATE_CYCLE(x)	(((x) == TEMP_UPDATE_CYCLE_3) || \
-                                 ((x) == TEMP_UPDATE_CYCLE_4) || \
-                                 ((x) == TEMP_UPDATE_CYCLE_5) || \
-                                 ((x) == TEMP_UPDATE_CYCLE_6) || \
-                                 ((x) == TEMP_UPDATE_CYCLE_7))
-#define IS_TEMP_OUTPUT_MODE(x)	(((x) == TEMP_OUTPUT_MODE_200)  || \
-                                 ((x) == TEMP_OUTPUT_MODE_400)  || \
-                                 ((x) == TEMP_OUTPUT_MODE_800)  || \
-                                 ((x) == TEMP_OUTPUT_MODE_1600) || \
-                                 ((x) == TEMP_OUTPUT_MODE_3200))
-#define IS_TEMP_SOURCE_SEL(x)	(((x) == TEMP_SOURCE_LOSC)        || \
-                                 ((x) == TEMP_SOURCE_LRC)         || \
-                                 ((x) == TEMP_SOURCE_HRC_DIV_1M ) || \
-                                 ((x) == TEMP_SOURCE_HOSC_DIV_1M))
-/**
-  * @}
-  */
-
-/** @addtogroup TEMP_Public_Functions
-  * @{
-  */
-/** @addtogroup TEMP_Public_Functions_Group1
-  * @{
-  */
-/* Initialization functions */
-extern void temp_init(temp_init_t *init);
-extern void temp_source_selcet(temp_source_sel_t sel);
-/**
-  * @}
-  */
-/** @addtogroup TEMP_Public_Functions_Group2
-  * @{
-  */
-/* Control functions */
-extern ald_status_t temp_get_value(uint16_t *temp);
-extern void temp_get_value_by_it(temp_cbk cbk);
-void temp_irq_handle(void);
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_TEMP_H__ */

+ 0 - 1086
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_timer.h

@@ -1,1086 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_timer.h
-  * @brief   TIMER module driver.
-  *	     This is the common part of the TIMER initialization
-  *
-  * @version V1.0
-  * @date    06 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_TIMER_H__
-#define __ALD_TIMER_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup TIMER
-  * @{
-  */
-
-/** @defgroup TIMER_Public_Types TIMER Public Types
-  * @{
-  */
-
-/**
-  * @brief TIMER counter mode
-  */
-typedef enum {
-	TIMER_CNT_MODE_UP      = 0,	/**< Counter mode up */
-	TIMER_CNT_MODE_DOWN    = 1,	/**< Counter mode down */
-	TIMER_CNT_MODE_CENTER1 = 2,	/**< Counter mode center1 */
-	TIMER_CNT_MODE_CENTER2 = 3,	/**< Counter mode center2 */
-	TIMER_CNT_MODE_CENTER3 = 4,	/**< Counter mode center3 */
-} timer_cnt_mode_t;
-
-/**
-  * @brief TIMER clock division
-  */
-typedef enum {
-	TIMER_CLOCK_DIV1 = 0,	/**< No prescaler is used */
-	TIMER_CLOCK_DIV2 = 1,	/** Clock is divided by 2 */
-	TIMER_CLOCK_DIV4 = 2,	/** Clock is divided by 4 */
-} timer_clock_division_t;
-
-/**
-  * @brief TIMER output compare and PWM modes
-  */
-typedef enum {
-	TIMER_OC_MODE_TIMERING       = 0,	/**< Output compare mode is timering */
-	TIMER_OC_MODE_ACTIVE         = 1,	/**< Output compare mode is active */
-	TIMER_OC_MODE_INACTIVE       = 2,	/**< Output compare mode is inactive */
-	TIMER_OC_MODE_TOGGLE         = 3,	/**< Output compare mode is toggle */
-	TIMER_OC_MODE_FORCE_INACTIVE = 4,	/**< Output compare mode is force inactive */
-	TIMER_OC_MODE_FORCE_ACTIVE   = 5,	/**< Output compare mode is force active */
-	TIMER_OC_MODE_PWM1           = 6,	/**< Output compare mode is pwm1 */
-	TIMER_OC_MODE_PWM2           = 7,	/**< Output compare mode is pwm2 */
-} timer_oc_mode_t;
-
-/**
-  * @brief TIMER output compare polarity
-  */
-typedef enum {
-	TIMER_OC_POLARITY_HIGH = 0,	/**< Output compare polarity is high */
-	TIMER_OC_POLARITY_LOW  = 1,	/**< Output compare polarity is low */
-} timer_oc_polarity_t;
-
-/**
-  * @brief TIMER complementary output compare polarity
-  */
-typedef enum {
-	TIMER_OCN_POLARITY_HIGH = 0,	/**< Complementary output compare polarity is high */
-	TIMER_OCN_POLARITY_LOW  = 1,	/**< Complementary output compare polarity is low */
-} timer_ocn_polarity_t;
-
-/**
-  * @brief TIMER output compare idle state
-  */
-typedef enum {
-	TIMER_OC_IDLE_RESET = 0,	/**< Output compare idle state is reset */
-	TIMER_OC_IDLE_SET   = 1,	/**< Output compare idle state is set */
-} timer_oc_idle_t;
-
-/**
-  * @brief TIMER complementary output compare idle state
-  */
-typedef enum {
-	TIMER_OCN_IDLE_RESET = 0,	/**< Complementary output compare idle state is reset */
-	TIMER_OCN_IDLE_SET   = 1,	/**< Complementary output compare idle state is set */
-} timer_ocn_idle_t;
-
-/**
-  * @brief TIMER channel
-  */
-typedef enum {
-	TIMER_CHANNEL_1   = 0,		/**< Channel 1 */
-	TIMER_CHANNEL_2   = 1,		/**< Channel 2 */
-	TIMER_CHANNEL_3   = 2,		/**< Channel 3 */
-	TIMER_CHANNEL_4   = 4,		/**< Channel 4 */
-	TIMER_CHANNEL_ALL = 0xF,	/**< All channel */
-} timer_channel_t;
-
-/**
-  * @brief TIMER one pulse mode
-  */
-typedef enum {
-	TIMER_OP_MODE_REPEAT = 0,	/**< Repetitive */
-	TIMER_OP_MODE_SINGLE = 1,	/**< single */
-} timer_op_mode_t;
-
-/**
-  * @brief TIMER one pulse output channel
-  */
-typedef enum {
-	TIMER_OP_OUTPUT_CHANNEL_1 = 0,	/**< One pulse output channal 1 */
-	TIMER_OP_OUTPUT_CHANNEL_2 = 1,	/**< One pulse output channal 2 */
-} timer_op_output_channel_t;
-
-/**
-  * @brief  TIMER time base configuration structure definition
-  */
-typedef struct {
-	uint32_t prescaler;		/**< Specifies the prescaler value used to divide the TIMER clock. */
-	timer_cnt_mode_t mode;		/**< Specifies the counter mode. */
-	uint32_t period;		/**< Specifies the period value to be loaded into ARR at the next update event. */
-	timer_clock_division_t clk_div;	/**< Specifies the clock division.*/
-	uint32_t re_cnt;		/**< Specifies the repetition counter value. */
-} timer_base_init_t;
-
-/**
-  * @brief  TIMER output compare configuration structure definition
-  */
-typedef struct {
-	timer_oc_mode_t oc_mode;		/**< Specifies the TIMER mode. */
-	uint32_t pulse;				/**< Specifies the pulse value to be loaded into the Capture Compare Register. */
-	timer_oc_polarity_t oc_polarity;	/**< Specifies the output polarity. */
-	timer_ocn_polarity_t ocn_polarity;	/**< Specifies the complementary output polarity. */
-	type_func_t oc_fast_en;			/**< Specifies the Fast mode state. */
-	timer_oc_idle_t oc_idle;		/**< Specifies the TIMER Output Compare pin state during Idle state. */
-	timer_ocn_idle_t ocn_idle;		/**< Specifies the TIMER Output Compare pin state during Idle state. */
-} timer_oc_init_t;
-
-/**
-  * @brief State structures definition
-  */
-typedef enum {
-	TIMER_STATE_RESET     = 0x00,	/**< Peripheral not yet initialized or disabled */
-	TIMER_STATE_READY     = 0x01,	/**< Peripheral Initialized and ready for use */
-	TIMER_STATE_BUSY      = 0x02,	/**< An internal process is ongoing */
-	TIMER_STATE_TIMEREOUT = 0x03,	/**< Timeout state */
-	TIMER_STATE_ERROR     = 0x04,	/**< Reception process is ongoing */
-} timer_state_t;
-
-/**
-  * @brief Active channel structures definition
-  */
-typedef enum {
-	TIMER_ACTIVE_CHANNEL_1       = 0x01,	/**< The active channel is 1 */
-	TIMER_ACTIVE_CHANNEL_2       = 0x02,	/**< The active channel is 2 */
-	TIMER_ACTIVE_CHANNEL_3       = 0x04,	/**< The active channel is 3 */
-	TIMER_ACTIVE_CHANNEL_4       = 0x08,	/**< The active channel is 4 */
-	TIMER_ACTIVE_CHANNEL_CLEARED = 0x00,	/**< All active channels cleared */
-} timer_active_channel_t;
-
-/**
-  * @brief  TIMER time base handle structure definition
-  */
-typedef struct timer_handle_s {
-	TIMER_TypeDef *perh;		/**< Register base address */
-	timer_base_init_t init;		/**< TIMER Time Base required parameters */
-	timer_active_channel_t ch;	/**< Active channel */
-	lock_state_t lock;		/**< Locking object */
-	timer_state_t state;		/**< TIMER operation state */
-
-	void (*period_elapse_cbk)(struct timer_handle_s *arg);		/**< Period elapse callback */
-	void (*delay_elapse_cbk)(struct timer_handle_s *arg);		/**< Delay_elapse callback */
-	void (*capture_cbk)(struct timer_handle_s *arg);		/**< Capture callback */
-	void (*pwm_pulse_finish_cbk)(struct timer_handle_s *arg);	/**< PWM_pulse_finish callback */
-	void (*trigger_cbk)(struct timer_handle_s *arg);		/**< Trigger callback */
-	void (*break_cbk)(struct timer_handle_s *arg);			/**< Break callback */
-	void (*com_cbk)(struct timer_handle_s *arg);			/**< commutation callback */
-	void (*error_cbk)(struct timer_handle_s *arg);			/**< Error callback */
-} timer_handle_t;
-
-
-/**
-  * @brief TIMER encoder mode
-  */
-typedef enum {
-	TIMER_ENC_MODE_TI1  = 1,	/**< encoder mode 1 */
-	TIMER_ENC_MODE_TI2  = 2,	/**< encoder mode 2 */
-	TIMER_ENC_MODE_TI12 = 3,	/**< encoder mode 3 */
-} timer_encoder_mode_t;
-
-/**
-  * @brief TIMER input capture polarity
-  */
-typedef enum {
-	TIMER_IC_POLARITY_RISE = 0,	/**< Input capture polarity rising */
-	TIMER_IC_POLARITY_FALL = 1,	/**< Input capture polarity falling */
-	TIMER_IC_POLARITY_BOTH = 3,	/**< Input capture polarity rising and falling */
-} timer_ic_polarity_t;
-
-/**
-  *@brief TIMER input capture selection
-  */
-typedef enum {
-	TIMER_IC_SEL_DIRECT   = 1,	/**< IC1 -- TI1 */
-	TIMER_IC_SEL_INDIRECT = 2,	/**< IC1 -- TI2 */
-	TIMER_IC_SEL_TRC      = 3,	/**< IC1 -- TRC */
-} timer_ic_select_t;
-
-/**
-  * @brief TIMER input capture prescaler
-  */
-typedef enum {
-	TIMER_IC_PSC_DIV1 = 0,	/**< Capture performed once every 1 events */
-	TIMER_IC_PSC_DIV2 = 1,	/**< Capture performed once every 2 events */
-	TIMER_IC_PSC_DIV4 = 2,	/**< Capture performed once every 4 events */
-	TIMER_IC_PSC_DIV8 = 3,	/**< Capture performed once every 4 events */
-} timer_ic_prescaler_t;
-
-/**
-  * @brief TIMER encoder configuration structure definition
-  */
-typedef struct {
-	timer_encoder_mode_t mode;		/**< Specifies the encoder mode */
-	timer_ic_polarity_t ic1_polarity;	/**< Specifies the active edge of the input signal */
-	timer_ic_select_t ic1_sel;		/**< Specifies the input */
-	timer_ic_prescaler_t ic1_psc;		/**< Specifies the Input Capture Prescaler */
-	uint32_t ic1_filter;			/**< Specifies the input capture filter */
-	timer_ic_polarity_t ic2_polarity;	/**< Specifies the active edge of the input signal */
-	timer_ic_select_t ic2_sel;		/**< Specifies the input */
-	timer_ic_prescaler_t ic2_psc;		/**< Specifies the Input Capture Prescaler */
-	uint32_t ic2_filter;			/**< Specifies the input capture filter */
-} timer_encoder_init_t;
-
-/**
-  * @brief  TIMER input capture configuration structure definition
-  */
-typedef struct {
-	timer_ic_polarity_t polarity;	/**< Specifies the active edge of the input signal */
-	timer_ic_select_t sel;		/**< Specifies the input */
-	timer_ic_prescaler_t psc;	/**< Specifies the Input Capture Prescaler */
-	uint32_t filter;		/**< Specifies the input capture filter */
-} timer_ic_init_t;
-
-/**
-  * @brief  TIMER one pulse mode configuration structure definition
-  */
-typedef struct {
-	timer_oc_mode_t mode;			/**< Specifies the TIMER mode */
-	uint16_t pulse;				/**< Specifies the pulse value */
-	timer_oc_polarity_t oc_polarity;	/**< Specifies the output polarity */
-	timer_ocn_polarity_t ocn_polarity;	/**< Specifies the complementary output polarity */
-	timer_oc_idle_t oc_idle;		/**< Specifies the TIMER Output Compare pin state during Idle state */
-	timer_ocn_idle_t ocn_idle;		/**< Specifies the TIMER Output Compare pin state during Idle state */
-	timer_ic_polarity_t polarity;		/**< Specifies the active edge of the input signal */
-	timer_ic_select_t sel;			/**< Specifies the input */
-	uint32_t filter;			/**< Specifies the input capture filter */
-} timer_one_pulse_init_t;
-
-/** @brief TIMER clear input source
-  */
-typedef enum {
-	TIMER_INPUT_NONE  = 0,	/**< Clear input none */
-	TIMER_INPUT_ETR   = 1,	/**< Clear input etr */
-} timer_clear_input_source_t;
-
-/** @brief TIMER clear input polarity
-  */
-typedef enum {
-	TIMER_POLARITY_NO_INV = 0,	/**< Polarity for ETRx pin */
-	TIMER_POLARITY_INV    = 1,	/**< Polarity for ETRx pin */
-} timer_clear_input_polarity_t;
-
-/** @brief TIMER clear input polarity
-  */
-typedef enum {
-	TIMER_ETR_PSC_DIV1 = 0,	/**< No prescaler is used */
-	TIMER_ETR_PSC_DIV2 = 1,	/**< ETR input source is divided by 2 */
-	TIMER_ETR_PSC_DIV4 = 2,	/**< ETR input source is divided by 4 */
-	TIMER_ETR_PSC_DIV8 = 3,	/**< ETR input source is divided by 8 */
-} timer_etr_psc_t;
-
-/**
-  * @brief  TIMER clear input configuration handle structure definition
-  */
-typedef struct {
-	type_func_t state;			/**< TIMER clear Input state */
-	timer_clear_input_source_t source;	/**< TIMER clear Input sources */
-	timer_clear_input_polarity_t polarity;	/**< TIMER Clear Input polarity */
-	timer_etr_psc_t psc;			/**< TIMER Clear Input prescaler */
-	uint32_t filter;			/**< TIMER Clear Input filter */
-} timer_clear_input_config_t;
-
-/** @brief TIMER clock source
-  */
-typedef enum {
-	TIMER_SRC_ETRMODE2 = 0,	/**< Clock source is etr mode2 */
-	TIMER_SRC_INTER    = 1,	/**< Clock source is etr internal */
-	TIMER_SRC_ITR0     = 2,	/**< Clock source is etr itr0 */
-	TIMER_SRC_ITR1     = 3,	/**< Clock source is etr itr1 */
-	TIMER_SRC_ITR2     = 4,	/**< Clock source is etr itr2 */
-	TIMER_SRC_ITR3     = 5,	/**< Clock source is etr itr3 */
-	TIMER_SRC_TI1ED    = 6,	/**< Clock source is etr ti1ed */
-	TIMER_SRC_TI1      = 7,	/**< Clock source is etr ti1 */
-	TIMER_SRC_TI2      = 8,	/**< Clock source is etr ti2 */
-	TIMER_SRC_ETRMODE1 = 9,	/**< Clock source is etr mode1 */
-} timer_clock_source_t;
-
-/** @brief TIMER clock polarity
-  */
-typedef enum {
-	TIMER_CLK_POLARITY_INV    = 1,	/**< Polarity for ETRx clock sources */
-	TIMER_CLK_POLARITY_NO_INV = 0,	/**< Polarity for ETRx clock sources */
-	TIMER_CLK_POLARITY_RISE   = 0,	/**< Polarity for TIx clock sources */
-	TIMER_CLK_POLARITY_FALL   = 1,	/**< Polarity for TIx clock sources */
-	TIMER_CLK_POLARITY_BOTH   = 3,	/**< Polarity for TIx clock sources */
-} timer_clock_polarity_t;
-
-/**
-  * @brief  TIMER clock config structure definition
-  */
-typedef struct {
-	timer_clock_source_t source;		/**< TIMER clock sources */
-	timer_clock_polarity_t polarity;	/**< TIMER clock polarity */
-	timer_etr_psc_t psc;			/**< TIMER clock prescaler */
-	uint32_t filter;			/**< TIMER clock filter */
-} timer_clock_config_t;
-
-/**
-  * @brief TIMER slave mode
-  */
-typedef enum {
-	TIMER_MODE_DISABLE   = 0,	/**< Slave mode is disable */
-	TIMER_MODE_ENC1      = 1,	/**< Slave mode is encoder1 */
-	TIMER_MODE_ENC2      = 2,	/**< Slave mode is encoder2 */
-	TIMER_MODE_ENC3      = 3,	/**< Slave mode is encoder3 */
-	TIMER_MODE_RESET     = 4,	/**< Slave mode is reset */
-	TIMER_MODE_GATED     = 5,	/**< Slave mode is gated */
-	TIMER_MODE_TRIG      = 6,	/**< Slave mode is trigger */
-	TIMER_MODE_EXTERNAL1 = 7,	/**< Slave mode is external1 */
-} timer_slave_mode_t;
-
-/**
-  * @brief TIMER ts definition
-  */
-typedef enum {
-	TIMER_TS_ITR0    = 0,	/**< ITR0 */
-	TIMER_TS_ITR1    = 1,	/**< ITR1 */
-	TIMER_TS_ITR2    = 2,	/**< ITR2 */
-	TIMER_TS_ITR3    = 3,	/**< ITR3 */
-	TIMER_TS_TI1F_ED = 4,	/**< TI1F_ED */
-	TIMER_TS_TI1FP1  = 5,	/**< TI1FP1 */
-	TIMER_TS_TI2FP2  = 6,	/**< TI2FP2 */
-	TIMER_TS_ETRF    = 7,	/**< ETRF */
-} timer_ts_t;
-
-/**
-  * @brief  TIMER slave configuration structure definition
-  */
-typedef struct {
-	timer_slave_mode_t mode;		/**< Slave mode selection */
-	timer_ts_t input;			/**< Input Trigger source */
-	timer_clock_polarity_t polarity;	/**< Input Trigger polarity */
-	timer_etr_psc_t psc;		/**< Input trigger prescaler */
-	uint32_t filter;		/**< Input trigger filter */
-} timer_slave_config_t;
-
-/**
-  * @brief  TIMER hall sensor configuretion structure definition
-  */
-typedef struct {
-	timer_ic_polarity_t polarity;	/**< Specifies the active edge of the input signal */
-	timer_ic_prescaler_t psc;		/**< Specifies the Input Capture Prescaler */
-	uint32_t filter;		/**< Specifies the input capture filter [0x0, 0xF] */
-	uint32_t delay;			/**< Specifies the pulse value to be loaded into the register [0x0, 0xFFFF] */
-} timer_hall_sensor_init_t;
-
-/**
-  * @brief TIMER lock level
-  */
-typedef enum {
-	TIMER_LOCK_LEVEL_OFF = 0,	/**< Lock off */
-	TIMER_LOCK_LEVEL_1   = 1,	/**< Lock level 1 */
-	TIMER_LOCK_LEVEL_2   = 2,	/**< Lock level 2 */
-	TIMER_LOCK_LEVEL_3   = 3,	/**< Lock level 3 */
-} timer_lock_level_t;
-
-/**
-  * @brief TIMER break polarity
-  */
-typedef enum {
-	TIMER_BREAK_POLARITY_LOW  = 0,	/**< LOW */
-	TIMER_BREAK_POLARITY_HIGH = 1,	/**< HIGH */
-} timer_break_polarity_t;
-
-/**
-  * @brief  TIMER break and dead time configuretion structure definition
-  */
-typedef struct {
-	type_func_t off_run;		/**< Enalbe/Disable off state in run mode */
-	type_func_t off_idle;		/**< Enalbe/Disable off state in idle mode */
-	timer_lock_level_t lock_level;	/**< Lock level */
-	uint32_t dead_time;		/**< Dead time, [0x0, 0xFF] */
-	type_func_t break_state;	/**< Break state */
-	timer_break_polarity_t polarity;	/**< Break input polarity */
-	type_func_t auto_out;		/**< Enalbe/Disable automatic output */
-} timer_break_dead_time_t;
-
-/**
-  * @brief  TIMER commutation event channel configuretion structure definition
-  */
-typedef struct {
-	type_func_t en;		/**< Enalbe/Disable the channel */
-	type_func_t n_en;	/**< Enalbe/Disable the complementary channel */
-	timer_oc_mode_t mode;	/**< Mode of the channel */
-} timer_channel_config_t;
-
-/**
-  * @brief  TIMER commutation event configuretion structure definition
-  */
-typedef struct {
-	timer_channel_config_t ch[3];	/**< Configure of channel */
-} timer_com_channel_config_t;
-
-/**
-  * @brief TIMER master mode selection
-  */
-typedef enum {
-	TIMER_TRGO_RESET  = 0,	/**< RESET */
-	TIMER_TRGO_ENABLE = 1,	/**< ENABLE */
-	TIMER_TRGO_UPDATE = 2,	/**< UPDATE */
-	TIMER_TRGO_OC1    = 3,	/**< OC1 */
-	TIMER_TRGO_OC1REF = 4,	/**< OC1REF */
-	TIMER_TRGO_OC2REF = 5,	/**< OC2REF */
-	TIMER_TRGO_OC3REF = 6,	/**< OC3REF */
-	TIMER_TRGO_OC4REF = 7,	/**< OC4REF */
-} timer_master_mode_sel_t;
-
-/**
-  * @brief  TIMER master configuretion structure definition
-  */
-typedef struct {
-	timer_master_mode_sel_t sel;	/**< Specifies the active edge of the input signal */
-	type_func_t master_en;		/**< Master/Slave mode selection */
-} timer_master_config_t;
-
-/**
-  * @brief Specifies the event source
-  */
-typedef enum {
-	TIMER_SRC_UPDATE = (1U << 0),	/**< Event source is update */
-	TIMER_SRC_CC1    = (1U << 1),	/**< Event source is channel1 */
-	TIMER_SRC_CC2    = (1U << 2),	/**< Event source is channel2 */
-	TIMER_SRC_CC3    = (1U << 3),	/**< Event source is channel3 */
-	TIMER_SRC_CC4    = (1U << 4),	/**< Event source is channel4 */
-	TIMER_SRC_COM    = (1U << 5),	/**< Event source is compare */
-	TIMER_SRC_TRIG   = (1U << 6),	/**< Event source is trigger */
-	TIMER_SRC_BREAK  = (1U << 7),	/**< Event source is break */
-} timer_event_source_t;
-
-/**
-  * @brief TIMER interrupt definition
-  */
-typedef enum {
-	TIMER_IT_UPDATE  = (1U << 0),	/**< Update interrupt bit */
-	TIMER_IT_CC1     = (1U << 1),	/**< Channel1 interrupt bit */
-	TIMER_IT_CC2     = (1U << 2),	/**< Channel2 interrupt bit */
-	TIMER_IT_CC3     = (1U << 3),	/**< Channel3 interrupt bit */
-	TIMER_IT_CC4     = (1U << 4),	/**< Channel4 interrupt bit */
-	TIMER_IT_COM     = (1U << 5),	/**< compare interrupt bit */
-	TIMER_IT_TRIGGER = (1U << 6),	/**< Trigger interrupt bit */
-	TIMER_IT_BREAK   = (1U << 7),	/**< Break interrupt bit */
-} timer_it_t;
-
-/**
-  * @brief TIMER DMA request
-  */
-typedef enum {
-	TIMER_DMA_UPDATE  = (1U << 8),	/**< DMA request from update */
-	TIMER_DMA_CC1     = (1U << 9),	/**< DMA request from channel1 */
-	TIMER_DMA_CC2     = (1U << 10),	/**< DMA request from channel2 */
-	TIMER_DMA_CC3     = (1U << 11),	/**< DMA request from channel3 */
-	TIMER_DMA_CC4     = (1U << 12),	/**< DMA request from channel4 */
-	TIMER_DMA_COM     = (1U << 13),	/**< DMA request from compare */
-	TIMER_DMA_TRIGGER = (1U << 14),	/**< DMA request from trigger */
-} timer_dma_req_t;
-
-/**
-  * @brief TIMER flag definition
-  */
-typedef enum {
-	TIMER_FLAG_UPDATE  = (1U << 0),	/**< Update interrupt flag */
-	TIMER_FLAG_CC1     = (1U << 1),	/**< Channel1 interrupt flag */
-	TIMER_FLAG_CC2     = (1U << 2),	/**< Channel2 interrupt flag */
-	TIMER_FLAG_CC3     = (1U << 3),	/**< Channel3 interrupt flag */
-	TIMER_FLAG_CC4     = (1U << 4),	/**< Channel4 interrupt flag */
-	TIMER_FLAG_COM     = (1U << 5),	/**< Compare interrupt flag */
-	TIMER_FLAG_TRIGGER = (1U << 6),	/**< Trigger interrupt flag */
-	TIMER_FLAG_BREAK   = (1U << 7),	/**< Break interrupt flag */
-	TIMER_FLAG_CC1OF   = (1U << 9),	/**< Channel1 override state flag */
-	TIMER_FLAG_CC2OF   = (1U << 10),	/**< Channel2 override state flag */
-	TIMER_FLAG_CC3OF   = (1U << 11),	/**< Channel3 override state flag */
-	TIMER_FLAG_CC4OF   = (1U << 12),	/**< Channel4 override state flag */
-} timer_flag_t;
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Macros   TIMER Public Macros
-  * @{
-  */
-#define CCER_CCxE_MASK		((1U << 0) | (1U << 4) | (1U << 8) | (1U << 12))
-#define CCER_CCxNE_MASK		((1U << 2) | (1U << 6) | (1U << 10))
-
-/**
-  * @brief  Reset TIMER handle state
-  */
-#define TIMER_RESET_HANDLE_STATE(hperh)	((hperh)->state = TIMER_STATE_RESET)
-
-/**
-  * @brief  Enable the TIMER peripheral.
- */
-#define TIMER_ENABLE(hperh)	(SET_BIT((hperh)->perh->CON1, TIMER_CON1_CNTEN_MSK))
-
-/**
-  * @brief  Enable the TIMER main output.
-  */
-#define TIMER_MOE_ENABLE(hperh)	(SET_BIT((hperh)->perh->BDCFG, TIMER_BDCFG_GOEN_MSK))
-
-/**
-  * @brief  Disable the TIMER peripheral.
-  */
-#define TIMER_DISABLE(hperh)                                              \
-do {                                                                    \
-	if ((((hperh)->perh->CCEP & CCER_CCxE_MASK) == 0)		\
-           && (((hperh)->perh->CCEP & CCER_CCxNE_MASK) == 0))		\
-		CLEAR_BIT((hperh)->perh->CON1, TIMER_CON1_CNTEN_MSK);	\
-} while (0)
-
-/**
-  * @brief  Disable the TIMER main output.
-  * @note The Main Output Enable of a timer instance is disabled only if
-  *       all the CCx and CCxN channels have been disabled
-  */
-#define TIMER_MOE_DISABLE(hperh)						\
-do {                                                                    \
-	if ((((hperh)->perh->CCEP & CCER_CCxE_MASK) == 0)		\
-           && (((hperh)->perh->CCEP & CCER_CCxNE_MASK) == 0))		\
-		CLEAR_BIT((hperh)->perh->BDCFG, TIMER_BDCFG_GOEN_MSK);	\
-} while (0)
-
-/**
-  * @brief  Sets the TIMER autoreload register value on runtime without calling
-  *         another time any Init function.
-  */
-#define TIMER_SET_AUTORELOAD(handle, AUTORELOAD)	\
-do {						\
-	(handle)->perh->AR    = (AUTORELOAD);	\
-	(handle)->init.period = (AUTORELOAD);	\
-} while (0)
-
-/**
-  * @brief  Gets the TIMER autoreload register value on runtime
-  */
-#define TIMER_GET_AUTORELOAD(handle)	((handle)->perh->AR)
-
-/**
-  * @brief  Gets the TIMER count register value on runtime
-  */
-#define TIMER_GET_CNT(handle)	((handle)->perh->COUNT)
-
-/**
-  * @brief  Gets the TIMER count direction value on runtime
-  */
-#define TIMER_GET_DIR(handle)	(READ_BITS((handle)->perh->CON1, TIMER_CON1_DIRSEL_MSK, TIMER_CON1_DIRSEL_POS))
-
-/**
-  * @brief  CCx DMA request sent when CCx event occurs
-  */
-#define TIMER_CCx_DMA_REQ_CCx(handle)	(CLEAR_BIT((handle)->perh->CON2, TIMER_CON2_CCDMASEL_MSK))
-
-/**
-  * @brief  CCx DMA request sent when update event occurs
-  */
-#define TIMER_CCx_DMA_REQ_UPDATE(handle)	(SET_BIT((handle)->perh->CON2, TIMER_CON2_CCDMASEL_MSK))
-
-/**
-  * @brief  Enable channel
-  * @param  handle: TIMER handle
-  * @param  ch: Must be one of this:
-  *           TIMER_CHANNEL_1
-  *           TIMER_CHANNEL_2
-  *           TIMER_CHANNEL_3
-  *           TIMER_CHANNEL_4
-  */
-#define TIMER_CCx_ENABLE(handle, ch)	(((ch) == TIMER_CHANNEL_4) ? \
-(SET_BIT((handle)->perh->CCEP, TIMER_CCEP_CC4POL_MSK)) : (WRITE_REG(((handle)->perh->CCEP), (((handle)->perh->CCEP) | (1 << ((ch) << 2))))))
-
-/**
-  * @brief  Disable channel
-  * @param  handle: TIMER handle
-  * @param  ch: Must be one of this:
-  *           TIMER_CHANNEL_1
-  *           TIMER_CHANNEL_2
-  *           TIMER_CHANNEL_3
-  *           TIMER_CHANNEL_4
-  */
-#define TIMER_CCx_DISABLE(handle, ch)	(((ch) == TIMER_CHANNEL_4) ? \
-(CLEAR_BIT((handle)->perh->CCEP, TIMER_CCEP_CC4EN_MSK)) : ((handle)->perh->CCEP &= ~(1 << ((ch) << 2))))
-
-/**
-  * @brief  Enable complementary channel
-  * @param  handle: TIMER handle
-  * @param  ch: Must be one of this:
-  *           TIMER_CHANNEL_1
-  *           TIMER_CHANNEL_2
-  *           TIMER_CHANNEL_3
-  */
-#define TIMER_CCxN_ENABLE(handle, ch)	((handle)->perh->CCEP |= (1 << (((ch) << 2) + 2)))
-
-/**
-  * @brief  Disable complementary channel
-  * @param  handle: TIMER handle
-  * @param  ch: Must be one of this:
-  *           TIMER_CHANNEL_1
-  *           TIMER_CHANNEL_2
-  *           TIMER_CHANNEL_3
-  */
-#define TIMER_CCxN_DISABLE(handle, ch)	((handle)->perh->CCEP &= ~(1 << (((ch) << 2) + 2)))
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Private_Macros TIMER Private Macros
-  * @{
-  */
-#define IS_TIMER_INSTANCE(x)	(((x) == TIMER0) || \
-                                 ((x) == TIMER1) || \
-                                 ((x) == TIMER2) || \
-                                 ((x) == TIMER3) || \
-                                 ((x) == TIMER4) || \
-                                 ((x) == TIMER5) || \
-                                 ((x) == TIMER6) || \
-                                 ((x) == TIMER7))
-#define IS_ADTIMER_INSTANCE(x)	((x) == TIMER0)
-#define IS_TIMER_XOR_INSTANCE(x)	(((x) == TIMER0) || ((x) == TIMER6))
-#define IS_TIMER_COM_EVENT_INSTANCE(x)	(((x) == TIMER0) || \
-                                         ((x) == TIMER2) || \
-                                         ((x) == TIMER3))
-#define IS_TIMER_CC2_INSTANCE(x)	(((x) == TIMER0) || \
-                                 ((x) == TIMER2) || \
-                                 ((x) == TIMER3) || \
-                                 ((x) == TIMER6))
-#define IS_TIMER_CC4_INSTANCE(x)	(((x) == TIMER0) || \
-                                 ((x) == TIMER6))
-#define IS_TIMER_BREAK_INSTANCE(x) (((x) == TIMER0) || \
-                                  ((x) == TIMER2) || \
-                                  ((x) == TIMER3))
-#define IS_TIMER_PWM_INPUT_INSTANCE(x, y)	((((x) == TIMER0)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2))) || \
-					 (((x) == TIMER2)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2))) || \
-					 (((x) == TIMER3)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2))) || \
-					 (((x) == TIMER6)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2))))
-#define IS_TIMER_CCX_INSTANCE(x, y)	((((x) == TIMER0)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2)   || \
-					 ((y) == TIMER_CHANNEL_3)   || \
-					 ((y) == TIMER_CHANNEL_4))) || \
-					 (((x) == TIMER2)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2))) || \
-					 (((x) == TIMER3)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2))) || \
-					 (((x) == TIMER6)           && \
-					 (((y) == TIMER_CHANNEL_1)  || \
-					 ((y) == TIMER_CHANNEL_2)   || \
-					 ((y) == TIMER_CHANNEL_3)   || \
-					 ((y) == TIMER_CHANNEL_4))))
-#define IS_TIMER_CCXN_INSTANCE(x, y)	((((x) == TIMER0)          || \
-					 ((x) == TIMER2)           || \
-					 ((x) == TIMER3))          && \
-                                         (((y) == TIMER_CHANNEL_1) || \
-                                         ((y) == TIMER_CHANNEL_2)  || \
-                                         ((y) == TIMER_CHANNEL_3)  || \
-                                         ((y) == TIMER_CHANNEL_4)))
-#define IS_TIMER_REPETITION_COUNTER_INSTANCE(x)	(((x) == TIMER0) || \
-                                                 ((x) == TIMER2) || \
-                                                 ((x) == TIMER3))
-#define IS_TIMER_CLOCK_DIVISION_INSTANCE(x)	IS_TIMER_CC2_INSTANCE(x)
-#define IS_TIMER_COUNTER_MODE(x)		(((x) == TIMER_CNT_MODE_UP)      || \
-                                         ((x) == TIMER_CNT_MODE_DOWN)    || \
-                                         ((x) == TIMER_CNT_MODE_CENTER1) || \
-                                         ((x) == TIMER_CNT_MODE_CENTER2) || \
-                                         ((x) == TIMER_CNT_MODE_CENTER3))
-#define IS_TIMER_CLOCK_DIVISION(x) 	(((x) == TIMER_CLOCK_DIV1) || \
-                                         ((x) == TIMER_CLOCK_DIV2) || \
-                                         ((x) == TIMER_CLOCK_DIV4))
-#define IS_TIMER_PWM_MODE(x)		(((x) == TIMER_OC_MODE_PWM1) || \
-                                         ((x) == TIMER_OC_MODE_PWM2))
-#define IS_TIMER_OC_MODE(x) 		(((x) == TIMER_OC_MODE_TIMERING)         || \
-                                         ((x) == TIMER_OC_MODE_ACTIVE)         || \
-                                         ((x) == TIMER_OC_MODE_INACTIVE)       || \
-                                         ((x) == TIMER_OC_MODE_TOGGLE)         || \
-                                         ((x) == TIMER_OC_MODE_FORCE_ACTIVE)   || \
-                                         ((x) == TIMER_OC_MODE_FORCE_INACTIVE) || \
-                                         ((x) == TIMER_OC_MODE_PWM1) || \
-                                         ((x) == TIMER_OC_MODE_PWM2))
-#define IS_TIMER_OC_POLARITY(x) 		(((x) == TIMER_OC_POLARITY_HIGH) || \
-                                         ((x) == TIMER_OC_POLARITY_LOW))
-#define IS_TIMER_OCN_POLARITY(x) 		(((x) == TIMER_OCN_POLARITY_HIGH) || \
-                                         ((x) == TIMER_OCN_POLARITY_LOW))
-#define IS_TIMER_OCIDLE_STATE(x) 		(((x) == TIMER_OC_IDLE_RESET) || \
-                                         ((x) == TIMER_OC_IDLE_SET))
-#define IS_TIMER_OCNIDLE_STATE(x) 	(((x) == TIMER_OCN_IDLE_RESET) || \
-                                         ((x) == TIMER_OCN_IDLE_SET))
-#define IS_TIMER_CHANNELS(x)		(((x) == TIMER_CHANNEL_1) || \
-                                         ((x) == TIMER_CHANNEL_2) || \
-                                         ((x) == TIMER_CHANNEL_3) || \
-                                         ((x) == TIMER_CHANNEL_4) || \
-                                         ((x) == TIMER_CHANNEL_ALL))
-#define IS_TIMER_OP_MODE(x) 		(((x) == TIMER_OP_MODE_REPEAT) || \
-                                         ((x) == TIMER_OP_MODE_SINGLE))
-#define IS_TIMER_OP_OUTPUT_CH(x) 		(((x) == TIMER_OP_OUTPUT_CHANNEL_1) || \
-                                         ((x) == TIMER_OP_OUTPUT_CHANNEL_2))
-#define IS_TIMER_ENCODER_MODE(x) 		(((x) == TIMER_ENC_MODE_TI1) || \
-                                         ((x) == TIMER_ENC_MODE_TI2) || \
-                                         ((x) == TIMER_ENC_MODE_TI12))
-#define IS_TIMER_IC_POLARITY(x) 		(((x) == TIMER_IC_POLARITY_RISE)  || \
-                                         ((x) == TIMER_IC_POLARITY_FALL) || \
-                                         ((x) == TIMER_IC_POLARITY_BOTH))
-#define IS_TIMER_IC_SELECT(x) 		(((x) == TIMER_IC_SEL_DIRECT)   || \
-                                         ((x) == TIMER_IC_SEL_INDIRECT) || \
-                                         ((x) == TIMER_IC_SEL_TRC))
-#define IS_TIMER_IC_PSC(x) 		(((x) == TIMER_IC_PSC_DIV1) || \
-                                         ((x) == TIMER_IC_PSC_DIV2) || \
-                                         ((x) == TIMER_IC_PSC_DIV4) || \
-                                         ((x) == TIMER_IC_PSC_DIV8))
-#define IS_TIMER_IC_FILTER(x) 		((x) <= 0xF)
-#define IS_TIMER_DEAD_TIMERE(x) 		((x) <= 0xFF)
-#define IS_TIMER_CLEAR_INPUT_SOURCE(x) 	(((x) == TIMER_INPUT_NONE) || \
-                                         ((x) == TIMER_INPUT_ETR))
-#define IS_TIMER_CLEAR_INPUT_POLARITY(x) 	(((x) == TIMER_POLARITY_NO_INV) || \
-                                         ((x) == TIMER_POLARITY_INV))
-#define IS_TIMER_ETR_PSC(x) 		(((x) == TIMER_ETR_PSC_DIV1) || \
-                                         ((x) == TIMER_ETR_PSC_DIV2) || \
-                                         ((x) == TIMER_ETR_PSC_DIV4) || \
-                                         ((x) == TIMER_ETR_PSC_DIV8))
-#define IS_TIMER_CLOCK_SOURCE(x) 		(((x) == TIMER_SRC_ETRMODE2) || \
-                                         ((x) == TIMER_SRC_INTER) || \
-                                         ((x) == TIMER_SRC_ITR0)     || \
-                                         ((x) == TIMER_SRC_ITR1)     || \
-                                         ((x) == TIMER_SRC_ITR2)     || \
-                                         ((x) == TIMER_SRC_ITR3)     || \
-                                         ((x) == TIMER_SRC_TI1ED)    || \
-                                         ((x) == TIMER_SRC_TI1)      || \
-                                         ((x) == TIMER_SRC_TI2)      || \
-                                         ((x) == TIMER_SRC_ETRMODE1))
-#define IS_TIMER_CLOCK_POLARITY(x) 	(((x) == TIMER_CLK_POLARITY_INV)    || \
-                                         ((x) == TIMER_CLK_POLARITY_NO_INV) || \
-                                         ((x) == TIMER_CLK_POLARITY_RISE)      || \
-                                         ((x) == TIMER_CLK_POLARITY_FALL)     || \
-                                         ((x) == TIMER_CLK_POLARITY_BOTH))
-#define IS_TIMER_SLAVE_MODE(x)	(((x) == TIMER_MODE_DISABLE)  || \
-                                 ((x) == TIMER_MODE_ENC1) || \
-                                 ((x) == TIMER_MODE_ENC2) || \
-                                 ((x) == TIMER_MODE_ENC3) || \
-                                 ((x) == TIMER_MODE_RESET)    || \
-                                 ((x) == TIMER_MODE_GATED)    || \
-                                 ((x) == TIMER_MODE_TRIG)  || \
-                                 ((x) == TIMER_MODE_EXTERNAL1))
-#define IS_TIMER_EVENT_SOURCE(x)	(((x) == TIMER_SRC_UPDATE)  || \
-                                 ((x) == TIMER_SRC_CC1)     || \
-                                 ((x) == TIMER_SRC_CC2)     || \
-                                 ((x) == TIMER_SRC_CC3)     || \
-                                 ((x) == TIMER_SRC_CC4)     || \
-                                 ((x) == TIMER_SRC_COM)     || \
-                                 ((x) == TIMER_SRC_TRIG) || \
-                                 ((x) == TIMER_SRC_BREAK))
-#define IS_TIMER_TS(x)		(((x) == TIMER_TS_ITR0)    || \
-                                 ((x) == TIMER_TS_ITR1)    || \
-                                 ((x) == TIMER_TS_ITR2)    || \
-                                 ((x) == TIMER_TS_ITR3)    || \
-                                 ((x) == TIMER_TS_TI1F_ED) || \
-                                 ((x) == TIMER_TS_TI1FP1)  || \
-                                 ((x) == TIMER_TS_TI2FP2)  || \
-                                 ((x) == TIMER_TS_ETRF))
-#define IS_TIMER_CLOCK_LEVEL(x)	(((x) == TIMER_LOCK_LEVEL_OFF) || \
-                                 ((x) == TIMER_LOCK_LEVEL_1)   || \
-                                 ((x) == TIMER_LOCK_LEVEL_2)   || \
-                                 ((x) == TIMER_LOCK_LEVEL_3))
-#define IS_TIMER_BREAK_POLARITY(x)	(((x) == TIMER_BREAK_POLARITY_LOW) || \
-                                         ((x) == TIMER_BREAK_POLARITY_HIGH))
-#define IS_TIMER_MASTER_MODE_SEL(x)	(((x) == TIMER_TRGO_RESET)  || \
-                                         ((x) == TIMER_TRGO_ENABLE) || \
-                                         ((x) == TIMER_TRGO_UPDATE) || \
-                                         ((x) == TIMER_TRGO_OC1)    || \
-                                         ((x) == TIMER_TRGO_OC1REF) || \
-                                         ((x) == TIMER_TRGO_OC2REF) || \
-                                         ((x) == TIMER_TRGO_OC3REF) || \
-                                         ((x) == TIMER_TRGO_OC4REF))
-#define IS_TIMER_IT(x)	(((x) == TIMER_IT_UPDATE)  || \
-                         ((x) == TIMER_IT_CC1)     || \
-                         ((x) == TIMER_IT_CC2)     || \
-                         ((x) == TIMER_IT_CC3)     || \
-                         ((x) == TIMER_IT_CC4)     || \
-                         ((x) == TIMER_IT_COM)     || \
-                         ((x) == TIMER_IT_TRIGGER) || \
-                         ((x) == TIMER_IT_BREAK))
-#define IS_TIMER_DMA_REQ(x)	(((x) == TIMER_DMA_UPDATE) || \
-                                 ((x) == TIMER_DMA_CC1)    || \
-                                 ((x) == TIMER_DMA_CC2)    || \
-                                 ((x) == TIMER_DMA_CC3)    || \
-                                 ((x) == TIMER_DMA_CC4)    || \
-                                 ((x) == TIMER_DMA_COM)    || \
-                                 ((x) == TIMER_DMA_TRIGGER))
-#define IS_TIMER_FLAG(x)	(((x) == TIMER_FLAG_UPDATE)  || \
-                         ((x) == TIMER_FLAG_CC1)     || \
-                         ((x) == TIMER_FLAG_CC2)     || \
-                         ((x) == TIMER_FLAG_CC3)     || \
-                         ((x) == TIMER_FLAG_CC4)     || \
-                         ((x) == TIMER_FLAG_COM)     || \
-                         ((x) == TIMER_FLAG_TRIGGER) || \
-                         ((x) == TIMER_FLAG_BREAK)   || \
-                         ((x) == TIMER_FLAG_CC1OF)   || \
-                         ((x) == TIMER_FLAG_CC2OF)   || \
-                         ((x) == TIMER_FLAG_CC3OF)   || \
-                         ((x) == TIMER_FLAG_CC4OF))
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions
-  * @{
-  */
-/** @addtogroup TIMER_Public_Functions_Group1
-  * @{
-  */
-/* Time Base functions */
-ald_status_t timer_base_init(timer_handle_t *hperh);
-void timer_base_reset(timer_handle_t *hperh);
-void timer_base_start(timer_handle_t *hperh);
-void timer_base_stop(timer_handle_t *hperh);
-void timer_base_start_by_it(timer_handle_t *hperh);
-void timer_base_stop_by_it(timer_handle_t *hperh);
-#ifdef ALD_DMA
-ald_status_t timer_base_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-                                  uint16_t *buf, uint32_t len, uint8_t dma_ch);
-void timer_base_stop_by_dma(timer_handle_t *hperh);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group2
-  * @{
-  */
-/* Timer Output Compare functions */
-ald_status_t timer_oc_init(timer_handle_t *hperh);
-void timer_oc_start(timer_handle_t *hperh, timer_channel_t ch);
-void timer_oc_stop(timer_handle_t *hperh, timer_channel_t ch);
-void timer_oc_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_oc_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
-#ifdef ALD_DMA
-ald_status_t timer_oc_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                      dma_handle_t *hdma, uint16_t *buf, uint32_t len, uint8_t dma_ch);
-void timer_oc_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group3
-  * @{
-  */
-/* Timer PWM functions */
-ald_status_t timer_pwm_init(timer_handle_t *hperh);
-void timer_pwm_start(timer_handle_t *hperh, timer_channel_t ch);
-void timer_pwm_stop(timer_handle_t *hperh, timer_channel_t ch);
-void timer_pwm_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_pwm_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_pwm_set_freq(timer_handle_t *hperh, uint16_t freq);
-void timer_pwm_set_duty(timer_handle_t *hperh, timer_channel_t ch, uint16_t duty);
-void timer_pwm_set_input(timer_handle_t *hperh, timer_channel_t ch);
-#ifdef ALD_DMA
-ald_status_t timer_pwm_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                      dma_handle_t *hdma, uint16_t *buf, uint32_t len, uint8_t dma_ch);
-void timer_pwm_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group4
-  * @{
-  */
-/* Timer Input Capture functions */
-ald_status_t timer_ic_init(timer_handle_t *hperh);
-void timer_ic_start(timer_handle_t *hperh, timer_channel_t ch);
-void timer_ic_stop(timer_handle_t *hperh, timer_channel_t ch);
-void timer_ic_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_ic_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
-#ifdef ALD_DMA
-ald_status_t timer_ic_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                      dma_handle_t *hdma, uint16_t *buf, uint32_t len, uint8_t dma_ch);
-void timer_ic_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group5
-  * @{
-  */
-/* Timer One Pulse functions */
-ald_status_t timer_one_pulse_init(timer_handle_t *hperh, timer_op_mode_t mode);
-void timer_one_pulse_start(timer_handle_t *hperh, timer_op_output_channel_t ch);
-void timer_one_pulse_stop(timer_handle_t *hperh, timer_op_output_channel_t ch);
-void timer_one_pulse_start_by_it(timer_handle_t *hperh, timer_op_output_channel_t ch);
-void timer_one_pulse_stop_by_it(timer_handle_t *hperh, timer_op_output_channel_t ch);
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group6
-  * @{
-  */
-/* Timer encoder functions */
-ald_status_t timer_encoder_init(timer_handle_t *hperh,  timer_encoder_init_t *config);
-void timer_encoder_start(timer_handle_t *hperh, timer_channel_t ch);
-void timer_encoder_stop(timer_handle_t *hperh, timer_channel_t ch);
-void timer_encoder_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_encoder_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
-#ifdef ALD_DMA
-ald_status_t timer_encoder_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                           dma_handle_t *hdma1, dma_handle_t *hdma2, uint16_t *buf1,
-			   uint16_t *buf2, uint32_t len, uint8_t dma_ch1, uint8_t dma_ch2);
-void timer_encoder_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group7
-  * @{
-  */
-/* Timer hall sensor functions */
-ald_status_t timer_hall_sensor_init(timer_handle_t *hperh,  timer_hall_sensor_init_t *config);
-void timer_hall_sensor_start(timer_handle_t *hperh);
-void timer_hall_sensor_stop(timer_handle_t *hperh);
-void timer_hall_sensor_start_by_it(timer_handle_t *hperh);
-void timer_hall_sensor_stop_by_it(timer_handle_t *hperh);
-#ifdef ALD_DMA
-ald_status_t timer_hall_sensor_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-		                       uint16_t *buf, uint32_t len, uint8_t dma_ch);
-void timer_hall_sensor_stop_by_dma(timer_handle_t *hperh);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group8
-  * @{
-  */
-/* Timer complementary output compare functions */
-void timer_ocn_start(timer_handle_t *hperh, timer_channel_t ch);
-void timer_ocn_stop(timer_handle_t *hperh, timer_channel_t ch);
-void timer_ocn_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_ocn_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
-#ifdef ALD_DMA
-ald_status_t timer_ocn_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-		          timer_channel_t ch, uint16_t *buf, uint32_t len, uint8_t dma_ch);
-void timer_ocn_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group9
-  * @{
-  */
-/* Timer complementary PWM functions */
-void timer_pwmn_start(timer_handle_t *hperh, timer_channel_t ch);
-void timer_pwmn_stop(timer_handle_t *hperh, timer_channel_t ch);
-void timer_pwmn_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_pwmn_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
-#ifdef ALD_DMA
-ald_status_t timer_pwmn_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-		          timer_channel_t ch, uint16_t *buf, uint32_t len, uint8_t dma_ch);
-void timer_pwmn_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group10
-  * @{
-  */
-/* Timer complementary one pulse functions */
-void timer_one_pulse_n_start(timer_handle_t *hperh, timer_channel_t ch);
-void timer_one_pulse_n_stop(timer_handle_t *hperh, timer_channel_t ch);
-void timer_one_pulse_n_start_by_it(timer_handle_t *hperh, timer_channel_t ch);
-void timer_one_pulse_n_stop_by_it(timer_handle_t *hperh, timer_channel_t ch);
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group11
-  * @{
-  */
-/* Control functions */
-ald_status_t timer_oc_config_channel(timer_handle_t *hperh, timer_oc_init_t* config, timer_channel_t ch);
-ald_status_t timer_ic_config_channel(timer_handle_t *hperh, timer_ic_init_t* config, timer_channel_t ch);
-ald_status_t timer_one_pulse_config_channel(timer_handle_t *hperh, timer_one_pulse_init_t *config,
-                                                   timer_channel_t ch_out,  timer_channel_t ch_in);
-ald_status_t timer_config_oc_ref_clear(timer_handle_t *hperh, timer_clear_input_config_t *config, timer_channel_t ch);
-ald_status_t timer_config_clock_source(timer_handle_t *hperh, timer_clock_config_t *config);
-ald_status_t timer_config_ti1_input(timer_handle_t *hperh, uint32_t ti1_select);
-ald_status_t timer_slave_config_sync(timer_handle_t *hperh, timer_slave_config_t *config);
-ald_status_t timer_slave_config_sync_by_it(timer_handle_t *hperh, timer_slave_config_t *config);
-ald_status_t timer_generate_event(timer_handle_t *hperh, timer_event_source_t event);
-uint32_t timer_read_capture_value(timer_handle_t *hperh, timer_channel_t ch);
-void timer_set_output_mode(timer_handle_t *hperh, timer_oc_mode_t mode, timer_channel_t ch);
-void timer_com_change_config(timer_handle_t *hperh, timer_com_channel_config_t *config);
-void timer_com_event_config(timer_handle_t *hperh, timer_ts_t ts, type_func_t trgi);
-void timer_com_event_config_it(timer_handle_t *hperh, timer_ts_t ts, type_func_t trgi);
-void timer_break_dead_time_config(timer_handle_t *hperh, timer_break_dead_time_t *config);
-void timer_master_sync_config(timer_handle_t *hperh, timer_master_config_t *config);
-void timer_irq_handle(timer_handle_t *hperh);
-void timer_dma_req_config(timer_handle_t *hperh, timer_dma_req_t req, type_func_t state);
-void timer_interrupt_config(timer_handle_t *hperh, timer_it_t it, type_func_t state);
-it_status_t timer_get_it_status(timer_handle_t *hperh, timer_it_t it);
-flag_status_t timer_get_flag_status(timer_handle_t *hperh, timer_flag_t flag);
-void timer_clear_flag_status(timer_handle_t *hperh, timer_flag_t flag);
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Public_Functions_Group12
-  * @{
-  */
-/* State functions */
-timer_state_t timer_get_state(timer_handle_t *hperh);
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_TIMER_H__ */

+ 0 - 176
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_trng.h

@@ -1,176 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_trng.h
-  * @brief   Header file of TRNG module driver.
-  *
-  * @version V1.0
-  * @date    04 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  */
-
-#ifndef __ALD_TRNG_H__
-#define __ALD_TRNG_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup TRNG
-  * @{
-  */
-
-/** @defgroup TRNG_Public_Macros TRNG Public Macros
-  * @{
-  */
-#define TRNG_ENABLE()		(SET_BIT(TRNG->CR, TRNG_CR_TRNGEN_MSK))
-#define TRNG_DISABLE()		(CLEAR_BIT(TRNG->CR, TRNG_CR_TRNGEN_MSK))
-#define TRNG_ADJM_ENABLE()	(SET_BIT(TRNG->CR, TRNG_CR_ADJM_MSK))
-#define TRNG_ADJM_DISABLE()	(CLEAR_BIT(TRNG->CR, TRNG_CR_ADJM_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup TRNG_Public_Types TRNG Public Types
-  * @{
-  */
-/**
-  * @brief Data width
-  */
-typedef enum {
-	TRNG_DSEL_1B  = 0x0,	/**< 1-bit */
-	TRNG_DSEL_8B  = 0x1,	/**< 8-bit */
-	TRNG_DSEL_16B = 0x2,	/**< 16-bit */
-	TRNG_DSEL_32B = 0x3,	/**< 32-bit */
-} trng_data_width_t;
-
-/**
-  * @brief seed type
-  */
-typedef enum {
-	TRNG_SEED_TYPE_0    = 0x0,	/**< Using 0 as seed */
-	TRNG_SEED_TYPE_1    = 0x1,	/**< Using 1 as seed */
-	TRNG_SEED_TYPE_LAST = 0x2,	/**< Using last seed */
-	TRNG_SEED_TYPE_SEED = 0x3,	/**< Using value of register */
-} trng_seed_type_t;
-
-/**
-  * @brief TRNG init structure definition
-  */
-typedef struct {
-	trng_data_width_t data_width;	/**< The width of data */
-	trng_seed_type_t seed_type;	/**< The seed type */
-	uint32_t seed;			/**< The value of seed */
-	uint16_t t_start;		/**< T(start) = T(hclk) * (t_start + 1), T(start) > 1ms */
-	uint8_t adjc;			/**< Adjust parameter */
-	uint8_t posten;
-} trng_init_t;
-
-/**
-  * @brief State type
-  */
-typedef enum {
-	TRNG_STATUS_START = (1U << 0),	/**< Start state */
-	TRNG_STATUS_DAVLD = (1U << 1),	/**< Data valid state */
-	TRNG_STATUS_SERR  = (1U << 2),	/**< Error state */
-} trng_status_t;
-
-/**
-  * @brief Interrupt type
-  */
-typedef enum {
-	TRNG_IT_START = (1U << 0),	/**< Start */
-	TRNG_IT_DAVLD = (1U << 1),	/**< Data valid */
-	TRNG_IT_SERR  = (1U << 2),	/**< Error */
-} trng_it_t;
-
-/**
-  * @brief Interrupt flag type
-  */
-typedef enum {
-	TRNG_IF_START = (1U << 0),	/**< Start */
-	TRNG_IF_DAVLD = (1U << 1),	/**< Data valid */
-	TRNG_IF_SERR  = (1U << 2),	/**< Error */
-} trng_flag_t;
-/**
-  * @}
-  */
-
-/**
-  * @defgroup TRNG_Private_Macros TRNG Private Macros
-  * @{
-  */
-#define IS_TRNG_DATA_WIDTH(x)	(((x) == TRNG_DSEL_1B)  || \
-                                 ((x) == TRNG_DSEL_8B)  || \
-                                 ((x) == TRNG_DSEL_16B) || \
-                                 ((x) == TRNG_DSEL_32B))
-#define IS_TRNG_SEED_TYPE(x)	(((x) == TRNG_SEED_TYPE_0)    || \
-                                 ((x) == TRNG_SEED_TYPE_1)    || \
-                                 ((x) == TRNG_SEED_TYPE_LAST) || \
-                                 ((x) == TRNG_SEED_TYPE_SEED))
-#define IS_TRNG_STATUS(x)	(((x) == TRNG_STATUS_START)  || \
-                                 ((x) == TRNG_STATUS_DAVLD)  || \
-                                 ((x) == TRNG_STATUS_SERR))
-#define IS_TRNG_IT(x)	(((x) == TRNG_IT_START)  || \
-                         ((x) == TRNG_IT_DAVLD)  || \
-                         ((x) == TRNG_IT_SERR))
-#define IS_TRNG_FLAG(x)	(((x) == TRNG_IF_START)  || \
-                         ((x) == TRNG_IF_DAVLD)  || \
-                         ((x) == TRNG_IF_SERR))
-#define IS_TRNG_ADJC(x)	((x) < 4)
-/**
-  * @}
-  */
-
-/** @addtogroup TRNG_Public_Functions
-  * @{
-  */
-/** @addtogroup TRNG_Public_Functions_Group1
-  * @{
-  */
-/* Initialization functions */
-extern void trng_init(trng_init_t *init);
-/**
-  * @}
-  */
-/** @addtogroup TRNG_Public_Functions_Group2
-  * @{
-  */
-/* Control functions */
-extern uint32_t trng_get_result(void);
-extern void trng_interrupt_config(trng_it_t it, type_func_t state);
-extern flag_status_t trng_get_status(trng_status_t status);
-extern it_status_t trng_get_it_status(trng_it_t it);
-extern flag_status_t trng_get_flag_status(trng_flag_t flag);
-extern void trng_clear_flag_status(trng_flag_t flag);
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_TRNG_H__ */

+ 0 - 461
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_uart.h

@@ -1,461 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_uart.h
-  * @brief   Header file of UART module library.
-  *
-  * @version V1.0
-  * @date    21 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_UART_H__
-#define __ALD_UART_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup UART
-  * @{
-  */
-
-/**
-  * @defgroup UART_Public_Macros UART Public Macros
-  * @{
-  */
-#define UART_RX_ENABLE(hperh)		(SET_BIT((hperh)->perh->LCR, UART_LCR_RXEN_MSK))
-#define UART_RX_DISABLE(hperh)		(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_RXEN_MSK))
-#define UART_BRR_WRITE_ENABLE(hperh)	(SET_BIT((hperh)->perh->LCR, UART_LCR_BRWEN_MSK))
-#define UART_BRR_WRITE_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_BRWEN_MSK))
-#define UART_RX_TIMEOUT_ENABLE(hperh)	(SET_BIT((hperh)->perh->LCR, UART_LCR_RTOEN_MSK))
-#define UART_RX_TIMEOUT_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_RTOEN_MSK))
-#define UART_MSB_FIRST_ENABLE(hperh)	(SET_BIT((hperh)->perh->LCR, UART_LCR_MSBFIRST_MSK))
-#define UART_MSB_FIRST_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_MSBFIRST_MSK))
-#define UART_DATA_INV_ENABLE(hperh)	(SET_BIT((hperh)->perh->LCR, UART_LCR_DATAINV_MSK))
-#define UART_DATA_INV_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_DATAINV_MSK))
-#define UART_RX_INV_ENABLE(hperh)	(SET_BIT((hperh)->perh->LCR, UART_LCR_RXINV_MSK))
-#define UART_RX_INV_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_RXINV_MSK))
-#define UART_TX_INV_ENABLE(hperh)	(SET_BIT((hperh)->perh->LCR, UART_LCR_TXINV_MSK))
-#define UART_TX_INV_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_TXINV_MSK))
-#define UART_TX_RX_SWAP_ENABLE(hperh)	(SET_BIT((hperh)->perh->LCR, UART_LCR_SWAP_MSK))
-#define UART_TX_RX_SWAP_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->LCR, UART_LCR_SWAP_MSK))
-#define UART_HDSEL_ENABLE(hperh)	(SET_BIT((hperh)->perh->MCR, UART_MCR_HDSEL_MSK))
-#define UART_HDSEL_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->MCR, UART_MCR_HDSEL_MSK))
-#define UART_FIFO_TX_RESET(hperh)	(SET_BIT((hperh)->perh->FCR, UART_FCR_TFRST_MSK))
-#define UART_FIFO_RX_RESET(hperh)	(SET_BIT((hperh)->perh->FCR, UART_FCR_RFRST_MSK))
-#define UART_LPBMOD_ENABLE(hperh)	(SET_BIT((hperh)->perh->MCR, UART_MCR_LBEN_MSK))
-#define UART_LPBMOD_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->MCR, UART_MCR_LBEN_MSK))
-#define UART_AUTOBR_ENABLE(hperh)	(SET_BIT((hperh)->perh->MCR, UART_MCR_ABREN_MSK))
-#define UART_AUTOBR_DISABLE(hperh)	(CLEAR_BIT((hperh)->perh->MCR, UART_MCR_ABREN_MSK))
-#define UART_AUTOBR_RESTART(hperh)	(SET_BIT((hperh)->perh->MCR, UART_MCR_ABRRS_MSK))
-#define UART_GET_BRR_VALUE(hperh)	(READ_REG((hperh)->perh->BRR))
-#define UART_SET_TIMEOUT_VALUE(x, y)	(MODIFY_REG((x)->perh->RTOR, UART_RTOR_RTO_MSK, (y) << UART_RTOR_RTO_POSS))
-/**
-  * @}
-  */
-
-/** @defgroup UART_Public_Types UART Public Types
-  * @{
-  */
-/**
-  * @brief UART word length
-  */
-typedef enum {
-	UART_WORD_LENGTH_5B = 0x0,	/**< 5-bits */
-	UART_WORD_LENGTH_6B = 0x1,	/**< 6-bits */
-	UART_WORD_LENGTH_7B = 0x2,	/**< 7-bits */
-	UART_WORD_LENGTH_8B = 0x3,	/**< 8-bits */
-} uart_word_length_t;
-
-/**
-  * @brief UART stop bits
-  */
-typedef enum {
-	UART_STOP_BITS_1   = 0x0,		/**< 1-bits */
-	UART_STOP_BITS_2   = 0x1,		/**< 2-bits */
-	UART_STOP_BITS_0_5 = 0x0,		/**< 0.5-bits, using smartcard mode */
-	UART_STOP_BITS_1_5 = 0x1,		/**< 1.5-bits, using smartcard mode */
-} uart_stop_bits_t;
-
-/**
-  * @brief UART parity
-  */
-typedef enum {
-	UART_PARITY_NONE = 0x0,		/**< Not parity */
-	UART_PARITY_ODD  = 0x1,		/**< Odd parity */
-	UART_PARITY_EVEN = 0x3,		/**< Even parity */
-} uart_parity_t;
-
-/**
-  * @brief UART mode
-  */
-typedef enum {
-	UART_MODE_UART  = 0x0,		/**< UART */
-	UART_MODE_LIN   = 0x1,		/**< LIN */
-	UART_MODE_IrDA  = 0x2,		/**< IrDA */
-	UART_MODE_RS485 = 0x3,		/**< RS485 */
-	UART_MODE_HDSEL = 0x4,		/**< Single-wire half-duplex */
-} uart_mode_t;
-
-/**
-  * @brief UART hardware flow control
-  */
-typedef enum {
-	UART_HW_FLOW_CTL_DISABLE = 0x0,	/**< Auto-flow-control disable */
-	UART_HW_FLOW_CTL_ENABLE  = 0x1,	/**< Auto-flow-control enable */
-} uart_hw_flow_ctl_t;
-
-/**
-  * @brief ALD UART state
-  */
-typedef enum {
-	UART_STATE_RESET      = 0x00,	/**< Peripheral is not initialized */
-	UART_STATE_READY      = 0x01,	/**< Peripheral Initialized and ready for use */
-	UART_STATE_BUSY       = 0x02,	/**< an internal process is ongoing */
-	UART_STATE_BUSY_TX    = 0x11,	/**< Data Transmission process is ongoing */
-	UART_STATE_BUSY_RX    = 0x21,	/**< Data Reception process is ongoing */
-	UART_STATE_BUSY_TX_RX = 0x31,	/**< Data Transmission Reception process is ongoing */
-	UART_STATE_TIMEOUT    = 0x03,	/**< Timeout state */
-	UART_STATE_ERROR      = 0x04,	/**< Error */
-} uart_state_t;
-
-/**
-  * @brief UART error codes
-  */
-typedef enum {
-	UART_ERROR_NONE = ((uint32_t)0x00),	/**< No error */
-	UART_ERROR_PE   = ((uint32_t)0x01),	/**< Parity error */
-	UART_ERROR_NE   = ((uint32_t)0x02),	/**< Noise error */
-	UART_ERROR_FE   = ((uint32_t)0x04),	/**< frame error */
-	UART_ERROR_ORE  = ((uint32_t)0x08),	/**< Overrun error */
-	UART_ERROR_DMA  = ((uint32_t)0x10),	/**< DMA transfer error */
-} uart_error_t;
-
-/**
-  * @brief UART init structure definition
-  */
-typedef struct {
-	uint32_t baud;			/**< Specifies the uart communication baud rate */
-	uart_word_length_t word_length;	/**< Specifies the number of data bits transmitted or received in a frame */
-	uart_stop_bits_t stop_bits;	/**< Specifies the number of stop bits transmitted */
-	uart_parity_t parity;		/**< Specifies the parity mode */
-	uart_mode_t mode;		/**< Specifies uart mode */
-	uart_hw_flow_ctl_t fctl;	/**< Specifies wether the hardware flow control mode is enabled or disabled */
-} uart_init_t;
-
-/**
-  * @brief  UART handle structure definition
-  */
-typedef struct uart_handle_s {
-	UART_TypeDef *perh;	/**< UART registers base address */
-	uart_init_t init;	/**< UART communication parameters */
-	uint8_t *tx_buf;	/**< Pointer to UART Tx transfer Buffer */
-	uint16_t tx_size;	/**< UART Tx Transfer size */
-	uint16_t tx_count;	/**< UART Tx Transfer Counter */
-	uint8_t *rx_buf;	/**< Pointer to UART Rx transfer Buffer */
-	uint16_t rx_size;	/**< UART Rx Transfer size */
-	uint16_t rx_count;	/**< UART Rx Transfer Counter */
-#ifdef ALD_DMA
-	dma_handle_t hdmatx;	/**< UART Tx DMA Handle parameters */
-	dma_handle_t hdmarx;	/**< UART Rx DMA Handle parameters */
-#endif
-	lock_state_t lock;	/**< Locking object */
-	uart_state_t state;	/**< UART communication state */
-	uart_error_t err_code;	/**< UART Error code */
-
-	void (*tx_cplt_cbk)(struct uart_handle_s *arg);	/**< Tx completed callback */
-	void (*rx_cplt_cbk)(struct uart_handle_s *arg);	/**< Rx completed callback */
-	void (*error_cbk)(struct uart_handle_s *arg);	/**< error callback */
-} uart_handle_t;
-
-/**
-  * @brief UART RS485 configure structure definition
-  */
-typedef struct {
-	type_func_t normal;	/**< Normal mode */
-	type_func_t dir;	/**< Auto-direction mode */
-	type_func_t invert;	/**< Address detection invert */
-	uint8_t addr;		/**< Address for compare */
-} uart_rs485_config_t;
-
-/**
-  * @brief LIN detection break length
-  */
-typedef enum {
-	LIN_BREAK_LEN_10B = 0x0,	/**< 10-bit break */
-	LIN_BREAK_LEN_11B = 0x1,	/**< 11-bit break */
-} uart_lin_break_len_t;
-
-/**
-  * @brief UART TXFIFO size
-  */
-typedef enum {
-	UART_TXFIFO_EMPTY = 0x0,	/**< Empty */
-	UART_TXFIFO_2BYTE = 0x1,	/**< 2-Bytes */
-	UART_TXFIFO_4BYTE = 0x2,	/**< 4-Bytes */
-	UART_TXFIFO_8BYTE = 0x3,	/**< 8-Bytes */
-} uart_txfifo_t;
-
-/**
-  * @brief UART RXFIFO size
-  */
-typedef enum {
-	UART_RXFIFO_1BYTE  = 0x0,	/**< 1-Byte */
-	UART_RXFIFO_4BYTE  = 0x1,	/**< 4-Bytes */
-	UART_RXFIFO_8BYTE  = 0x2,	/**< 8-Bytes */
-	UART_RXFIFO_14BYTE = 0x3,	/**< 14-Bytes */
-} uart_rxfifo_t;
-
-/**
-  * @brief UART auto-baud mode
-  */
-typedef enum {
-	UART_ABRMOD_1_TO_0 = 0x0,	/**< Detect bit0:1, bit1:0 */
-	UART_ABRMOD_1      = 0x1,	/**< Detect bit0:1 */
-	UART_ABRMOD_0_TO_1 = 0x2,	/**< Detect bit0:0, bit1:1 */
-} uart_auto_baud_mode_t;
-
-/**
-  * @brief UART status types
-  */
-typedef enum {
-	UART_STATUS_DR   = (1U << 0),	/**< Data ready */
-	UART_STATUS_OE   = (1U << 1),	/**< Overrun error */
-	UART_STATUS_PE   = (1U << 2),	/**< Parity error */
-	UART_STATUS_FE   = (1U << 3),	/**< Framing error */
-	UART_STATUS_BI   = (1U << 4),	/**< Break interrupt */
-	UART_STATUS_TBEM = (1U << 5),	/**< Transmit buffer empty */
-	UART_STATUS_TEM  = (1U << 6),	/**< Transmitter empty */
-	UART_STATUS_RFE  = (1U << 7),	/**< Reveiver FIFO data error */
-	UART_STATUS_BUSY = (1U << 8),	/**< UART busy */
-	UART_STATUS_TFNF = (1U << 9),	/**< Transmit FIFO not full */
-	UART_STATUS_TFEM = (1U << 10),	/**< Transmit FIFO not empty */
-	UART_STATUS_RFNE = (1U << 11),	/**< Receive FIFO not empty */
-	UART_STATUS_RFF  = (1U << 12),	/**< Receive FIFO full */
-	UART_STATUS_DCTS = (1U << 14),	/**< Delta clear to send */
-	UART_STATUS_CTS  = (1U << 15),	/**< Clear to send */
-} uart_status_t;
-
-/**
-  * @brief UART interrupt types
-  */
-typedef enum {
-	UART_IT_RXRD  = (1U << 0),	/**< Receive data available */
-	UART_IT_TXS   = (1U << 1),	/**< Tx empty status */
-	UART_IT_RXS   = (1U << 2),	/**< Rx line status */
-	UART_IT_MDS   = (1U << 3),	/**< Modem status */
-	UART_IT_RTO   = (1U << 4),	/**< Receiver timeout */
-	UART_IT_BZ    = (1U << 5),	/**< Busy status */
-	UART_IT_ABE   = (1U << 6),	/**< Auto-baud rate detection end */
-	UART_IT_ABTO  = (1U << 7),	/**< Auto-baud rate detection timeout */
-	UART_IT_LINBK = (1U << 8),	/**< Lin break detection */
-	UART_IT_TC    = (1U << 9),	/**< Transmission complete */
-	UART_IT_EOB   = (1U << 10),	/**< End of block */
-	UART_IT_CM    = (1U << 11),	/**< Character match */
-} uart_it_t;
-
-/**
-  * @brief UART flags types
-  */
-typedef enum {
-	UART_IF_RXRD  = (1U << 0),	/**<  Receive data available */
-	UART_IF_TXS   = (1U << 1),	/**<  Tx empty status */
-	UART_IF_RXS   = (1U << 2),	/**<  Rx line status */
-	UART_IF_MDS   = (1U << 3),	/**<  Modem status */
-	UART_IF_RTO   = (1U << 4),	/**<  Receiver timeout */
-	UART_IF_BZ    = (1U << 5),	/**<  Busy status */
-	UART_IF_ABE   = (1U << 6),	/**<  Auto-baud rate detection end */
-	UART_IF_ABTO  = (1U << 7),	/**<  Auto-baud rate detection timeout */
-	UART_IF_LINBK = (1U << 8),	/**<  Lin break detection */
-	UART_IF_TC    = (1U << 9),	/**<  Transmission complete */
-	UART_IF_EOB   = (1U << 10),	/**<  End of block */
-	UART_IF_CM    = (1U << 11),	/**<  Character match */
-} uart_flag_t;
-/**
-  * @}
-  */
-
-/** @defgroup UART_Private_Macros   UART Private Macros
-  * @{
-  */
-#define IS_UART_ALL(x)	(((x) == UART0) || \
-                         ((x) == UART1) || \
-                         ((x) == UART2) || \
-                         ((x) == UART3))
-#define IS_UART_WORD_LENGTH(x)	(((x) == UART_WORD_LENGTH_5B) || \
-                                 ((x) == UART_WORD_LENGTH_6B) || \
-                                 ((x) == UART_WORD_LENGTH_7B) || \
-                                 ((x) == UART_WORD_LENGTH_8B))
-#define IS_UART_STOPBITS(x)	(((x) == UART_STOP_BITS_1)   || \
-                                 ((x) == UART_STOP_BITS_2)   || \
-                                 ((x) == UART_STOP_BITS_0_5) || \
-                                 ((x) == UART_STOP_BITS_1_5))
-#define IS_UART_PARITY(x)	(((x) == UART_PARITY_NONE)  || \
-                                 ((x) == UART_PARITY_ODD) || \
-                                 ((x) == UART_PARITY_EVEN))
-#define IS_UART_MODE(x)		(((x) == UART_MODE_UART) || \
-                                 ((x) == UART_MODE_LIN)  || \
-                                 ((x) == UART_MODE_IrDA) || \
-                                 ((x) == UART_MODE_RS485) || \
-                                 ((x) == UART_MODE_HDSEL))
-#define IS_UART_HARDWARE_FLOW_CONTROL(x) \
-                                (((x) == UART_HW_FLOW_CTL_DISABLE) || \
-                                 ((x) == UART_HW_FLOW_CTL_ENABLE))
-#define IS_UART_LIN_BREAK_LEN(x)	(((x) == LIN_BREAK_LEN_10B) || \
-                                         ((x) == LIN_BREAK_LEN_11B))
-#define IS_UART_TXFIFO_TYPE(x)	(((x) == UART_TXFIFO_EMPTY) || \
-                                 ((x) == UART_TXFIFO_2BYTE) || \
-                                 ((x) == UART_TXFIFO_4BYTE) || \
-                                 ((x) == UART_TXFIFO_8BYTE))
-#define IS_UART_RXFIFO_TYPE(x)	(((x) == UART_RXFIFO_1BYTE) || \
-                                 ((x) == UART_RXFIFO_4BYTE) || \
-                                 ((x) == UART_RXFIFO_8BYTE) || \
-                                 ((x) == UART_RXFIFO_14BYTE))
-#define IS_UART_AUTO_BAUD_MODE(x)	(((x) == UART_ABRMOD_1_TO_0) || \
-                                         ((x) == UART_ABRMOD_1)      || \
-                                         ((x) == UART_ABRMOD_0_TO_1))
-#define IS_UART_STATUS(x)	(((x) == UART_STATUS_DR)   || \
-                                 ((x) == UART_STATUS_OE)   || \
-                                 ((x) == UART_STATUS_PE)   || \
-                                 ((x) == UART_STATUS_FE)   || \
-                                 ((x) == UART_STATUS_BI)   || \
-                                 ((x) == UART_STATUS_TBEM) || \
-                                 ((x) == UART_STATUS_TEM)  || \
-                                 ((x) == UART_STATUS_RFE)  || \
-                                 ((x) == UART_STATUS_BUSY) || \
-                                 ((x) == UART_STATUS_TFNF) || \
-                                 ((x) == UART_STATUS_TFEM) || \
-                                 ((x) == UART_STATUS_RFNE) || \
-                                 ((x) == UART_STATUS_RFF)  || \
-                                 ((x) == UART_STATUS_DCTS) || \
-                                 ((x) == UART_STATUS_CTS))
-#define IS_UART_IT(x)		(((x) == UART_IT_RXRD)  || \
-                                 ((x) == UART_IT_TXS)   || \
-                                 ((x) == UART_IT_RXS)   || \
-                                 ((x) == UART_IT_MDS)   || \
-                                 ((x) == UART_IT_RTO)   || \
-                                 ((x) == UART_IT_BZ)    || \
-                                 ((x) == UART_IT_ABE)   || \
-                                 ((x) == UART_IT_ABTO)  || \
-                                 ((x) == UART_IT_LINBK) || \
-                                 ((x) == UART_IT_TC)    || \
-                                 ((x) == UART_IT_EOB)   || \
-                                 ((x) == UART_IT_CM))
-#define IS_UART_IF(x)		(((x) == UART_IF_RXRD)  || \
-                                 ((x) == UART_IF_TXS)   || \
-                                 ((x) == UART_IF_RXS)   || \
-                                 ((x) == UART_IF_MDS)   || \
-                                 ((x) == UART_IF_RTO)   || \
-                                 ((x) == UART_IF_BZ)    || \
-                                 ((x) == UART_IF_ABE)   || \
-                                 ((x) == UART_IF_ABTO)  || \
-                                 ((x) == UART_IF_LINBK) || \
-                                 ((x) == UART_IF_TC)    || \
-                                 ((x) == UART_IF_EOB)   || \
-                                 ((x) == UART_IF_CM))
-#define IS_UART_BAUDRATE(x)	(((x) > 0) && ((x) < 0x44AA21))
-#define IS_UART_DATA(x)		((x) <= 0x1FF)
-
-#define UART_STATE_TX_MASK	(1U << 4)
-#define UART_STATE_RX_MASK	(1U << 5)
-/**
-  * @}
-  */
-
-/** @addtogroup UART_Public_Functions
-  * @{
-  */
-
-/** @addtogroup UART_Public_Functions_Group1
-  * @{
-  */
-/* Initialization functions */
-void uart_init(uart_handle_t *hperh);
-void uart_reset(uart_handle_t *hperh);
-void uart_rs485_config(uart_handle_t *hperh, uart_rs485_config_t *config);
-/**
-  * @}
-  */
-
-/** @addtogroup UART_Public_Functions_Group2
-  * @{
-  */
-/* IO operation functions */
-ald_status_t uart_send(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t uart_recv(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t uart_send_by_it(uart_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t uart_recv_by_it(uart_handle_t *hperh, uint8_t *buf, uint16_t size);
-#ifdef ALD_DMA
-ald_status_t uart_send_by_dma(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t uart_recv_by_dma(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t uart_dma_pause(uart_handle_t *hperh);
-ald_status_t uart_dma_resume(uart_handle_t *hperh);
-ald_status_t uart_dma_stop(uart_handle_t *hperh);
-#endif
-void uart_irq_handle(uart_handle_t *hperh);
-/**
-  * @}
-  */
-
-/** @addtogroup UART_Public_Functions_Group3
-  * @{
-  */
-/* Peripheral Control functions */
-void uart_interrupt_config(uart_handle_t *hperh, uart_it_t it, type_func_t state);
-void uart_dma_req_config(uart_handle_t *hperh, type_func_t state);
-void uart_tx_fifo_config(uart_handle_t *hperh, uart_rxfifo_t config, uint8_t level);
-void uart_rx_fifo_config(uart_handle_t *hperh, uart_rxfifo_t config, uint8_t level);
-void uart_lin_send_break(uart_handle_t *hperh);
-void uart_lin_detect_break_len_config(uart_handle_t *hperh, uart_lin_break_len_t len);
-void uart_auto_baud_config(uart_handle_t *hperh, uart_auto_baud_mode_t mode);
-ald_status_t uart_rs485_send_addr(uart_handle_t *hperh, uint16_t addr, uint32_t timeout);
-it_status_t uart_get_it_status(uart_handle_t *hperh, uart_it_t it);
-flag_status_t uart_get_status(uart_handle_t *hperh, uart_status_t status);
-flag_status_t uart_get_flag_status(uart_handle_t *hperh, uart_flag_t flag);
-flag_status_t uart_get_mask_flag_status(uart_handle_t *hperh, uart_flag_t flag);
-void uart_clear_flag_status(uart_handle_t *hperh, uart_flag_t flag);
-/**
-  * @}
-  */
-
-/** @addtogroup UART_Public_Functions_Group4
-  * @{
-  */
-/* Peripheral State and Errors functions */
-uart_state_t uart_get_state(uart_handle_t *hperh);
-uint32_t uart_get_error(uart_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_UART_H__ */

+ 0 - 561
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Include/ald_usart.h

@@ -1,561 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_usart.h
-  * @brief   Header file of USART module library.
-  *
-  * @version V1.0
-  * @date    16 Apr 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#ifndef __ALD_USART_H__
-#define __ALD_USART_H__
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-#include "utils.h"
-#include "ald_dma.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @addtogroup USART
-  * @{
-  */
-
-/** @defgroup USART_Public_Types USART Public Types
-  * @{
-  */
-
-/**
-  * @brief usart_word_length
-  */
-typedef enum {
-	USART_WORD_LENGTH_8B = 0x0,	/**< Word length is 8-bits */
-	USART_WORD_LENGTH_9B = 0x1,	/**< Word length is 9-bits */
-} usart_word_length_t;
-
-/**
-  * @brief usart_stop_bits
-  */
-typedef enum {
-	USART_STOP_BITS_1   = 0x0,	/**< Stop bits is 1-bits */
-	USART_STOP_BITS_0_5 = 0x1,	/**< Stop bits is 0.5-bits */
-	USART_STOP_BITS_2   = 0x2,	/**< Stop bits is 2-bits */
-	USART_STOP_BITS_1_5 = 0x3,	/**< Stop bits is 1.5-bits */
-} usart_stop_bits_t;
-
-/**
-  * @brief usart_parity
-  */
-typedef enum {
-	USART_PARITY_NONE = 0x0,	/**< Not parity */
-	USART_PARITY_EVEN = 0x2,	/**< Even parity */
-	USART_PARITY_ODD  = 0x3,	/**< Odd parity */
-} usart_parity_t;
-
-/**
-  * @brief usart_mode
-  */
-typedef enum {
-	USART_MODE_RX    = 0x1,		/**< TX mode */
-	USART_MODE_TX    = 0x2,		/**< RX mode */
-	USART_MODE_TX_RX = 0x3,		/**< TX & RX mode */
-} usart_mode_t;
-
-/**
-  * @brief usart_hardware_flow_control
-  */
-typedef enum {
-	USART_HW_FLOW_CTL_NONE    = 0x0,	/**< Not flow control */
-	USART_HW_FLOW_CTL_RTS     = 0x1,	/**< RTS flow control */
-	USART_HW_FLOW_CTL_CTS     = 0x2,	/**< CTS flow control */
-	USART_HW_FLOW_CTL_RTS_CTS = 0x3,	/**< RTS & CTS flow control */
-} usart_hw_flow_ctl_t;
-
-/**
-  * @brief usart_clock
-  */
-typedef enum {
-	USART_CLOCK_DISABLE = 0x0,	/**< Disable clock output */
-	USART_CLOCK_ENABLE  = 0x1,	/**< Enable clock output */
-} usart_clock_t;
-
-/**
-  * @brief usart_clock_polarity
-  */
-typedef enum {
-	USART_CPOL_LOW  = 0x0,		/**< Clock polarity low */
-	USART_CPOL_HIGH = 0x1,		/**< Clock polarity high */
-} usart_cpol_t;
-
-/**
-  * @brief usart_clock_phase
-  */
-typedef enum {
-	USART_CPHA_1EDGE = 0x0,		/**< Clock phase first edge */
-	USART_CPHA_2EDGE = 0x1,		/**< Clock phase second edge */
-} usart_cpha_t;
-
-/**
-  * @brief usart_last_bit
-  */
-typedef enum {
-	USART_LAST_BIT_DISABLE = 0x0,	/**< Disable last bit clock output */
-	USART_LAST_BIT_ENABLE  = 0x1,	/**< Enable last bit clock output */
-} usart_last_bit_t;
-
-/**
-  * @brief usart state structures definition
-  */
-typedef enum {
-	USART_STATE_RESET      = 0x00,	/**< Peripheral is not initialized */
-	USART_STATE_READY      = 0x01,	/**< Peripheral Initialized and ready for use */
-	USART_STATE_BUSY       = 0x02,	/**< an internal process is ongoing */
-	USART_STATE_BUSY_TX    = 0x11,	/**< Data Transmission process is ongoing */
-	USART_STATE_BUSY_RX    = 0x21,	/**< Data Reception process is ongoing */
-	USART_STATE_BUSY_TX_RX = 0x31,	/**< Data Transmission Reception process is ongoing */
-	USART_STATE_TIMEOUT    = 0x03,	/**< Timeout state */
-	USART_STATE_ERROR      = 0x04,	/**< Error */
-} usart_state_t;
-
-/**
-  * @brief usart error codes
-  */
-typedef enum {
-	USART_ERROR_NONE = ((uint32_t)0x00),	/**< No error */
-	USART_ERROR_PE   = ((uint32_t)0x01),	/**< Parity error */
-	USART_ERROR_NE   = ((uint32_t)0x02),	/**< Noise error */
-	USART_ERROR_FE   = ((uint32_t)0x04),	/**< frame error */
-	USART_ERROR_ORE  = ((uint32_t)0x08),	/**< Overrun error */
-	USART_ERROR_DMA  = ((uint32_t)0x10),	/**< DMA transfer error */
-} usart_error_t;
-
-
-/**
-  * @brief usart init structure definition
-  */
-typedef struct {
-	uint32_t baud;			/**< This member configures the Usart communication baud rate. */
-	usart_word_length_t word_length;/**< Specifies the number of data bits transmitted or received in a frame. */
-	usart_stop_bits_t stop_bits;	/**< Specifies the number of stop bits transmitted. */
-	usart_parity_t parity;		/**< Specifies the parity mode.
-					     @note When parity is enabled, the computed parity is inserted
- 						   at the MSB position of the transmitted data (9th bit when
- 						   the word length is set to 9 data bits; 8th bit when the
-						   word length is set to 8 data bits). */
-	usart_mode_t mode;		/**< Specifies wether the Receive or Transmit mode is enabled or disabled. */
-	usart_hw_flow_ctl_t fctl;	/**< Specifies wether the hardware flow control mode is enabled or disabled. */
-	type_func_t over_sampling;	/**< Specifies whether the Over sampling 8 is enabled or disabled. */
-} usart_init_t;
-
-/**
-  * @brief  USART handle structure definition
-  */
-typedef struct usart_handle_s {
-	USART_TypeDef *perh;	/**< USART registers base address */
-	usart_init_t init;	/**< USART communication parameters */
-	uint8_t *tx_buf;	/**< Pointer to USART Tx transfer buffer */
-	uint16_t tx_size;	/**< USART Tx transfer size */
-	uint16_t tx_count;	/**< USART Tx transfer counter */
-	uint8_t *rx_buf;	/**< Pointer to USART Rx transfer buffer */
-	uint16_t rx_size;	/**< USART Rx Transfer size */
-	uint16_t rx_count;	/**< USART Rx Transfer Counter */
-#ifdef ALD_DMA
-	dma_handle_t hdmatx;	/**< USART Tx DMA handle parameters */
-	dma_handle_t hdmarx;	/**< USART Rx DMA handle parameters */
-#endif
-	lock_state_t lock;	/**< Locking object */
-	usart_state_t state;	/**< USART communication state */
-	uint32_t err_code;	/**< USART error code */
-
-	void (*tx_cplt_cbk)(struct usart_handle_s *arg);	/**< Tx completed callback */
-	void (*rx_cplt_cbk)(struct usart_handle_s *arg);	/**< Rx completed callback */
-	void (*tx_rx_cplt_cbk)(struct usart_handle_s *arg);	/**< Tx & Rx completed callback */
-	void (*error_cbk)(struct usart_handle_s *arg);		/**< error callback */
-} usart_handle_t;
-
-
-/**
-  * @brief USART clock init structure definition
-  */
-typedef struct {
-	usart_clock_t clk;		/**< Pecifies whether the USART clock is enable or disable. */
-	usart_cpol_t polarity;		/**< Specifies the steady state of the serial clock. */
-	usart_cpha_t phase;		/**< Specifies the clock transition on which the bit capture is made. */
-	usart_last_bit_t last_bit;	/**< Specifies whether the clock pulse corresponding to the last transmitted
-				             data bit (MSB) has to be output on the SCLK pin in synchronous mode. */
-} usart_clock_init_t;
-
-
-/**
-  * @brief usart_dma_request
-  */
-typedef enum {
-	USART_DMA_REQ_TX = (1U << 7),	/**< TX dma bit */
-	USART_DMA_REQ_RX = (1U << 6),	/**< RX dma bit */
-} usart_dma_req_t;
-
-/**
-  * @brief usart_wakeup_methods
-  */
-typedef enum {
-	USART_WAKEUP_IDLE = 0x0,	/**< Wake up the machine when bus-line is idle */
-	USART_WAKEUP_ADDR = 0x1,	/**< Wake up the machine when match the address */
-} usart_wakeup_t;
-
-/**
-  * @brief usart_IrDA_low_power
-  */
-typedef enum {
-	USART_IrDA_MODE_NORMAL    = 0x0,		/**< Normal IrDA mode */
-	USART_IrDA_MODE_LOW_POWER = 0x1,		/**< Low-power IrDA mode */
-} usart_IrDA_mode_t;
-
-/**
-  * @brief USART interrupts definition
-  */
-typedef enum {
-	USART_IT_PE   = ((1U << 8) | (1U << 16)),	/**< Parity error */
-	USART_IT_TXE  = ((1U << 7) | (1U << 16)),	/**< Tx empty */
-	USART_IT_TC   = ((1U << 6) | (1U << 16)),	/**< Tx complete */
-	USART_IT_RXNE = ((1U << 5) | (1U << 16)),	/**< Rx not empty */
-	USART_IT_IDLE = ((1U << 4) | (1U << 16)),	/**< Idle */
-	USART_IT_CTS  = ((1U << 10)| (1U << 18)),	/**< CTS */
-	USART_IT_ERR  = ((1U << 0) | (1U << 18)),	/**< Error */
-	USART_IT_ORE  = (1U << 3),			/**< Overrun error */
-	USART_IT_NE   = (1U << 2),			/**< Noise error */
-	USART_IT_FE   = (1U << 0),			/**< Frame error */
-} usart_it_t;
-
-/**
-  * @brief USART flags
-  */
-typedef enum {
-	USART_FLAG_CTS  = (1U << 9),	/**< CTS */
-	USART_FLAG_TXE  = (1U << 7),	/**< Tx empty */
-	USART_FLAG_TC   = (1U << 6),	/**< Tx complete */
-	USART_FLAG_RXNE = (1U << 5),	/**< Rx not empty */
-	USART_FLAG_IDLE = (1U << 4),	/**< Idle */
-	USART_FLAG_ORE  = (1U << 3),	/**< Overrun error */
-	USART_FLAG_NE   = (1U << 2),	/**< Noise error */
-	USART_FLAG_FE   = (1U << 1),	/**< Frame error */
-	USART_FLAG_PE   = (1U << 0),	/**< Parity error */
-} usart_flag_t;
-
-/**
-  * @}
-  */
-
-
-/** @defgroup USART_Public_Macros USART Public Macros
-  * @{
-  */
-
-/** @defgroup USART_Public_Macros_1 USART handle reset
-  * @{
-  */
-#define USART_RESET_HANDLE_STATE(handle) ((handle)->state = USART_STATE_RESET)
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_2 USART clear PE flag
-  * @{
-  */
-#define USART_CLEAR_PEFLAG(handle)	\
-do {					\
-	__IO uint32_t tmpreg;		\
-	tmpreg = (handle)->perh->STAT;	\
-	tmpreg = (handle)->perh->DATA;	\
-	UNUSED(tmpreg);			\
-} while (0)
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_3 USART clear FE flag
-  * @{
-  */
-#define USART_CLEAR_FEFLAG(handle) USART_CLEAR_PEFLAG(handle)
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_4 USART clear NE flag
-  * @{
-  */
-#define USART_CLEAR_NEFLAG(handle) USART_CLEAR_PEFLAG(handle)
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_5 USART clear ORE flag
-  * @{
-  */
-#define USART_CLEAR_OREFLAG(handle) USART_CLEAR_PEFLAG(handle)
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_6 USART clear IDLE flag
-  * @{
-  */
-#define USART_CLEAR_IDLEFLAG(handle) USART_CLEAR_PEFLAG(handle)
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_7 USART enable CTS flow control
-  * @{
-  */
-#define USART_HWCONTROL_CTS_ENABLE(handle)	\
-	(SET_BIT((handle)->perh->CON2, USART_CON2_CTSEN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_8 USART disable CTS flow control
-  * @{
-  */
-#define USART_HWCONTROL_CTS_DISABLE(handle)	\
-	(CLEAR_BIT((handle)->perh->CON2, USART_CON2_CTSEN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_9 USART enable RTS flow control
-  * @{
-  */
-#define USART_HWCONTROL_RTS_ENABLE(handle)	\
-	(SET_BIT((handle)->perh->CON2, USART_CON2_RTSEN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_10 USART disable RTS flow control
-  * @{
-  */
-#define USART_HWCONTROL_RTS_DISABLE(handle)	\
-	(CLEAR_BIT((handle)->perh->CON2, USART_CON2_RTSEN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_11 USART enable
-  * @{
-  */
-#define USART_ENABLE(handle)	(SET_BIT((handle)->perh->CON0, USART_CON0_EN_MSK))
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Macros_12 USART disable
-  * @{
-  */
-#define USART_DISABLE(handle)	(CLEAR_BIT((handle)->perh->CON0, USART_CON0_EN_MSK))
- /**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup USART_Private_Macros   USART Private Macros
-  * @{
-  */
-
-#define IS_USART(x) (((x) == USART0) || ((x) == USART1))
-#define IS_USART_WORD_LENGTH(x) (((x) == USART_WORD_LENGTH_8B) || \
-                                 ((x) == USART_WORD_LENGTH_9B))
-#define IS_USART_STOPBITS(x) (((x) == USART_STOP_BITS_1) ||   \
-                              ((x) == USART_STOP_BITS_0_5) || \
-                              ((x) == USART_STOP_BITS_2) ||   \
-                              ((x) == USART_STOP_BITS_1_5))
-#define IS_USART_PARITY(x) (((x) == USART_PARITY_NONE) ||   \
-                            ((x) == USART_PARITY_EVEN) || \
-                            ((x) == USART_PARITY_ODD))
-#define IS_USART_MODE(x) (((x) == USART_MODE_RX) || \
-			  ((x) == USART_MODE_TX) || \
-			  ((x) == USART_MODE_TX_RX))
-#define IS_USART_HARDWARE_FLOW_CONTROL(x)\
-                              (((x) == USART_HW_FLOW_CTL_NONE) || \
-                               ((x) == USART_HW_FLOW_CTL_RTS)  || \
-                               ((x) == USART_HW_FLOW_CTL_CTS)  || \
-                               ((x) == USART_HW_FLOW_CTL_RTS_CTS))
-#define IS_USART_CLOCK(x) (((x) == USART_CLOCK_DISABLE) || \
-                           ((x) == USART_CLOCK_ENABLE))
-#define IS_USART_CPOL(x) (((x) == USART_CPOL_LOW) || ((x) == USART_CPOL_HIGH))
-#define IS_USART_CPHA(x) (((x) == USART_CPHA_1EDGE) || ((x) == USART_CPHA_2EDGE))
-#define IS_USART_LASTBIT(x) (((x) == USART_LAST_BIT_DISABLE) || \
-                             ((x) == USART_LAST_BIT_ENABLE))
-#define IS_USART_DMAREQ(x) (((x) == USART_DMA_REQ_TX) || \
-                            ((x) == USART_DMA_REQ_RX))
-#define IS_USART_WAKEUP(x) (((x) == USART_WAKEUP_IDLE) || \
-                            ((x) == USART_WAKEUP_ADDR))
-#define IS_USART_IRDA_MODE(x) (((x) == USART_IrDA_MODE_NORMAL) || \
-                               ((x) == USART_IrDA_MODE_LOW_POWER))
-#define IS_USART_CONFIG_IT(x) (((x) == USART_IT_PE) || ((x) == USART_IT_TXE)   || \
-                               ((x) == USART_IT_TC) || ((x) == USART_IT_RXNE)  || \
-                               ((x) == USART_IT_IDLE) || \
-                               ((x) == USART_IT_CTS) || ((x) == USART_IT_ERR))
-#define IS_USART_GET_IT(x) (((x) == USART_IT_PE) || ((x) == USART_IT_TXE)   || \
-                            ((x) == USART_IT_TC) || ((x) == USART_IT_RXNE)  || \
-                            ((x) == USART_IT_IDLE) || \
-                            ((x) == USART_IT_CTS) || ((x) == USART_IT_ORE)  || \
-                            ((x) == USART_IT_NE) || ((x) == USART_IT_FE)    || \
-                            ((x) == USART_IT_ERR))
-#define IS_USART_CLEAR_IT(x) (((x) == USART_IT_TC) || ((x) == USART_IT_RXNE) || \
-                               ((x) == USART_IT_CTS))
-
-#define IS_USART_FLAG(x) (((x) == USART_FLAG_PE) || ((x) == USART_FLAG_TXE)   || \
-                          ((x) == USART_FLAG_TC) || ((x) == USART_FLAG_RXNE)  || \
-                          ((x) == USART_FLAG_IDLE) || \
-                          ((x) == USART_FLAG_CTS) || ((x) == USART_FLAG_ORE)  || \
-                          ((x) == USART_FLAG_NE) || ((x) == USART_FLAG_FE))
-#define IS_USART_CLEAR_FLAG(x) (((x) == USART_FLAG_CTS) || \
-                                ((x) == USART_FLAG_TC)  || \
-                                ((x) == USART_FLAG_RXNE))
-#define IS_USART_BAUDRATE(x)	(((x) > 0) && ((x) < 0x0044AA21))
-#define IS_USART_ADDRESS(x)	((x) <= 0xF)
-#define IS_USART_DATA(x)	((x) <= 0x1FF)
-#define DUMMY_DATA		0xFFFF
-#define USART_STATE_TX_MASK	(1 << 4)
-#define USART_STATE_RX_MASK	(1 << 5)
-
-/**
-  * @}
-  */
-
-/** @addtogroup USART_Public_Functions
-  * @{
-  */
-
-/** @addtogroup USART_Public_Functions_Group1
-  * @{
-  */
-/* Initialization functions */
-void usart_reset(usart_handle_t *hperh);
-ald_status_t usart_init(usart_handle_t *hperh);
-ald_status_t usart_half_duplex_init(usart_handle_t *hperh);
-ald_status_t usart_multi_processor_init(usart_handle_t *hperh, uint8_t addr, usart_wakeup_t wakeup);
-ald_status_t usart_clock_init(usart_handle_t *hperh, usart_clock_init_t *init);
-/**
-  * @}
-  */
-
-/** @addtogroup USART_Public_Functions_Group2
-  * @{
-  */
-
-/** @addtogroup USART_Public_Functions_Group2_1
-  * @{
-  */
-/* Asynchronization IO operation functions */
-ald_status_t usart_send(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t usart_recv(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t usart_send_by_it(usart_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t usart_recv_by_it(usart_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t usart_recv_frame_by_it(usart_handle_t *hperh, uint8_t *buf, uint16_t size);
-#ifdef ALD_DMA
-ald_status_t usart_send_by_dma(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t usart_recv_by_dma(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup USART_Public_Functions_Group2_2
-  * @{
-  */
-/* Synchronization IO operation functions */
-ald_status_t usart_send_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t usart_recv_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout);
-ald_status_t usart_send_recv_sync(usart_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size, uint32_t timeout);
-ald_status_t usart_send_by_it_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t usart_recv_by_it_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size);
-ald_status_t usart_send_recv_by_it_sync(usart_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf,  uint16_t size);
-#ifdef ALD_DMA
-ald_status_t usart_send_by_dma_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel);
-ald_status_t usart_recv_by_dma_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t tx_channel, uint8_t rx_channel);
-ald_status_t usart_send_recv_by_dma_sync(usart_handle_t *hperh, uint8_t *tx_buf,
-                    uint8_t *rx_buf, uint16_t size, uint8_t tx_channel, uint8_t rx_channel);
-#endif
-/**
-  * @}
-  */
-
-/** @addtogroup USART_Public_Functions_Group2_3
-  * @{
-  */
-/* Utilities functions */
-#ifdef ALD_DMA
-ald_status_t usart_dma_pause(usart_handle_t *hperh);
-ald_status_t usart_dma_resume(usart_handle_t *hperh);
-ald_status_t usart_dma_stop(usart_handle_t *hperh);
-#endif
-void usart_irq_handle(usart_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @addtogroup USART_Public_Functions_Group3
-  * @{
-  */
-/* Peripheral control functions */
-ald_status_t usart_multi_processor_enter_mute_mode(usart_handle_t *hperh);
-ald_status_t usart_multi_processor_exit_mute_mode(usart_handle_t *hperh);
-ald_status_t usart_half_duplex_enable_send(usart_handle_t *hperh);
-ald_status_t usart_half_duplex_enable_recv(usart_handle_t *hperh);
-void usart_dma_req_config(usart_handle_t *hperh, usart_dma_req_t req, type_func_t state);
-void usart_interrupt_config(usart_handle_t *hperh, usart_it_t it, type_func_t state);
-flag_status_t usart_get_flag_status(usart_handle_t *hperh, usart_flag_t flag);
-void usart_clear_flag_status(usart_handle_t *hperh, usart_flag_t flag);
-it_status_t usart_get_it_status(usart_handle_t *hperh, usart_it_t it);
-/**
-  * @}
-  */
-
-/** @addtogroup USART_Public_Functions_Group4
-  * @{
-  */
-
-/* Peripheral state and error functions */
-usart_state_t usart_get_state(usart_handle_t *hperh);
-uint32_t usart_get_error(usart_handle_t *hperh);
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __ALD_USART_H__ */

+ 0 - 326
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_acmp.c

@@ -1,326 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_acmp.c
-  * @brief   ACMP module driver.
-  *
-  * @version V1.0
-  * @date    13 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_acmp.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup ACMP ACMP
-  * @brief ACMP module driver
-  * @{
-  */
-#ifdef ALD_ACMP
-
-/** @defgroup ACMP_Public_Functions ACMP Public Functions
-  * @{
-  */
-
-/** @defgroup ACMP_Public_Functions_Group1 Initialization functions
-  * @brief Initialization and Configuration functions
-  * @{
-  */
-
-/**
-  * @brief  Initializes the ACMP mode according to the specified parameters in
-  *         the acmp_init_t and create the associated handle.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t acmp_init(acmp_handle_t *hperh)
-{
-	uint32_t tmp = 0;
-
-	if (hperh == NULL)
-		return ERROR;
-
-	if (hperh->init.vdd_level > 63)
-		return ERROR;
-
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-	assert_param(IS_ACMP_MODE_TYPE(hperh->init.mode));
-	assert_param(IS_ACMP_WARM_UP_TIME_TYPE(hperh->init.warm_time));
-	assert_param(IS_ACMP_HYSTSEL_TYPE(hperh->init.hystsel));
-	assert_param(IS_ACMP_WARM_FUNC_TYPE(hperh->init.warm_func));
-	assert_param(IS_ACMP_POS_INPUT_TYPE(hperh->init.pos_port));
-	assert_param(IS_ACMP_NEG_INPUT_TYPE(hperh->init.neg_port));
-	assert_param(IS_ACMP_INACTVAL_TYPE(hperh->init.inactval));
-	assert_param(IS_ACMP_EDGE_TYPE(hperh->init.edge));
-
-	__LOCK(hperh);
-
-	tmp = hperh->perh->CON;
-
-	tmp |= ((hperh->init.mode << ACMP_CON_MODSEL_POSS) | (hperh->init.warm_time << ACMP_CON_WARMUPT_POSS) |
-		(hperh->init.inactval << ACMP_CON_INACTV_POS));
-
-	hperh->perh->CON = tmp;
-
-	tmp = hperh->perh->INPUTSEL;
-
-	tmp |= ((hperh->init.pos_port << ACMP_INPUTSEL_PSEL_POSS) | (hperh->init.neg_port << ACMP_INPUTSEL_NSEL_POSS) |
-		(hperh->init.vdd_level << ACMP_INPUTSEL_VDDLVL_POSS));
-
-	hperh->perh->INPUTSEL = tmp;
-
-	if (hperh->init.warm_func == ACMP_WARM_DISABLE)
-		CLEAR_BIT(hperh->perh->IES, ACMP_IES_WARMUP_MSK);
-	else
-		SET_BIT(hperh->perh->IES, ACMP_IES_WARMUP_MSK);
-
-	switch (hperh->init.edge) {
-	case ACMP_EDGE_NONE:
-		CLEAR_BIT(hperh->perh->CON, ACMP_CON_FALLEN_MSK);
-		CLEAR_BIT(hperh->perh->CON, ACMP_CON_RISEEN_MSK);
-		break;
-
-	case ACMP_EDGE_FALL:
-		SET_BIT(hperh->perh->CON, ACMP_CON_FALLEN_MSK);
-		CLEAR_BIT(hperh->perh->CON, ACMP_CON_RISEEN_MSK);
-		break;
-
-	case ACMP_EDGE_RISE:
-		CLEAR_BIT(hperh->perh->CON, ACMP_CON_FALLEN_MSK);
-		SET_BIT(hperh->perh->CON, ACMP_CON_RISEEN_MSK);
-		break;
-
-	case ACMP_EDGE_ALL:
-		SET_BIT(hperh->perh->CON, ACMP_CON_FALLEN_MSK);
-		SET_BIT(hperh->perh->CON, ACMP_CON_RISEEN_MSK);
-		break;
-
-	default:
-		break;
-	}
-
-	SET_BIT(hperh->perh->CON, ACMP_CON_EN_MSK);
-
-	while (READ_BIT(hperh->perh->STAT, ACMP_STAT_ACT_MSK) == 0);
-
-	__UNLOCK(hperh);
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup ACMP_Public_Functions_Group2 Interrupt operation functions
-  * @brief ACMP Interrupt operation functions
-  * @{
-  */
-
-/**
-  * @brief  Enables or disables the specified ACMP interrupts.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @param  it: Specifies the ACMP interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref acmp_it_t.
-  * @param  state: New status
-  *           - ENABLE
-  *           - DISABLE
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t acmp_interrupt_config(acmp_handle_t *hperh, acmp_it_t it, type_func_t state)
-{
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-	assert_param(IS_ACMP_IT_TYPE(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	__LOCK(hperh);
-
-	if (state)
-		hperh->perh->IES |= it;
-	else
-		hperh->perh->IEC |= it;
-
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Checks whether the specified ACMP interrupt has occurred or not.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @param  flag: Specifies the ACMP interrupt source to check.
-  *         This parameter can be one of the @ref acmp_it_t.
-  * @retval it_status_t
-  *           - SET
-  *           - RESET
-  */
-it_status_t acmp_get_flag_status(acmp_handle_t *hperh, acmp_flag_t flag)
-{
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-	assert_param(IS_ACMP_FLAG_TYPE(flag));
-
-	if (hperh->perh->RIF & flag) {
-		__UNLOCK(hperh);
-		return SET;
-	}
-
-	return RESET;
-}
-
-/** @brief  Clear the specified ACMP it flags.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @param  flag: specifies the it flag.
-  *         This parameter can be one of the @ref acmp_it_t.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t acmp_clear_flag_status(acmp_handle_t *hperh, acmp_flag_t flag)
-{
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-	assert_param(IS_ACMP_FLAG_TYPE(flag));
-
-	__LOCK(hperh);
-	hperh->perh->IFC |= flag;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/** @brief  Set the specified acmp it flags.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified acmp module.
-  * @param  it: specifies the  it flag.
-  *         This parameter can be one of the @ref acmp_it_t.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t acmp_set_it_mask(acmp_handle_t *hperh, acmp_it_t it)
-{
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-	assert_param(IS_ACMP_IT_TYPE(it));
-
-	__LOCK(hperh);
-	hperh->perh->IFM |= it;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/** @brief  Check whether the specified ACMP flag is set or not.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @param  status: specifies the status to check.
-  *         This parameter can be one of the @ref acmp_status_t.
-  * @retval flag_status_t
-  *           - SET
-  *           - RESET
-  */
-flag_status_t acmp_get_status(acmp_handle_t *hperh, acmp_status_t status)
-{
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-	assert_param(IS_ACMP_STATUS_TYPE(status));
-
-	if (hperh->perh->STAT & status) {
-		__UNLOCK(hperh);
-		return SET;
-	}
-
-	return RESET;
-}
-/**
-  * @}
-  */
-
-/** @defgroup ACMP_Public_Functions_Group3 Output value functions
-  * @brief ACMP Output value functions
-  * @{
-  */
-
-/**
-  * @brief  This function handles ACMP interrupt request.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @retval None
-  */
-void acmp_irq_handle(acmp_handle_t *hperh)
-{
-	if (acmp_get_flag_status(hperh, ACMP_FLAG_WARMUP) == SET) {
-		if (hperh->acmp_warmup_cplt_cbk)
-			hperh->acmp_warmup_cplt_cbk(hperh);
-		acmp_clear_flag_status(hperh, ACMP_FLAG_WARMUP);
-	}
-
-	if (acmp_get_flag_status(hperh, ACMP_FLAG_EDGE) == SET) {
-		if (hperh->acmp_edge_cplt_cbk)
-			hperh->acmp_edge_cplt_cbk(hperh);
-		acmp_clear_flag_status(hperh, ACMP_FLAG_EDGE);
-	}
-
-	return;
-}
-
-/**
-  * @brief  This function config acmp output.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @param  config: Pointer to a acmp_output_config_t structure that contains
-  *         the configutation information for acmp output.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t acmp_out_config(acmp_handle_t *hperh, acmp_output_config_t *config)
-{
-	if (hperh == NULL)
-		return ERROR;
-
-	if (config == NULL)
-		return ERROR;
-
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-	assert_param(IS_ACMP_INVERT_TYPE(config->gpio_inv));
-	assert_param(IS_ACMP_LOCATION_TYPE(config->location));
-	assert_param(IS_ACMP_OUT_FUNC_TYPE(config->out_func));
-
-	__LOCK(hperh);
-	hperh->perh->PORT = config->location;
-	hperh->perh->CON |= (config->gpio_inv << ACMP_CON_OUTINV_POS);
-	hperh->perh->PORT = config->out_func;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  This function output acmp result.
-  * @param  hperh: Pointer to a acmp_handle_t structure that contains
-  *         the configuration information for the specified ACMP module.
-  * @retval output value.
-  */
-uint8_t acmp_out_result(acmp_handle_t *hperh)
-{
-	assert_param(IS_ACMP_TYPE(hperh->perh));
-
-	return (READ_BIT(hperh->perh->STAT, ACMP_STAT_OUT_MSK) >> ACMP_STAT_OUT_POS);
-}
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#endif /* ALD_ACMP */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 1291
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_adc.c

@@ -1,1291 +0,0 @@
-/**
-  ******************************************************************************
-  * @file    ald_adc.c
-  * @brief   This file provides firmware functions to manage the following
-  *          functionalities of the Analog to Digital Convertor (ADC)
-  *          peripheral:
-  *           + Initialization functions
-  *             ++ Initialization and Configuration of ADC
-  *           + Operation functions
-  *             ++ Start, stop, get result of conversions of normal
-  *                group, using 3 possible modes: polling, interruption or DMA.
-  *           + Control functions
-  *             ++ Channels configuration on normal group
-  *             ++ Channels configuration on insert group
-  *             ++ Analog Watchdog configuration
-  *           + State functions
-  *             ++ ADC state machine management
-  *             ++ Interrupts and flags management
-  *
-  * @version V1.0
-  * @date    15 Dec 2017
-  * @author  AE Team.
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-
-#include "ald_cmu.h"
-#include "ald_adc.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup ADC ADC
-  * @brief ADC module driver
-  * @{
-  */
-
-#ifdef ALD_ADC
-
-/** @addtogroup ADC_Private_Functions
-  * @{
-  */
-#ifdef ALD_DMA
-static void adc_dma_normal_conv_cplt(void *arg);
-static void adc_dma_error(void *arg);
-#endif
-/**
-  * @}
-  */
-
-
-/** @defgroup ADC_Public_Functions ADC Public Functions
-  * @{
-  */
-
-/** @defgroup ADC_Public_Functions_Group1 Initialization functions
-  * @brief    Initialization and Configuration functions
-  * @{
-  */
-
-/**
-  * @brief  Initializes the ADC peripheral and normal group according to
-  *         parameters specified in structure "adc_handle_t".
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_init(adc_handle_t *hperh)
-{
-	ald_status_t tmp_status = OK;
-
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_DATA_ALIGN_TYPE(hperh->init.data_align));
-	assert_param(IS_ADC_SCAN_MODE_TYPE(hperh->init.scan_mode));
-	assert_param(IS_ADC_CLK_DIV_TYPE(hperh->init.clk_div));
-	assert_param(IS_ADC_NEG_REF_VOLTAGE_TYPE(hperh->init.neg_ref));
-	assert_param(IS_POS_REF_VOLTAGE_TYPE(hperh->init.pos_ref));
-	assert_param(IS_ADC_CONV_RES_TYPE(hperh->init.conv_res));
-	assert_param(IS_ADC_NBR_OF_NM_TYPE(hperh->init.conv_nbr));
-	assert_param(IS_ADC_DISC_NBR_TYPE(hperh->init.disc_nbr));
-	assert_param(IS_FUNC_STATE(hperh->init.cont_mode));
-	assert_param(IS_FUNC_STATE(hperh->init.disc_mode));
-	assert_param(IS_ADC_NCHESEL_MODE_TYPE(hperh->init.nche_mode));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->nm_trig_mode));
-
-	if (hperh->state ==  ADC_STATE_RESET ) {
-		hperh->error_code = ADC_ERROR_NONE;
-		hperh->lock 	  = UNLOCK;
-	}
-
-	ADC_DISABLE(hperh);
-	hperh->state = ADC_STATE_BUSY_INTERNAL;
-	MODIFY_REG(hperh->perh->CON1, ADC_CON1_ALIGN_MSK, hperh->init.data_align << ADC_CON1_ALIGN_POS);
-	MODIFY_REG(hperh->perh->CON1, ADC_CON1_CM_MSK, hperh->init.cont_mode << ADC_CON1_CM_POS);
-	MODIFY_REG(hperh->perh->CON0, ADC_CON0_SCANEN_MSK, hperh->init.scan_mode << ADC_CON0_SCANEN_POS);
-	MODIFY_REG(hperh->perh->CON0, ADC_CON0_RSEL_MSK, hperh->init.conv_res << ADC_CON0_RSEL_POSS);
-
-	/* Enable discontinuous mode only if continuous mode is enabled */
-	if (hperh->init.disc_mode == ENABLE) {
-		if (hperh->init.cont_mode == ENABLE) {
-			SET_BIT(hperh->perh->CON0, ADC_CON0_NCHDCEN_MSK);
-			MODIFY_REG(hperh->perh->CON0, ADC_CON0_ETRGN_MSK, hperh->init.disc_nbr << ADC_CON0_ETRGN_POSS);
-			MODIFY_REG(hperh->perh->CHSL, ADC_CHSL_NSL_MSK, hperh->init.conv_nbr << ADC_CHSL_NSL_POSS);
-		}
-		else {
-			hperh->state 	  |= ADC_STATE_ERROR;
-			hperh->error_code |= ADC_ERROR_INTERNAL;
-			tmp_status 	   = ERROR;
-		}
-	}
-	else {
-		CLEAR_BIT(hperh->perh->CON0, ADC_CON0_NCHDCEN_MSK);
-	}
-
-	if (hperh->init.scan_mode == ADC_SCAN_ENABLE)
-		MODIFY_REG(hperh->perh->CHSL, ADC_CHSL_NSL_MSK, hperh->init.conv_nbr << ADC_CHSL_NSL_POSS);
-
-	if (hperh->init.cont_mode == ENABLE)
-		MODIFY_REG(hperh->perh->CHSL, ADC_CHSL_NSL_MSK, hperh->init.conv_nbr << ADC_CHSL_NSL_POSS);
-
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_GAINCALEN_MSK, DISABLE << ADC_CCR_GAINCALEN_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_OFFCALEN_MSK, DISABLE << ADC_CCR_OFFCALEN_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_DIFFEN_MSK, DISABLE << ADC_CCR_DIFFEN_POS);
-	/* if the ADC CLK less than 1MHZ,PWRMOD should be Enable*/
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_PWRMODSEL_MSK, DISABLE << ADC_CCR_PWRMODSEL_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_VRBUFEN_MSK, ENABLE << ADC_CCR_VRBUFEN_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_VCMBUFEN_MSK, ENABLE << ADC_CCR_VCMBUFEN_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_VREFEN_MSK, ENABLE << ADC_CCR_VREFEN_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_IREFEN_MSK, ENABLE << ADC_CCR_IREFEN_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_CKDIV_MSK, hperh->init.clk_div << ADC_CCR_CKDIV_POSS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_VRNSEL_MSK, hperh->init.neg_ref << ADC_CCR_VRNSEL_POS);
-	MODIFY_REG(hperh->perh->CCR, ADC_CCR_VRPSEL_MSK, hperh->init.pos_ref << ADC_CCR_VRPSEL_POSS);
-	MODIFY_REG(hperh->perh->CON1, ADC_CON1_NCHESEL_MSK, hperh->init.nche_mode << ADC_CON1_NCHESEL_POS);
-
-	if (hperh->nm_trig_mode != ADC_TRIG_SOFT)
-		pis_create(&hperh->reg_pis_handle);
-
-	if (tmp_status == OK) {
-		hperh->error_code = ADC_ERROR_NONE;
-		hperh->state 	 |= ADC_STATE_READY;
-		hperh->state 	 &= ~(ADC_STATE_ERROR | ADC_STATE_NM_BUSY
-				      | ADC_STATE_IST_BUSY | ADC_STATE_BUSY_INTERNAL);
-	}
-
-	adc_interrupt_config(hperh, ADC_IT_OVR, ENABLE);
-	return tmp_status;
-}
-
-/**
-  * @brief  Deinitialize the ADC peripheral registers to their default reset
-  *         values.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_reset(adc_handle_t *hperh)
-{
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	ADC_DISABLE(hperh);
-
-	adc_clear_flag_status(hperh, ADC_FLAG_AWD);
-	adc_clear_flag_status(hperh, ADC_FLAG_NH);
-	adc_clear_flag_status(hperh, ADC_FLAG_IH);
-	adc_clear_flag_status(hperh, ADC_FLAG_OVR);
-	adc_clear_flag_status(hperh, ADC_FLAG_NHS);
-	adc_clear_flag_status(hperh, ADC_FLAG_IHS);
-
-	WRITE_REG(hperh->perh->CON0, 0x0);
-	WRITE_REG(hperh->perh->CON1, 0x0);
-	WRITE_REG(hperh->perh->CCR, 0x0);
-	WRITE_REG(hperh->perh->WDTH, 0xFFF);
-	WRITE_REG(hperh->perh->WDTL, 0x0);
-	WRITE_REG(hperh->perh->ICHOFF[0], 0x0);
-	WRITE_REG(hperh->perh->ICHOFF[1], 0x0);
-	WRITE_REG(hperh->perh->ICHOFF[2], 0x0);
-	WRITE_REG(hperh->perh->ICHOFF[3], 0x0);
-	WRITE_REG(hperh->perh->ICHS, 0x0);
-	WRITE_REG(hperh->perh->NCHS1, 0x0);
-	WRITE_REG(hperh->perh->NCHS2, 0x0);
-	WRITE_REG(hperh->perh->NCHS3, 0x0);
-	WRITE_REG(hperh->perh->NCHS4, 0x0);
-	WRITE_REG(hperh->perh->SMPT1, 0x0);
-	WRITE_REG(hperh->perh->SMPT2, 0x0);
-	WRITE_REG(hperh->perh->CHSL, 0x0);
-
-	if (hperh->nm_trig_mode != ADC_TRIG_SOFT)
-		pis_destroy(&hperh->reg_pis_handle);
-
-	if (hperh->ist_trig_mode != ADC_TRIG_SOFT)
-		pis_destroy(&hperh->inj_pis_handle);
-
-	hperh->state      = ADC_STATE_RESET;
-	hperh->error_code = ADC_ERROR_NONE;
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup ADC_Public_Functions_Group2 IO operation functions
- *  @brief    Input and Output operation functions
- *  @{
- */
-
-/**
-  * @brief  Enables ADC, starts conversion of normal group.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_normal_start(adc_handle_t *hperh)
-{
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->nm_trig_mode));
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	ADC_ENABLE(hperh);
-	hperh->state &= ~(ADC_STATE_READY | ADC_STATE_NM_EOC);
-	hperh->state |= ADC_STATE_NM_BUSY;
-	__UNLOCK(hperh);
-	adc_clear_flag_status(hperh, ADC_FLAG_NH);
-
-	if (hperh->nm_trig_mode == ADC_TRIG_SOFT)
-		SET_BIT(hperh->perh->CON1, ADC_CON1_NCHTRG_MSK);
-
-	return OK;
-}
-
-/**
-  * @brief  Stop ADC conversion of normal group (and insert channels in
-  *         case of auto_injection mode), disable ADC peripheral.
-  * @note:  ADC peripheral disable is forcing stop of potential
-  *         conversion on insert group. If insert group is under use, it
-  *         should be preliminarily stopped using adc_insert_stop function.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_normal_stop(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->nm_trig_mode));
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-
-	ADC_DISABLE(hperh);
-	hperh->state &= ~(ADC_STATE_NM_BUSY | ADC_STATE_NM_EOC);
-	hperh->state |=  ADC_STATE_READY;
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Wait for normal group conversion to be completed.
-  * @note   This function cannot be used in a particular setup: ADC configured  in DMA mode.
-  *         In this case, DMA resets the flag EOC and polling cannot be performed on each conversion.
-  * @note   When use this function,you should be pay attention to the hperh->init.reocs_mode,
-  *         if it is ADC_REOCS_MODE_ALL, it means the function will wait all normal rank conversion  finished.
-  *         if it is ADC_REOCS_MODE_ONE, it means the funcion will wait every normal rank conversion finished.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  timeout: Timeout value in millisecond.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_normal_poll_for_conversion(adc_handle_t *hperh, uint32_t timeout)
-{
-	uint32_t tickstart = 0;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	tickstart = __get_tick();
-	while (!(READ_BIT(hperh->perh->STAT, ADC_STAT_NCHE_MSK))) {
-		if (timeout != ALD_MAX_DELAY ) {
-			if ((timeout == 0) || ((__get_tick() - tickstart) > timeout)) {
-				hperh->state |= ADC_STATE_TIMEOUT;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-
-	adc_clear_flag_status(hperh, ADC_FLAG_NHS);
-	adc_clear_flag_status(hperh, ADC_FLAG_NH);
-
-	hperh->state |= ADC_STATE_NM_EOC;
-
-	if ((hperh->nm_trig_mode == ADC_TRIG_SOFT)
-		       && (hperh->init.cont_mode == DISABLE)
-	               && (hperh->init.scan_mode == ADC_SCAN_DISABLE)) {
-		hperh->state &= ~ADC_STATE_NM_BUSY;
-
-		if ((hperh->state & ADC_STATE_IST_BUSY) == 0)
-			hperh->state |= ADC_STATE_READY;
-	}
-	return OK;
-}
-
-/**
-  * @brief  Poll for conversion event.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  event_type: the ADC event type.
-  *          This parameter can be one of the following values:
-  *            ADC_awd_event: ADC Analog watchdog event.
-  * @param  timeout: Timeout value in millisecond.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_poll_for_event(adc_handle_t *hperh, adc_event_type_t event_type, uint32_t timeout)
-{
-	uint32_t tickstart = 0;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_EVENT_TYPE(event_type));
-
-	tickstart = __get_tick();
-
-	while (adc_get_flag_status(hperh, (adc_flag_t)event_type) == RESET) {
-		if (timeout != ALD_MAX_DELAY ) {
-			if ((timeout == 0) || ((__get_tick() - tickstart) > timeout)) {
-				hperh->state |= ADC_STATE_TIMEOUT;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-
-	hperh->state |= ADC_STATE_AWD;
-	return OK;
-}
-
-/**
-  * @brief  Enables ADC, starts conversion of normal group with interruption.
-  *         Interruptions enabled in this function:
-  *          - REOC (end of conversion of normal group)
-  *         Each of these interruptions has its dedicated callback function.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_normal_start_by_it(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	ADC_ENABLE(hperh);
-	hperh->state 	 &= ~(ADC_STATE_READY | ADC_STATE_NM_EOC);
-	hperh->state 	 |= ADC_STATE_NM_BUSY;
-	hperh->error_code = ADC_ERROR_NONE;
-
-	if (READ_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK)) {
-		hperh->state &= ~(ADC_STATE_IST_EOC);
-		hperh->state |= ADC_STATE_IST_BUSY;
-	}
-
-	__UNLOCK(hperh);
-	adc_clear_flag_status(hperh, ADC_FLAG_NH);
-	adc_interrupt_config(hperh, ADC_IT_NH, ENABLE);
-
-	if (hperh->nm_trig_mode == ADC_TRIG_SOFT)
-		SET_BIT(hperh->perh->CON1, ADC_CON1_NCHTRG_MSK);
-
-	return OK;
-}
-
-/**
-  * @brief  Stop ADC conversion of normal group (and insert group in
-  *         case of auto_injection mode), disable interrution of
-  *         end-of-conversion, disable ADC peripheral.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_normal_stop_by_it(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	ADC_DISABLE(hperh);
-	adc_interrupt_config(hperh, ADC_IT_NH, DISABLE);
-	hperh->state |= ADC_STATE_READY;
-	hperh->state &= ~(ADC_STATE_NM_BUSY | ADC_STATE_IST_BUSY);
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Enables ADC, starts conversion of normal group and transfers result
-  *         through DMA.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  buf: The destination Buffer address.
-  * @param  size: The length of data to be transferred from ADC peripheral to memory.
-  * @param  channel: The DMA channel
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_start_by_dma(adc_handle_t *hperh, uint16_t *buf, uint16_t size, uint8_t channel)
-{
-	if ((hperh == NULL) || (buf == NULL) || (size == 0) || (channel > 5))
-		return ERROR;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	ADC_ENABLE(hperh);
-	hperh->state &= ~(ADC_STATE_READY | ADC_STATE_NM_EOC);
-	hperh->state |= ADC_STATE_NM_BUSY;
-
-	if (READ_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK)) {
-		hperh->state &= ~(ADC_STATE_IST_EOC);
-		hperh->state |= ADC_STATE_IST_BUSY;
-	}
-
-	if ((hperh->state & ADC_STATE_IST_BUSY) != 0) {
-		hperh->state      &= ~(ADC_STATE_ERROR);
-		hperh->error_code &= ~(ADC_ERROR_OVR | ADC_ERROR_DMA);
-	}
-	else {
-		hperh->state     &= ~(ADC_STATE_ERROR);
-		hperh->error_code = ADC_ERROR_NONE;
-	}
-	__UNLOCK(hperh);
-
-	if (hperh->hdma.perh == NULL)
-		hperh->hdma.perh = DMA0;
-
-	hperh->hdma.cplt_cbk = adc_dma_normal_conv_cplt;
-	hperh->hdma.cplt_arg = hperh;
-	hperh->hdma.err_cbk  = adc_dma_error;
-	hperh->hdma.err_arg  = hperh;
-
-	dma_config_struct(&hperh->hdma.config);
-	hperh->hdma.config.src        = (void *)&hperh->perh->NCHDR;
-	hperh->hdma.config.dst        = (void *)buf;
-	hperh->hdma.config.size       = size;
-	hperh->hdma.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	hperh->hdma.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdma.config.dst_inc    = DMA_DATA_INC_HALFWORD;
-	hperh->hdma.config.msel       = DMA_MSEL_ADC0;
-	hperh->hdma.config.msigsel    = DMA_MSIGSEL_ADC;
-	hperh->hdma.config.channel    = channel;
-	dma_config_basic(&hperh->hdma);
-
-	hperh->hpis.init.producer_src  = PIS_ADC1_REGULAT;
-	hperh->hpis.init.producer_clk  = PIS_CLK_PCLK2;
-	hperh->hpis.init.producer_edge = PIS_EDGE_NONE;
-	hperh->hpis.init.consumer_trig = PIS_CH7_DAC_CH0;
-	hperh->hpis.init.consumer_clk  = PIS_CLK_PCLK1;
- 	pis_create(&hperh->hpis);
-
-	if (hperh->nm_trig_mode == ADC_TRIG_SOFT)
-		SET_BIT(hperh->perh->CON1, ADC_CON1_NCHTRG_MSK);
-
-	return OK;
-}
-
-/**
-  * @brief  Stop ADC conversion of normal group (and insert group in
-  *         case of auto_insert mode), disable ADC DMA transfer, disable
-  *         ADC peripheral.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_stop_dma(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	__LOCK(hperh);
-
-	ADC_DISABLE(hperh);
-	pis_destroy(&hperh->hpis);
-	hperh->state &= ~(ADC_STATE_NM_BUSY | ADC_STATE_IST_BUSY);
-	hperh->state |= ADC_STATE_READY;
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  DMA transfer complete callback.
-  * @param  arg: argument of the call back.
-  * @retval None
-  */
-static void adc_dma_timer_trigger_cplt(void *arg)
-{
-	adc_timer_config_t *hperh = (adc_timer_config_t *)arg;
-
-	ADC_DISABLE(&hperh->lh_adc);
-	timer_base_stop(&hperh->lh_timer);
-	
-	__UNLOCK(hperh);
-	if (hperh->lh_adc.adc_reg_cplt_cbk != NULL)
-		hperh->lh_adc.adc_reg_cplt_cbk(&hperh->lh_adc);
-
-}
-
-
-/**
-  * @brief  Config Timer trigger adc function
-  * @param  config: Pointer to a adc_timer_config_t structure that
-  *         contains the configuration information for the specified function.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_timer_trigger_adc_by_dma(adc_timer_config_t *config)
-{
-	__LOCK(config);
-
-	config->lh_pis.perh               = PIS;
-	config->lh_pis.init.producer_clk  = PIS_CLK_PCLK1;
-	config->lh_pis.init.producer_edge = PIS_EDGE_NONE;
-	config->lh_pis.init.consumer_clk  = PIS_CLK_PCLK1;
-	
-	if (config->p_timer == TIMER0)
-		config->lh_pis.init.producer_src  = PIS_TIMER0_UPDATA;
-	else if (config->p_timer == TIMER1)
-		config->lh_pis.init.producer_src  = PIS_TIMER1_UPDATA;
-	else if (config->p_timer == TIMER2)
-		config->lh_pis.init.producer_src  = PIS_TIMER2_UPDATA;
-	else if (config->p_timer == TIMER3)
-		config->lh_pis.init.producer_src  = PIS_TIMER3_UPDATA;
-	else
-		return ERROR;
-	
-	if (config->p_adc == ADC0)
-		config->lh_pis.init.consumer_trig = PIS_CH6_ADC0_NORMAL;
-	else if (config->p_adc == ADC1)
-		config->lh_pis.init.consumer_trig = PIS_CH0_ADC1_NORMAL;
-	else
-		return ERROR;
-
-	pis_create(&config->lh_pis);
-	
-	/* Initialize TIMER0 */
-	config->lh_timer.perh           = config->p_timer;
-	config->lh_timer.init.prescaler = 0;
-	config->lh_timer.init.mode      = TIMER_CNT_MODE_UP;
-	config->lh_timer.init.period    = ((cmu_get_pclk1_clock() / 1000000) * config->time);
-	config->lh_timer.init.clk_div   = TIMER_CLOCK_DIV1;
-	config->lh_timer.init.re_cnt    = 0;
-	timer_base_init(&config->lh_timer);
-
-	config->lh_adc.perh               = config->p_adc;
-	config->lh_adc.init.data_align    = ADC_DATAALIGN_RIGHT;
-	config->lh_adc.init.scan_mode     = ADC_SCAN_DISABLE;
-	config->lh_adc.init.cont_mode     = DISABLE;
-	config->lh_adc.init.conv_nbr      = ADC_NM_NBR_1;
-	config->lh_adc.init.disc_mode     = DISABLE;
-	config->lh_adc.init.disc_nbr      = ADC_DISC_NBR_1;
-	config->lh_adc.init.conv_res      = ADC_CONV_RES_12;
-	config->lh_adc.init.clk_div       = ADC_CKDIV_16;
-	config->lh_adc.init.nche_mode     = ADC_NCHESEL_MODE_ONE;
-	config->lh_adc.init.neg_ref       = config->n_ref;
-	config->lh_adc.init.pos_ref       = config->p_ref;
-	config->lh_adc.adc_reg_cplt_cbk   = config->adc_cplt_cbk;
-	config->lh_adc.adc_inj_cplt_cbk   = NULL;
-	config->lh_adc.adc_out_of_win_cbk = NULL;
-	config->lh_adc.adc_error_cbk      = NULL;
-	config->lh_adc.adc_ovr_cbk        = NULL;
-	adc_init(&config->lh_adc);
-
-	config->lnm_config.channel       = config->adc_ch;
-	config->lnm_config.rank          = ADC_NC_RANK_1;
-	config->lnm_config.sampling_time = ADC_SAMPLETIME_1;
- 	adc_normal_channel_config(&config->lh_adc, &config->lnm_config);
-	
-	config->lh_dma.cplt_cbk = adc_dma_timer_trigger_cplt;
-	config->lh_dma.cplt_arg = config;
-	config->lh_dma.err_cbk  = adc_dma_error;
-	config->lh_dma.err_arg  = &config->lh_adc;
-
-	dma_config_struct(&config->lh_dma.config);
-	config->lh_dma.perh              = DMA0;
-	config->lh_dma.config.src        = (void *)&config->lh_adc.perh->NCHDR;
-	config->lh_dma.config.dst        = (void *)config->buf;
-	config->lh_dma.config.size       = config->size;
-	config->lh_dma.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	config->lh_dma.config.src_inc    = DMA_DATA_INC_NONE;
-	config->lh_dma.config.dst_inc    = DMA_DATA_INC_HALFWORD;
-	config->lh_dma.config.msel       = config->p_adc == ADC0? DMA_MSEL_ADC0 : DMA_MSEL_ADC1;
-	config->lh_dma.config.msigsel    = DMA_MSIGSEL_ADC;
-	config->lh_dma.config.channel    = config->dma_ch;
-	dma_config_basic(&config->lh_dma);
-	
-	ADC_ENABLE(&config->lh_adc);
-	timer_base_start(&config->lh_timer);
-
-	return OK;
-}
-#endif
-
-/**
-  * @brief  Get ADC normal group conversion result.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval ADC group normal conversion data
-  */
-uint32_t adc_normal_get_value(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-
-	hperh->state &= ~ADC_STATE_NM_EOC;
-	return hperh->perh->NCHDR;
-}
-
-/**
-  * @brief  Enables ADC, starts conversion of insert group.
-  *         Interruptions enabled in this function: None.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_insert_start(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->ist_trig_mode));
-
-	__LOCK(hperh);
-	ADC_ENABLE(hperh);
-	hperh->state &= ~(ADC_STATE_READY | ADC_STATE_IST_EOC);
-	hperh->state |= ADC_STATE_IST_BUSY;
-
-	if ((hperh->state & ADC_STATE_NM_BUSY) == 0)
-		hperh->error_code = ADC_ERROR_NONE;
-
-	__UNLOCK(hperh);
-	adc_clear_flag_status(hperh, ADC_FLAG_IH);
-
-	if (!(READ_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK))) {
-		if (hperh->ist_trig_mode == ADC_TRIG_SOFT)
-			SET_BIT(hperh->perh->CON1, ADC_CON1_ICHTRG_MSK);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Stop conversion of insert channels. Disable ADC peripheral if
-  *         no normal conversion is on going.
-  * @note   If ADC must be disabled and if conversion is on going on
-  *         normal group, function adc_normal_stop must be used to stop both
-  *         insert and normal groups, and disable the ADC.
-  * @note   If insert group mode auto-injection is enabled,
-  *         function adc_normal_stop must be used.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_insert_stop(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->ist_trig_mode));
-
-	__LOCK(hperh);
-
-	if (((hperh->state & ADC_STATE_NM_BUSY) == 0)
-				&& (!(READ_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK)))) {
-		ADC_DISABLE(hperh);
-		hperh->state &= ~(ADC_STATE_NM_BUSY | ADC_STATE_IST_BUSY | ADC_STATE_IST_EOC);
-		hperh->state |= ADC_STATE_READY;
-	}
-	else {
-		hperh->state |= ADC_STATE_ERROR;
-		__UNLOCK(hperh);
-		return ERROR;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Wait for insert group conversion to be completed.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  timeout: Timeout value in millisecond.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_insert_poll_for_conversion(adc_handle_t *hperh, uint32_t timeout)
-{
-	uint32_t tickstart;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->ist_trig_mode));
-
-	tickstart = __get_tick();
-
-	while (!(READ_BIT(hperh->perh->STAT, ADC_STAT_ICHE_MSK))) {
-		if (timeout != ALD_MAX_DELAY) {
-			if ((timeout == 0) || ((__get_tick() - tickstart) > timeout)) {
-				hperh->state |= ADC_STATE_TIMEOUT;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-
-	adc_clear_flag_status(hperh, ADC_FLAG_IHS);
-	adc_clear_flag_status(hperh, ADC_FLAG_IH);
-	adc_clear_flag_status(hperh, ADC_FLAG_NH);
-
-	hperh->state |= ADC_STATE_IST_EOC;
-
-	if (hperh->ist_trig_mode == ADC_TRIG_SOFT ) {
-		hperh->state &= ~(ADC_STATE_IST_BUSY);
-		if ((hperh->state & ADC_STATE_NM_BUSY) == 0)
-			hperh->state |= ADC_STATE_READY;
-	}
-
-	hperh->state &= ~(ADC_STATE_TIMEOUT);
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Enables ADC, starts conversion of insert group with interruption.
-  *          - JEOC (end of conversion of insert group)
-  *         Each of these interruptions has its dedicated callback function.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval Status, see @ref ald_status_t..
-  */
-ald_status_t adc_insert_start_by_it(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->ist_trig_mode));
-
-	__LOCK(hperh);
-	ADC_ENABLE(hperh);
-	hperh->state &= ~(ADC_STATE_READY | ADC_STATE_IST_EOC);
-	hperh->state |= ADC_STATE_IST_BUSY;
-
-	if ((hperh->state & ADC_STATE_NM_BUSY) == 0)
-		hperh->error_code = ADC_ERROR_NONE;
-
-	__UNLOCK(hperh);
-	adc_clear_flag_status(hperh, ADC_FLAG_IH);
-	adc_interrupt_config(hperh, ADC_IT_IH, ENABLE);
-
-	if (!(READ_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK))) {
-		if (hperh->ist_trig_mode == ADC_TRIG_SOFT)
-			SET_BIT(hperh->perh->CON1, ADC_CON1_ICHTRG_MSK);
-	}
-	return OK;
-}
-
-/**
-  * @brief  Stop conversion of insert channels, disable interruption of
-  *         end-of-conversion. Disable ADC peripheral if no normal conversion
-  *         is on going.
-  * @note   If ADC must be disabled and if conversion is on going on
-  *         normal group, function adc_normal_stop must be used to stop both
-  *         insert and normal groups, and disable the ADC.
-  * @note   If insert group mode auto-injection is enabled,
-  *         function adc_normal_stop must be used.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval None
-  */
-ald_status_t adc_insert_stop_by_it(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->ist_trig_mode));
-
-	__LOCK(hperh);
-
-	if (((hperh->state & ADC_STATE_NM_BUSY) == 0)
-				&& (!(READ_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK)))) {
-		ADC_DISABLE(hperh);
-		adc_interrupt_config(hperh, ADC_IT_IH, DISABLE);
-		hperh->state &= ~(ADC_STATE_NM_BUSY | ADC_STATE_IST_BUSY);
-		hperh->state |= ADC_STATE_READY;
-	}
-	else {
-		adc_interrupt_config(hperh, ADC_IT_IH, DISABLE);
-		hperh->state |= ADC_STATE_ERROR;
-		__UNLOCK(hperh);
-		return ERROR;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Get ADC insert group conversion result.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  ih_rank: the converted ADC insert rank.
-  *          This parameter can be one of the following values:
-  *            @arg ADC_INJ_RANK_1: insert Channel1 selected
-  *            @arg ADC_INJ_RANK_2: insert Channel2 selected
-  *            @arg ADC_INJ_RANK_3: insert Channel3 selected
-  *            @arg ADC_INJ_RANK_4: insert Channel4 selected
-  * @retval ADC group insert conversion data
-  */
-uint32_t adc_insert_get_value(adc_handle_t *hperh, adc_ih_rank_t ih_rank)
-{
-	uint32_t tmp;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_IH_RANK_TYPE(ih_rank));
-
-	switch (ih_rank) {
-	case ADC_IH_RANK_1:
-		tmp = hperh->perh->ICHDR[0];
-		break;
-	case ADC_IH_RANK_2:
-		tmp = hperh->perh->ICHDR[1];
-		break;
-	case ADC_IH_RANK_3:
-		tmp = hperh->perh->ICHDR[2];
-		break;
-	case ADC_IH_RANK_4:
-		tmp = hperh->perh->ICHDR[3];
-		break;
-	default:
-		break;
-	}
-
-	return tmp;
-}
-
-/**
-  * @brief  Handles ADC interrupt request
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval None
-  */
-void adc_irq_handler(adc_handle_t *hperh)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->ist_trig_mode));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->nm_trig_mode));
-
-	if (adc_get_it_status(hperh, ADC_IT_NH) && adc_get_flag_status(hperh, ADC_FLAG_NH)) {
-		if ((hperh->state & ADC_STATE_ERROR) == 0)
-			hperh->state |= ADC_STATE_NM_EOC;
-
-		if ((hperh->nm_trig_mode == ADC_TRIG_SOFT)
-			         && (hperh->init.cont_mode == DISABLE)) {
-			adc_interrupt_config(hperh, ADC_IT_NH, DISABLE);
-			hperh->state &= ~(ADC_STATE_NM_BUSY);
-
-			if ((hperh->state & ADC_STATE_IST_BUSY) == 0)
-				hperh->state |= ADC_STATE_READY;
-		}
-
-		if (hperh->adc_reg_cplt_cbk != NULL)
-			hperh->adc_reg_cplt_cbk(hperh);
-
-		adc_clear_flag_status(hperh, ADC_FLAG_NHS);
-		adc_clear_flag_status(hperh, ADC_FLAG_NH);
-	}
-
-	if (adc_get_it_status(hperh, ADC_IT_IH) && adc_get_flag_status(hperh, ADC_FLAG_IH)) {
-		if ((hperh->state & ADC_STATE_ERROR) == 0)
-			hperh->state |= ADC_STATE_IST_EOC;
-
-		if ((hperh->ist_trig_mode == ADC_TRIG_SOFT)
-			   || ((!(READ_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK)))
-		           && (hperh->nm_trig_mode == ADC_TRIG_SOFT)
-			   && (hperh->init.cont_mode == DISABLE))) {
-			adc_interrupt_config(hperh, ADC_IT_IH, DISABLE);
-			hperh->state &= ~(ADC_STATE_IST_BUSY);
-
-			if ((hperh->state & ADC_STATE_NM_BUSY) == 0)
-				hperh->state |= ADC_STATE_READY;
-		}
-		if (hperh->adc_inj_cplt_cbk != NULL)
-			hperh->adc_inj_cplt_cbk(hperh);
-
-		adc_clear_flag_status(hperh, ADC_FLAG_IHS);
-		adc_clear_flag_status(hperh, ADC_FLAG_IH);
-	}
-
-	if (adc_get_it_status(hperh, ADC_IT_AWD) && adc_get_flag_status(hperh, ADC_FLAG_AWD)) {
-		hperh->state |= ADC_STATE_AWD;
-
-		if (hperh->adc_out_of_win_cbk != NULL)
-			hperh->adc_out_of_win_cbk(hperh);
-
-		adc_clear_flag_status(hperh, ADC_FLAG_AWD);
-	}
-
-	if (adc_get_it_status(hperh, ADC_IT_OVR) && adc_get_flag_status(hperh, ADC_FLAG_OVR)) {
-		adc_clear_flag_status(hperh, ADC_FLAG_OVR);
-		hperh->error_code |= ADC_ERROR_OVR;
-		hperh->state      |= ADC_STATE_ERROR;
-
-		if (hperh->adc_ovr_cbk != NULL)
-			hperh->adc_ovr_cbk(hperh);
-	}
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup ADC_Public_Functions_Group3 Peripheral Control functions
- *  @brief    Peripheral Control functions
- *  @{
- */
-
-/**
-  * @brief  Configures the the selected channel to be linked to the normal
-  *         group.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  config: Structure of ADC channel for normal group.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_normal_channel_config(adc_handle_t *hperh, adc_channel_conf_t *config)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_CHANNELS_TYPE(config->channel));
-	assert_param(IS_ADC_NC_RANK_TYPE(config->rank));
-	assert_param(IS_ADC_SAMPLING_TIMES_TYPE(config->sampling_time));
-
-	__LOCK(hperh);
-
-	if (config->rank <= ADC_NC_RANK_4 ) {
-		hperh->perh->NCHS1 &= ~(0x1f <<  ((config->rank - 1) << 3));
-		hperh->perh->NCHS1 |= (config->channel << ((config->rank - 1) << 3));
-	}
-	else if (config->rank <= ADC_NC_RANK_8) {
-		hperh->perh->NCHS2 &= ~(0x1f <<  ((config->rank - 5) << 3));
-		hperh->perh->NCHS2 |= (config->channel << ((config->rank - 5) << 3));
-	}
-	else if (config->rank <= ADC_NC_RANK_12) {
-		hperh->perh->NCHS3 &= ~(0x1f <<  ((config->rank - 9) << 3));
-		hperh->perh->NCHS3 |= (config->channel << ((config->rank - 9) << 3));
-	}
-	else {
-		hperh->perh->NCHS4 &= ~(0x1f <<  ((config->rank - 13) << 3));
-		hperh->perh->NCHS4 |= (config->channel << ((config->rank - 13) << 3));
-	}
-
-	if (config->channel <= 15) {
-		hperh->perh->SMPT1 &=  ~(0x03 << (config->channel << 1));
-		hperh->perh->SMPT1 |= config->sampling_time << (config->channel << 1);
-	}
-	else {
-		hperh->perh->SMPT2 &=  ~(0x03 << ((config->channel - 16) << 1));
-		hperh->perh->SMPT2 |= config->sampling_time << ((config->channel - 16) << 1);
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Configures the the selected channel to be linked to the insert
-  *         group.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  config: Structure of ADC channel for insert group.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t adc_insert_channel_config(adc_handle_t *hperh, adc_ih_conf_t *config)
-{
-	uint8_t tmp1, tmp2;
-	ald_status_t tmp_status = OK;
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_CHANNELS_TYPE(config->channel));
-	assert_param(IS_ADC_IH_RANK_TYPE(config->rank));
-	assert_param(IS_ADC_SAMPLING_TIMES_TYPE(config->samp_time));
-	assert_param(IS_ADC_IST_OFFSET_TYPE(config->offset));
-	assert_param(IS_ADC_NBR_OF_IST_TYPE(config->nbr));
-	assert_param(IS_FUNC_STATE(config->disc_mode));
-	assert_param(IS_FUNC_STATE(config->auto_inj));
-	assert_param(IS_ADC_TRIG_MODE_TYPE(hperh->ist_trig_mode));
-
-	__LOCK(hperh);
-
-	if (hperh->init.scan_mode == ADC_SCAN_DISABLE) {
-		switch (config->rank) {
-		case ADC_IH_RANK_1:
-			MODIFY_REG(hperh->perh->ICHS, ADC_ICHS_IS1_MSK, config->channel << ADC_ICHS_IS1_POSS);
-			break;
-		case ADC_IH_RANK_2:
-			MODIFY_REG(hperh->perh->ICHS, ADC_ICHS_IS2_MSK, config->channel << ADC_ICHS_IS1_POSS);
-			break;
-		case ADC_IH_RANK_3:
-			MODIFY_REG(hperh->perh->ICHS, ADC_ICHS_IS3_MSK, config->channel << ADC_ICHS_IS1_POSS);
-			break;
-		case ADC_IH_RANK_4:
-			MODIFY_REG(hperh->perh->ICHS, ADC_ICHS_IS4_MSK, config->channel << ADC_ICHS_IS1_POSS);
-			break;
-		default:
-			hperh->state      |= ADC_STATE_ERROR;
-			hperh->error_code |= ADC_ERROR_INTERNAL;
-			tmp_status         = ERROR;
-			break;
-		}
-	}
-	else {
-		MODIFY_REG(hperh->perh->CHSL, ADC_CHSL_ISL_MSK, config->nbr << ADC_CHSL_ISL_POSS);
-		tmp1 = config->rank ;
-		tmp2 = config->nbr;
-
-		if (tmp1 <= tmp2) {
-			hperh->perh->ICHS &= ~(0x1f << ((tmp1 - 1) << 3));
-			hperh->perh->ICHS |= config->channel
-			                                  << ((tmp1 - 1) << 3);
-		}
-		else {
-			hperh->perh->ICHS &= ~(0x1f << ((tmp1 - 1) << 3));
-		}
-	}
-
-	if (config->auto_inj == ENABLE) {
-		if (hperh->ist_trig_mode == ADC_TRIG_SOFT) {
-			SET_BIT(hperh->perh->CON0, ADC_CON0_IAUTO_MSK);
-		}
-		else {
-			hperh->state      |= ADC_STATE_ERROR;
-			hperh->error_code |= ADC_ERROR_INTERNAL;
-			tmp_status         = ERROR;
-		}
-	}
-
-	if (config->disc_mode == ENABLE) {
-		if (config->auto_inj == DISABLE) {
-			MODIFY_REG(hperh->perh->CHSL, ADC_CHSL_ISL_MSK, config->nbr << ADC_CHSL_ISL_POSS);
-			SET_BIT(hperh->perh->CON0, ADC_CON0_ICHDCEN_MSK);
-		}
-		else {
-			hperh->state      |= ADC_STATE_ERROR;
-			hperh->error_code |= ADC_ERROR_INTERNAL;
-			tmp_status         = ERROR;
-		}
-	}
-
-	if (config->channel <= 15) {
-		hperh->perh->SMPT1 &=  ~(0x03 << (config->channel << 1));
-		hperh->perh->SMPT1 |= config->samp_time << (config->channel << 1);
-	}
-	else {
-		hperh->perh->SMPT2 &=  ~(0x03 << ((config->channel - 16) << 1));
-		hperh->perh->SMPT2 |= config->samp_time << ((config->channel - 16) << 1);
-	}
-
-	switch (config->rank) {
-	case ADC_IH_RANK_1:
-		hperh->perh->ICHOFF[0] = config->offset;
-		break;
-	case ADC_IH_RANK_2:
-		hperh->perh->ICHOFF[1] = config->offset;
-		break;
-	case ADC_IH_RANK_3:
-		hperh->perh->ICHOFF[2] = config->offset;
-		break;
-	case ADC_IH_RANK_4:
-		hperh->perh->ICHOFF[3] = config->offset;
-		break;
-	default:
-		break;
-	}
-
-	if (hperh->ist_trig_mode != ADC_TRIG_SOFT)
-		pis_create(&hperh->inj_pis_handle);
-
-	__UNLOCK(hperh);
-	return tmp_status;
-}
-
-/**
-  * @brief  Configures the analog watchdog.
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @param  config: Structure of ADC analog watchdog configuration
-  * @retval ALD status
-  */
-ald_status_t adc_analog_wdg_config(adc_handle_t *hperh, adc_analog_wdg_conf_t *config)
-{
-
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_ANALOG_WTD_MODE_TYPE(config->watchdog_mode));
-	assert_param(IS_FUNC_STATE(config->it_mode));
-	assert_param(IS_HTR_TYPE(config->high_threshold));
-	assert_param(IS_LTR_TYPE(config->low_threshold));
-
-	__LOCK(hperh);
-
-	if ((config->watchdog_mode == ADC_ANAWTD_SING_NM)
-		|| (config->watchdog_mode == ADC_ANAWTD_SING_IST)
-	        || (config->watchdog_mode == ADC_ANAWTD_SING_NMIST))
-		assert_param(IS_ADC_CHANNELS_TYPE(config->channel));
-
-	if (config->it_mode == DISABLE)
-		adc_interrupt_config(hperh, ADC_IT_AWD, DISABLE);
-	else
-		adc_interrupt_config(hperh, ADC_IT_AWD, ENABLE);
-
-	CLEAR_BIT(hperh->perh->CON0, ADC_CON0_ICHWDTEN_MSK);
-	CLEAR_BIT(hperh->perh->CON0, ADC_CON0_NCHWDEN_MSK);
-	CLEAR_BIT(hperh->perh->CON0, ADC_CON0_AWDSGL_MSK);
-	hperh->perh->CON0 |= config->watchdog_mode;
-
-	if (READ_BIT(hperh->perh->CON0, ADC_CON0_AWDSGL_MSK))
-		MODIFY_REG(hperh->perh->CON0, ADC_CON0_AWDCH_MSK, config->channel << ADC_CON0_AWDCH_POSS);
-
-	WRITE_REG(hperh->perh->WDTL, config->low_threshold);
-	WRITE_REG(hperh->perh->WDTH, config->high_threshold);
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Enables or disables the specified ADC interrupts.
-  * @param  hperh: Pointer to a adc_handle_t structure.
-  * @param  it: Specifies the ADC interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref adc_it_t.
-  * @param  state: New status
-  *           - ENABLE
-  *           - DISABLE
-  * @retval None
-  */
-void adc_interrupt_config(adc_handle_t *hperh, adc_it_t it, type_func_t state)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_IT_TYPE(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		SET_BIT(hperh->perh->CON0, it);
-	else
-		CLEAR_BIT(hperh->perh->CON0, it);
-
-	return;
-}
-
-/**
-  * @brief  Checks whether the specified ADC interrupt has occurred or not.
-  * @param  hperh: Pointer to a adc_handle_t structure.
-  * @param  it: Specifies the ADC interrupt source to check.
-  *         This parameter can be one of the @ref adc_it_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-it_status_t adc_get_it_status(adc_handle_t *hperh, adc_it_t it)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_IT_TYPE(it));
-
-	if (READ_BIT(hperh->perh->CON0, it))
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Check whether the specified ADC flag is set or not.
-  * @param  hperh: Pointer to a adc_handle_t structure.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref adc_flag_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-flag_status_t adc_get_flag_status(adc_handle_t *hperh, adc_flag_t flag)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_FLAGS_TYPE(flag));
-
-	if (READ_BIT(hperh->perh->STAT, flag))
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Clear the specified ADC pending flags.
-  * @param  hperh: Pointer to a adc_handle_t structure.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref adc_flag_t.
-  * @retval None
-  */
-void adc_clear_flag_status(adc_handle_t *hperh, adc_flag_t flag)
-{
-	assert_param(IS_ADC_TYPE(hperh->perh));
-	assert_param(IS_ADC_FLAGS_TYPE(flag));
-
-	WRITE_REG(hperh->perh->CLR, flag);
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup ADC_Public_Functions_Group4 Peripheral State functions
- *  @brief    Peripheral State functions
- *  @{
- */
-
-/**
-  * @brief  return the ADC state
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval state
-  */
-uint32_t adc_get_state(adc_handle_t *hperh)
-{
-	return hperh->state;
-}
-
-/**
-  * @brief  Return the ADC error code
-  * @param  hperh: Pointer to a adc_handle_t structure that contains
-  *         the configuration information for the specified ADC module.
-  * @retval ADC Error Code
-  */
-uint32_t adc_get_error(adc_handle_t *hperh)
-{
-	return hperh->error_code;
-}
-
-/**
-  *@}
-  */
-
-/**
-  *@}
-  */
-
-/** @defgroup ADC_Private_Functions ADC Private Functions
-  * @{
-  */
-
-#ifdef ALD_DMA
-/**
-  * @brief  DMA transfer complete callback.
-  * @param  arg: argument of the call back.
-  * @retval None
-  */
-static void adc_dma_normal_conv_cplt(void *arg)
-{
-	adc_handle_t *hperh = (adc_handle_t *)arg;
-
-	if (hperh->adc_reg_cplt_cbk != NULL)
-		hperh->adc_reg_cplt_cbk(hperh);
-
-}
-
-/**
-  * @brief  DMA error callback
-  * @param  arg: argument of the call back.
-  * @retval None
-  */
-static void adc_dma_error(void *arg)
-{
-	adc_handle_t *hperh = (adc_handle_t *)arg;
-	hperh->state       |= ADC_STATE_ERROR;
-	hperh->error_code  |= ADC_ERROR_DMA;
-
-	if (hperh->adc_error_cbk != NULL)
-		hperh->adc_error_cbk(hperh);
-}
-#endif
-/**
-  *@}
-  */
-
-#endif /* ALD_ADC */
-
-/**
-  *@}
-  */
-
-/**
-  *@}
-  */

+ 0 - 1065
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_cmu.c

@@ -1,1065 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_cmu.c
-  * @brief   CMU module driver.
-  *
-  * @version V1.0
-  * @date    22 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  * @verbatim
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-    [..]
-     *** System clock configure ***
-     =================================
-     [..]
-       (+) If you don't change system clock, you can using cmu_clock_config_default() API.
-           It will select HRC as system clock. The system clock is 24MHz.
-       (+) If you want to change system clock, you can using cmu_clock_config() API.
-           You can select one of the following as system clock:
-             @ref CMU_CLOCK_HRC   2MHz or 24MHz
-             @ref CMU_CLOCK_LRC   32768Hz
-             @ref CMU_CLOCK_LOSC  32768Hz
-             @ref CMU_CLOCK_PLL1  32MHz, 48MHz or (32768*1024)Hz
-             @ref CMU_CLOCK_HOSC  1MHz -- 24MHz
-       (+) If you select CMU_CLOCK_PLL1 as system clock, it must config the PLL1
-           using cmu_pll1_config() API. The input of clock must be 4MHz or PLL2.
-       (+) If you get current clock, you can using cmu_get_clock() API.
-
-     *** BUS division control ***
-     ===================================
-
-     PLCK            sys_clk                     hclk1
-     -------DIV_SYS-----------+------DIV_AHB1------------Peripheral(GPIO, CRC, ... etc.)
-                              |
-                              |                  pclk1
-                              +------DIV_APB1------------Peripheral(TIM, UART, ... etc.)
-                              |
-                              |                  pclk2
-                              +------DIV_APB2------------Peripheral(ADC, WWDT, ... etc.)
-
-     [..]
-       (+) Configure the division using cmu_div_config() API.
-       (+) Get sys_clk using cmu_get_sys_clock() API.
-       (+) Get hclk1 using cmu_get_hclk1_clock() API.
-       (+) Get pclk1 using cmu_get_pclk1_clock() API.
-       (+) Get pclk2 using cmu_get_pclk2_clock() API.
-
-     *** Clock safe configure ***
-     ===================================
-     [..]
-       (+) If you select CMU_CLOCK_HOSC as system clock, you need enable
-           clock safe using cmu_hosc_safe_config() API. It will change
-           CMU_CLOCK_HRC as system clock, when the outer crystal stoped.
-       (+) If you select CMU_CLOCK_LOSC as system clock, you need enable
-           clock safe using cmu_losc_safe_config() API. It will change
-           CMU_CLOCK_LRC as system clock, when the outer crystal stoped.
-       (+) If you select CMU_CLOCK_PLL1 as system clock, you need enable
-           clock safe using cmu_pll_safe_config() API. It will change
-           CMU_CLOCK_HRC as system clock, when the pll1 is lose.
-       (+) The cmu_irq_cbk() will be invoked, when CMU interrupt has
-           been occurred. You can overwrite this function in application.
-
-     *** Clock output configure ***
-     ===================================
-     [..]
-       (+) Output high-speed clock using cmu_output_high_clock_config() API.
-       (+) Output low-speed clock using cmu_output_low_clock_config() API.
-
-     *** Peripheral clock configure ***
-     ===================================
-     [..]
-       (+) Configure buzz clock using cmu_buzz_config() API.
-       (+) Selected lptim0 clock using cmu_lptim0_clock_select() API.
-       (+) Selected lpuart clock using cmu_lpuart0_clock_select() API.
-       (+) Selected lcd clock using cmu_lcd_clock_select() API.
-       (+) Enable/Disable peripheral clock using cmu_perh_clock_config() API.
-
-     *** CMU ALD driver macros list ***
-     =============================================
-     [..]
-       Below the list of most used macros in CMU driver.
-
-      (+) CMU_LOSC_ENABLE():     Enable outer low crystal(32768Hz).
-      (+) CMU_LOSC_DISABLE():    Disable outer low crystal(32768Hz).
-      (+) CMU_LRC_ENABLE():      Enable LRC(32768Hz).
-      (+) CMU_LRC_DISABLE():     Disable LRC(32768Hz).
-      (+) CMU_ULRC_ENABLE():     Enable ULRC(10KHz).
-      (+) CMU_ULRC_DISABLE():    Disable ULRC(10KHz).
-      (+) CMU_LP_LRC_ENABLE():   Enable low power LRC(32768Hz).
-      (+) CMU_LP_LRC_DISABLE():  Disable low power LRC(32768Hz).
-      (+) CMU_LP_LOSC_ENABLE():  Enable low power LOSC(32768Hz).
-      (+) CMU_LP_LOSC_DISABLE(): Disable low power LOSC(32768Hz).
-      (+) CMU_LP_HRC_ENABLE():   Enable low power HRC(2MHz or 24MHz).
-      (+) CMU_LP_HRC_DISABLE():  Disable low power HRC(2MHz OR 24MHz).
-      (+) CMU_LP_HOSC_ENABLE():  Enable low power HOSC(1MHz -- 24MHz).
-      (+) CMU_LP_HOSC_DISABLE(): Disable low power HOSC(1MHz -- 24MHz).
-
-     [..]
-      (@) You can refer to the CMU driver header file for used the macros
-
-  @endverbatim
-  ******************************************************************************
-  */
-
-#include "ald_cmu.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup CMU CMU
-  * @brief CMU module driver
-  * @{
-  */
-
-/**
-  * @defgroup CMU_Private_Variables CMU Private Variables
-  * @{
-  */
-uint32_t __system_clock  = 24000000;
-/**
-  * @}
-  */
-
-/** @defgroup CMU_Private_Functions CMU Private Functions
-  * @{
-  */
-
-/**
-  * @brief  Update the current system clock. This function
-  *         will be invoked, when system clock has changed.
-  * @param  clock: The new clock.
-  * @retval None
-  */
-
-static void cmu_clock_update(uint32_t clock)
-{
-	__system_clock = clock;
-
-	if (clock > 1000000)
-		__init_tick(TICK_INT_PRIORITY);
-
-	return;
-}
-
-/**
-  * @brief  CMU module interrupt handler
-  * @retval None
-  */
-void CMU_Handler(void)
-{
-	/* HOSC stop */
-	if (READ_BIT(CMU->HOSMCR, CMU_HOSMCR_STPIF_MSK) && READ_BIT(CMU->HOSMCR, CMU_HOSMCR_STPIE_MSK)) {
-		SYSCFG_UNLOCK();
-		SET_BIT(CMU->HOSMCR, CMU_HOSMCR_STPIF_MSK);
-		SYSCFG_LOCK();
-
-		if ((READ_BIT(CMU->HOSMCR, CMU_HOSMCR_CLKS_MSK))
-				&& ((READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) == 1)
-				|| ((READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) == 5))))
-			cmu_clock_update(READ_BIT(CMU->CFGR, CMU_CFGR_HRCFST_MSK) ? 2000000 : 24000000);
-		cmu_irq_cbk(CMU_HOSC_STOP);
-	}
-	
-	/* HOSC start */
-	if (READ_BIT(CMU->HOSMCR, CMU_HOSMCR_STRIF_MSK) && READ_BIT(CMU->HOSMCR, CMU_HOSMCR_STRIE_MSK)) {
-		SYSCFG_UNLOCK();
-		SET_BIT(CMU->HOSMCR, CMU_HOSMCR_STRIF_MSK);
-		SYSCFG_LOCK();
-
-		if (!(READ_BIT(CMU->HOSMCR, CMU_HOSMCR_CLKS_MSK))
-				&& ((READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) == 5)))
-			cmu_clock_update((READ_BITS(CMU->HOSCCFG, CMU_HOSCCFG_FREQ_MSK, CMU_HOSCCFG_FREQ_POSS) + 1) * 1000000);
-		cmu_irq_cbk(CMU_HOSC_START);
-	}
-
-	/* LOSC stop */
-	if (READ_BIT(CMU->LOSMCR, CMU_LOSMCR_STPIF_MSK) && READ_BIT(CMU->LOSMCR, CMU_LOSMCR_STPIE_MSK)) {
-		SYSCFG_UNLOCK();
-		SET_BIT(CMU->LOSMCR, CMU_LOSMCR_STPIF_MSK);
-		SYSCFG_LOCK();
-		cmu_irq_cbk(CMU_LOSC_STOP);
-	}
-	
-	/* LOSC start */
-	if (READ_BIT(CMU->LOSMCR, CMU_LOSMCR_STRIF_MSK) && READ_BIT(CMU->LOSMCR, CMU_LOSMCR_STRIE_MSK)) {
-		SYSCFG_UNLOCK();
-		SET_BIT(CMU->LOSMCR, CMU_LOSMCR_STRIF_MSK);
-		SYSCFG_LOCK();
-		cmu_irq_cbk(CMU_LOSC_START);
-	}
-
-	/* PLL1 lose */
-	if (READ_BIT(CMU->PULMCR, CMU_PULMCR_ULKIF_MSK) && READ_BIT(CMU->PULMCR, CMU_PULMCR_ULKIE_MSK)) {
-		SYSCFG_UNLOCK();
-		SET_BIT(CMU->PULMCR, CMU_PULMCR_ULKIF_MSK);
-		SYSCFG_LOCK();
-
-		if (READ_BIT(CMU->PULMCR, CMU_PULMCR_CLKS_MSK)
-				&& ((READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) == 1)
-				|| ((READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) == 5))))
-			cmu_clock_update(READ_BIT(CMU->CFGR, CMU_CFGR_HRCFST_MSK) ? 2000000 : 24000000);
-		cmu_irq_cbk(CMU_PLL1_UNLOCK);
-	}
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup CMU_Public_Functions CMU Public Functions
-  * @{
-  */
-
-/** @defgroup CMU_Public_Functions_Group1 System clock configuration
-  * @brief    System clock configuration functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### System clock Configuration functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to:
-      (+) Configure system clock using default parameters.
-      (+) Configure system clock using specified parameters.
-      (+) Configure PLL1 using specified parameters.
-      (+) Get system clock.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Configure system clock using default.
-  *         Select CMU_CLOCK_HRC(24MHz) as system clock and
-  *         enable CMU_CLOCK_LRC(32768Hz).
-  * @retval The status of ALD.
-  */
-ald_status_t cmu_clock_config_default(void)
-{
-	uint32_t cnt = 4000, tmp;
-
-	SYSCFG_UNLOCK();
-
-	/* Select HRC */
-	MODIFY_REG(CMU->CSR, CMU_CSR_SYS_CMD_MSK, CMU_CLOCK_HRC << CMU_CSR_SYS_CMD_POSS);
-	while (READ_BIT(CMU->CSR, CMU_CSR_SYS_RDYN_MSK) && (--cnt));
-
-	if (READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) != CMU_CLOCK_HRC) {
-		SYSCFG_LOCK();
-		return ERROR;
-	}
-
-	CLEAR_BIT(CMU->CFGR, CMU_CFGR_HRCFSW_MSK);	/* Select 24Mhz */
-
-	tmp = READ_REG(CMU->CLKENR);
-	/* Enable HRC/LRC/LOSC */
-	SET_BIT(tmp, CMU_CLKENR_HRCEN_MSK | CMU_CLKENR_LRCEN_MSK | CMU_CLKENR_LOSCEN_MSK);
-	WRITE_REG(CMU->CLKENR, tmp);
-
-	SYSCFG_LOCK();
-	return OK;
-}
-
-/**
-  * @brief  Configure system clock using specified parameters
-  * @param  clk: The parameter can be one of the following:
-  *           @arg @ref CMU_CLOCK_HRC  2MHz or 24MHz
-  *           @arg @ref CMU_CLOCK_LRC  32768Hz
-  *           @arg @ref CMU_CLOCK_LOSC 32768Hz
-  *           @arg @ref CMU_CLOCK_PLL1 32MHz, 48MHz or (32768*1024)Hz
-  *           @arg @ref CMU_CLOCK_HOSC 1MHz -- 24MHz
-  * @param  clock: The clock which will be set. the value depends
-  *         on the parameter of clk.
-  * @retval The status of ALD.
-  */
-ald_status_t cmu_clock_config(cmu_clock_t clk, uint32_t clock)
-{
-	uint32_t cnt = 4000;
-
-	assert_param(IS_CMU_CLOCK(clk));
-	SYSCFG_UNLOCK();
-
-	switch (clk) {
-	case CMU_CLOCK_HRC:
-		assert_param(clock == 24000000 || clock == 2000000);
-
-		MODIFY_REG(CMU->CSR, CMU_CSR_SYS_CMD_MSK, CMU_CLOCK_HRC << CMU_CSR_SYS_CMD_POSS);
-		while (READ_BIT(CMU->CSR, CMU_CSR_SYS_RDYN_MSK) && (--cnt));
-
-		if (READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) != CMU_CLOCK_HRC) {
-			SYSCFG_LOCK();
-			return ERROR;
-		}
-
-		if (clock == 24000000)
-			CLEAR_BIT(CMU->CFGR, CMU_CFGR_HRCFSW_MSK);
-		else
-			SET_BIT(CMU->CFGR, CMU_CFGR_HRCFSW_MSK);
-
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_HRCEN_MSK);
-
-		for (cnt = 4000; cnt; --cnt);
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_HRCACT_MSK))) && (--cnt));
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_HRCRDY_MSK))) && (--cnt));
-
-		cmu_clock_update(clock);
-		break;
-
-	case CMU_CLOCK_LRC:
-		/* Close SysTick interrupt in lower clock */
-		SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
-
-		MODIFY_REG(CMU->CSR, CMU_CSR_SYS_CMD_MSK, CMU_CLOCK_LRC << CMU_CSR_SYS_CMD_POSS);
-		while (READ_BIT(CMU->CSR, CMU_CSR_SYS_RDYN_MSK) && (--cnt));
-
-		if (READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) != CMU_CLOCK_LRC) {
-			SYSCFG_LOCK();
-			return ERROR;
-		}
-
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_LRCEN_MSK);
-
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_LRCACT_MSK))) && (--cnt));
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_LRCRDY_MSK))) && (--cnt));
-
-		cmu_clock_update(32768);
-		break;
-
-	case CMU_CLOCK_LOSC:
-		/* Close SysTick interrupt in lower clock */
-		SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
-
-		MODIFY_REG(CMU->CSR, CMU_CSR_SYS_CMD_MSK, CMU_CLOCK_LOSC << CMU_CSR_SYS_CMD_POSS);
-		while (READ_BIT(CMU->CSR, CMU_CSR_SYS_RDYN_MSK) && (--cnt));
-
-		if (READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) != CMU_CLOCK_LOSC) {
-			SYSCFG_LOCK();
-			return ERROR;
-		}
-
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);
-
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_LOSCACT_MSK))) && (--cnt));
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_LOSCRDY_MSK))) && (--cnt));
-
-		cmu_clock_update(32768);
-		break;
-
-	case CMU_CLOCK_PLL1:
-		MODIFY_REG(CMU->CSR, CMU_CSR_SYS_CMD_MSK, CMU_CLOCK_PLL1 << CMU_CSR_SYS_CMD_POSS);
-		while (READ_BIT(CMU->CSR, CMU_CSR_SYS_RDYN_MSK) && (--cnt));
-
-		if (READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) != CMU_CLOCK_PLL1) {
-			SYSCFG_LOCK();
-			return ERROR;
-		}
-
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_PLL1EN_MSK);
-
-		for (cnt = 4000; cnt; --cnt);
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_PLL1ACT_MSK))) && (--cnt));
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_PLL1RDY_MSK))) && (--cnt));
-
-		cmu_clock_update(clock);
-		break;
-
-	case CMU_CLOCK_HOSC:
-		assert_param(clock <= 24000000);
-
-		MODIFY_REG(CMU->CSR, CMU_CSR_SYS_CMD_MSK, CMU_CLOCK_HOSC << CMU_CSR_SYS_CMD_POSS);
-		while (READ_BIT(CMU->CSR, CMU_CSR_SYS_RDYN_MSK) && (--cnt));
-
-		if (READ_BITS(CMU->CSR, CMU_CSR_SYS_STU_MSK, CMU_CSR_SYS_STU_POSS) != CMU_CLOCK_HOSC) {
-			SYSCFG_LOCK();
-			return ERROR;
-		}
-
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_HOSCEN_MSK);
-		MODIFY_REG(CMU->HOSCCFG, CMU_HOSCCFG_FREQ_MSK, clock / 1000000 - 1);
-
-		for (cnt = 4000; cnt; --cnt);
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_HOSCACT_MSK))) && (--cnt));
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_HOSCRDY_MSK))) && (--cnt));
-
-		cmu_clock_update(clock);
-		break;
-
-	default:
-		break;
-	}
-
-	SYSCFG_LOCK();
-	return OK;
-}
-
-
-
-/**
-  * @brief  Configure PLL1 using specified parameters.
-  * @param  input: The input clock type.
-  * @param  output: The output clock which can be 32MHz or 48MHz.
-  *           When input = CMU_PLL1_INPUT_PLL2; then output must be
-  *           CMU_PLL1_OUTPUT_32M, and then the real clock is (32768x1024)Hz.
-  * @retval None
-  */
-void cmu_pll1_config(cmu_pll1_input_t input, cmu_pll1_output_t output)
-{
-	uint32_t cnt = 4000;
-
-	assert_param(IS_CMU_PLL1_INPUT(input));
-	assert_param(IS_CMU_PLL1_OUTPUT(output));
-
-	SYSCFG_UNLOCK();
-
-	if (input == CMU_PLL1_INPUT_HRC_6) {
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_HRCEN_MSK);
-	}
-	else if (input == CMU_PLL1_INPUT_PLL2) {
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_LOSCEN_MSK);
-		CLEAR_BIT(CMU->PLLCFG, CMU_PLLCFG_PLL2RFS_MSK);
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_PLL2EN_MSK);
-	}
-	else {
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_HOSCEN_MSK);
-	}
-
-	MODIFY_REG(CMU->PLLCFG, CMU_PLLCFG_PLL1RFS_MSK, input << CMU_PLLCFG_PLL1RFS_POSS);
-	MODIFY_REG(CMU->PLLCFG, CMU_PLLCFG_PLL1OS_MSK, output << CMU_PLLCFG_PLL1OS_POS);
-	SET_BIT(CMU->CLKENR, CMU_CLKENR_PLL1EN_MSK);
-
-	while ((READ_BIT(CMU->PLLCFG, CMU_PLLCFG_PLL1LCKN_MSK)) && (--cnt));
-	cnt = 4000;
-	while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_PLL1RDY_MSK))) && (--cnt));
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Gets current system clock.
-  * @retval The value of system clock.
-  */
-uint32_t cmu_get_clock(void)
-{
-	return __system_clock;
-}
-
-/**
-  * @brief  Automatic-calibrate internal clock.
-  * @param  input: input type: HOSC or LOSC.
-  * @param  freq: output frequency: 24MHz or 2MHz.
-  * @retval The result:
-  *           - 0  Success
-  *           - -1 Failed
-  */
-int32_t cmu_auto_calib_clock(cmu_auto_calib_input_t input, cmu_auto_calib_output_t freq)
-{
-	uint32_t cnt = 5000, tmp;
-
-	assert_param(IS_CMU_AUTO_CALIB_INPUT(input));
-	assert_param(IS_CMU_AUTO_CALIB_OUTPUT(freq));
-
-	SYSCFG_UNLOCK();
-
-	tmp = READ_REG(CMU->HRCACR);
-
-	MODIFY_REG(tmp, CMU_HRCACR_AC_MSK, 1 << CMU_HRCACR_AC_POSS);
-	MODIFY_REG(tmp, CMU_HRCACR_RFSEL_MSK, input << CMU_HRCACR_RFSEL_POS);
-	MODIFY_REG(tmp, CMU_HRCACR_FREQ_MSK, freq << CMU_HRCACR_FREQ_POS);
-	SET_BIT(tmp, CMU_HRCACR_EN_MSK);
-	WRITE_REG(CMU->HRCACR, tmp);
-
-	while (cnt--);
-	cnt = 30000;
-	while ((READ_BIT(CMU->HRCACR, CMU_HRCACR_BUSY_MSK)) && (--cnt));
-
-	if (READ_BITS(CMU->HRCACR, CMU_HRCACR_STA_MSK, CMU_HRCACR_STA_POSS) != 1) {
-		CLEAR_BIT(CMU->HRCACR, CMU_HRCACR_EN_MSK);
-		SYSCFG_LOCK();
-		return -1;
-	}
-
-	SET_BIT(CMU->HRCACR, CMU_HRCACR_WRTRG_MSK);
-	CLEAR_BIT(CMU->HRCACR, CMU_HRCACR_EN_MSK);
-	SYSCFG_LOCK();
-
-	return 0;
-}
-/**
-  * @}
-  */
-
-/** @defgroup CMU_Public_Functions_Group2 BUS division control
-  * @brief    BUS division control functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### BUS division control functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to:
-      (+) Configure the bus division.
-      (+) Get ahb1 clock.
-      (+) Get sys bus clock.
-      (+) Get apb1 clock.
-      (+) Get apb2 clock.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Configure the bus division.
-  * @param  bus: The type of bus:
-  *          @arg CMU_HCLK_1
-  *          @arg CMU_SYS
-  *          @arg CMU_PCLK_1
-  *          @arg CMU_PCLK_2
-  * @param  div: The value of divider.
-  * @retval None
-  */
-void cmu_div_config(cmu_bus_t bus, cmu_div_t div)
-{
-	assert_param(IS_CMU_BUS(bus));
-	assert_param(IS_CMU_DIV(div));
-
-	SYSCFG_UNLOCK();
-
-	switch (bus) {
-	case CMU_HCLK_1:
-		MODIFY_REG(CMU->CFGR, CMU_CFGR_HCLK1DIV_MSK, div << CMU_CFGR_HCLK1DIV_POSS);
-		break;
-
-	case CMU_SYS:
-		MODIFY_REG(CMU->CFGR, CMU_CFGR_SYSDIV_MSK, div << CMU_CFGR_SYSDIV_POSS);
-		break;
-
-	case CMU_PCLK_1:
-		MODIFY_REG(CMU->CFGR, CMU_CFGR_PCLK1DIV_MSK, div << CMU_CFGR_PCLK1DIV_POSS);
-		break;
-
-	case CMU_PCLK_2:
-		MODIFY_REG(CMU->CFGR, CMU_CFGR_PCLK2DIV_MSK, div << CMU_CFGR_PCLK2DIV_POSS);
-		break;
-
-	default:
-		break;
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Get AHB1 clock.
-  * @retval The value of AHB1 clock.
-  */
-uint32_t cmu_get_hclk1_clock(void)
-{
-	uint32_t sys_div = READ_BITS(CMU->CFGR, CMU_CFGR_SYSDIV_MSK, CMU_CFGR_SYSDIV_POSS);
-	uint32_t ahb_div = READ_BITS(CMU->CFGR, CMU_CFGR_HCLK1DIV_MSK, CMU_CFGR_HCLK1DIV_POSS);
-
-	return (__system_clock >> sys_div) >> ahb_div;
-}
-
-/**
-  * @brief  Get SYS clock
-  * @retval The value of SYS clock
-  */
-uint32_t cmu_get_sys_clock(void)
-{
-	uint32_t sys_div = READ_BITS(CMU->CFGR, CMU_CFGR_SYSDIV_MSK, CMU_CFGR_SYSDIV_POSS);
-
-	return __system_clock >> sys_div;
-}
-
-/**
-  * @brief  Get APB1 clock.
-  * @retval The value of APB1 clock.
-  */
-uint32_t cmu_get_pclk1_clock(void)
-{
-	uint32_t sys_div  = READ_BITS(CMU->CFGR, CMU_CFGR_SYSDIV_MSK, CMU_CFGR_SYSDIV_POSS);
-	uint32_t apb1_div = READ_BITS(CMU->CFGR, CMU_CFGR_PCLK1DIV_MSK, CMU_CFGR_PCLK1DIV_POSS);
-
-	return (__system_clock >> sys_div) >> apb1_div;
-}
-
-/**
-  * @brief  Get APB2 clock.
-  * @retval The value of APB2 clock.
-  */
-uint32_t cmu_get_pclk2_clock(void)
-{
-	uint32_t sys_div  = READ_BITS(CMU->CFGR, CMU_CFGR_SYSDIV_MSK, CMU_CFGR_SYSDIV_POSS);
-	uint32_t apb2_div = READ_BITS(CMU->CFGR, CMU_CFGR_PCLK2DIV_MSK, CMU_CFGR_PCLK2DIV_POSS);
-
-	return (__system_clock >> sys_div) >> apb2_div;
-}
-/**
-  * @}
-  */
-
-/** @defgroup CMU_Public_Functions_Group3 Clock safe configure
-  * @brief    Clock safe configure functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Clock safe configure functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to:
-      (+) Enable/Disable outer high crystal safe mode.
-      (+) Enable/Disable outer low crystal safe mode.
-      (+) Enable/Disable PLL1 safe mode.
-      (+) Interrupt callback function.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Enable/Disable outer high crystal safe mode.
-  * @param  clock: the value of outer crystal frequency.
-  * @param  status: The new status.
-  * @retval None
-  */
-void cmu_hosc_safe_config(cmu_hosc_range_t clock, type_func_t status)
-{
-	assert_param(IS_CMU_HOSC_RANGE(clock));
-	assert_param(IS_FUNC_STATE(status));
-
-	SYSCFG_UNLOCK();
-
-	if (status) {
-		SET_BIT(CMU->HOSMCR, CMU_HOSMCR_STPIF_MSK);
-		MODIFY_REG(CMU->HOSMCR, CMU_HOSMCR_FRQS_MSK, clock << CMU_HOSMCR_FRQS_POSS);
-		SET_BIT(CMU->HOSMCR, CMU_HOSMCR_EN_MSK);
-		SET_BIT(CMU->HOSMCR, CMU_HOSMCR_STPIE_MSK);
-
-		mcu_irq_config(CMU_IRQn, 3, ENABLE);
-	}
-	else {
-		CLEAR_BIT(CMU->HOSMCR, CMU_HOSMCR_EN_MSK);
-		CLEAR_BIT(CMU->HOSMCR, CMU_HOSMCR_STPIE_MSK);
-
-		if (READ_BIT(CMU->LOSMCR, CMU_LOSMCR_EN_MSK) == 0 && READ_BIT(CMU->PULMCR, CMU_PULMCR_EN_MSK) == 0)
-			mcu_irq_config(CMU_IRQn, 3, DISABLE);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Enable/Disable outer low crystal safe mode.
-  * @param  status: The new status.
-  * @retval None
-  */
-void cmu_losc_safe_config(type_func_t status)
-{
-	assert_param(IS_FUNC_STATE(status));
-	SYSCFG_UNLOCK();
-
-	if (status) {
-		SET_BIT(CMU->LOSMCR, CMU_LOSMCR_STPIF_MSK);
-		SET_BIT(CMU->LOSMCR, CMU_LOSMCR_EN_MSK);
-		SET_BIT(CMU->LOSMCR, CMU_LOSMCR_STPIE_MSK);
-
-		mcu_irq_config(CMU_IRQn, 3, ENABLE);
-	}
-	else {
-		CLEAR_BIT(CMU->LOSMCR, CMU_LOSMCR_EN_MSK);
-		CLEAR_BIT(CMU->LOSMCR, CMU_LOSMCR_STPIE_MSK);
-
-		if (READ_BIT(CMU->HOSMCR, CMU_HOSMCR_EN_MSK) == 0 && READ_BIT(CMU->PULMCR, CMU_PULMCR_EN_MSK) == 0)
-			mcu_irq_config(CMU_IRQn, 3, DISABLE);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Enable/Disable PLL1 safe mode.
-  * @param  status: The new status.
-  * @retval None
-  */
-void cmu_pll_safe_config(type_func_t status)
-{
-	assert_param(IS_FUNC_STATE(status));
-	SYSCFG_UNLOCK();
-
-	if (status) {
-		SET_BIT(CMU->PULMCR, CMU_PULMCR_ULKIF_MSK);
-		MODIFY_REG(CMU->PULMCR, CMU_PULMCR_MODE_MSK, 2 << CMU_PULMCR_MODE_POSS);
-		SET_BIT(CMU->PULMCR, CMU_PULMCR_EN_MSK);
-		SET_BIT(CMU->PULMCR, CMU_PULMCR_ULKIE_MSK);
-
-		mcu_irq_config(CMU_IRQn, 3, ENABLE);
-	}
-	else {
-		CLEAR_BIT(CMU->PULMCR, CMU_PULMCR_EN_MSK);
-		CLEAR_BIT(CMU->PULMCR, CMU_PULMCR_ULKIE_MSK);
-
-		if (READ_BIT(CMU->HOSMCR, CMU_HOSMCR_EN_MSK) == 0 && READ_BIT(CMU->LOSMCR, CMU_LOSMCR_EN_MSK) == 0)
-			mcu_irq_config(CMU_IRQn, 3, DISABLE);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Get clock state.
-  * @param  sr: The state type, see @ref cmu_clock_state_t.
-  * @retval SET/RESET
-  */
-flag_status_t cmu_get_clock_state(cmu_clock_state_t sr)
-{
-	assert_param(IS_CMU_CLOCK_STATE(sr));
-
-	if (READ_BIT(CMU->CLKSR, sr))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Interrupt callback function.
-  * @note   This function is declared as __weak to be overwritten in case of other
-  *         implementations in user file.
-  * @retval None
-  */
-__weak void cmu_irq_cbk(cmu_security_t se)
-{
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup CMU_Public_Functions_Group4 Clock output configure
-  * @brief    Clock output configure functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Clock output configure functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to:
-      (+) Configure the high-speed clock output.
-      (+) Configure the low-speed clock output.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Configure the high-speed clock output.
-  * @param  sel: Select the source:
-  *           @arg CMU_OUTPUT_HIGH_SEL_HOSC
-  *           @arg CMU_OUTPUT_HIGH_SEL_LOSC
-  *           @arg CMU_OUTPUT_HIGH_SEL_HRC
-  *           @arg CMU_OUTPUT_HIGH_SEL_LRC
-  *           @arg CMU_OUTPUT_HIGH_SEL_HOSM
-  *           @arg CMU_OUTPUT_HIGH_SEL_PLL1
-  *           @arg CMU_OUTPUT_HIGH_SEL_PLL2
-  *           @arg CMU_OUTPUT_HIGH_SEL_SYSCLK
-  * @param  div: The value of divider:
-  *           @arg CMU_OUTPUT_DIV_1
-  *           @arg CMU_OUTPUT_DIV_2
-  *           @arg CMU_OUTPUT_DIV_4
-  *           @arg CMU_OUTPUT_DIV_8
-  *           @arg CMU_OUTPUT_DIV_16
-  *           @arg CMU_OUTPUT_DIV_32
-  *           @arg CMU_OUTPUT_DIV_64
-  *           @arg CMU_OUTPUT_DIV_128
-  * @param  status: The new status.
-  * @retval None
-  */
-void cmu_output_high_clock_config(cmu_output_high_sel_t sel,
-		cmu_output_high_div_t div, type_func_t status)
-{
-	assert_param(IS_CMU_OUTPUT_HIGH_SEL(sel));
-	assert_param(IS_CMU_OUTPUT_HIGH_DIV(div));
-	assert_param(IS_FUNC_STATE(status));
-
-	SYSCFG_UNLOCK();
-
-	if (status) {
-		MODIFY_REG(CMU->CLKOCR, CMU_CLKOCR_HSCOS_MSK, sel << CMU_CLKOCR_HSCOS_POSS);
-		MODIFY_REG(CMU->CLKOCR, CMU_CLKOCR_HSCODIV_MSK, div << CMU_CLKOCR_HSCODIV_POSS);
-		SET_BIT(CMU->CLKOCR, CMU_CLKOCR_HSCOEN_MSK);
-	}
-	else {
-		CLEAR_BIT(CMU->CLKOCR, CMU_CLKOCR_HSCOEN_MSK);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Configure the low-speed clock output.
-  * @param  sel: Select the source:
-  *           @arg CMU_OUTPUT_LOW_SEL_LOSC
-  *           @arg CMU_OUTPUT_LOW_SEL_LRC
-  *           @arg CMU_OUTPUT_LOW_SEL_LOSM
-  *           @arg CMU_OUTPUT_LOW_SEL_BUZZ
-  *           @arg CMU_OUTPUT_LOW_SEL_ULRC
-  * @param  status: The new status.
-  * @retval None
-  */
-void cmu_output_low_clock_config(cmu_output_low_sel_t sel, type_func_t status)
-{
-	assert_param(IS_CMU_OUTPUT_LOW_SEL(sel));
-	assert_param(IS_FUNC_STATE(status));
-
-	SYSCFG_UNLOCK();
-
-	if (status) {
-		MODIFY_REG(CMU->CLKOCR, CMU_CLKOCR_LSCOS_MSK, sel << CMU_CLKOCR_LSCOS_POSS);
-		SET_BIT(CMU->CLKOCR, CMU_CLKOCR_LSCOEN_MSK);
-	}
-	else {
-		CLEAR_BIT(CMU->CLKOCR, CMU_CLKOCR_LSCOEN_MSK);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup CMU_Public_Functions_Group5 Peripheral Clock configure
-  * @brief    Peripheral clock configure functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Peripheral clock configure functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to:
-      (+) Configure buzz clock.
-      (+) Select lptim0 clock source.
-      (+) Select lpuart0 clock source.
-      (+) Select lcd clock source.
-      (+) Enable/Disable peripheral clock.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Configure buzz clock.
-  *         freq = sysclk / (2^(div + 1) * (dat + 1))
-  * @param  div: The value of divider.
-  * @param  dat: The value of coefficient.
-  * @param  status: The new status.
-  * @retval None
-  */
-void cmu_buzz_config(cmu_buzz_div_t div, uint16_t dat, type_func_t status)
-{
-	assert_param(IS_CMU_BUZZ_DIV(div));
-	assert_param(IS_FUNC_STATE(status));
-
-	SYSCFG_UNLOCK();
-
-	if (status) {
-		MODIFY_REG(CMU->BUZZCR, CMU_BUZZCR_DIV_MSK, div << CMU_BUZZCR_DIV_POSS);
-		MODIFY_REG(CMU->BUZZCR, CMU_BUZZCR_DAT_MSK, dat << CMU_BUZZCR_DAT_POSS);
-		SET_BIT(CMU->BUZZCR, CMU_BUZZCR_EN_MSK);
-	}
-	else {
-		CLEAR_BIT(CMU->BUZZCR, CMU_BUZZCR_EN_MSK);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Select lptim0 clock source.
-  * @param  clock: The clock source:
-  *           @arg CMU_LP_PERH_CLOCK_SEL_PCLK2
-  *           @arg CMU_LP_PERH_CLOCK_SEL_PLL1
-  *           @arg CMU_LP_PERH_CLOCK_SEL_PLL2
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HRC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HOSC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_LRC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_LOSC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_ULRC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HRC_1M
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HOSC_1M
-  *           @arg CMU_LP_PERH_CLOCK_SEL_LOSM
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HOSM
-  * @retval None
-  */
-void cmu_lptim0_clock_select(cmu_lp_perh_clock_sel_t clock)
-{
-	assert_param(IS_CMU_LP_PERH_CLOCK_SEL(clock));
-
-	SYSCFG_UNLOCK();
-	MODIFY_REG(CMU->PERICR, CMU_PERICR_LPTIM0_MSK, clock << CMU_PERICR_LPTIM0_POSS);
-	SYSCFG_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Select lpuart0 clock source.
-  * @param  clock: The clock source:
-  *           @arg CMU_LP_PERH_CLOCK_SEL_PCLK2
-  *           @arg CMU_LP_PERH_CLOCK_SEL_PLL1
-  *           @arg CMU_LP_PERH_CLOCK_SEL_PLL2
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HRC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HOSC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_LRC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_LOSC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_ULRC
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HRC_1M
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HOSC_1M
-  *           @arg CMU_LP_PERH_CLOCK_SEL_LOSM
-  *           @arg CMU_LP_PERH_CLOCK_SEL_HOSM
-  * @retval None
-  */
-void cmu_lpuart0_clock_select(cmu_lp_perh_clock_sel_t clock)
-{
-	assert_param(IS_CMU_LP_PERH_CLOCK_SEL(clock));
-
-	SYSCFG_UNLOCK();
-	MODIFY_REG(CMU->PERICR, CMU_PERICR_LPUART0_MSK, clock << CMU_PERICR_LPUART0_POSS);
-	SYSCFG_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Select lcd clock source.
-  * @param  clock: The clock source:
-  *           @arg CMU_LCD_SEL_LOSM
-  *           @arg CMU_LCD_SEL_LOSC
-  *           @arg CMU_LCD_SEL_LRC
-  *           @arg CMU_LCD_SEL_ULRC
-  *           @arg CMU_LCD_SEL_HRC_1M
-  *           @arg CMU_LCD_SEL_HOSC_1M
-  * @retval None
-  */
-void cmu_lcd_clock_select(cmu_lcd_clock_sel_t clock)
-{
-	assert_param(IS_CMU_LCD_CLOCK_SEL(clock));
-
-	SYSCFG_UNLOCK();
-	MODIFY_REG(CMU->PERICR, CMU_PERICR_LCD_MSK, clock << CMU_PERICR_LCD_POSS);
-	SYSCFG_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Enable/Disable peripheral clock.
-  * @param  perh: The type of peripheral, you can see @ref cmu_perh_t
-  * @param  status: The new status.
-  * @retval None
-    */
-void cmu_perh_clock_config(cmu_perh_t perh, type_func_t status)
-{
-	uint32_t idx, pos;
-
-	assert_param(IS_CMU_PERH(perh));
-	assert_param(IS_FUNC_STATE(status));
-
-	SYSCFG_UNLOCK();
-
-	if (perh == CMU_PERH_ALL) {
-		if (status) {
-			WRITE_REG(CMU->AHB1ENR, ~0);
-			WRITE_REG(CMU->APB1ENR, ~0);
-			WRITE_REG(CMU->APB2ENR, ~0);
-		}
-		else {
-			WRITE_REG(CMU->AHB1ENR, 0);
-			WRITE_REG(CMU->APB1ENR, 0);
-			WRITE_REG(CMU->APB2ENR, 0);
-		}
-
-		SYSCFG_LOCK();
-		return;
-	}
-
-	idx = (perh >> 27) & 0x3;
-	pos = perh & ~(0x3 << 27);
-
-	if (status) {
-		switch (idx) {
-		case 0:
-			SET_BIT(CMU->AHB1ENR, pos);
-			break;
-
-		case 1:
-			SET_BIT(CMU->APB1ENR, pos);
-			break;
-
-		case 2:
-			SET_BIT(CMU->APB2ENR, pos);
-			break;
-
-		default:
-			break;
-		}
-	}
-	else {
-		switch (idx) {
-		case 0:
-			CLEAR_BIT(CMU->AHB1ENR, pos);
-			break;
-
-		case 1:
-			CLEAR_BIT(CMU->APB1ENR, pos);
-			break;
-
-		case 2:
-			CLEAR_BIT(CMU->APB2ENR, pos);
-			break;
-
-		default:
-			break;
-		}
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
- * @}
- */
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-/**
- * @}
- */

+ 0 - 342
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_crc.c

@@ -1,342 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_crc.c
-  * @brief   CRC module driver.
-  *
-  * @version V1.0
-  * @date    6 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_crc.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup CRC CRC
-  * @brief CRC module driver
-  * @{
-  */
-#ifdef ALD_CRC
-
-/** @addtogroup CRC_Private_Functions   CRC Private Functions
-  * @{
-  */
-void crc_reset(crc_handle_t *hperh);
-#ifdef ALD_DMA
-static void crc_dma_calculate_cplt(void *arg);
-static void crc_dma_error(void *arg);
-#endif
-/**
-  * @}
-  */
-
-
-/** @defgroup CRC_Public_Functions CRC Public Functions
-  * @{
-  */
-
-/** @defgroup CRC_Public_Functions_Group1 Initialization functions
-  * @brief Initialization and Configuration functions
-  * @{
-  */
-
-/**
-  * @brief  Initializes the CRC mode according to the specified parameters in
-  *         the crc_handle_t and create the associated handle.
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crc_init(crc_handle_t *hperh)
-{
-	uint32_t tmp = 0;
-
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_CRC(hperh->perh));
-	assert_param(IS_CRC_MODE(hperh->init.mode));
-	assert_param(IS_FUNC_STATE(hperh->init.chs_rev));
-	assert_param(IS_FUNC_STATE(hperh->init.data_inv));
-	assert_param(IS_FUNC_STATE(hperh->init.data_rev));
-	assert_param(IS_FUNC_STATE(hperh->init.chs_inv));
-
-	crc_reset(hperh);
-	__LOCK(hperh);
-
-	CRC_ENABLE(hperh);
-
-	tmp = hperh->perh->CR;
-
-	tmp |= ((hperh->init.chs_rev << CRC_CR_CHSREV_POS) | (hperh->init.data_inv << CRC_CR_DATREV_POS) |
-		(hperh->init.chs_inv << CRC_CR_CHSINV_POS) | (hperh->init.mode << CRC_CR_MODE_POSS) |
-		(CRC_DATASIZE_8 << CRC_CR_DATLEN_POSS) | (hperh->init.data_rev << CRC_CR_DATREV_POS) |
-		(1 << CRC_CR_BYTORD_POS));
-
-	hperh->perh->CR = tmp;
-	hperh->perh->SEED = hperh->init.seed;
-	CRC_RESET(hperh);
-
-	hperh->state = CRC_STATE_READY;
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup CRC_Public_Functions_Group2 Calculate functions
-  * @brief Calculate functions
-  * @{
-  */
-
-/**
-  * @brief  Calculate the crc value of data.
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: The size of data to be calculate
-  * @retval result, the result of a amount data
-  */
-uint32_t crc_calculate(crc_handle_t *hperh, uint8_t *buf, uint32_t size)
-{
-	uint32_t i;
-	uint32_t ret;
-
-	assert_param(IS_CRC(hperh->perh));
-
-	if (buf == NULL || size == 0)
-		return 0;
-
-	__LOCK(hperh);
-	hperh->state = CRC_STATE_BUSY;
-
-	for (i = 0; i < size; i++)
- 		CRC->DATA = buf[i];
-
-	ret          = CRC->CHECKSUM;
-	hperh->state = CRC_STATE_READY;
-	__UNLOCK(hperh);
-
-	return ret;
-}
-/**
-  * @}
-  */
-
-#ifdef ALD_DMA
-/** @defgroup CRC_Public_Functions_Group3 DMA operation functions
-  * @brief DMA operation functions
-  * @{
-  */
-
-/**
-  * @brief  Calculate an amount of data used dma channel
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @param  buf: Pointer to data buffer
-  * @param  res: Pointer to result
-  * @param  size: Amount of data to be Calculate
-  * @param  channel: DMA channel as CRC transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crc_calculate_by_dma(crc_handle_t *hperh, uint8_t *buf, uint32_t *res, uint16_t size, uint8_t channel)
-{
-	if (hperh->state != CRC_STATE_READY)
-		return BUSY;
-
-	if (buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->state = CRC_STATE_BUSY;
-
-	hperh->cal_buf = buf;
-	hperh->cal_res = res;
-
-	if (hperh->hdma.perh == NULL)
-		hperh->hdma.perh = DMA0;
-
-	hperh->hdma.cplt_arg = (void *)hperh;
-	hperh->hdma.cplt_cbk = &crc_dma_calculate_cplt;
-	hperh->hdma.err_arg  = (void *)hperh;
-	hperh->hdma.err_cbk  = &crc_dma_error;
-
-	dma_config_struct(&(hperh->hdma.config));
-	hperh->hdma.config.data_width = DMA_DATA_SIZE_BYTE;
-	hperh->hdma.config.src        = (void *)buf;
-	hperh->hdma.config.dst        = (void *)&hperh->perh->DATA;
-	hperh->hdma.config.size       = size;
-	hperh->hdma.config.src_inc    = DMA_DATA_INC_BYTE;
-	hperh->hdma.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdma.config.msel       = DMA_MSEL_CRC;
-	hperh->hdma.config.msigsel    = DMA_MSIGSEL_NONE;
-	hperh->hdma.config.channel    = channel;
-	dma_config_basic(&(hperh->hdma));
-
-	__UNLOCK(hperh);
-	CRC_DMA_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Pauses the DMA Transfer.
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crc_dma_pause(crc_handle_t *hperh)
-{
-	__LOCK(hperh);
-	CRC_DMA_DISABLE(hperh);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Resumes the DMA Transfer.
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crc_dma_resume(crc_handle_t *hperh)
-{
-	__LOCK(hperh);
-	CRC_DMA_ENABLE(hperh);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Stops the DMA Transfer.
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crc_dma_stop(crc_handle_t *hperh)
-{
-	__LOCK(hperh);
-	CRC_DMA_DISABLE(hperh);
-	__UNLOCK(hperh);
-
-	hperh->state = CRC_STATE_READY;
-	return OK;
-}
-
-/**
-  * @}
-  */
-#endif
-
-/** @defgroup CRC_Public_Functions_Group4 Peripheral State and Errors functions
-  * @brief    CRC State and Errors functions
-  * @{
-  */
-
-/**
-  * @brief  Returns the CRC state.
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval CRC state
-  */
-crc_state_t crc_get_state(crc_handle_t *hperh)
-{
-	assert_param(IS_CRC(hperh->perh));
-
-	return hperh->state;
-}
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup CRC_Private_Functions   CRC Private Functions
-  *  @brief   CRC Private functions
-  * @{
-  */
-
-/**
-  * @brief  Reset the CRC peripheral.
-  * @param  hperh: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval None
-  */
-void crc_reset(crc_handle_t *hperh)
-{
-	hperh->perh->DATA = 0x0;
-	hperh->perh->CR   = 0x2;
-	hperh->perh->SEED = 0xFFFFFFFF;
-
-	hperh->state = CRC_STATE_READY;
-	__UNLOCK(hperh);
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  DMA CRC calculate process complete callback.
-  * @param  arg: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval None
-  */
-static void crc_dma_calculate_cplt(void *arg)
-{
-	crc_handle_t *hperh = (crc_handle_t *)arg;
-
-	*(hperh->cal_res) = CRC->CHECKSUM;
-	CRC_DMA_DISABLE(hperh);
-
-	hperh->state = CRC_STATE_READY;
-
-	if (hperh->cal_cplt_cbk)
-		hperh->cal_cplt_cbk(hperh);
-}
-
-/**
-  * @brief  DMA CRC communication error callback.
-  * @param  arg: Pointer to a crc_handle_t structure that contains
-  *         the configuration information for the specified CRC module.
-  * @retval None
-  */
-static void crc_dma_error(void *arg)
-{
-	crc_handle_t *hperh = (crc_handle_t *)arg;
-
-	CRC_CLEAR_ERROR_FLAG(hperh);
-	CRC_DMA_DISABLE(hperh);
-
-	hperh->state = CRC_STATE_READY;
-
-	if (hperh->err_cplt_cbk)
-		hperh->err_cplt_cbk(hperh);
-}
-#endif
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#endif /* ALD_CRC */
-
-/**
-  * @}
-  */

+ 0 - 999
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_crypt.c

@@ -1,999 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_crypt.c
-  * @brief   CRYPT module driver.
-  *	     This is the common part of the CRYPT initialization
-  *
-  * @version V1.0
-  * @date    7 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-
-#include "ald_crypt.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup CRYPT CRYPT
-  * @brief CRYPT module driver
-  * @{
-  */
-#ifdef ALD_CRYPT
-
-/** @addtogroup CRYPT_Private_Functions CRYPT Private Functions
-  * @{
-  */
-void crypt_reset(crypt_handle_t *hperh);
-#ifdef ALD_DMA
-static void crypt_dma_crypt_cplt(void *arg);
-static void crypt_dma_error(void *arg);
-#endif
-/**
-  * @}
-  */
-
-
-/** @defgroup CRYPT_Public_Functions CRYPT Public Functions
-  * @{
-  */
-
-/** @defgroup CRYPT_Public_Functions_Group1 Initialization functions
-  * @brief Initialization and Configuration functions
-  * @{
-  */
-
-/**
-  * @brief  Initializes the CRYPT mode according to the specified parameters in
-  *         the crypt_init_t and create the associated handle.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_init(crypt_handle_t *hperh)
-{
-	uint32_t tmp = 0;
-
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-	assert_param(IS_CRYPT_MODE(hperh->init.mode));
-
-	__LOCK(hperh);
-	crypt_reset(hperh);
-
-	if (hperh->state == CRYPT_STATE_RESET)
-		__UNLOCK(hperh);
-
-	tmp = hperh->perh->CON;
-	hperh->step = 4;
-	tmp |= ((1 << CRYPT_CON_FIFOODR_POS) | (hperh->init.mode << CRYPT_CON_MODE_POSS) | \
-		(hperh->init.type << CRYPT_CON_TYPE_POSS) | (1 << CRYPT_CON_FIFOEN_POS));
-	WRITE_REG(hperh->perh->CON, tmp);
-	hperh->state = CRYPT_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Write the Content of KEY.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  key: Pointer to key data buffer
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_write_key(crypt_handle_t *hperh, uint32_t *key)
-{
-	uint32_t *temp   = key;
-	uint32_t i;
-
-	if (hperh->state == CRYPT_STATE_BUSY)
-		return BUSY;
-
-	if ((hperh == NULL) || (key == NULL))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	hperh->perh->KEY[3] = *temp++;
-	hperh->perh->KEY[2] = *temp++;
-	hperh->perh->KEY[1] = *temp++;
-	hperh->perh->KEY[0] = *temp;
-
-	for (i = 0; i < 4; i++)
-		hperh->key[i] = *key++;
-
-	return OK;
-}
-
-/**
-  * @brief  Read the Content of KEY.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  key: The pointer to the key
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_read_key(crypt_handle_t *hperh, uint32_t *key)
-{
-	uint32_t *temp   = key;
-
-	if (hperh->state == CRYPT_STATE_BUSY)
-		return BUSY;
-
-	if ((hperh == NULL) || (key == NULL))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	*temp++ = hperh->perh->KEY[3];
-	*temp++ = hperh->perh->KEY[2];
-	*temp++ = hperh->perh->KEY[1];
-	*temp = hperh->perh->KEY[0];
-
-	return OK;
-}
-
-/**
-  * @brief  Write the Content of IV if you use CBC mode
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  iv: Pointer to iv data buffer
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_write_ivr(crypt_handle_t *hperh, uint32_t *iv)
-{
-	uint32_t *temp = iv;
-	uint32_t i;
-	if (hperh->state == CRYPT_STATE_BUSY)
-		return BUSY;
-
-	if ((hperh == NULL) || (iv == NULL))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	hperh->perh->IV[3] = *temp++;
-	hperh->perh->IV[2] = *temp++;
-	hperh->perh->IV[1] = *temp++;
-	hperh->perh->IV[0] = *temp;
-
-	for (i = 0; i < 4; i++)
-		hperh->iv[i] = *iv++;
-
-	CRYPT_IVEN_ENABLE(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Read the Content of IV.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  iv: Pointer to iv data buffer
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_read_ivr(crypt_handle_t *hperh, uint32_t *iv)
-{
-	uint32_t *temp = iv;
-
-	if (hperh->state == CRYPT_STATE_BUSY)
-		return BUSY;
-
-	if ((hperh == NULL) || (iv == NULL))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	*temp++ = hperh->perh->IV[3];
-	*temp++ = hperh->perh->IV[2];
-	*temp++ = hperh->perh->IV[1];
-	*temp   = hperh->perh->IV[0];
-
-	return OK;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup CRYPT_Public_Functions_Group2 Encrypt or Decrypt functions
-  * @brief Encrypt or Decrypt functions
-  * @{
-  */
-
-/**
-  * @brief  Encrypt an amount of data in blocking mode.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  plain_text: Pointer to plain data buffer
-  * @param  cipher_text: Pointer to cipher data buffer
-  * @param  size: Amount of plain data
-  * @retval Status, see @ref ald_status_t.
-  * @note   the size is multiple of 16(ase)
-  */
-ald_status_t crypt_encrypt(crypt_handle_t *hperh, uint8_t *plain_text, uint8_t *cipher_text, uint32_t size)
-{
-	uint32_t count = 0;
-	uint32_t i;
-	uint32_t *plain_buf  = (uint32_t *)plain_text;
-	uint32_t *cipher_buf = (uint32_t *)cipher_text;
-
-	if (hperh->state != CRYPT_STATE_READY)
-		return ERROR;
-
-	if ((plain_buf == NULL) || (cipher_buf == NULL) || (size == 0))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	__LOCK(hperh);
-	hperh->state = CRYPT_STATE_BUSY;
-	CRYPT_SETDIR(hperh, CRYPT_ENCRYPT);
-	count = size / (4 * hperh->step);
-
-	while (count--) {
-		for (i = 0; i < hperh->step; i++) {
-			CRYPT_WRITE_FIFO(hperh, *plain_buf);
-			plain_buf++;
-		}
-
-		while (crypt_get_flag_status(hperh, CRYPT_FLAG_DONE) == SET);
-
-		for (i = 0; i < hperh->step; i++) {
-			*cipher_buf = CRYPT_READ_FIFO(hperh);
-			cipher_buf++;
-		}
-	}
-
-	hperh->state = CRYPT_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Decrypt an amount of data in blocking mode.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  cipher_text: Pointer to cipher data buffer
-  * @param  plain_text: Pointer to plain data buffer
-  * @param  size: Amount of cipher data
-  * @retval Status, see @ref ald_status_t.
-  * @note   the size is multiple of 16(ase)
-  */
-ald_status_t crypt_decrypt(crypt_handle_t *hperh, uint8_t *cipher_text, uint8_t *plain_text, uint32_t size)
-{
-	uint32_t count = 0;
-	uint32_t i;
-	uint32_t *plain_buf  = (uint32_t*)plain_text;
-	uint32_t *cipher_buf = (uint32_t*)cipher_text;
-
-	if (hperh->init.mode == CRYPT_MODE_CTR) {
-		return crypt_encrypt(hperh, cipher_text, plain_text, size);
-	}
-
-	if (hperh->state != CRYPT_STATE_READY)
-		return ERROR;
-
-	if ((plain_buf == NULL) || (cipher_buf == NULL) || (size == 0))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	__LOCK(hperh);
-	hperh->state = CRYPT_STATE_BUSY;
-	CRYPT_SETDIR(hperh, CRYPT_DECRYPT);
-	count = size / (4 * hperh->step);
-
-	while (count--) {
-		for (i = 0; i < hperh->step; i++) {
-			CRYPT_WRITE_FIFO(hperh, *cipher_buf);
-			cipher_buf++;
-		}
-
-		while (crypt_get_flag_status(hperh, CRYPT_FLAG_DONE) == SET);
-
-		for (i = 0; i < hperh->step; i++) {
-			*plain_buf = CRYPT_READ_FIFO(hperh);
-			plain_buf++;
-		}
-	}
-
-	hperh->state = CRYPT_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-void gcm_mul(uint32_t *res, uint32_t *data, uint32_t *iv)
-{
-	CRYPT->CON = 0;
-	CRYPT->DATA[0] = data[3];
-	CRYPT->DATA[1] = data[2];
-	CRYPT->DATA[2] = data[1];
-	CRYPT->DATA[3] = data[0];
-	CRYPT->IV[0]   = iv[3];
-	CRYPT->IV[1]   = iv[2];
-	CRYPT->IV[2]   = iv[1];
-	CRYPT->IV[3]   = iv[0];
-	CRYPT->CON |= ((1 << CRYPT_CON_RESCLR_POS) | (3 << CRYPT_CON_MODE_POSS) | \
-		       (1 << CRYPT_CON_GO_POS));
-
-	while (READ_BIT(CRYPT->IF, CRYPT_IF_MULTHIF_MSK) == 0);
-
-	res[3] = CRYPT->RES[0];
-	res[2] = CRYPT->RES[1];
-	res[1] = CRYPT->RES[2];
-	res[0] = CRYPT->RES[3];
-
-	WRITE_REG(CRYPT->IFC, CRYPT_IFC_MULTHIFC_MSK);
-	return;
-}
-
-/**
-  * @brief  verify an amount of data in gcm mode.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  cipher_text: Pointer to cipher data buffer
-  * @param  size: Amount of cipher data
-  * @param  aadata: Pointer to additional authenticated data buffer
-  * @param  alen: Amount of additional authenticated data
-  * @param  tag: Pointer to authentication tag buffer
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_gcm_verify(crypt_handle_t *hperh, uint8_t *cipher_text, uint32_t size, uint8_t *aadata, uint32_t alen, uint8_t *tag)
-{
-	uint8_t GCM_HASH_in[0x60] = {0};
-	uint8_t ecb[16] = {0};
-	uint32_t x_temp[4];
-	uint64_t u, v;
-	uint32_t len = 0;
-	uint32_t j, i, k;
-	uint32_t *tag_temp, *cipher_text_temp;
-
-	/* calculate u and v */
-	u = 128 * ((size % 16) ? (size / 16 + 1) : size / 16) - size * 8;
-	v = 128 * ((alen % 16) ? (alen / 16 + 1): alen / 16) - alen * 8;
-
-	/* get the input of GHASH algorithm,the input:A||0^v||C||0^u||[len(A)]_64||[len(C)]_64 */
-	for (i = 0; i < alen; i++) {
-		GCM_HASH_in [i] = * (aadata + i);
-	}
-	len += alen;
-	for (i = 0; i < v / 8; i++) {
-		GCM_HASH_in[i + len] = 0;
-	}
-	len += v / 8;
-	for (i = 0; i < size; i++) {
-		GCM_HASH_in[i + len] = * (cipher_text + i);
-	}
-	len += size;
-	for (i = 0; i < u / 8; i++) {
-		GCM_HASH_in[i + len] = 0;
-	}
-	len += u / 8;
-
-	for (i = 0; i < 4; i++) {
-		GCM_HASH_in[i + len] = 0;
-	}
-	len += 4;
-
-	for (i = 0; i < 4; i++) {
-		GCM_HASH_in[i + len] = ((alen * 8) >> (8 * i)) & 0xFF;
-	}
-	len += 4;
-
-	for (i = 0; i < 4; i++) {
-		GCM_HASH_in[i + len] = 0;
-	}
-	len += 4;
-
-	for (i = 0; i < 4; i++) {
-		GCM_HASH_in[i + len] = ((size * 8) >> (8 * i)) & 0xFF;
-	}
-	len += 4;
-
-	CRYPT->CON &= ~(3 << CRYPT_CON_MODE_POSS);
-	CRYPT->CON |= (CRYPT_MODE_ECB << CRYPT_CON_MODE_POSS);
-
-	crypt_encrypt(hperh, ecb, ecb, 16);
-
-	k = len / 16;
-	for (i = 0; i < 16; i++) {
-		tag[i] = 0;
-	}
-
-	cipher_text_temp = (uint32_t *)GCM_HASH_in;
-	tag_temp         = (uint32_t *)tag;
-	for (i = 0; i < k; i++) {
-		for (j = 0; j < 4; j++) {
-			x_temp[j] = (*cipher_text_temp) ^ tag_temp[j];
-			++cipher_text_temp;
-		}
-
-		gcm_mul((uint32_t *)tag_temp, x_temp, (uint32_t *)ecb);
-	}
-
-	/* calculate the authentication tag T,
-	 * T = CIPH_K(J0)^S,J0=IV||0^31||1,CIPH_K is the algorithm of AES in ECB mode
-	 */
-	tag_temp = (uint32_t *)tag;
-	crypt_init(hperh);
-	CRYPT->CON &= ~(3 << CRYPT_CON_MODE_POSS);
-	CRYPT->CON |= (CRYPT_MODE_CTR << CRYPT_CON_MODE_POSS);
-	crypt_write_key(hperh, hperh->key);
-	hperh->iv[3] = 1;
-	crypt_write_ivr(hperh, hperh->iv);
-	crypt_encrypt(hperh, tag, tag, 16);
-
-	return OK;
-}
-
-/**
-  * @brief  Encrypt an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  plain_text: Pointer to plain data buffer
-  * @param  cipher_text: Pointer to cipher data buffer
-  * @param  size: Amount of plain data
-  * @retval Status, see @ref ald_status_t.
-  * @note   the size is multiple of 16(ase)
-  */
-ald_status_t crypt_encrypt_by_it(crypt_handle_t *hperh, uint8_t * plain_text, uint8_t *cipher_text, uint32_t size)
-{
-	uint32_t i;
-	uint32_t *plain_buf = (uint32_t *)plain_text;
-
-	if (hperh->state != CRYPT_STATE_READY)
-		return ERROR;
-
-	if ((plain_text == NULL) || (cipher_text == NULL) || (size == 0))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	__LOCK(hperh);
-	hperh->state = CRYPT_STATE_BUSY;
-	CRYPT_SETDIR(hperh, CRYPT_ENCRYPT);
-	hperh->count       = hperh->step;
-	hperh->plain_text  = plain_text;
-	hperh->cipher_text = cipher_text;
-	hperh->size        = size;
-	crypt_interrupt_config(hperh, CRYPT_IT_IT, ENABLE);
-
-	for (i = 0; i < hperh->step; i++) {
-		CRYPT_WRITE_FIFO(hperh, *plain_buf);
-		++plain_buf;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Decrypt an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  plain_text: Pointer to plain data buffer
-  * @param  cipher_text: Pointer to cipher data buffer
-  * @param  size: Amount of cipher data
-  * @retval Status, see @ref ald_status_t.
-  * @note   the size is multiple of 16(ase)
-  */
-ald_status_t crypt_decrypt_by_it(crypt_handle_t *hperh, uint8_t *cipher_text, uint8_t *plain_text, uint32_t size)
-{
-	uint32_t i;
-	uint32_t *cipher_buf = (uint32_t*)cipher_text;
-
-	if (hperh->init.mode == CRYPT_MODE_CTR) {
-		return crypt_decrypt_by_it(hperh, cipher_text, plain_text, size);
-	}
-
-	if (hperh->state != CRYPT_STATE_READY)
-		return ERROR;
-
-	if ((plain_text == NULL) || (cipher_text == NULL) || (size == 0))
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	__LOCK(hperh);
-	hperh->state = CRYPT_STATE_BUSY;
-	CRYPT_SETDIR(hperh, CRYPT_DECRYPT);
-	hperh->count       = hperh->step;
-	hperh->plain_text  = plain_text;
-	hperh->cipher_text = cipher_text;
-	hperh->size        = size;
-	crypt_interrupt_config(hperh, CRYPT_IT_IT, ENABLE);
-
-	for (i = 0; i < hperh->step; i++) {
-		CRYPT_WRITE_FIFO(hperh, *cipher_buf);
-		cipher_buf++;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Encrypt an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  plain_text: Pointer to plain data buffer
-  * @param  cipher_text: Pointer to cipher data buffer
-  * @param  size: Amount of plain data
-  * @param  channel_m2p: Memory to Crypt module DMA channel
-  * @param  channel_p2m: Crypt module to Memory DMA channel
-  * @retval Status, see @ref ald_status_t.
-  * @note   the size is multiple of 16(ase)
-  */
-ald_status_t crypt_encrypt_by_dma(crypt_handle_t *hperh, uint8_t * plain_text,
-             uint8_t *cipher_text, uint32_t size, uint8_t channel_m2p, uint8_t channel_p2m)
-{
-	if (hperh->state != CRYPT_STATE_READY)
-		return ERROR;
-
-	if (plain_text == NULL || cipher_text == NULL || size == 0)
-		return ERROR;
-
-	assert_param(IS_CRYPT(hperh->perh));
-
-	__LOCK(hperh);
-	hperh->state = CRYPT_STATE_BUSY;
-
-	hperh->plain_text  = plain_text;
-	hperh->cipher_text = cipher_text;
-	hperh->size        = size;
-	hperh->count       = size;
-
-	if (hperh->hdma_m2p.perh == NULL)
-		hperh->hdma_m2p.perh = DMA0;
-	if (hperh->hdma_p2m.perh == NULL)
-		hperh->hdma_p2m.perh = DMA0;
-
-	hperh->hdma_m2p.cplt_arg = NULL;
-	hperh->hdma_m2p.cplt_cbk = NULL;
-	hperh->hdma_m2p.err_arg  = NULL;
-	hperh->hdma_m2p.err_cbk  = NULL;
-
-	hperh->hdma_p2m.cplt_arg = (void *)hperh;
-	hperh->hdma_p2m.cplt_cbk = &crypt_dma_crypt_cplt;
-	hperh->hdma_p2m.err_arg  = (void *)hperh;
-	hperh->hdma_p2m.err_cbk  = &crypt_dma_error;
-
-	CRYPT_SETDIR(hperh, CRYPT_ENCRYPT);
-
-	dma_config_struct(&hperh->hdma_m2p.config);
-	hperh->hdma_m2p.config.data_width = DMA_DATA_SIZE_WORD;
-	hperh->hdma_m2p.config.src        = (void *)hperh->plain_text;
-	hperh->hdma_m2p.config.dst        = (void *)&hperh->perh->FIFO;
-	hperh->hdma_m2p.config.size       = size / 4;
-	hperh->hdma_m2p.config.src_inc    = DMA_DATA_INC_WORD;
-	hperh->hdma_m2p.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdma_m2p.config.msel       = DMA_MSEL_CRYPT;
-	hperh->hdma_m2p.config.msigsel    = DMA_MSIGSEL_CRYPT_WRITE;
-	hperh->hdma_m2p.config.channel    = channel_m2p;
-	dma_config_basic(&(hperh->hdma_m2p));
-
-	dma_config_struct(&hperh->hdma_p2m.config);
-	hperh->hdma_p2m.config.data_width = DMA_DATA_SIZE_WORD;
-	hperh->hdma_p2m.config.src        = (void *)&hperh->perh->FIFO;
-	hperh->hdma_p2m.config.dst        = (void *)hperh->cipher_text;
-	hperh->hdma_p2m.config.size       = size / 4;
-	hperh->hdma_p2m.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdma_p2m.config.dst_inc    = DMA_DATA_INC_WORD;
-	hperh->hdma_p2m.config.msel       = DMA_MSEL_CRYPT;
-	hperh->hdma_p2m.config.msigsel    = DMA_MSIGSEL_CRYPT_READ;
-	hperh->hdma_p2m.config.channel    = channel_p2m;
-	dma_config_basic(&(hperh->hdma_p2m));
-
-	CRYPT_DMA_ENABLE(hperh);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Decrypt an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  plain_text: Pointer to plain data buffer
-  * @param  cipher_text: Pointer to cipher data buffer
-  * @param  size: Amount of cipher data
-  * @param  channel_m2p: Memory to Crypt module DMA channel
-  * @param  channel_p2m: Crypt module to Memory DMA channel
-  * @retval Status, see @ref ald_status_t.
-  * @note   the size is multiple of 16(ase)
-  */
-ald_status_t crypt_decrypt_by_dma(crypt_handle_t *hperh, uint8_t * cipher_text,
-               uint8_t *plain_text, uint32_t size, uint8_t channel_m2p, uint8_t channel_p2m)
-{
-	if (hperh->init.mode == CRYPT_MODE_CTR)
-		return crypt_decrypt_by_dma(hperh, cipher_text, plain_text, size, channel_m2p, channel_p2m);
-
-	if (hperh->state != CRYPT_STATE_READY)
-		return ERROR;
-	if (plain_text == NULL || cipher_text == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state = CRYPT_STATE_BUSY;
-
-	hperh->plain_text  = plain_text;
-	hperh->cipher_text = cipher_text;
-	hperh->size        = size;
-	hperh->count       = size;
-
-	if (hperh->hdma_m2p.perh == NULL)
-		hperh->hdma_m2p.perh = DMA0;
-	if (hperh->hdma_p2m.perh == NULL)
-		hperh->hdma_p2m.perh = DMA0;
-
-
-	hperh->hdma_m2p.cplt_arg = NULL;
-	hperh->hdma_m2p.cplt_cbk = NULL;
-	hperh->hdma_m2p.err_arg  = NULL;
-	hperh->hdma_m2p.err_cbk  = NULL;
-
-	hperh->hdma_p2m.cplt_arg = (void *)hperh;
-	hperh->hdma_p2m.cplt_cbk = &crypt_dma_crypt_cplt;
-	hperh->hdma_p2m.err_arg  = (void *)hperh;
-	hperh->hdma_p2m.err_cbk  = &crypt_dma_error;
-
-	CRYPT_SETDIR(hperh, CRYPT_DECRYPT);
-
-	dma_config_struct(&hperh->hdma_m2p.config);
-	hperh->hdma_m2p.config.data_width = DMA_DATA_SIZE_WORD;
-	hperh->hdma_m2p.config.src        = (void *)hperh->cipher_text;
-	hperh->hdma_m2p.config.dst        = (void *)&hperh->perh->FIFO;
-	hperh->hdma_m2p.config.size       = size / 4;
-	hperh->hdma_m2p.config.src_inc    = DMA_DATA_INC_WORD;
-	hperh->hdma_m2p.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdma_m2p.config.msel       = DMA_MSEL_CRYPT;
-	hperh->hdma_m2p.config.msigsel    = DMA_MSIGSEL_CRYPT_WRITE;
-	hperh->hdma_m2p.config.channel    = channel_m2p;
-	dma_config_basic(&(hperh->hdma_m2p));
-
-	dma_config_struct(&hperh->hdma_p2m.config);
-	hperh->hdma_p2m.config.data_width = DMA_DATA_SIZE_WORD;
-	hperh->hdma_p2m.config.src        = (void *)&hperh->perh->FIFO;
-	hperh->hdma_p2m.config.dst        = (void *)hperh->plain_text;
-	hperh->hdma_p2m.config.size       = size / 4;
-	hperh->hdma_p2m.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdma_p2m.config.dst_inc    = DMA_DATA_INC_WORD;
-	hperh->hdma_p2m.config.msel       = DMA_MSEL_CRYPT;
-	hperh->hdma_p2m.config.msigsel    = DMA_MSIGSEL_CRYPT_READ;
-	hperh->hdma_p2m.config.channel    = channel_p2m;
-	dma_config_basic(&(hperh->hdma_p2m));
-
-	CRYPT_DMA_ENABLE(hperh);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup CRYPT_Public_Functions_Group3 DMA operation functions
-  * @brief DMA operation functions
-  * @{
-  */
-
-/**
-  * @brief  Pauses the DMA Transfer.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_dma_pause(crypt_handle_t *hperh)
-{
-	__LOCK(hperh);
-	CRYPT_DMA_DISABLE(hperh);
-	__UNLOCK(hperh);
-
-	return OK;
-
-}
-
-/**
-  * @brief  Resumes the DMA Transfer.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_dma_resume(crypt_handle_t *hperh)
-{
-	__LOCK(hperh);
-	CRYPT_DMA_ENABLE(hperh);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Stops the DMA Transfer.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t crypt_dma_stop(crypt_handle_t *hperh)
-{
-	__LOCK(hperh);
-	CRYPT_DMA_DISABLE(hperh);
-	__UNLOCK(hperh);
-
-	hperh->state = CRYPT_STATE_READY;
-	return OK;
-}
-#endif
-
-/**
-  * @brief  This function handles CRYPT interrupt request.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval None
-  */
-void crypt_irq_handle(crypt_handle_t *hperh)
-{
-	uint32_t i;
-	uint32_t *in_buf;
-	uint32_t *out_buf;
-
-	if (READ_BIT(hperh->perh->CON, CRYPT_CON_ENCS_MSK)) {
-		in_buf  = (uint32_t *)hperh->plain_text + hperh->count;
-		out_buf = (uint32_t *)hperh->cipher_text + hperh->count - hperh->step;
-	}
-	else {
-		in_buf  = (uint32_t *)hperh->cipher_text + hperh->count;
-		out_buf = (uint32_t *)hperh->plain_text + hperh->count - hperh->step;
-	}
-
-	if (crypt_get_flag_status(hperh, CRYPT_FLAG_AESIF) == SET) {
-		crypt_clear_flag_status(hperh, CRYPT_FLAG_AESIF);
-	}
-
-	for (i = 0; i < hperh->step; i++)
-		*out_buf++ = CRYPT_READ_FIFO(hperh);
-
-	hperh->count += hperh->step;
-	if (hperh->count > (hperh->size / 4)) {
-		hperh->count = 0;
-		hperh->state = CRYPT_STATE_READY;
-
-		if (hperh->crypt_cplt_cbk)
-			hperh->crypt_cplt_cbk(hperh);
-	}
-	else {
-		for (i = 0; i < hperh->step; i++) {
-			CRYPT_WRITE_FIFO(hperh, *in_buf++);
-		}
-	}
-}
-/**
-  * @}
-  */
-
-/** @defgroup CRYPT_Public_Functions_Group4 Peripheral Control functions
-  *  @brief   CRYPT control functions
-  * @{
-  */
-
-/**
-  * @brief  Enables or disables the specified CRYPT interrupts.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  it: Specifies the CRYPT interrupt sources to be enabled or disabled.
-  *           This parameter can be one of the following values:
-  *           @arg crypt_it_t:  CRYPT interrupt
-  * @param  state: New status
-  *           - ENABLE
-  *           - DISABLE
-  * @retval None
-  */
-void crypt_interrupt_config(crypt_handle_t *hperh, crypt_it_t it, type_func_t state)
-{
-	assert_param(IS_CRYPT(hperh->perh));
-
-	if (it == CRYPT_IT_IT) {
-		CLEAR_BIT(CRYPT->CON, CRYPT_CON_IE_MSK);
-		CRYPT->CON |= (state << CRYPT_CON_IE_POS);
-	}
-
-	return;
-}
-
-/** @brief  Check whether the specified CRYPT flag is set or not.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref crypt_flag_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-flag_status_t crypt_get_flag_status(crypt_handle_t *hperh, crypt_flag_t flag)
-{
-	assert_param(IS_CRYPT(hperh->perh));
-	assert_param(IS_CRYPT_FLAG(flag));
-
-	if (CRYPT->IF & flag)
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Clear the specified CRYPT pending flags.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  flag: specifies the flag to check.
-  *          This parameter can be any combination of the following values:
-  *            @arg CRYPT_FLAG_AESIF: AES encrypt or decrypt Complete flag.
-  *            @arg CRYPT_FLAG_DONE: encrypt or decrypt Complete flag.
-  * @retval None
-  */
-void crypt_clear_flag_status(crypt_handle_t *hperh, crypt_flag_t flag)
-{
-	assert_param(IS_CRYPT(hperh->perh));
-	assert_param(IS_CRYPT_FLAG(flag));
-
-	WRITE_REG(CRYPT->IFC, flag);
-	return;
-}
-
-/**
-  * @brief  Checks whether the specified CRYPT interrupt has occurred or not.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @param  it: Specifies the CRYPT interrupt source to check.
-  *	       This parameter can be one of the following values:
-  *	       @arg crypt_it_t:  CRYPT interrupt
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-it_status_t crypt_get_it_status(crypt_handle_t *hperh, crypt_it_t it)
-{
-	assert_param(IS_CRYPT_IT(it));
-
-	if (READ_BIT(CRYPT->CON, CRYPT_CON_IE_MSK))
-		return SET;
-
-	return RESET;
-}
-
-
-/**
-  * @}
-  */
-
-/** @defgroup CRYPT_Public_Functions_Group5 Peripheral State and Errors functions
-  * @brief    State and Errors functions
-  * @{
-  */
-
-/**
-  * @brief  Returns the CRYPT state.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval CRYPT state
-  */
-crypt_state_t crypt_get_state(crypt_handle_t *hperh)
-{
-	assert_param(IS_CRYPT(hperh->perh));
-
-
-	return hperh->state;
-}
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup CRYPT_Private_Functions   CRYPT Private Functions
-  *  @brief   CRYPT Private functions
-  * @{
-  */
-
-/**
-  * @brief  Reset the CRYPT peripheral.
-  * @param  hperh: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval None
-  */
-void crypt_reset(crypt_handle_t *hperh)
-{
-	hperh->perh->DATA[0] = 0x0;
-	hperh->perh->DATA[1] = 0x0;
-	hperh->perh->DATA[2] = 0x0;
-	hperh->perh->DATA[3] = 0x0;
-	hperh->perh->KEY[0] = 0x0;
-	hperh->perh->KEY[1] = 0x0;
-	hperh->perh->KEY[2] = 0x0;
-	hperh->perh->KEY[3] = 0x0;
-	hperh->perh->KEY[4] = 0x0;
-	hperh->perh->KEY[5] = 0x0;
-	hperh->perh->KEY[6] = 0x0;
-	hperh->perh->KEY[7] = 0x0;
-	hperh->perh->IV[0] = 0x0;
-	hperh->perh->IV[1] = 0x0;
-	hperh->perh->IV[2] = 0x0;
-	hperh->perh->IV[3] = 0x0;
-	hperh->perh->CON = 0x0;
-
-	hperh->state = CRYPT_STATE_READY;
-	__UNLOCK(hperh);
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  DMA CRYPT encrypt or decrypt process complete callback.
-  * @param  arg: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval None
-  */
-static void crypt_dma_crypt_cplt(void *arg)
-{
-	crypt_handle_t *hperh = (crypt_handle_t *)arg;
-
-	CRYPT_DMA_DISABLE(hperh);
-	hperh->count       = 0;
-	hperh->plain_text  = NULL;
-	hperh->cipher_text = NULL;
-	hperh->size        = 0;
-
-	hperh->state = CRYPT_STATE_READY;
-
-	if (hperh->crypt_cplt_cbk)
-		hperh->crypt_cplt_cbk(hperh);
-}
-
-/**
-  * @brief  DMA CRYPT communication error callback.
-  * @param  arg: Pointer to a crypt_handle_t structure that contains
-  *         the configuration information for the specified CRYPT module.
-  * @retval None
-  */
-static void crypt_dma_error(void *arg)
-{
-	crypt_handle_t *hperh = (crypt_handle_t *)arg;
-	CRYPT_DMA_DISABLE(hperh);
-
-	hperh->count       = 0;
-	hperh->plain_text  = NULL;
-	hperh->cipher_text = NULL;
-	hperh->size        = 0;
-
-	hperh->state = CRYPT_STATE_READY;
-
-	if (hperh->err_cplt_cbk)
-		hperh->err_cplt_cbk(hperh);
-}
-#endif
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#endif /* ALD_CRYPT */
-
-/**
-  * @}
-  */

+ 0 - 734
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_dma.c

@@ -1,734 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_dma.c
-  * @brief   DMA module driver.
-  *
-  * @version V1.0
-  * @date    09 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  * @verbatim
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-  [..]
-    The DMA driver can be used as follows:
-
-    (#) System initialization invokes dma_init(), mcu_ald_init() --> dma_init().
-
-    (#) Declare a dma_handle_t handle structure.
-
-    (#) Configure the dma_handle_t structure, you can configure the
-        dma_config_t structure with the help of dma_config_struct().
-
-    (#) Enable the DMA Configure:
-        (##) Memory     -- memory: call dma_config_auto().
-	(##) Peripheral -- memory: call dma_config_basic().
-	(##) If you want use the dma easily, you can do this:
-	    (+++) Memory     -- memory: call dma_config_auto_easy().
-	    (+++) Peripheral -- memory: call dma_config_basic_easy().
-
-    (#) Enable the DMA request signal:
-        (##) Memory     -- memory: the DMA request signal is request automatic.
-	(##) Peripheral -- memory: you need enable peripheral request signal.
-
-    (#) If you enable DMA interrupt, the callback will be invoked:
-        (##) When DMA transfer is completed, the cplt_cbk() will be invoked.
-	(##) When DMA bus occurs error, the err_cbk() will be invoked.
-
-    (#) If you don't enable the DMA interrupt, you need do this:
-        (##) Polling the dma_get_flag_status(), this function's parameter is channel
-	     or DMA_ERR.
-	    (+++) When the function's Parameter is channel, if retval is SET, it means
-	          the DMA transfer is completed. at this moment, you can do something,
-		  and then, you need invoke dma_clear_flag_status() to clear flag.
-
-	    (+++) When the function's Parameter is DMA_ERR, if retval is SET, it means
-	          the DMA bus occurs error. at this moment, you can do something,
-		  and then, you need invoke dma_clear_flag_status() to clear flag.
-
-    @endverbatim
-  */
-
-#include <string.h>
-#include "ald_conf.h"
-#include "ald_dma.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup DMA DMA
-  * @brief DMA module driver
-  * @{
-  */
-
-#ifdef ALD_DMA
-/** @defgroup DMA_Private_Variables DMA Private Variables
-  * @{
-  */
-dma_descriptor_t dma0_ctrl_base[28] __attribute__ ((aligned(512)));
-dma_call_back_t dma0_cbk[6];
-/**
-  * @}
-  */
-
-/** @defgroup DMA_Private_Functions DMA Private Functions
-  * @{
-  */
-
-/**
-  * @brief  Configure DMA channel using dma_config_t structure
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  mode: DMA transfer mode. see @ref dma_cycle_ctrl_t
-  * @param  p: Pointer to dma_cycle_ctrl_t which contains
-  *            DMA channel parameter. see @ref dma_config_t
-  * @retval None
-  */
-static void dma_config_base(DMA_TypeDef *DMAx, dma_cycle_ctrl_t mode, dma_config_t *p)
-{
-	dma_descriptor_t *descr;
-
-	assert_param(IS_DMA(DMAx));
-	assert_param(IS_CYCLECTRL_TYPE(mode));
-	assert_param(p->src != NULL);
-	assert_param(p->dst != NULL);
-	assert_param(IS_DMA_DATA_SIZE(p->size));
-	assert_param(IS_DMA_DATASIZE_TYPE(p->data_width));
-	assert_param(IS_DMA_DATAINC_TYPE(p->src_inc));
-	assert_param(IS_DMA_DATAINC_TYPE(p->dst_inc));
-	assert_param(IS_DMA_ARBITERCONFIG_TYPE(p->R_power));
-	assert_param(IS_FUNC_STATE(p->primary));
-	assert_param(IS_FUNC_STATE(p->burst));
-	assert_param(IS_FUNC_STATE(p->high_prio));
-	assert_param(IS_FUNC_STATE(p->iterrupt));
-	assert_param(IS_DMA_MSEL_TYPE(p->msel));
-	assert_param(IS_DMA_MSIGSEL_TYPE(p->msigsel));
-	assert_param(IS_DMA_CHANNEL(p->channel));
-
-	if (p->primary)
-		descr = (dma_descriptor_t *)(DMAx->CTRLBASE) + p->channel;
-	else
-		descr = (dma_descriptor_t *)(DMAx->ALTCTRLBASE) + p->channel;
-
-	if (p->src_inc == DMA_DATA_INC_NONE)
-		descr->src = p->src;
-	else
-		descr->src = (void *)((uint32_t)p->src + ((p->size - 1) << p->data_width));
-
-	if (p->dst_inc == DMA_DATA_INC_NONE)
-		descr->dst = p->dst;
-	else
-		descr->dst = (void *)((uint32_t)p->dst + ((p->size - 1) << p->data_width));
-
-	descr->ctrl.cycle_ctrl    = mode;
-	descr->ctrl.next_useburst = 0;
-	descr->ctrl.n_minus_1     = p->size - 1;
-	descr->ctrl.R_power       = p->R_power;
-	descr->ctrl.src_prot_ctrl = 0,
-	descr->ctrl.dst_prot_ctrl = 0,
-	descr->ctrl.src_size      = p->data_width;
-	descr->ctrl.src_inc       = p->src_inc;
-	descr->ctrl.dst_size      = p->data_width;
-	descr->ctrl.dst_inc       = p->dst_inc;
-
-	if (p->primary)
-		WRITE_REG(DMAx->CHPRIALTCLR, (1 << p->channel));
-	else
-		WRITE_REG(DMAx->CHPRIALTSET, (1 << p->channel));
-
-	if (p->burst)
-		WRITE_REG(DMAx->CHUSEBURSTSET, (1 << p->channel));
-	else
-		WRITE_REG(DMAx->CHUSEBURSTCLR, (1 << p->channel));
-
-	if (p->high_prio)
-		WRITE_REG(DMAx->CHPRSET, (1 << p->channel));
-	else
-		WRITE_REG(DMAx->CHPRCLR, (1 << p->channel));
-
-	if (p->iterrupt)
-		SET_BIT(DMAx->IER, (1 << p->channel));
-	else
-		CLEAR_BIT(DMAx->IER, (1 << p->channel));
-
-	MODIFY_REG(DMAx->CH_SELCON[p->channel], DMA_CH0_SELCON_MSEL_MSK, p->msel << DMA_CH0_SELCON_MSEL_POSS);
-	MODIFY_REG(DMAx->CH_SELCON[p->channel], DMA_CH0_SELCON_MSIGSEL_MSK, p->msigsel << DMA_CH0_SELCON_MSIGSEL_POSS);
-	return;
-}
-
-/**
-  * @brief  Handle DMA interrupt
-  * @retval None
-  */
-void DMA_Handler(void)
-{
-	uint32_t i, reg = DMA0->IFLAG;
-
-	for (i = 0; i < DMA_CH_COUNT; ++i) {
-		if (READ_BIT(reg, (1 << i))) {
-			if (dma0_cbk[i].cplt_cbk != NULL)
-				dma0_cbk[i].cplt_cbk(dma0_cbk[i].cplt_arg);
-
-			dma_clear_flag_status(DMA0, i);
-		}
-	}
-
-	if (READ_BIT(reg, (1U << DMA_ERR))) {
-		dma_clear_flag_status(DMA0, DMA_ERR);
-
-		for (i = 0; i < DMA_CH_COUNT; ++i) {
-			if (((DMA0->CHENSET >> i) & 0x1) && (dma0_cbk[i].err_cbk != NULL))
-				dma0_cbk[i].err_cbk(dma0_cbk[i].err_arg);
-		}
-	}
-
-	dma0_irq_cbk();
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup DMA_Public_Functions DMA Public Functions
-  * @{
-  */
-
-/** @defgroup DMA_Public_Functions_Group1 Initialization functions
-  * @brief Initialization functions
-  *
-  * @verbatim
-    ===================================================================
-
-                    #### Initialization functions ####
-
-    ===================================================================
-    [..]
-    This subsection provides two functions to Initilizate DMA:
-    (+) dma_reset(): Reset the DMA register.
-
-    (+) dma_init(): Initializate the DMA module. this function is
-        invoked by mcu_ald_init().
-	this function do this:
-	(++) Initializte private variable dma_ctrl_base and dma_cbk.
-	(++) Reset DMA register.
-	(++) Set DMA interrupt priority: preempt_prio=1, sub_priority=1
-	(++) Enable DMA interrupt.
-	(++) Enable DMA bus error interrupt.
-	(++) Configure CTRLBASE resigter.
-	(++) Enable DMA module.
-
-    (+) dma_config_struct(): Configure dma_config_t
-        structure using default parameter.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Reset the DMA register
-  * @param  DMAx: Pointer to DMA peripheral
-  * @retval None
-  */
-void dma_reset(DMA_TypeDef *DMAx)
-{
-	uint32_t i;
-
-	assert_param(IS_DMA(DMAx));
-
-	WRITE_REG(DMAx->CFG, 0x0);
-	WRITE_REG(DMAx->CHUSEBURSTCLR, 0xFFF);
-	WRITE_REG(DMAx->CHREQMASKCLR, 0xFFF);
-	WRITE_REG(DMAx->CHENCLR, 0xFFF);
-	WRITE_REG(DMAx->CHPRIALTCLR, 0xFFF);
-	WRITE_REG(DMAx->CHPRCLR, 0xFFF);
-	WRITE_REG(DMAx->ERRCLR, 0x1);
-	WRITE_REG(DMAx->IER, 0x0);
-	WRITE_REG(DMAx->ICFR, 0x80000FFF);
-
-	for (i = 0; i < DMA_CH_COUNT; ++i)
-		WRITE_REG(DMAx->CH_SELCON[i], 0x0);
-
-	return;
-}
-
-/**
-  * @brief  DMA module initialization, this function
-  *         is invoked by mcu_ald_init().
-  * @param  DMAx: Pointer to DMA peripheral
-  * @retval None
-  */
-void dma_init(DMA_TypeDef *DMAx)
-{
-	assert_param(IS_DMA(DMAx));
-
-	memset(dma0_ctrl_base, 0x0, sizeof(dma0_ctrl_base));
-	memset(dma0_cbk, 0x0, sizeof(dma0_cbk));
-
-	dma_reset(DMAx);
-	NVIC_SetPriority(DMA_IRQn, 2);
-	NVIC_EnableIRQ(DMA_IRQn);
-	SET_BIT(DMAx->IER, DMA_IER_DMAERRIE_MSK);
-
-	WRITE_REG(DMAx->CTRLBASE, (uint32_t)&dma0_ctrl_base);
-	SET_BIT(DMAx->CFG, DMA_CFG_MASTER_ENABLE_MSK);
-
-	return;
-}
-
-/**
-  * @brief  Configure dma_config_t structure using default parameter.
-  *         User can invoked this function, before configure dma_config_t
-  * @param  p: Pointer to dma_config_t structure, see @ref dma_config_t
-  * @retval None
-  */
-void dma_config_struct(dma_config_t *p)
-{
-	p->data_width = DMA_DATA_SIZE_BYTE;
-	p->src_inc    = DMA_DATA_INC_BYTE;
-	p->dst_inc    = DMA_DATA_INC_BYTE;
-	p->R_power    = DMA_R_POWER_1;
-	p->primary    = ENABLE;
-	p->burst      = DISABLE;
-	p->high_prio  = DISABLE;
-	p->iterrupt   = ENABLE;
-
-	return;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup DMA_Public_Functions_Group2 Configure DMA channel functions
-  * @brief Configure DMA channel functions
-  *
-  * @verbatim
-    ===================================================================
-
-                    #### Configure DMA channel functions ####
-
-    ===================================================================
-    [..]
-    This subsection provides some functions allowing to configure
-    DMA channel. Include two type DMA transfer:
-    (+) Carry data from memory to memory, this mode APIs are:
-        (++) dma_config_auto(): Configure DMA channel according to
-	     the specified parameter in the dma_handle_t structure.
-	(++) dma_restart_auto(): Restart DMA transmitted.
-        (++) dma_config_auto_easy(): Configure DMA channel according
-	     to the specified parameter. If you want use the dma easily,
-             you can invoke this function.
-    (+) Carry data from peripheral to memory or from memory to peripheral,
-        this mode APIs are:
-	(++) dma_config_basic(): Configure DMA channel according to
-	     the specified parameter in the dma_handle_t structure.
-	(++) dma_restart_basic(): Restart DMA transmitted.
-        (++) dma_config_basic_easy(): Configure DMA channel according
-	     to the specified parameter. If you want use the dma easily,
-             you can invoke this function.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Configure DMA channel according to the specified parameter
-  *         in the dma_handle_t structure. The DMA mode is automatic.
-  *         This mode is used to carry data from memory to memory.
-  * @param  hperh: Pointer to DMA_handle_t structure that contains
-  *               configuration information for specified DMA channel.
-  * @retval None
-  */
-void dma_config_auto(dma_handle_t *hperh)
-{
-	dma0_cbk[hperh->config.channel].cplt_cbk = hperh->cplt_cbk;
-	dma0_cbk[hperh->config.channel].err_cbk  = hperh->err_cbk;
-	dma0_cbk[hperh->config.channel].cplt_arg = hperh->cplt_arg;
-	dma0_cbk[hperh->config.channel].err_arg  = hperh->err_arg;
-	dma_config_base(hperh->perh, DMA_CYCLE_CTRL_AUTO, &hperh->config);
-
-	dma_clear_flag_status(hperh->perh, hperh->config.channel);
-	WRITE_REG(hperh->perh->CHENSET, (1 << hperh->config.channel));
-	SET_BIT(hperh->perh->CHSWREQ, (1 << hperh->config.channel));
-
-	return;
-}
-
-/**
-  * @brief  Restart DMA transmitted. The DMA mode is automatic.
-  *         The other parameters have not changed except 'size' and 'addr'.
-  * @param  hperh: Pointer to DMA_handle_t structure that contains
-  *               configuration information for specified DMA channel.
-  * @param  src: Source data begin pointer
-  * @param  dst: Destination data begin pointer
-  * @param  size: Size.
-  * @retval None
-  */
-void dma_restart_auto(dma_handle_t *hperh, void *src, void *dst, uint16_t size)
-{
-	dma_descriptor_t *descr;
-
-	if (hperh->config.primary)
-		descr = (dma_descriptor_t *)(hperh->perh->CTRLBASE) + hperh->config.channel;
-	else
-		descr = (dma_descriptor_t *)(hperh->perh->ALTCTRLBASE) + hperh->config.channel;
-
-	if (src) {
-		if (hperh->config.src_inc == DMA_DATA_INC_NONE)
-			descr->src = src;
-		else
-			descr->src = (void *)((uint32_t)src + ((size - 1) << hperh->config.data_width));
-	}
-
-	if (dst) {
-		if (hperh->config.dst_inc == DMA_DATA_INC_NONE)
-			descr->dst = dst;
-		else
-			descr->dst = (void *)((uint32_t)dst + ((size - 1) << hperh->config.data_width));
-	}
-
-	dma_clear_flag_status(hperh->perh, hperh->config.channel);
-	descr->ctrl.cycle_ctrl = DMA_CYCLE_CTRL_AUTO;
-	descr->ctrl.n_minus_1  = size - 1;
-	WRITE_REG(hperh->perh->CHENSET, (1 << hperh->config.channel));
-	SET_BIT(hperh->perh->CHSWREQ, (1 << hperh->config.channel));
-	return;
-}
-
-
-
-/**
-  * @brief  Configure DMA channel according to the specified parameter.
-  *         The DMA mode is automatic. This mode is used to carry data
-  *         from memory to memory. If User want use the dma easily,
-  *         they can invoke this function.
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  src: Source data begin pointer
-  * @param  dst: Destination data begin pointer
-  * @param  size: The total number of DMA transfers that DMA cycle contains
-  * @param  channel: Channel index which well be used.
-  * @param  cbk: DMA complete callback function
-  *
-  * @retval None
-  */
-void dma_config_auto_easy(DMA_TypeDef *DMAx, void *src, void *dst,
-                       uint16_t size, uint8_t channel, void (*cbk)(void *arg))
-{
-	dma_handle_t hperh;
-
-	assert_param(IS_DMA(DMAx));
-
-	dma_config_struct(&hperh.config);
-	hperh.config.src     = src;
-	hperh.config.dst     = dst;
-	hperh.config.size    = size;
-	hperh.config.msel    = DMA_MSEL_NONE;
-	hperh.config.msigsel = DMA_MSIGSEL_NONE;
-	hperh.config.channel = channel;
-
-	hperh.perh     = DMAx;
-	hperh.cplt_cbk = cbk;
-	hperh.cplt_arg = NULL;
-	hperh.err_cbk  = NULL;
-
-	dma_clear_flag_status(DMAx, channel);
-	dma_config_auto(&hperh);
-
-	return;
-}
-
-/**
-  * @brief  Configure DMA channel according to the specified parameter
-  *         in the dma_handle_t structure. The DMA mode is basic.
-  *         This mode is used to carry data from peripheral to memory
-  *         or from memory to peripheral.
-  * @param  hperh: Pointer to dma_handle_t structure that contains
-  *         configuration information for specified DMA channel.
-  * @retval None
-  */
-void dma_config_basic(dma_handle_t *hperh)
-{
-	dma0_cbk[hperh->config.channel].cplt_cbk = hperh->cplt_cbk;
-	dma0_cbk[hperh->config.channel].err_cbk  = hperh->err_cbk;
-	dma0_cbk[hperh->config.channel].cplt_arg = hperh->cplt_arg;
-	dma0_cbk[hperh->config.channel].err_arg  = hperh->err_arg;
-
-	dma_clear_flag_status(hperh->perh, hperh->config.channel);
-	dma_config_base(hperh->perh, DMA_CYCLE_CTRL_BASIC, &hperh->config);
-	WRITE_REG(hperh->perh->CHENSET, (1 << hperh->config.channel));
-
-	return;
-}
-
-/**
-  * @brief  Restart DMA transmitted. The DMA mode is basic.
-  *         The other parameters have not changed except 'size' and 'addr'.
-  * @param  hperh: Pointer to DMA_handle_t structure that contains
-  *               configuration information for specified DMA channel.
-  * @param  src: Source data begin pointer
-  * @param  dst: Destination data begin pointer
-  * @param  size: Size.
-  * @retval None
-  */
-void dma_restart_basic(dma_handle_t *hperh, void *src, void *dst, uint16_t size)
-{
-	dma_descriptor_t *descr;
-
-	if (hperh->config.primary)
-		descr = (dma_descriptor_t *)(hperh->perh->CTRLBASE) + hperh->config.channel;
-	else
-		descr = (dma_descriptor_t *)(hperh->perh->ALTCTRLBASE) + hperh->config.channel;
-
-	if (src) {
-		if (hperh->config.src_inc == DMA_DATA_INC_NONE)
-			descr->src = src;
-		else
-			descr->src = (void *)((uint32_t)src + ((size - 1) << hperh->config.data_width));
-	}
-
-	if (dst) {
-		if (hperh->config.dst_inc == DMA_DATA_INC_NONE)
-			descr->dst = dst;
-		else
-			descr->dst = (void *)((uint32_t)dst + ((size - 1) << hperh->config.data_width));
-	}
-
-	dma_clear_flag_status(hperh->perh, hperh->config.channel);
-	descr->ctrl.cycle_ctrl = DMA_CYCLE_CTRL_BASIC;
-	descr->ctrl.n_minus_1  = size - 1;
-	WRITE_REG(hperh->perh->CHENSET, (1 << hperh->config.channel));
-
-	return;
-}
-
-/**
-  * @brief  Configure DMA channel according to the specified parameter.
-  *         The DMA mode is basic. This mode is used to carry data
-  *         from peripheral to memory or negative direction. If user want
-  *         use the dma easily, they can invoke this function.
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  src: Source data begin pointer
-  * @param  dst: Destination data begin pointer
-  * @param  size: The total number of DMA transfers that DMA cycle contains
-  * @param  msel: Input source to DMA channel @ref dma_msel_t
-  * @param  msigsel: Input signal to DMA channel @ref dma_msigsel_t
-  * @param  channel: Channel index which well be used
-  * @param  cbk: DMA complete callback function
-  *
-  * @retval None
-  *
- */
-void dma_config_basic_easy(DMA_TypeDef *DMAx, void *src, void *dst, uint16_t size, dma_msel_t msel,
-		dma_msigsel_t msigsel, uint8_t channel, void (*cbk)(void *arg))
-{
-	dma_handle_t hperh;
-
-	assert_param(IS_DMA(DMAx));
-	dma_config_struct(&hperh.config);
-
-	if (((uint32_t)src) >= 0x40000000)
-		hperh.config.src_inc = DMA_DATA_INC_NONE;
-
-	if (((uint32_t)dst) >= 0x40000000)
-		hperh.config.dst_inc = DMA_DATA_INC_NONE;
-
-	hperh.config.src     = src;
-	hperh.config.dst     = dst;
-	hperh.config.size    = size;
-	hperh.config.msel    = msel;
-	hperh.config.msigsel = msigsel;
-	hperh.config.channel = channel;
-
-	hperh.perh     = DMAx;
-	hperh.cplt_cbk = cbk;
-	hperh.cplt_arg = NULL;
-	hperh.err_cbk  = NULL;
-
-	dma_clear_flag_status(DMAx, channel);
-	dma_config_basic(&hperh);
-
-	return;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup DMA_Public_Functions_Group3 DMA Control functions
-  * @brief DMA control functions
-  *
-  * @verbatim
-    ===================================================================
-
-                    #### DMA control functions ####
-
-    ===================================================================
-    [..]
-    This subsection provides some functions allowing to control DMA:
-    (+) dma_channel_config(): Control DMA channel ENABLE/DISABLE.
-    (+) dma_interrupt_config(): Control DMA channel interrupt ENABLE or
-        DISABLE.
-    (+) dma_get_it_status(): Check whether the specified channel
-        interrupt is SET or RESET.
-    (+) dma_get_flag_status(): Check whether the specified channel
-        flag is SET or RESET.
-    (+) dma_clear_flag_status(): Clear the specified channel
-        pending flag
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Configure channel enable or disable. It will unbind descriptor with
-  *         channel, when channel has been disable.
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  channel: channel index
-  * @param  state: status of channel:
-  *           @arg ENABLE: Enable the channel
-  *           @arg DISABLE: Disable the channel
-  * @retval None
-  */
-void dma_channel_config(DMA_TypeDef *DMAx, uint8_t channel, type_func_t state)
-{
-	dma_descriptor_t *descr, *alt_descr;
-
-	assert_param(IS_DMA(DMAx));
-	assert_param(IS_DMA_CHANNEL(channel));
-	assert_param(IS_FUNC_STATE(state));
-
-	descr     = (dma_descriptor_t *)(DMAx->CTRLBASE) + channel;
-	alt_descr = (dma_descriptor_t *)(DMAx->ALTCTRLBASE) + channel;
-
-	if (state) {
-		WRITE_REG(DMAx->CHENSET, (1 << channel));
-	}
-	else {
-		memset(descr, 0x00, sizeof(dma_descriptor_t));
-		memset(alt_descr, 0x00, sizeof(dma_descriptor_t));
-		WRITE_REG(DMAx->CH_SELCON[channel], 0x0);
-		WRITE_REG(DMAx->CHENCLR, (1 << channel));
-	}
-
-	return;
-}
-
-/**
-  * @brief  Configure the interrupt enable or disable
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  channel: Channel index or DMA_ERR.
-  *           @arg 0~5: Channel index
-  *           @arg DMA_ERR: DMA bus error
-  * @param  state: status of channel:
-  *           @arg ENABLE: Enable the channel
-  *           @arg DISABLE: Disable the channel
-  *
-  * @retval None
-  */
-void dma_interrupt_config(DMA_TypeDef *DMAx, uint8_t channel, type_func_t state)
-{
-	assert_param(IS_DMA(DMAx));
-	assert_param(IS_DMA_IT_TYPE(channel));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state)
-		SET_BIT(DMAx->IER, (1 << channel));
-	else
-		CLEAR_BIT(DMAx->IER, (1 << channel));
-
-	return;
-}
-
-/**
-  * @brief  Check whether the specified channel interrupt
-  *         is set or reset
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  channel: Channel index or DMA_ERR
-  *           @arg 0~5: Channel index
-  *           @arg DMA_ERR: DMA bus error
-  * @retval Status:
-  *           - SET: Channel interrupt is set
-  *           - RESET: Channel interrupt is reset
-  */
-it_status_t dma_get_it_status(DMA_TypeDef *DMAx, uint8_t channel)
-{
-	assert_param(IS_DMA(DMAx));
-	assert_param(IS_DMA_IT_TYPE(channel));
-
-	if (READ_BIT(DMAx->IER, (1 << channel)))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Check whether the specified channel flag
-  *         is set or reset
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  channel: Channel index or DMA_ERR
-  *           @arg 0~5: Channel index
-  *           @arg DMA_ERR: DMA bus error
-  * @retval Status:
-  *           - SET: Channel flag is set
-  *           - RESET: Channel flag is reset
-  */
-flag_status_t dma_get_flag_status(DMA_TypeDef *DMAx, uint8_t channel)
-{
-	assert_param(IS_DMA(DMAx));
-	assert_param(IS_DMA_IT_TYPE(channel));
-
-	if (READ_BIT(DMAx->IFLAG, (1 << channel)))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Clear the specified channel pending flag
-  * @param  DMAx: Pointer to DMA peripheral
-  * @param  channel: Channel index or DMA_ERR
-  *           @arg 0~5: Channel index
-  *           @arg DMA_ERR: DMA bus error
-  * @retval None
-  */
-void dma_clear_flag_status(DMA_TypeDef *DMAx, uint8_t channel)
-{
-	assert_param(IS_DMA(DMAx));
-	assert_param(IS_DMA_IT_TYPE(channel));
-
-	WRITE_REG(DMAx->ICFR, (1 << channel));
-	return;
-}
-
-/**
-  * @brief  Interrupt callback function.
-  * @note   This function is declared as __weak to be overwritten in case of other
-  *         implementations in user file.
-  * @retval None
-  */
-__weak void dma0_irq_cbk(void)
-{
-	return;
-}
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#endif /* ALD_DMA */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 508
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_flash.c

@@ -1,508 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_flash.c
-  * @brief   FLASH module driver.
-  *
-  * @version V1.0
-  * @date    20 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  *
-  *********************************************************************************
-  * @verbatim
-  ==============================================================================
-                    ##### FLASH Peripheral features #####
-  ==============================================================================
-  [..]
-  Base address is 0x00000000
-
-  [..]
-  FLASH have just one programme mode , word programme.
-  word programme can programme 8 bytes once ;
-
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-  [..]
-   (#) programme flash using flash_write(uint32_t addr, uint8_t *buf, uint16_t len)
-       (++) call the function and supply all the three paraments is needs, addr means
-            the first address to write in this operation, buf is a pointer to the data which
-	    need writing to flash.
-
-   (#) erase flash using flash_erase(uint32_t addr, uint16_t len)
-       (++) call the function and supply two paraments, addr is the first address to erase,
-            len is the length to erase
-
-   (#) read flash using flash_read(uint32_t *ram_addr, uint32_t addr, uint16_t len)
-       (++) read the flash and save to a buffer, ram_addr is the buffer's first address,
-            addr is the start reading address in flash, len is the length need read
-
-    @endverbatim
-  */
-
-#include "ald_flash.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup FLASH FLASH
-  * @brief FLASH module driver
-  * @{
-  */
-
-#ifdef ALD_FLASH
-
-/** @addtogroup FLASH_Private_Types
-  * @{
-  */
-
-/* opration buffer, global variable*/
-static uint8_t write_buf[FLASH_PAGE_SIZE];
-static op_cmd_type OP_CMD = OP_FLASH;
-
-#if defined ( __ICCARM__ )
-#define __RAMFUNC       __ramfunc
-#else
-#define __RAMFUNC
-#endif
-
-/**
-  * @}
-  */
-
-/** @defgroup Flash_Private_Functions Flash Private Functions
-  *  @brief   Flash Private functions
-  * @{
-  */
-
-/**
-  * @brief  Unlock the flash.
-  * @retval Status, see @ref ald_status_t.
-  */
-__RAMFUNC static ald_status_t flash_unlock(void)
-{
-	uint16_t i;
-	uint16_t op_cmd = OP_CMD;
-
-	if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_BUSY_MSK))
-		return ERROR;
-
-	FLASH_REG_UNLOCK();
-	FLASH_IAP_ENABLE();
-	FLASH_REQ();
-
-	for (i = 0; i < 0xFFFF; i++) {
-		if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_FLASHACK_MSK))
-			break;
-	}
-
-	return i == 0xFFFF ? ERROR : OK;
-}
-
-/**
-  * @brief  Lock the flash.
-  * @retval Status, see @ref ald_status_t.
-  */
-__RAMFUNC static ald_status_t flash_lock(void)
-{
-	uint16_t i;
-	uint16_t op_cmd = OP_CMD;
-
-	FLASH_REG_UNLOCK();
-	WRITE_REG(MSC->FLASHCR, 0x0);
-
-	for (i = 0; i < 0xFFFF; i++) {
-		if (!(READ_BIT(MSC->FLASHSR, MSC_FLASHSR_FLASHACK_MSK)))
-			break;
-	}
-
-	return i == 0xFFFF ? ERROR : OK;
-}
-
-/**
-  * @brief  Erase one page.
-  * @param  addr: The erased page's address
-  * @retval Status, see @ref ald_status_t.
-  */
-__RAMFUNC static ald_status_t flash_page_erase(uint32_t addr)
-{
-	uint32_t i;
-	uint16_t op_cmd = OP_CMD;
-
-	__disable_irq();
-	if (flash_unlock() != OK)
-		goto end;
-
-	if (op_cmd == OP_FLASH) {
-		CLEAR_BIT(MSC->FLASHADDR, MSC_FLASHADDR_IFREN_MSK);
-		MODIFY_REG(MSC->FLASHADDR, MSC_FLASHADDR_ADDR_MSK, FLASH_PAGE_ADDR(addr) << MSC_FLASHADDR_ADDR_POSS);
-	}
-	else {
-		SET_BIT(MSC->FLASHADDR, MSC_FLASHADDR_IFREN_MSK);
-		MODIFY_REG(MSC->FLASHADDR, MSC_FLASHADDR_ADDR_MSK, INFO_PAGE_ADDR(addr) << MSC_FLASHADDR_ADDR_POSS);
-	}
-
-	WRITE_REG(MSC->FLASHCMD, FLASH_CMD_PE);
-
-	for (i = 0; i < 0xFFFF; i++) {
-		if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_BUSY_MSK))
-			continue;
-		if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_ADDR_OV_MSK))
-			goto end;
-		if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_WRP_FLAG_MSK))
-			goto end;
-		if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_SERA_MSK))
-			break;
-	}
-
-	if (i == 0xFFFF)
-		goto end;
-
-	if (flash_lock() == ERROR)
-		goto end;
-
-	__enable_irq();
-	return OK;
-end:
-
-	if (flash_lock() == ERROR)
-		while (1);
-
-	__enable_irq();
-	return ERROR;
-}
-
-/**
-  * @brief  Programme a word.
-  * @param  addr: The word's address, it is must word align.
-  * @param  data: The 8 bytes data be write.
-  * @param  len: The number of data be write.
-  * @param  fifo: Choose if use fifo.
-  * @retval Status, see @ref ald_status_t.
-  */
-__RAMFUNC static ald_status_t flash_word_program(uint32_t addr, uint32_t data[], uint32_t len, uint32_t fifo)
-{
-	uint16_t i;
-	uint16_t prog_len;
-	uint32_t *p_data = data;
-	uint16_t op_cmd = OP_CMD;
-
-	__disable_irq();
-	if (flash_unlock() != OK)
-		goto end;
-
-	if (op_cmd == OP_FLASH)
-		CLEAR_BIT(MSC->FLASHADDR, MSC_FLASHADDR_IFREN_MSK);
-	else
-		SET_BIT(MSC->FLASHADDR, MSC_FLASHADDR_IFREN_MSK);
-
-	MODIFY_REG(MSC->FLASHADDR, MSC_FLASHADDR_ADDR_MSK, addr << MSC_FLASHADDR_ADDR_POSS);
-	MODIFY_REG(MSC->FLASHCR, MSC_FLASHCR_FIFOEN_MSK, fifo << MSC_FLASHCR_FIFOEN_POS);
-
-	for (prog_len = 0; prog_len < len; prog_len++) {
-		if (fifo) {
-			WRITE_REG(MSC->FLASHFIFO, p_data[0]);
-			WRITE_REG(MSC->FLASHFIFO, p_data[1]);
-		}
-		else {
-			WRITE_REG(MSC->FLASHDL, p_data[0]);
-			WRITE_REG(MSC->FLASHDH, p_data[1]);
-			WRITE_REG(MSC->FLASHCMD, FLASH_CMD_WP);
-		}
-
-		p_data += 2;
-
-		for (i = 0; i < 0xFFFF; i++) {
-			if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_BUSY_MSK))
-				continue;
-			if (READ_BIT(MSC->FLASHSR, MSC_FLASHSR_PROG_MSK))
-				break;
-		}
-	}
-	if (i == 0xFFFF)
-		goto end;
-
-	if (flash_lock() == ERROR)
-		goto end;
-
-	__enable_irq();
-	return OK;
-end:
-	if (flash_lock() == ERROR)
-		while (1);
-
-	__enable_irq();
-	return ERROR;
-}
-
-/**
-  * @brief  Read data from flash, and store in buffer.
-  * @param  ram_addr: The stored buffer's address.
-  * @param  addr: The start address in flash to read.
-  * @param  len: The length of byte to read.
-  * @retval Status, see @ref ald_status_t.
-  */
-__RAMFUNC static ald_status_t __flash_read(uint32_t ram_addr[], uint32_t addr, uint32_t len)
-{
-	uint32_t i;
-
-	if (!len)
-		return ERROR;
-
-	for (i = 0; i < len; i++) {
-		ram_addr[i] = ((uint32_t *)addr)[i];
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Check whether the flash between the given address section
-  *         have been writen, if it have been writen, return TRUE, else
-  *         return FALSE.
-  * @param  begin_addr: The begin address.
-  * @param  end_addr: The end address.
-  * @retval The check result
-  *         - TRUE
-  *         - FALSE
-  */
-__RAMFUNC static type_bool_t page_have_writen(uint32_t begin_addr, uint32_t end_addr)
-{
-	uint8_t* addr_to_read;
-	uint8_t value;
-	uint32_t index;
-
-	/* Check the parameters */
-	assert_param(IS_FLASH_ADDRESS(begin_addr));
-	assert_param(IS_FLASH_ADDRESS(end_addr));
-
-	addr_to_read = (uint8_t *)begin_addr;
-	index        = begin_addr;
-	value        = 0xFF;
-
-	if (begin_addr > end_addr)
-		return FALSE;
-
-	while (index++ <= end_addr) {
-		value = *addr_to_read++;
-
-		if (value != 0xFF)
-			break;
-	}
-
-	return value == 0xFF ? FALSE : TRUE;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup FLASH_Exported_Functions FLASH Exported Functions
-  * @verbatim
- ===============================================================================
-              ##### Flash oprate functions #####
- ===============================================================================
-  [..]
-    This section provides functions allowing to operate flash, such as read and write.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Write the give bytes to the given address section.
-  * @param  addr: The start address to write.
-  * @param  buf: The bytes' address.
-  * @param  len: The length to write,and multiple of 2.
-  * @retval Status, see @ref ald_status_t.
-  */
-
-__RAMFUNC ald_status_t flash_write(uint32_t addr, uint8_t *buf, uint16_t len)
-{
-	uint32_t index = 0;
-	uint32_t para = 0;
-	uint32_t index2 = 0;
-	uint32_t start_write_addr;
-	uint32_t end_write_addr;
-	uint32_t start_word_addr;
-	uint32_t end_word_addr;
-	uint16_t len_to_write;
-	uint32_t len_index;
-	type_bool_t need_erase_page;
-
-	assert_param(IS_FLASH_ADDRESS(addr));
-	assert_param(IS_FLASH_ADDRESS(addr + len - 1));
-
-	len_to_write = len;
-
-	while (len_to_write > 0) {
-		need_erase_page = FALSE;
-
-		for (index = 0; index < FLASH_PAGE_SIZE; index++)
-			write_buf[index] = 0xFF;
-
-		start_write_addr = addr + (len - len_to_write);
-		end_write_addr   = addr + len - 1;
-		end_write_addr   = FLASH_PAGE_ADDR(start_write_addr) == FLASH_PAGE_ADDR(end_write_addr)
-		                   ? end_write_addr : FLASH_PAGEEND_ADDR(start_write_addr);
-		need_erase_page  = page_have_writen(FLASH_WORD_ADDR(start_write_addr),
-		                                    FLASH_WORDEND_ADDR(end_write_addr));
-
-		if (need_erase_page) {
-			if (ERROR == __flash_read((uint32_t *)write_buf, FLASH_PAGE_ADDR(start_write_addr),
-                                 		  FLASH_PAGE_SIZE >> 2))
-				return ERROR;
-
-			if (ERROR == flash_page_erase(FLASH_PAGE_ADDR(start_write_addr)))
-				return ERROR;
-
-			para   = end_write_addr & (FLASH_PAGE_SIZE - 1);
-			index  = start_write_addr & (FLASH_PAGE_SIZE - 1);
-			index2 = len - len_to_write;
-
-			while (index <= para)
-				write_buf[index++] = buf[index2++];
-
-			index2     = 0;
-			index      = FLASH_PAGE_ADDR(start_write_addr);
-			para       = FLASH_PAGE_ADDR(start_write_addr) + FLASH_PAGE_SIZE;
-			len_index  = FLASH_PAGE_SIZE;
-		}
-		else {
-			para   = end_write_addr & (FLASH_PAGE_SIZE - 1);
-			index  = start_write_addr & (FLASH_PAGE_SIZE - 1);
-			index2 = len - len_to_write;
-
-			while (index <= para)
-				write_buf[index++] = buf[index2++];
-
-			start_word_addr = FLASH_WORD_ADDR(start_write_addr);
-			end_word_addr   = FLASH_WORDEND_ADDR(end_write_addr);
-			index2          = (FLASH_WORD_ADDR(start_word_addr) - FLASH_PAGE_ADDR(start_word_addr));
-			index           = start_word_addr;
-			len_index       = end_word_addr - start_word_addr + 1;
-		}
-
-		if (ERROR == flash_word_program(index, (uint32_t *)(write_buf + index2), (len_index >> 3), FLASH_FIFO))
-			return ERROR;
-
-		len_to_write = len_to_write - (end_write_addr - start_write_addr + 1);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  erase The flash between the given address section.
-  * @param  addr: The start address to erase.
-  * @param  len: The length to erase.
-  * @retval Status, see @ref ald_status_t.
-  */
-__RAMFUNC ald_status_t flash_erase(uint32_t addr, uint16_t len)
-{
-	int32_t	index;
-	int32_t para;
-	int32_t start_erase_addr;
-	int32_t end_erase_addr;
-	uint16_t len_not_erase;
-	uint32_t len_index;
-	type_bool_t page_need_save;
-
-	assert_param(IS_FLASH_ADDRESS(addr));
-	assert_param(IS_FLASH_ADDRESS(addr + len - 1));
-
-	len_not_erase = len;
-
-	while (len_not_erase > 0) {
-		page_need_save = FALSE;
-
-		start_erase_addr = addr + len - len_not_erase;
-		end_erase_addr   = addr + len - 1;
-		end_erase_addr   = (FLASH_PAGE_ADDR(start_erase_addr) == FLASH_PAGE_ADDR(end_erase_addr))
-		                    ? end_erase_addr : FLASH_PAGEEND_ADDR(start_erase_addr);
-
-		if (start_erase_addr != FLASH_PAGE_ADDR(start_erase_addr)) {
-			if (page_have_writen(FLASH_PAGE_ADDR(start_erase_addr), (start_erase_addr - 1)))
-				page_need_save = TRUE;
-		}
-		if (end_erase_addr != FLASH_PAGEEND_ADDR(end_erase_addr)) {
-			if (page_have_writen((end_erase_addr + 1), FLASH_PAGEEND_ADDR(end_erase_addr)))
-				page_need_save = TRUE;
-		}
-
-		if (page_need_save) {
-			if (ERROR == __flash_read((uint32_t *)write_buf, FLASH_PAGE_ADDR(start_erase_addr),
-			                                                     FLASH_PAGE_SIZE >> 2)) {
-				__enable_irq();
-				return ERROR;
-			}
-		}
-
-		if (ERROR == flash_page_erase(FLASH_PAGE_ADDR(start_erase_addr))) {
-			__enable_irq();
-			return ERROR;
-		}
-
-		if (page_need_save) {
-			para  = end_erase_addr & (FLASH_PAGE_SIZE - 1);
-			index = start_erase_addr & (FLASH_PAGE_SIZE - 1);
-
-			while (index <= para)
-				write_buf[index++] = 0xFF;
-
-			index     = FLASH_PAGE_ADDR(start_erase_addr);
-			len_index = FLASH_PAGE_SIZE;
-			if (ERROR == flash_word_program(index, (uint32_t *)write_buf, (len_index >> 3), FLASH_FIFO)) {
-				__enable_irq();
-				return ERROR;
-			}
-		}
-		len_not_erase = len_not_erase - (end_erase_addr - start_erase_addr + 1);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  read the specified length bytes from flash, and store to the specified area.
-  * @param  ram_addr: the specified area to store the reading bytes.
-  * @param  addr: the start address.
-  * @param  len: the length to read.
-  * @retval Status, see @ref ald_status_t.
-  */
-__RAMFUNC ald_status_t flash_read(uint32_t *ram_addr, uint32_t addr, uint16_t len)
-{
-	uint32_t temp;
-
-	assert_param(IS_4BYTES_ALIGN(ram_addr));
-	assert_param(IS_FLASH_ADDRESS(addr));
-	assert_param(IS_FLASH_ADDRESS(addr + len - 1));
-
-	temp = (uint32_t)ram_addr;
-
-	if (((temp & 0x3) != 0) || (((addr) & 0x3) != 0))
-		return ERROR;
-
-	return __flash_read(ram_addr, addr, len) == ERROR ? ERROR : OK;
-}
-
-/**
-  * @}
-  */
-
-#endif
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 3136
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_i2c.c

@@ -1,3136 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_i2c.c
-  * @brief   I2C module driver.
-  *
-  * @version V1.0
-  * @date    15 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
- @verbatim
- ==============================================================================
-                       ##### How to use this driver #####
- ==============================================================================
- [..]
-   The I2C driver can be used as follows:
-
-   (#) Declare a i2c_handle_t handle structure, for example:
-       i2c_handle_t  hperh;
-
-   (#) Configure the Communication Speed, Duty cycle, Addressing mode, Own Address1,
-       Dual Addressing mode, Own Address2, General call and Nostretch mode in the hperh init structure.
-
-   (#) Initialize the I2C registers by calling the i2c_init().
-   (#) To check if target device is ready for communication, use the function i2c_is_device_ready()
-
-   (#) For I2C IO and IO MEM operations, three operation modes are available within this driver :
-
-   *** Polling mode IO operation ***
-   =================================
-   [..]
-     (+) Transmit in master mode an amount of data in blocking mode using i2c_master_send()
-     (+) Receive in master mode an amount of data in blocking mode using i2c_master_recv()
-     (+) Transmit in slave mode an amount of data in blocking mode using i2c_slave_send()
-     (+) Receive in slave mode an amount of data in blocking mode using i2c_slave_recv()
-
-   *** Polling mode IO MEM operation ***
-   =====================================
-   [..]
-     (+) Write an amount of data in blocking mode to a specific memory address using i2c_mem_write()
-     (+) Read an amount of data in blocking mode from a specific memory address using i2c_mem_read()
-
-
-   *** Interrupt mode IO operation ***
-   ===================================
-   [..]
-     (+) The I2C interrupts should have the highest priority in the application in order
-         to make them uninterruptible.
-     (+) Transmit in master mode an amount of data in non-blocking mode using i2c_master_send_by_it()
-     (+) At transmission end of transfer, hperh->master_tx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->master_tx_cplt_cbk()
-     (+) Receive in master mode an amount of data in non-blocking mode using i2c_master_recv_by_it()
-     (+) At reception end of transfer, hperh->master_rx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->master_rx_cplt_cbk()
-     (+) Transmit in slave mode an amount of data in non-blocking mode using i2c_slave_send_by_it()
-     (+) At transmission end of transfer, hperh->slave_tx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->slave_tx_cplt_cbk()
-     (+) Receive in slave mode an amount of data in non-blocking mode using i2c_slave_recv_by_it()
-     (+) At reception end of transfer, hperh->slave_rx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->slave_rx_cplt_cbk()
-     (+) In case of transfer Error, hperh->error_callback() function is executed and user can
-          add his own code by customization of function pointer hperh->error_callback()
-
-   *** Interrupt mode IO MEM operation ***
-   =======================================
-   [..]
-     (+) The I2C interrupts should have the highest priority in the application in order
-         to make them uninterruptible.
-     (+) Write an amount of data in non-blocking mode with Interrupt to a specific memory address using
-         i2c_mem_write_by_it()
-     (+) At Memory end of write transfer, hperh->mem_tx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->mem_tx_cplt_cbk()
-     (+) Read an amount of data in non-blocking mode with Interrupt from a specific memory address using
-         i2c_mem_read_by_it()
-     (+) At Memory end of read transfer, hperh->mem_rx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->mem_rx_cplt_cbk()
-     (+) In case of transfer Error, hperh->error_callback() function is executed and user can
-          add his own code by customization of function pointer hperh->error_callback()
-
-   *** DMA mode IO operation ***
-   ==============================
-   [..]
-     (+) Transmit in master mode an amount of data in non-blocking mode (DMA) using
-         i2c_master_send_by_dma()
-     (+) At transmission end of transfer, hperh->master_tx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->master_tx_cplt_cbk()
-     (+) Receive in master mode an amount of data in non-blocking mode (DMA) using
-         i2c_master_recv_by_dma()
-     (+) At reception end of transfer, hperh->master_rx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->master_rx_cplt_cbk()
-     (+) Transmit in slave mode an amount of data in non-blocking mode (DMA) using
-         i2c_slave_send_by_dma()
-     (+) At transmission end of transfer, hperh->slave_tx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->slave_tx_cplt_cbk()
-     (+) Receive in slave mode an amount of data in non-blocking mode (DMA) using
-         i2c_slave_recv_by_dma()
-     (+) At reception end of transfer, hperh->slave_rx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->slave_rx_cplt_cbk()
-     (+) In case of transfer Error, hperh->error_callback() function is executed and user can
-          add his own code by customization of function pointer hperh->error_callback()
-
-   *** DMA mode IO MEM operation ***
-   =================================
-   [..]
-     (+) Write an amount of data in non-blocking mode with DMA to a specific memory address using
-         i2c_mem_write_by_dma()
-     (+) At Memory end of write transfer, hperh->mem_tx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->mem_tx_cplt_cbk()
-     (+) Read an amount of data in non-blocking mode with DMA from a specific memory address using
-         i2c_mem_read_by_dma()
-     (+) At Memory end of read transfer, hperh->mem_rx_cplt_cbk() is executed and user can
-          add his own code by customization of function pointer hperh->mem_rx_cplt_cbk()
-     (+) In case of transfer Error, hperh->error_callback() function is executed and user can
-          add his own code by customization of function pointer hperh->error_callback()
-
-
-    *** I2C ald_status_t driver macros list ***
-    ==================================
-    [..]
-      Below the list of most used macros in I2C ald_status_t driver.
-
-     (+) I2C_ENABLE: Enable the I2C peripheral
-     (+) I2C_DISABLE: Disable the I2C peripheral
-      (@) You can refer to the I2C ald_status_t driver header file for more useful macros
-
-
-    *** I2C Workarounds linked to Silicon Limitation ***
-    ====================================================
-    [..]
-      Below the list of all silicon limitations implemented for library on our product.
-      (@) See ErrataSheet to know full silicon limitation list of your product.
-
-      (#) Workarounds Implemented inside I2C library
-         (##) Wrong data read into data register (Polling and Interrupt mode)
-         (##) Start cannot be generated after a misplaced Stop
-         (##) Some software events must be managed before the current byte is being transferred:
-              Workaround: Use DMA in general, except when the Master is receiving a single byte.
-              For Interupt mode, I2C should have the highest priority in the application.
-         (##) Mismatch on the "Setup time for a repeated Start condition" timing parameter:
-              Workaround: Reduce the frequency down to 88 kHz or use the I2C Fast-mode if
-              supported by the slave.
-         (##) Data valid time (tVD;DAT) violated without the OVR flag being set:
-              Workaround: If the slave device allows it, use the clock stretching mechanism
-              by programming no_stretch = I2C_NOSTRETCH_DISABLE in i2c_init.
-
- @endverbatim
- *********************************************************************************
- */
-
-#include "ald_i2c.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup I2C I2C
-  * @brief I2C module driver
-  * @{
-  */
-#ifdef ALD_I2C
-
-/** @addtogroup I2C_Private_Constants I2C Private Constants
-  * @{
-  */
-#define I2C_TIMEOUT_FLAG          (__systick_interval / 20 + 1)
-#define I2C_TIMEOUT_ADDR_SLAVE    (__systick_interval * 10)
-#define I2C_TIMEOUT_BUSY_FLAG     (__systick_interval * 10)
-#define I2C_MAX_DELAY             0xFFFFFFFF
-/**
-  * @}
-  */
-
-/** @addtogroup I2C_Private_Functions I2C Private Functions
-  * @{
-  */
-#ifdef ALD_DMA
-static void i2c_dma_master_send_cplt(void *argv);
-static void i2c_dma_master_recv_cplt(void *argv);
-static void i2c_dma_slave_send_cplt(void *argv);
-static void i2c_dma_slave_recv_cplt(void *argv);
-static void i2c_dma_mem_send_cplt(void *argv);
-static void i2c_dma_mem_recv_cplt(void *argv);
-static void i2c_dma_error(void *argv);
-#endif
-static ald_status_t i2c_master_req_write(i2c_handle_t *hperh, uint16_t dev_addr, uint32_t timeout);
-static ald_status_t i2c_master_req_read(i2c_handle_t *hperh, uint16_t dev_addr, uint32_t timeout);
-static ald_status_t i2c_req_mem_write(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                                      uint16_t add_size, uint32_t timeout);
-static ald_status_t i2c_req_mem_read(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                                     uint16_t add_size, uint32_t timeout);
-static ald_status_t i2c_wait_flag_to_timeout(i2c_handle_t *hperh, i2c_flag_t flag,
-                                                flag_status_t status, uint32_t timeout);
-static ald_status_t i2c_wait_master_addr_to_timeout(i2c_handle_t *hperh, i2c_flag_t flag, uint32_t timeout);
-static ald_status_t i2c_wait_txe_to_timeout(i2c_handle_t *hperh, uint32_t timeout);
-static ald_status_t i2c_wait_btf_to_timeout(i2c_handle_t *hperh, uint32_t timeout);
-static ald_status_t i2c_wait_rxne_to_timeout(i2c_handle_t *hperh, uint32_t timeout);
-static ald_status_t i2c_wait_stop_to_timeout(i2c_handle_t *hperh, uint32_t timeout);
-static ald_status_t i2c_is_ack_failed(i2c_handle_t *hperh);
-static ald_status_t i2c_master_send_txe(i2c_handle_t *hperh);
-static ald_status_t i2c_master_send_btf(i2c_handle_t *hperh);
-static ald_status_t i2c_master_recv_rxne(i2c_handle_t *hperh);
-static ald_status_t i2c_master_recv_btf(i2c_handle_t *hperh);
-static ald_status_t i2c_slave_send_txe(i2c_handle_t *hperh);
-static ald_status_t i2c_slave_send_btf(i2c_handle_t *hperh);
-static ald_status_t i2c_slave_recv_rxne(i2c_handle_t *hperh);
-static ald_status_t i2c_slave_recv_btf(i2c_handle_t *hperh);
-static ald_status_t i2c_slave_addr(i2c_handle_t *hperh);
-static ald_status_t i2c_slave_stopf(i2c_handle_t *hperh);
-static ald_status_t i2c_slave_af(i2c_handle_t *hperh);
-static uint32_t i2c_configure_speed(i2c_handle_t *hperh, uint32_t i2c_clk);
-/**
-  * @}
-  */
-
-/** @defgroup I2C_Public_Functions I2C Public functions
-  * @{
-  */
-
-/** @defgroup I2C_Public_Functions_Group1 Initialization functions
-  * @brief     Initialization and Configuration functions
-  *
-@verbatim
- ===============================================================================
-              ##### Initialization and Configuration functions #####
- ===============================================================================
-    [..]  This subsection provides a set of functions allowing to initialize and
-          de-initialiaze the I2Cx peripheral:
-
-      (+) Call the function i2c_init() to configure the selected device with
-          the selected configuration:
-        (++) Communication Speed
-        (++) Duty cycle
-        (++) Addressing mode
-        (++) Own Address 1
-        (++) Dual Addressing mode
-        (++) Own Address 2
-        (++) General call mode
-        (++) Nostretch mode
-
-      (+) Call the function i2c_reset() to restore the default configuration
-          of the selected I2Cx periperal.
-
-@endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Initializes the I2C according to the specified parameters
-  *         in the i2c_init_t and initialize the associated handle.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_init(i2c_handle_t *hperh)
-{
-	uint32_t freqrange = 0;
-	uint32_t pclk1 = 0;
-
-	if (hperh == NULL)
-		return ERROR;
-
-	/* Check the parameters */
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_CLOCK_SPEED(hperh->init.clk_speed));
-	assert_param(IS_I2C_DUTY_CYCLE(hperh->init.duty));
-	assert_param(IS_I2C_OWN_ADDRESS1(hperh->init.own_addr1));
-	assert_param(IS_I2C_ADDRESSING_MODE(hperh->init.addr_mode));
-	assert_param(IS_I2C_GENERAL_CALL(hperh->init.general_call));
-	assert_param(IS_I2C_NO_STRETCH(hperh->init.no_stretch));
-
-	if (hperh->init.dual_addr == I2C_DUALADDR_ENABLE)
-		assert_param(IS_I2C_OWN_ADDRESS2(hperh->init.own_addr2));
-
-	if (hperh->state == I2C_STATE_RESET)
-		hperh->lock = UNLOCK;
-
-	hperh->state = I2C_STATE_BUSY;
-	pclk1 = cmu_get_pclk1_clock();
-	I2C_DISABLE(hperh);
-
-	freqrange = I2C_FREQ_RANGE(pclk1);
-	WRITE_REG(hperh->perh->CON2, freqrange);
-	WRITE_REG(hperh->perh->RT, I2C_RISE_TIME(freqrange, hperh->init.clk_speed));
-	WRITE_REG(hperh->perh->CKCFG, i2c_configure_speed(hperh, pclk1));
-	WRITE_REG(hperh->perh->CON1, hperh->init.general_call);
-	SET_BIT(hperh->perh->CON1, hperh->init.no_stretch);
-	WRITE_REG(hperh->perh->ADDR1, (hperh->init.addr_mode | hperh->init.own_addr1));
-	WRITE_REG(hperh->perh->ADDR2, (hperh->init.dual_addr | hperh->init.own_addr2));
-
-	I2C_ENABLE(hperh);
-
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->state      = I2C_STATE_READY;
-	hperh->mode       = I2C_MODE_NONE;
-
-	return OK;
-}
-
-/**
-  * @brief  DeInitialize the I2C peripheral.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_reset(i2c_handle_t *hperh)
-{
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	hperh->state = I2C_STATE_BUSY;
-	I2C_DISABLE(hperh);
-
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->state      = I2C_STATE_RESET;
-	hperh->mode       = I2C_MODE_NONE;
-
-	__UNLOCK(hperh);
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup I2C_Public_Functions_Group2 Input and Output operation functions
-  *  @brief   Data transfers functions
-  *
-@verbatim
- ===============================================================================
-                      ##### IO operation functions #####
- ===============================================================================
-    [..]
-    This subsection provides a set of functions allowing to manage the I2C data
-    transfers.
-
-    (#) There are two modes of transfer:
-       (++) Blocking mode : The communication is performed in the polling mode.
-            The status of all data processing is returned by the same function
-            after finishing transfer.
-       (++) No-Blocking mode : The communication is performed using Interrupts
-            or DMA. These functions return the status of the transfer startup.
-            The end of the data processing will be indicated through the
-            dedicated I2C IRQ when using Interrupt mode or the DMA IRQ when
-            using DMA mode.
-
-    (#) Blocking mode functions are :
-        (++) i2c_master_send()
-        (++) i2c_master_recv()
-        (++) i2c_slave_send()
-        (++) i2c_slave_recv()
-        (++) i2c_mem_write()
-        (++) i2c_mem_read()
-        (++) i2c_is_device_ready()
-
-    (#) No-Blocking mode functions with Interrupt are :
-        (++) i2c_master_send_by_it()
-        (++) i2c_master_recv_by_it()
-        (++) i2c_slave_send_by_it()
-        (++) i2c_slave_recv_by_it()
-        (++) i2c_mem_write_by_it()
-        (++) i2c_mem_read_by_it()
-
-    (#) No-Blocking mode functions with DMA are :
-        (++) i2c_master_send_by_dma()
-        (++) i2c_master_recv_by_dma()
-        (++) i2c_slave_send_by_dma()
-        (++) i2c_slave_recv_by_dma()
-        (++) i2c_mem_write_by_dma()
-        (++) i2c_mem_read_by_dma()
-
-    (#) A set of Transfer Complete Callbacks are provided in non Blocking mode:
-        (++) hperh->mem_tx_cplt_cbk()
-        (++) hperh->mem_rx_cplt_cbk()
-        (++) hperh->master_tx_cplt_cbk()
-        (++) hperh->master_rx_cplt_cbk()
-        (++) hperh->slave_tx_cplt_cbk()
-        (++) hperh->slave_rx_cplt_cbk()
-        (++) hperh->error_callback()
-
-@endverbatim
- * @{
- */
-
-/**
-  * @brief  Transmits in master mode an amount of data in blocking mode.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_master_send(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf,
-                                 uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_MASTER;
-	hperh->error_code = I2C_ERROR_NONE;
-
-	if (i2c_master_req_write(hperh, dev_addr, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-
-	while (size > 0) {
-		if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_AF) {
-				SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-			else {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-
-		hperh->perh->DATA = (*buf++);
-		--size;
-
-		if ((i2c_get_flag_status(hperh, I2C_FLAG_BTF) == SET) && (size != 0)) {
-			hperh->perh->DATA = (*buf++);
-			--size;
-		}
-	}
-
-	if (i2c_wait_btf_to_timeout(hperh, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	hperh->state = I2C_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-
-}
-
-/**
-  * @brief  Receives in master mode an amount of data in blocking mode.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_master_recv(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf,
-                                uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	__LOCK(hperh);
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_MASTER;
-	hperh->error_code = I2C_ERROR_NONE;
-
-	if (i2c_master_req_read(hperh, dev_addr, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	if (size == 1) {
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		__disable_irq();
-		I2C_CLEAR_ADDRFLAG(hperh);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		__enable_irq();
-	}
-	else if (size == 2) {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-		__disable_irq();
-		I2C_CLEAR_ADDRFLAG(hperh);
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		__enable_irq();
-	}
-	else {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		I2C_CLEAR_ADDRFLAG(hperh);
-	}
-
-	while (size > 3) {
-		if (i2c_wait_rxne_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_TIMEOUT) {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-			else {
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-		}
-
-		(*buf++) = hperh->perh->DATA;
-		--size;
-
-		if (i2c_get_flag_status(hperh, I2C_FLAG_BTF) == SET) {
-			(*buf++) = hperh->perh->DATA;
-			--size;
-		}
-	}
-
-	switch (size) {
-	case 1:
-		if (i2c_wait_rxne_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_TIMEOUT) {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-			else {
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-		}
-
-		(*buf++) = hperh->perh->DATA;
-		break;
-
-	case 2:
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		__disable_irq();
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		(*buf++) = hperh->perh->DATA;
-		__enable_irq();
-		(*buf++) = hperh->perh->DATA;
-		break;
-
-	case 3:
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		__disable_irq();
-		(*buf++) = hperh->perh->DATA;
-
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			__enable_irq();
-			return TIMEOUT;
-		}
-
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		(*buf++) = hperh->perh->DATA;
-		__enable_irq();
-		(*buf++) = hperh->perh->DATA;
-		break;
-
-	default :
-		break;
-	}
-
-	hperh->state = I2C_STATE_READY;
-	hperh->mode  = I2C_MODE_NONE;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Transmits in slave mode an amount of data in blocking mode.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_slave_send(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_SLAVE;
-	hperh->error_code = I2C_ERROR_NONE;
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_ADDR, RESET, timeout) != OK) {
-		__UNLOCK(hperh);
-		return TIMEOUT;
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-
-	if (hperh->init.addr_mode == I2C_ADDR_10BIT) {
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_ADDR, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		I2C_CLEAR_ADDRFLAG(hperh);
-	}
-
-	while (size > 0) {
-		if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-			CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-
-			if (hperh->error_code == I2C_ERROR_AF) {
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-			else {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-
-		hperh->perh->DATA = (*buf++);
-		--size;
-
-		if ((i2c_get_flag_status(hperh, I2C_FLAG_BTF) == SET) && (size != 0)) {
-			hperh->perh->DATA = (*buf++);
-			--size;
-		}
-	}
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_AF, RESET, timeout) != OK) {
-		__UNLOCK(hperh);
-		return TIMEOUT;
-	}
-
-	i2c_clear_flag_status(hperh, I2C_FLAG_AF);
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	hperh->state = I2C_STATE_READY;
-	hperh->mode  = I2C_MODE_NONE;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Receive in slave mode an amount of data in blocking mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_slave_recv(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_SLAVE;
-	hperh->error_code = I2C_ERROR_NONE;
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_ADDR, RESET, timeout) != OK) {
-		__UNLOCK(hperh);
-		return TIMEOUT;
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-
-	while (size > 0) {
-		if (i2c_wait_rxne_to_timeout(hperh, timeout) != OK) {
-			hperh->perh->CON1 &= ~I2C_CON1_ACKEN;
-
-			if (hperh->error_code == I2C_ERROR_TIMEOUT) {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-			else {
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-		}
-
-		(*buf++) = hperh->perh->DATA;
-		--size;
-
-		if ((i2c_get_flag_status(hperh, I2C_FLAG_BTF) == SET) && (size != 0)) {
-			(*buf++) = hperh->perh->DATA;
-			--size;
-		}
-	}
-
-	if (i2c_wait_stop_to_timeout(hperh, I2C_TIMEOUT_FLAG) != OK) {
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	__I2C_CLEAR_STOPFLAG(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	hperh->state = I2C_STATE_READY;
-	hperh->mode  = I2C_MODE_NONE;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Transmit in master mode an amount of data in non-blocking mode with Interrupt
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_master_send_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_MASTER;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (i2c_master_req_write(hperh, dev_addr, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-
-	__UNLOCK(hperh);
-
-	/* Note : The I2C interrupts must be enabled after unlocking current process
-	 *        to avoid the risk of I2C interrupt handle execution before current
-	 *        process unlock */
-	i2c_interrupt_config(hperh, I2C_IT_EVT, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, ENABLE);
-	return OK;
-}
-
-/**
-  * @brief  Receive in master mode an amount of data in non-blocking mode with Interrupt
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_master_recv_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_MASTER;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (i2c_master_req_read(hperh, dev_addr, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	if (hperh->xfer_count == 1) {
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		I2C_CLEAR_ADDRFLAG(hperh);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	}
-	else if (hperh->xfer_count == 2) {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-		I2C_CLEAR_ADDRFLAG(hperh);
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	}
-	else {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		I2C_CLEAR_ADDRFLAG(hperh);
-	}
-
-	__UNLOCK(hperh);
-
-	/* Note : The I2C interrupts must be enabled after unlocking current process
-	 *        to avoid the risk of I2C interrupt handle execution before current
-	 *        process unlock */
-	i2c_interrupt_config(hperh, I2C_IT_EVT, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, ENABLE);
-	return OK;
-}
-
-/**
-  * @brief  Transmit in slave mode an amount of data in non-blocking mode with Interrupt
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_slave_send_by_it(i2c_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_SLAVE;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	__UNLOCK(hperh);
-
-	/* Note : The I2C interrupts must be enabled after unlocking current process
-	 *        to avoid the risk of I2C interrupt handle execution before current
-	 *        process unlock */
-	i2c_interrupt_config(hperh, I2C_IT_EVT, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Receive in slave mode an amount of data in non-blocking mode with Interrupt
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_slave_recv_by_it(i2c_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_SLAVE;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	__UNLOCK(hperh);
-
-	/* Note : The I2C interrupts must be enabled after unlocking current process
-	 *        to avoid the risk of I2C interrupt handle execution before current
-	 *        process unlock */
-	i2c_interrupt_config(hperh, I2C_IT_EVT, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, ENABLE);
-
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Transmit in master mode an amount of data in non-blocking mode with DMA
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as I2C transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_master_send_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf,
-                                     uint16_t size, uint8_t channel)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_MASTER;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	hperh->hdmatx.cplt_cbk = i2c_dma_master_send_cplt;
-	hperh->hdmatx.cplt_arg = hperh;
-	hperh->hdmatx.err_cbk  = i2c_dma_error;
-	hperh->hdmatx.err_arg  = hperh;
-
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src        = (void *)buf;
-	hperh->hdmatx.config.dst        = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size       = size;
-	hperh->hdmatx.config.data_width = DMA_DATA_SIZE_BYTE;
-	hperh->hdmatx.config.src_inc    = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel       = hperh->perh == I2C0 ? DMA_MSEL_I2C0 : DMA_MSEL_I2C1;
-	hperh->hdmatx.config.msigsel    = DMA_MSIGSEL_I2C_TXEMPTY;
-	hperh->hdmatx.config.channel    = channel;
-	dma_config_basic(&hperh->hdmatx);
-
-	if (i2c_master_req_write(hperh, dev_addr, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	SET_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-	I2C_CLEAR_ADDRFLAG(hperh);
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Receive in master mode an amount of data in non-blocking mode with DMA
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as I2C receive
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_master_recv_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, uint8_t *buf,
-                                    uint16_t size, uint8_t channel)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_MASTER;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	hperh->hdmarx.cplt_cbk = i2c_dma_master_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.err_cbk  = i2c_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-
-	dma_config_struct(&hperh->hdmarx.config);
-	hperh->hdmarx.config.src        = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst        = (void *)buf;
-	hperh->hdmarx.config.size       = size;
-	hperh->hdmarx.config.data_width = DMA_DATA_SIZE_BYTE;
-	hperh->hdmarx.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msel       = hperh->perh == I2C0 ? DMA_MSEL_I2C0 : DMA_MSEL_I2C1;
-	hperh->hdmarx.config.msigsel    = DMA_MSIGSEL_I2C_RNR;
-	hperh->hdmarx.config.channel    = channel;
-	dma_config_basic(&hperh->hdmarx);
-
-	if (i2c_master_req_read(hperh, dev_addr, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	if (size == 1)
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	else
-		SET_BIT(hperh->perh->CON2, I2C_CON2_LDMA);
-
-	SET_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-	I2C_CLEAR_ADDRFLAG(hperh);
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Transmit in slave mode an amount of data in non-blocking mode with DMA
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as I2C Transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_slave_send_by_dma(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_SLAVE;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	hperh->hdmatx.cplt_cbk = i2c_dma_slave_send_cplt;
-	hperh->hdmatx.cplt_arg = hperh;
-	hperh->hdmatx.err_cbk  = i2c_dma_error;
-	hperh->hdmatx.err_arg  = hperh;
-
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src        = (void *)buf;
-	hperh->hdmatx.config.dst        = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size       = size;
-	hperh->hdmatx.config.data_width = DMA_DATA_SIZE_BYTE;
-	hperh->hdmatx.config.src_inc    = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel       = hperh->perh == I2C0 ? DMA_MSEL_I2C0 : DMA_MSEL_I2C1;
-	hperh->hdmatx.config.msigsel    = DMA_MSIGSEL_I2C_TXEMPTY;
-	hperh->hdmatx.config.channel    = channel;
-	dma_config_basic(&hperh->hdmatx);
-
-	SET_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_ADDR, RESET, I2C_TIMEOUT_ADDR_SLAVE) != OK) {
-		__UNLOCK(hperh);
-		return TIMEOUT;
-	}
-
-	if (hperh->init.addr_mode == I2C_ADDR_7BIT) {
-		I2C_CLEAR_ADDRFLAG(hperh);
-	}
-	else {
-		I2C_CLEAR_ADDRFLAG(hperh);
-
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_ADDR, RESET, I2C_TIMEOUT_ADDR_SLAVE) != OK) {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		I2C_CLEAR_ADDRFLAG(hperh);
-	}
-
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receive in slave mode an amount of data in non-blocking mode with DMA
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as I2C receive
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_slave_recv_by_dma(i2c_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_SLAVE;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	hperh->hdmarx.cplt_cbk = i2c_dma_slave_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.err_cbk  = i2c_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-
-	dma_config_struct(&hperh->hdmarx.config);
-	hperh->hdmarx.config.src        = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst        = (void *)buf;
-	hperh->hdmarx.config.size       = size;
-	hperh->hdmarx.config.data_width = DMA_DATA_SIZE_BYTE;
-	hperh->hdmarx.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msel       = hperh->perh == I2C0 ? DMA_MSEL_I2C0 : DMA_MSEL_I2C1;
-	hperh->hdmarx.config.msigsel    = DMA_MSIGSEL_I2C_RNR;
-	hperh->hdmarx.config.channel    = channel;
-	dma_config_basic(&hperh->hdmarx);
-
-	SET_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_ADDR, RESET, I2C_TIMEOUT_ADDR_SLAVE) != OK) {
-		__UNLOCK(hperh);
-		return TIMEOUT;
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-	__UNLOCK(hperh);
-	return OK;
-}
-#endif
-
-/**
-  * @brief  Write an amount of data in blocking mode to a specific memory address
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_mem_write(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                           i2c_addr_size_t add_size, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_MEMADD_size(add_size));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_MEM;
-	hperh->error_code = I2C_ERROR_NONE;
-
-	if (i2c_req_mem_write(hperh, dev_addr, mem_addr, add_size, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	while (size > 0) {
-		if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_AF) {
-				SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-			else {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-
-		hperh->perh->DATA = (*buf++);
-		--size;
-
-		if ((i2c_get_flag_status(hperh, I2C_FLAG_BTF) == SET) && (size != 0)) {
-			hperh->perh->DATA = (*buf++);
-			--size;
-		}
-	}
-
-	if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	hperh->state = I2C_STATE_READY;
-	hperh->mode  = I2C_MODE_NONE;
-	__delay_ms(10);
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Read an amount of data in blocking mode from a specific memory address
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_mem_read(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr, i2c_addr_size_t add_size,
-                          uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_MEMADD_size(add_size));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_MEM;
-	hperh->error_code = I2C_ERROR_NONE;
-
-	if (i2c_req_mem_read(hperh, dev_addr, mem_addr, add_size, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	if (size == 1) {
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		__disable_irq();
-		I2C_CLEAR_ADDRFLAG(hperh);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		__enable_irq();
-	}
-	else if (size == 2) {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-		__disable_irq();
-		I2C_CLEAR_ADDRFLAG(hperh);
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		__enable_irq();
-	}
-	else {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		I2C_CLEAR_ADDRFLAG(hperh);
-	}
-
-	while (size > 3) {
-		if (i2c_wait_rxne_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_TIMEOUT) {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-			else {
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-		}
-
-		(*buf++) = hperh->perh->DATA;
-		--size;
-
-		if (i2c_get_flag_status(hperh, I2C_FLAG_BTF) == SET) {
-			(*buf++) = hperh->perh->DATA;
-			--size;
-		}
-	}
-
-	switch (size) {
-	case 1:
-		if (i2c_wait_rxne_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_TIMEOUT) {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-			else {
-				__UNLOCK(hperh);
-				return ERROR;
-			}
-		}
-
-		(*buf++) = hperh->perh->DATA;
-		break;
-
-	case 2:
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		__disable_irq();
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		(*buf++) = hperh->perh->DATA;
-		__enable_irq();
-		(*buf++) = hperh->perh->DATA;
-		break;
-
-	case 3:
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		__disable_irq();
-		(*buf++) = hperh->perh->DATA;
-
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			__enable_irq();
-			return TIMEOUT;
-		}
-
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		(*buf++) = hperh->perh->DATA;
-		__enable_irq();
-		(*buf++) = hperh->perh->DATA;
-		break;
-
-	default:
-		break;
-	}
-
-	hperh->state = I2C_STATE_READY;
-	hperh->mode  = I2C_MODE_NONE;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Write an amount of data in non-blocking mode with Interrupt to a specific memory address
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_mem_write_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                              i2c_addr_size_t add_size, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_MEMADD_size(add_size));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_MEM;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (i2c_req_mem_write(hperh, dev_addr, mem_addr, add_size, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	__UNLOCK(hperh);
-
-	/* Note : The I2C interrupts must be enabled after unlocking current process
-	 *        to avoid the risk of I2C interrupt handle execution before current
-	 *        process unlock */
-	i2c_interrupt_config(hperh, I2C_IT_EVT, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Read an amount of data in non-blocking mode with Interrupt from a specific memory address
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_mem_read_by_it(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr,
-                             i2c_addr_size_t add_size, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_MEMADD_size(add_size));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_MEM;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (i2c_req_mem_read(hperh, dev_addr, mem_addr, add_size, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	if (hperh->xfer_count == 1) {
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		I2C_CLEAR_ADDRFLAG(hperh);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	}
-	else if (hperh->xfer_count == 2) {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-		I2C_CLEAR_ADDRFLAG(hperh);
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	}
-	else {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		I2C_CLEAR_ADDRFLAG(hperh);
-	}
-
-	__UNLOCK(hperh);
-
-	/* Note : The I2C interrupts must be enabled after unlocking current process
-	 *        to avoid the risk of I2C interrupt handle execution before current
-	 *        process unlock */
-	i2c_interrupt_config(hperh, I2C_IT_EVT, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, ENABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, ENABLE);
-
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Write an amount of data in non-blocking mode with DMA to a specific memory address
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_mem_write_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr, i2c_addr_size_t add_size,
-                               uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_MEMADD_size(add_size));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_TX;
-	hperh->mode       = I2C_MODE_MEM;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	hperh->hdmatx.cplt_cbk = i2c_dma_mem_send_cplt;
-	hperh->hdmatx.cplt_arg = hperh;
-	hperh->hdmatx.err_cbk  = i2c_dma_error;
-	hperh->hdmatx.err_arg  = hperh;
-	dma_config_struct(&hperh->hdmatx.config);
-
-	hperh->hdmatx.config.src        = (void *)buf;
-	hperh->hdmatx.config.dst        = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.data_width = DMA_DATA_SIZE_BYTE;
-	hperh->hdmatx.config.size       = size;
-	hperh->hdmatx.config.src_inc    = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel       = hperh->perh == I2C0 ? DMA_MSEL_I2C0 : DMA_MSEL_I2C1;
-	hperh->hdmatx.config.msigsel    = DMA_MSIGSEL_I2C_TXEMPTY;
-	hperh->hdmatx.config.channel    = channel;
-	dma_config_basic(&hperh->hdmatx);
-
-	if (i2c_req_mem_write(hperh, dev_addr, mem_addr, add_size, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	SET_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Reads an amount of data in non-blocking mode with DMA from a specific memory address.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be read
-  * @param  channel: DMA channel
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_mem_read_by_dma(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr, i2c_addr_size_t add_size,
-                              uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_MEMADD_size(add_size));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state      = I2C_STATE_BUSY_RX;
-	hperh->mode       = I2C_MODE_MEM;
-	hperh->error_code = I2C_ERROR_NONE;
-	hperh->p_buff     = buf;
-	hperh->xfer_size  = size;
-	hperh->xfer_count = size;
-
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	hperh->hdmarx.cplt_cbk = i2c_dma_mem_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.err_cbk  = i2c_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-	dma_config_struct(&hperh->hdmarx.config);
-
-	hperh->hdmarx.config.src        = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst        = (void *)buf;
-	hperh->hdmarx.config.data_width = DMA_DATA_SIZE_BYTE;
-	hperh->hdmarx.config.size       = size;
-	hperh->hdmarx.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msel       = hperh->perh == I2C0 ? DMA_MSEL_I2C0 : DMA_MSEL_I2C1;
-	hperh->hdmarx.config.msigsel    = DMA_MSIGSEL_I2C_RNR;
-	hperh->hdmarx.config.channel    = channel;
-	dma_config_basic(&hperh->hdmarx);
-
-	if (i2c_req_mem_read(hperh, dev_addr, mem_addr, add_size, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-		else {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-
-	if (size == 1)
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	else
-		SET_BIT(hperh->perh->CON2, I2C_CON2_LDMA);
-
-	SET_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-	I2C_CLEAR_ADDRFLAG(hperh);
-	__UNLOCK(hperh);
-	return OK;
-}
-#endif
-
-/**
-  * @brief  Checks if target device is ready for communication.
-  * @note   This function is used with Memory devices
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  trials: Number of trials
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t i2c_is_device_ready(i2c_handle_t *hperh, uint16_t dev_addr, uint32_t trials, uint32_t timeout)
-{
-	uint32_t tickstart = 0;
-	uint32_t tmp1 = 0;
-	uint32_t tmp2 = 0;
-	uint32_t tmp3 = 0;
-	uint32_t I2C_Trials = 1;
-
-	if (hperh->state != I2C_STATE_READY)
-		return BUSY;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET, I2C_TIMEOUT_BUSY_FLAG) != OK)
-		return BUSY;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-
-	__LOCK(hperh);
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-
-	hperh->state = I2C_STATE_BUSY;
-	hperh->error_code = I2C_ERROR_NONE;
-
-	do {
-		SET_BIT(hperh->perh->CON1, I2C_CON1_START);
-
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_SB, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		hperh->perh->DATA = I2C_7BIT_ADD_WRITE(dev_addr);
-		tickstart            = __get_tick();
-		tmp1                 = i2c_get_flag_status(hperh, I2C_FLAG_ADDR);
-		tmp2                 = i2c_get_flag_status(hperh, I2C_FLAG_AF);
-		tmp3                 = hperh->state;
-
-		while ((tmp1 == RESET) && (tmp2 == RESET) && (tmp3 != I2C_STATE_TIMEOUT)) {
-			if ((timeout == 0) || ((__get_tick() - tickstart ) > timeout))
-				hperh->state = I2C_STATE_TIMEOUT;
-
-			tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_ADDR);
-			tmp2 = i2c_get_flag_status(hperh, I2C_FLAG_AF);
-			tmp3 = hperh->state;
-		}
-		hperh->state = I2C_STATE_READY;
-
-		if (i2c_get_flag_status(hperh, I2C_FLAG_ADDR) == SET) {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			I2C_CLEAR_ADDRFLAG(hperh);
-
-			if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET,
-							I2C_TIMEOUT_BUSY_FLAG) != OK) {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-
-			hperh->state = I2C_STATE_READY;
-			__UNLOCK(hperh);
-			return OK;
-		}
-		else {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			i2c_clear_flag_status(hperh, I2C_FLAG_AF);
-
-			if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BUSY, SET,
-							I2C_TIMEOUT_BUSY_FLAG) != OK) {
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	} while (I2C_Trials++ < trials);
-
-	hperh->state = I2C_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup I2C_Public_Functions_Group3 Peripheral Control functions
-  * @brief   Peripheral state and Errors functions
-  *
-@verbatim
- ===============================================================================
-            ##### Peripheral Control functions #####
- ===============================================================================
-    [..]
-    This subsection permits to get in run-time the status of the peripheral
-    and the data flow.
-
-@endverbatim
- * @{
- */
-
-/**
-  * @brief  Enable/disable the specified i2c interrupts.
-  * @param  hperh: Pointer to a i2c_handle_t structure.
-  * @param  it: Specifies the i2c interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref i2c_interrupt_t.
-  * @param  state: New state of the specified i2c interrupts.
-  *         This parameter can be:
-  *             @arg ENABLE
-  *             @arg DISABLE
-  * @retval None
-  */
-void i2c_interrupt_config(i2c_handle_t *hperh, i2c_interrupt_t it, type_func_t state)
-{
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_IT_TYPE(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		SET_BIT((hperh)->perh->CON2, (it));
-	else
-		CLEAR_BIT((hperh)->perh->CON2, (it));
-
-	return;
-}
-
-/**
-  * @brief  Get the status of I2C_SR register.
-  * @param  hperh: Pointer to a i2c_handle_t structure.
-  * @param  flag: Specifies the I2C status type.
-  *         This parameter can be one of the @ref i2c_flag_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t i2c_get_flag_status(i2c_handle_t *hperh, i2c_flag_t flag)
-{
-	flag_status_t state = RESET;
-
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_FLAG(flag));
-
-	if ((flag & 0xFF0000) == 0) {
-		if ((hperh->perh->STAT1 & flag) == flag)
-			state = SET;
-	}
-	else {
-		if ((hperh->perh->STAT2 & (flag >> 16)) == (flag >> 16))
-			state = SET;
-	}
-
-	return state;
-}
-
-/**
-  * @brief  Get the status of interrupt.
-  * @param  hperh: Pointer to a i2c_handle_t structure.
-  * @param  it: Specifies the i2c interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref i2c_interrupt_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t i2c_get_it_status(i2c_handle_t *hperh, i2c_interrupt_t it)
-{
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_IT_TYPE(it));
-
-	if ((hperh->perh->CON2 & it) == it)
-		return SET;
-	else
-		return RESET;
-}
-
-/**
-  * @brief  Clear the UART interrupt flag.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  flag: Specifies the UART interrupt flag.
-  *         This parameter can be one of the @ref uart_flag_t.
-  * @retval None
-  */
-void i2c_clear_flag_status(i2c_handle_t *hperh, i2c_flag_t flag)
-{
-	assert_param(IS_I2C_TYPE(hperh->perh));
-	assert_param(IS_I2C_FLAG(flag));
-
-	if (flag > 65535)
-		return;
-
-	hperh->perh->STAT1 = (hperh->perh->STAT1 & (~flag));
-
-	return;
-
-}
-
-/**
-  * @brief  Return the I2C handle state.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval ald_status_t state
-  */
-i2c_state_t i2c_get_state(i2c_handle_t *hperh)
-{
-	return hperh->state;
-}
-
-/**
-  * @brief  Return the I2C error code.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval I2C Error Code
-  */
-uint32_t i2c_get_error(i2c_handle_t *hperh)
-{
-	return hperh->error_code;
-}
-/**
-  * @}
-  */
-
-/** @defgroup I2C_Public_Functions_Group4 IRQ Handler and Callbacks
-  * @{
-  */
-
-/**
-  * @brief  This function handles I2C event interrupt request.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval None
-  */
-void i2c_ev_irq_handler(i2c_handle_t *hperh)
-{
-	uint32_t tmp1 = 0;
-	uint32_t tmp2 = 0;
-	uint32_t tmp3 = 0;
-	uint32_t tmp4 = 0;
-
-	if ((hperh->mode == I2C_MODE_MASTER) || (hperh->mode == I2C_MODE_MEM)) {
-		if (i2c_get_flag_status(hperh, I2C_FLAG_TRA) == SET) {
-			tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_TXE);
-			tmp2 = i2c_get_it_status(hperh, I2C_IT_BUF);
-			tmp3 = i2c_get_flag_status(hperh, I2C_FLAG_BTF);
-			tmp4 = i2c_get_it_status(hperh, I2C_IT_EVT);
-
-			if ((tmp1 == SET) && (tmp2 == SET) && (tmp3 == RESET))
-				i2c_master_send_txe(hperh);
-			else if ((tmp3 == SET) && (tmp4 == SET))
-				i2c_master_send_btf(hperh);
-		}
-
-		/* I2C in mode Receiver */
-		else {
-			tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_RXNE);
-			tmp2 = i2c_get_it_status(hperh, I2C_IT_BUF);
-			tmp3 = i2c_get_flag_status(hperh, I2C_FLAG_BTF);
-			tmp4 = i2c_get_it_status(hperh, I2C_IT_EVT);
-
-			if ((tmp1 == SET) && (tmp2 == SET) && (tmp3 == RESET))
-				i2c_master_recv_rxne(hperh);
-			else if ((tmp3 == SET) && (tmp4 == SET))
-				i2c_master_recv_btf(hperh);
-		}
-	}
-
-	/* Slave mode selected */
-	else {
-		tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_ADDR);
-		tmp2 = i2c_get_it_status(hperh, (I2C_IT_EVT));
-		tmp3 = i2c_get_flag_status(hperh, I2C_FLAG_STOPF);
-		tmp4 = i2c_get_flag_status(hperh, I2C_FLAG_TRA);
-
-		if ((tmp1 == SET) && (tmp2 == SET)) {
-			i2c_slave_addr(hperh);
-		}
-		else if ((tmp3 == SET) && (tmp2 == SET)) {
-			i2c_slave_stopf(hperh);
-		}
-
-		/* I2C in mode Transmitter */
-		else if (tmp4 == SET) {
-			tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_TXE);
-			tmp2 = i2c_get_it_status(hperh, I2C_IT_BUF);
-			tmp3 = i2c_get_flag_status(hperh, I2C_FLAG_BTF);
-			tmp4 = i2c_get_it_status(hperh, I2C_IT_EVT);
-
-			if ((tmp1 == SET) && (tmp2 == SET) && (tmp3 == RESET))
-				i2c_slave_send_txe(hperh);
-			else if ((tmp3 == SET) && (tmp4 == SET))
-				i2c_slave_send_btf(hperh);
-		}
-
-		/* I2C in mode Receiver */
-		else {
-			tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_RXNE);
-			tmp2 = i2c_get_it_status(hperh, I2C_IT_BUF);
-			tmp3 = i2c_get_flag_status(hperh, I2C_FLAG_BTF);
-			tmp4 = i2c_get_it_status(hperh, I2C_IT_EVT);
-
-			if ((tmp1 == SET) && (tmp2 == SET) && (tmp3 == RESET))
-				i2c_slave_recv_rxne(hperh);
-			else if ((tmp3 == SET) && (tmp4 == SET))
-				i2c_slave_recv_btf(hperh);
-		}
-	}
-}
-
-/**
-  * @brief  This function handles I2C error interrupt request.
-  * @param  hperh: pointer to a i2c_handle_t structure that contains
-  *         the configuration information for I2C module
-  * @retval  NONE
-  */
-void i2c_er_irq_handler(i2c_handle_t *hperh)
-{
-	uint32_t tmp1 = 0;
-	uint32_t tmp2 = 0;
-	uint32_t tmp3 = 0;
-
-	tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_BERR);
-	tmp2 = i2c_get_it_status(hperh, I2C_IT_ERR);
-
-	/* I2C Bus error interrupt occurred */
-	if ((tmp1 == SET) && (tmp2 == SET)) {
-		hperh->error_code |= I2C_ERROR_BERR;
-		i2c_clear_flag_status(hperh, I2C_FLAG_BERR);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_SRST);
-	}
-
-	tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_ARLO);
-	tmp2 = i2c_get_it_status(hperh, I2C_IT_ERR);
-
-	/* I2C Arbitration Loss error interrupt occurred */
-	if ((tmp1 == SET) && (tmp2 == SET)) {
-		hperh->error_code |= I2C_ERROR_ARLO;
-		i2c_clear_flag_status(hperh, I2C_FLAG_ARLO);
-	}
-
-	tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_AF);
-	tmp2 = i2c_get_it_status(hperh, I2C_IT_ERR);
-
-	/* I2C Acknowledge failure error interrupt occurred */
-	if ((tmp1 == SET) && (tmp2 == SET)) {
-		tmp1 = hperh->mode;
-		tmp2 = hperh->xfer_count;
-		tmp3 = hperh->state;
-		if ((tmp1 == I2C_MODE_SLAVE) && (tmp2 == 0) && \
-		   (tmp3 == I2C_STATE_BUSY_TX)) {
-			i2c_slave_af(hperh);
-		}
-		else {
-			hperh->error_code |= I2C_ERROR_AF;
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			i2c_clear_flag_status(hperh, I2C_FLAG_AF);
-		}
-	}
-
-	tmp1 = i2c_get_flag_status(hperh, I2C_FLAG_OVR);
-	tmp2 = i2c_get_it_status(hperh, I2C_IT_ERR);
-
-	/* I2C Over-Run/Under-Run interrupt occurred */
-	if ((tmp1 == SET) && (tmp2 == SET)) {
-		hperh->error_code |= I2C_ERROR_OVR;
-		i2c_clear_flag_status(hperh, I2C_FLAG_OVR);
-	}
-
-	if (hperh->error_code != I2C_ERROR_NONE) {
-		hperh->state = I2C_STATE_READY;
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_POSAP);
-		if (hperh->error_callback)
-			hperh->error_callback(hperh);
-	}
-}
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @addtogroup I2C_Private_Functions
-  * @{
-  */
-
-/**
-  * @brief  Handle TXE flag for Master Transmit mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_master_send_txe(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count == 0) {
-		i2c_interrupt_config(hperh, I2C_IT_BUF, DISABLE);
-	}
-	else {
-		hperh->perh->DATA = (*hperh->p_buff++);
-		hperh->xfer_count--;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Handle BTF flag for Master Transmit mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_master_send_btf(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count != 0) {
-		hperh->perh->DATA = (*hperh->p_buff++);
-		hperh->xfer_count--;
-	}
-	else {
-		i2c_interrupt_config(hperh, I2C_IT_EVT, DISABLE);
-		i2c_interrupt_config(hperh, I2C_IT_BUF, DISABLE);
-		i2c_interrupt_config(hperh, I2C_IT_ERR, DISABLE);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		if (hperh->mode == I2C_MODE_MEM) {
-			hperh->state = I2C_STATE_READY;
-			if (hperh->mem_tx_cplt_cbk)
-				hperh->mem_tx_cplt_cbk(hperh);
-		}
-		else {
-			hperh->state = I2C_STATE_READY;
-			if (hperh->master_tx_cplt_cbk)
-				hperh->master_tx_cplt_cbk(hperh);
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  Handle RXNE flag for Master Receive mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_master_recv_rxne(i2c_handle_t *hperh)
-{
-	uint32_t tmp = 0;
-
-	tmp = hperh->xfer_count;
-	if (tmp > 3) {
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		hperh->xfer_count--;
-	}
-	else if ((tmp == 2) || (tmp == 3)) {
-		i2c_interrupt_config(hperh, I2C_IT_BUF, DISABLE);
-	}
-	else {
-		i2c_interrupt_config(hperh, I2C_IT_EVT, DISABLE);
-		i2c_interrupt_config(hperh, I2C_IT_BUF, DISABLE);
-		i2c_interrupt_config(hperh, I2C_IT_ERR, DISABLE);
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		hperh->xfer_count--;
-
-		if (hperh->mode == I2C_MODE_MEM) {
-			hperh->state = I2C_STATE_READY;
-			if (hperh->mem_rx_cplt_cbk)
-				hperh->mem_rx_cplt_cbk(hperh);
-		}
-		else {
-			hperh->state = I2C_STATE_READY;
-			if (hperh->master_rx_cplt_cbk)
-				hperh->master_rx_cplt_cbk(hperh);
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  Handle BTF flag for Master Receive mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_master_recv_btf(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count == 3) {
-		CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		--hperh->xfer_count;
-	}
-	else if (hperh->xfer_count == 2) {
-		i2c_interrupt_config(hperh, I2C_IT_EVT, DISABLE);
-		i2c_interrupt_config(hperh, I2C_IT_ERR, DISABLE);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		--hperh->xfer_count;
-
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		--hperh->xfer_count;
-
-		if (hperh->mode == I2C_MODE_MEM) {
-			hperh->state = I2C_STATE_READY;
-			if (hperh->mem_rx_cplt_cbk)
-				hperh->mem_rx_cplt_cbk(hperh);
-		}
-		else {
-			hperh->state = I2C_STATE_READY;
-			if (hperh->master_rx_cplt_cbk)
-				hperh->master_rx_cplt_cbk(hperh);
-		}
-	}
-	else {
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		--hperh->xfer_count;
-	}
-	return OK;
-}
-
-/**
-  * @brief  Handle TXE flag for Slave Transmit mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_slave_send_txe(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count != 0) {
-		hperh->perh->DATA = (*hperh->p_buff++);
-		--hperh->xfer_count;
-	}
-	return OK;
-}
-
-/**
-  * @brief  Handle BTF flag for Slave Transmit mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_slave_send_btf(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count != 0) {
-		hperh->perh->DATA = (*hperh->p_buff++);
-		--hperh->xfer_count;
-	}
-	return OK;
-}
-
-/**
-  * @brief  Handle RXNE flag for Slave Receive mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_slave_recv_rxne(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count != 0) {
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		--hperh->xfer_count;
-	}
-	return OK;
-}
-
-/**
-  * @brief  Handle BTF flag for Slave Receive mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_slave_recv_btf(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count != 0) {
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		--hperh->xfer_count;
-	}
-	return OK;
-}
-
-/**
-  * @brief  Handle ADD flag for Slave
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_slave_addr(i2c_handle_t *hperh)
-{
-	I2C_CLEAR_ADDRFLAG(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Handle STOPF flag for Slave mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_slave_stopf(i2c_handle_t *hperh)
-{
-	if (hperh->xfer_count != 0) {
-		(*hperh->p_buff++) = hperh->perh->DATA;
-		--hperh->xfer_count;
-	}
-
-	i2c_interrupt_config(hperh, I2C_IT_EVT, DISABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, DISABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, DISABLE);
-	__I2C_CLEAR_STOPFLAG(hperh);
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	hperh->state = I2C_STATE_READY;
-
-	if (hperh->slave_rx_cplt_cbk)
-		hperh->slave_rx_cplt_cbk(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Handle Acknowledge Failed for Slave mode
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_slave_af(i2c_handle_t *hperh)
-{
-	i2c_interrupt_config(hperh, I2C_IT_EVT, DISABLE);
-	i2c_interrupt_config(hperh, I2C_IT_BUF, DISABLE);
-	i2c_interrupt_config(hperh, I2C_IT_ERR, DISABLE);
-	i2c_clear_flag_status(hperh, I2C_FLAG_AF);
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	hperh->state = I2C_STATE_READY;
-
-	if (hperh->slave_tx_cplt_cbk)
-		hperh->slave_tx_cplt_cbk(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Master sends target device address followed by internal memory address for write request.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_master_req_write(i2c_handle_t *hperh, uint16_t dev_addr, uint32_t timeout)
-{
-	SET_BIT(hperh->perh->CON1, I2C_CON1_START);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_SB, RESET, timeout) != OK)
-		return TIMEOUT;
-
-	if (hperh->init.addr_mode == I2C_ADDR_7BIT) {
-		hperh->perh->DATA = I2C_7BIT_ADD_WRITE(dev_addr);
-	}
-	else {
-		hperh->perh->DATA = I2C_10BIT_HEADER_WRITE(dev_addr);
-
-		if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADD10, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_AF) {
-				return ERROR;
-			}
-			else {
-				return TIMEOUT;
-			}
-		}
-
-		hperh->perh->DATA = I2C_10BIT_ADDRESS(dev_addr);
-	}
-
-	if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADDR, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF)
-			return ERROR;
-		else
-			return TIMEOUT;
-	}
-	return OK;
-}
-
-/**
-  * @brief  Master sends target device address followed by internal memory address for read request.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_master_req_read(i2c_handle_t *hperh, uint16_t dev_addr, uint32_t timeout)
-{
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	SET_BIT(hperh->perh->CON1, I2C_CON1_START);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_SB, RESET, timeout) != OK)
-		return TIMEOUT;
-
-	if (hperh->init.addr_mode == I2C_ADDR_7BIT) {
-		hperh->perh->DATA = I2C_7BIT_ADD_READ(dev_addr);
-	}
-	else {
-		hperh->perh->DATA = I2C_10BIT_HEADER_WRITE(dev_addr);
-		if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADD10, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_AF)
-				return ERROR;
-			else
-				return TIMEOUT;
-		}
-
-		hperh->perh->DATA = I2C_10BIT_ADDRESS(dev_addr);
-
-		if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADDR, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_AF)
-				return ERROR;
-			else
-				return TIMEOUT;
-		}
-
-		I2C_CLEAR_ADDRFLAG(hperh);
-		SET_BIT(hperh->perh->CON1, I2C_CON1_START);
-
-		if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_SB, RESET, timeout) != OK)
-			return TIMEOUT;
-
-		hperh->perh->DATA = I2C_10BIT_HEADER_READ(dev_addr);
-	}
-
-	if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADDR, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF)
-			return ERROR;
-		else
-			return TIMEOUT;
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Master sends target device address followed by internal memory address for write request.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_req_mem_write(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr, uint16_t add_size, uint32_t timeout)
-{
-	SET_BIT(hperh->perh->CON1, I2C_CON1_START);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_SB, RESET, timeout) != OK) {
-		return TIMEOUT;
-	}
-
-	hperh->perh->DATA = I2C_7BIT_ADD_WRITE(dev_addr);
-
-	if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADDR, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF)
-			return ERROR;
-		else
-			return TIMEOUT;
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-
-	if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			return ERROR;
-		}
-		else {
-			return TIMEOUT;
-		}
-	}
-
-	if (add_size == I2C_MEMADD_SIZE_8BIT) {
-		hperh->perh->DATA = I2C_MEM_ADD_LSB(mem_addr);
-	}
-	else {
-		hperh->perh->DATA = I2C_MEM_ADD_MSB(mem_addr);
-		if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_AF) {
-				SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-				return ERROR;
-			}
-			else {
-				return TIMEOUT;
-			}
-		}
-		hperh->perh->DATA = I2C_MEM_ADD_LSB(mem_addr);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Master sends target device address followed by internal memory address for read request.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  dev_addr: Target device address
-  * @param  mem_addr: Internal memory address
-  * @param  add_size: size of internal memory address
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_req_mem_read(i2c_handle_t *hperh, uint16_t dev_addr, uint16_t mem_addr, uint16_t add_size, uint32_t timeout)
-{
-	SET_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	SET_BIT(hperh->perh->CON1, I2C_CON1_START);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_SB, RESET, timeout) != OK)
-		return TIMEOUT;
-
-	hperh->perh->DATA = I2C_7BIT_ADD_WRITE(dev_addr);
-
-	if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADDR, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF)
-			return ERROR;
-		else
-			return TIMEOUT;
-	}
-
-	I2C_CLEAR_ADDRFLAG(hperh);
-
-	if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			return ERROR;
-		}
-		else {
-			return TIMEOUT;
-		}
-	}
-
-	if (add_size == I2C_MEMADD_SIZE_8BIT) {
-		hperh->perh->DATA = I2C_MEM_ADD_LSB(mem_addr);
-	}
-	else {
-		hperh->perh->DATA = I2C_MEM_ADD_MSB(mem_addr);
-
-		if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-			if (hperh->error_code == I2C_ERROR_AF) {
-				SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-				return ERROR;
-			}
-			else {
-				return TIMEOUT;
-			}
-		}
-		hperh->perh->DATA = I2C_MEM_ADD_LSB(mem_addr);
-	}
-
-	if (i2c_wait_txe_to_timeout(hperh, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF) {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			return ERROR;
-		}
-		else {
-			return TIMEOUT;
-		}
-	}
-
-	SET_BIT(hperh->perh->CON1, I2C_CON1_START);
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_SB, RESET, timeout) != OK)
-		return TIMEOUT;
-
-	hperh->perh->DATA = I2C_7BIT_ADD_READ(dev_addr);
-
-	if (i2c_wait_master_addr_to_timeout(hperh, I2C_FLAG_ADDR, timeout) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF)
-			return ERROR;
-		else
-			return TIMEOUT;
-	}
-
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  DMA I2C master transmit process complete callback.
-  * @param  argv: I2C handle
-  * @retval None
-  */
-static void i2c_dma_master_send_cplt(void *argv)
-{
-	i2c_handle_t* hperh = (i2c_handle_t*)argv;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, I2C_TIMEOUT_FLAG) != OK)
-		hperh->error_code |= I2C_ERROR_TIMEOUT;
-
-	SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-
-	hperh->xfer_count = 0;
-	hperh->state      = I2C_STATE_READY;
-	hperh->mode       = I2C_MODE_NONE;
-
-	if (hperh->error_code != I2C_ERROR_NONE) {
-		if (hperh->error_callback)
-			hperh->error_callback(hperh);
-	}
-	else {
-		if (hperh->master_tx_cplt_cbk)
-			hperh->master_tx_cplt_cbk(hperh);
-	}
-}
-
-/**
-  * @brief  DMA I2C slave transmit process complete callback.
-  * @param  argv: I2C handle
-  * @retval None
-  */
-static void i2c_dma_slave_send_cplt(void *argv)
-{
-	i2c_handle_t* hperh = (i2c_handle_t*)argv;
-
-	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_AF, RESET, I2C_TIMEOUT_FLAG) != OK)
-		hperh->error_code |= I2C_ERROR_TIMEOUT;
-
-	i2c_clear_flag_status(hperh, I2C_FLAG_AF);
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-
-	hperh->xfer_count = 0;
-	hperh->state      = I2C_STATE_READY;
-	hperh->mode       = I2C_MODE_NONE;
-
-	if (hperh->error_code != I2C_ERROR_NONE) {
-		if (hperh->error_callback)
-			hperh->error_callback(hperh);
-	}
-	else {
-		if (hperh->slave_tx_cplt_cbk)
-			hperh->slave_tx_cplt_cbk(hperh);
-	}
-}
-
-/**
-  * @brief  DMA I2C master receive process complete callback
-  * @param  argv: I2C handle
-  * @retval None
-  */
-static void i2c_dma_master_recv_cplt(void *argv)
-{
-	i2c_handle_t* hperh = (i2c_handle_t*)argv;
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_LDMA);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-
-	hperh->xfer_count = 0;
-	hperh->state      = I2C_STATE_READY;
-	hperh->mode       = I2C_MODE_NONE;
-
-	if (hperh->error_code != I2C_ERROR_NONE) {
-		if (hperh->error_callback)
-			hperh->error_callback(hperh);
-	}
-	else {
-		if (hperh->master_rx_cplt_cbk)
-			hperh->master_rx_cplt_cbk(hperh);
-	}
-}
-
-/**
-  * @brief  DMA I2C slave receive process complete callback.
-  * @param  argv: I2C handle
-  * @retval None
-  */
-static void i2c_dma_slave_recv_cplt(void *argv)
-{
-	i2c_handle_t* hperh = (i2c_handle_t*)argv;
-
-	if (i2c_wait_stop_to_timeout(hperh, I2C_TIMEOUT_FLAG) != OK) {
-		if (hperh->error_code == I2C_ERROR_AF)
-			hperh->error_code |= I2C_ERROR_AF;
-		else
-			hperh->error_code |= I2C_ERROR_TIMEOUT;
-	}
-
-	__I2C_CLEAR_STOPFLAG(hperh);
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-
-	hperh->xfer_count = 0;
-	hperh->state      = I2C_STATE_READY;
-	hperh->mode       = I2C_MODE_NONE;
-
-	if (hperh->error_code != I2C_ERROR_NONE) {
-		if (hperh->error_callback)
-			hperh->error_callback(hperh);
-	}
-	else {
-		if (hperh->slave_rx_cplt_cbk)
-			hperh->slave_rx_cplt_cbk(hperh);
-	}
-}
-
-/**
-  * @brief  DMA I2C Memory Write process complete callback
-  * @param  argv: I2C handle
-  * @retval None
-  */
-static void i2c_dma_mem_send_cplt(void *argv)
-{
-	i2c_handle_t* hperh = (i2c_handle_t*)argv;
-
- 	if (i2c_wait_flag_to_timeout(hperh, I2C_FLAG_BTF, RESET, I2C_TIMEOUT_FLAG) != OK)
-		hperh->error_code |= I2C_ERROR_TIMEOUT;
-
-	SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-
-	hperh->xfer_count = 0;
-	hperh->state      = I2C_STATE_READY;
-	hperh->mode       = I2C_MODE_NONE;
-
-	if (hperh->error_code != I2C_ERROR_NONE) {
-		if (hperh->error_callback)
-			hperh->error_callback(hperh);
-	}
-	else {
-		if (hperh->mem_tx_cplt_cbk)
-			hperh->mem_tx_cplt_cbk(hperh);
-	}
-}
-
-/**
-  * @brief  DMA I2C Memory Read process complete callback
-  * @param  argv: I2C handle
-  * @retval None
-  */
-static void i2c_dma_mem_recv_cplt(void *argv)
-{
-	i2c_handle_t* hperh = (i2c_handle_t*)argv;
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-	SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_LDMA);
-	CLEAR_BIT(hperh->perh->CON2, I2C_CON2_DMAEN);
-
-	hperh->xfer_count = 0;
-	hperh->state      = I2C_STATE_READY;
-	hperh->mode       = I2C_MODE_NONE;
-
-	if (hperh->error_code != I2C_ERROR_NONE) {
-		if (hperh->error_callback)
-			hperh->error_callback(hperh);
-	}
-	else {
-		if (hperh->mem_rx_cplt_cbk)
-			hperh->mem_rx_cplt_cbk(hperh);
-	}
-}
-#endif
-
-/**
-  * @brief  I2C Configuration Speed function
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  i2c_clk: PCLK frequency from RCC.
-  * @retval CCR Speed: Speed to set in I2C CCR Register
-  */
-static uint32_t i2c_configure_speed(i2c_handle_t *hperh, uint32_t i2c_clk)
-{
-	uint32_t tmp1 = 0;
-
-	if (hperh->init.clk_speed <= I2C_STANDARD_MODE_MAX_CLK) {
-		tmp1 = (i2c_clk / (hperh->init.clk_speed << 1));
-		if ((tmp1 & I2C_CKCFG_CLKSET) < 4 )
-			return 4;
-		else
-			return tmp1;
-	}
-	else {
-		tmp1 = I2C_CKCFG_CLKMOD;
-
-		if (hperh->init.duty == I2C_DUTYCYCLE_2)
-			tmp1 |= (i2c_clk / (hperh->init.clk_speed * 3)) | I2C_DUTYCYCLE_2;
-		else
-			tmp1 |= (i2c_clk / (hperh->init.clk_speed * 25)) | I2C_DUTYCYCLE_16_9;
-
-		if ((tmp1 & I2C_CKCFG_CLKSET) < 1 )
-			return 1;
-		else
-			return tmp1;
-	}
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  DMA I2C communication error callback.
-  * @param  argv: I2C handle
-  * @retval None
-  */
-static void i2c_dma_error(void *argv)
-{
-	i2c_handle_t* hperh = (i2c_handle_t*)argv;
-
-	CLEAR_BIT(hperh->perh->CON1, I2C_CON1_ACKEN);
-
-	hperh->xfer_count  = 0;
-	hperh->state       = I2C_STATE_READY;
-	hperh->mode        = I2C_MODE_NONE;
-	hperh->error_code |= I2C_ERROR_DMA;
-
-	if (hperh->error_callback)
-		hperh->error_callback(hperh);
-}
-#endif
-
-/**
-  * @brief  This function handles I2C Communication timeout.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  flag: specifies the I2C flag to check.
-  * @param  status: The new flag status (SET or RESET).
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_wait_flag_to_timeout(i2c_handle_t *hperh, i2c_flag_t flag, flag_status_t status, uint32_t timeout)
-{
-	uint32_t tickstart = 0;
-
-	tickstart = __get_tick();
-
-	if (status == RESET) {
-		while (i2c_get_flag_status(hperh, flag) == RESET) {
-			if ((timeout == 0) || ((__get_tick() - tickstart ) > timeout)) {
-				hperh->state = I2C_STATE_READY;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-	else {
-		while (i2c_get_flag_status(hperh, flag) != RESET) {
-			if ((timeout == 0) || ((__get_tick() - tickstart ) > timeout)) {
-				hperh->state = I2C_STATE_READY;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  This function handles I2C Communication timeout for Master addressing phase.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  flag: specifies the I2C flag to check.
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_wait_master_addr_to_timeout(i2c_handle_t *hperh, i2c_flag_t flag, uint32_t timeout)
-{
-	uint32_t tickstart = 0;
-
-	tickstart = __get_tick();
-	while (i2c_get_flag_status(hperh, flag) == RESET) {
-		if (i2c_get_flag_status(hperh, I2C_FLAG_AF) == SET) {
-			SET_BIT(hperh->perh->CON1, I2C_CON1_STOP);
-			i2c_clear_flag_status(hperh, I2C_FLAG_AF);
-
-			hperh->error_code = I2C_ERROR_AF;
-			hperh->state = I2C_STATE_READY;
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-
-		if (timeout != I2C_MAX_DELAY) {
-			if ((timeout == 0) || ((__get_tick() - tickstart ) > timeout)) {
-				hperh->state = I2C_STATE_READY;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  This function handles I2C Communication timeout for specific usage of TXE flag.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_wait_txe_to_timeout(i2c_handle_t *hperh, uint32_t timeout)
-{
-	uint32_t tickstart = __get_tick();
-
-	while (i2c_get_flag_status(hperh, I2C_FLAG_TXE) == RESET) {
-		if (i2c_is_ack_failed(hperh) != OK)
-			return ERROR;
-
-		if (timeout != I2C_MAX_DELAY) {
-			if ((timeout == 0) || ((__get_tick() - tickstart) > timeout)) {
-				hperh->error_code |= I2C_ERROR_TIMEOUT;
-				hperh->state = I2C_STATE_READY;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  This function handles I2C Communication timeout for specific usage of BTF flag.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_wait_btf_to_timeout(i2c_handle_t *hperh, uint32_t timeout)
-{
-	uint32_t tickstart = __get_tick();
-
-	while (i2c_get_flag_status(hperh, I2C_FLAG_BTF) == RESET) {
-		if (i2c_is_ack_failed(hperh) != OK) {
-			return ERROR;
-		}
-
-		if (timeout != I2C_MAX_DELAY) {
-			if ((timeout == 0) || ((__get_tick() - tickstart) > timeout)) {
-				hperh->error_code |= I2C_ERROR_TIMEOUT;
-				hperh->state = I2C_STATE_READY;
-				__UNLOCK(hperh);
-				return TIMEOUT;
-			}
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  This function handles I2C Communication timeout for specific usage of STOP flag.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_wait_stop_to_timeout(i2c_handle_t *hperh, uint32_t timeout)
-{
-	uint32_t tickstart = 0x00;
-	tickstart = __get_tick();
-
-	while (i2c_get_flag_status(hperh, I2C_FLAG_STOPF) == RESET) {
-		if (i2c_is_ack_failed(hperh) != OK)
-			return ERROR;
-
-		if ((timeout == 0) || ((__get_tick() - tickstart) > timeout)) {
-			hperh->error_code |= I2C_ERROR_TIMEOUT;
-			hperh->state = I2C_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  This function handles I2C Communication timeout for specific usage of RXNE flag.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_wait_rxne_to_timeout(i2c_handle_t *hperh, uint32_t timeout)
-{
-	uint32_t tickstart = 0x00;
-	tickstart = __get_tick();
-
-	while (i2c_get_flag_status(hperh, I2C_FLAG_RXNE) == RESET) {
-		if (i2c_get_flag_status(hperh, I2C_FLAG_STOPF) == SET) {
-			i2c_clear_flag_status(hperh, I2C_FLAG_STOPF);
-			hperh->error_code = I2C_ERROR_NONE;
-			hperh->state = I2C_STATE_READY;
-			__UNLOCK(hperh);
-			return ERROR;
-		}
-
-		if ((timeout == 0) || ((__get_tick() - tickstart) > timeout)) {
-			hperh->error_code |= I2C_ERROR_TIMEOUT;
-			hperh->state = I2C_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-	}
-	return OK;
-}
-
-/**
-  * @brief  This function handles Acknowledge failed detection during an I2C Communication.
-  * @param  hperh: Pointer to a i2c_handle_t structure that contains
-  *                the configuration information for the specified I2C.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t i2c_is_ack_failed(i2c_handle_t *hperh)
-{
-	if (i2c_get_flag_status(hperh, I2C_FLAG_AF) == SET) {
-		i2c_clear_flag_status(hperh, I2C_FLAG_AF);
-		hperh->error_code = I2C_ERROR_AF;
-		hperh->state = I2C_STATE_READY;
-		__UNLOCK(hperh);
-
-		return ERROR;
-	}
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-#endif /* ALD_I2C */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 345
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_lcd.c

@@ -1,345 +0,0 @@
- /**
-   *********************************************************************************
-   *
-   * @file    ald_lcd.c
-   * @brief   LCD module driver.
-   *
-   * @version V1.0
-   * @date    29 Nov 2017
-   * @author  AE Team
-   * @note
-   *
-   * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-   *
-   *********************************************************************************
-   */
-
-#include "ald_lcd.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup LCD LCD
-  * @brief LCD module library
-  * @{
-  */
-#ifdef ALD_LCD
-
-/** @defgroup LCD_Public_Functions LCD Public Functions
-  * @{
-  */
-
-/** @defgroup LCD_Public_Functions_Group1 Initialize and Enable functions
-  * @brief Initialize and Enable Functions
-  * @{
-  */
-
-/**
-  * @brief Initializes the LCD Peripheral according to the specified parameters.
-  * @note This function can be used only when the LCD is disabled.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lcd_init(lcd_handle_t *hperh)
-{
-	uint16_t delay = 0;
-
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_VCHPS_TYPE(hperh->init.lcd_vchps));
-	assert_param(IS_LCD_VSEL_TYPE(hperh->init.lcd_vsel));
-	assert_param(IS_LCD_FUNC_TYPE(hperh->init.lcd_vbufld));
-	assert_param(IS_LCD_FUNC_TYPE(hperh->init.lcd_vbufhd));
-	assert_param(IS_LCD_LEVEL_TYPE(hperh->init.lcd_dsld));
-	assert_param(IS_LCD_LEVEL_TYPE(hperh->init.lcd_dshd));
-	assert_param(IS_LCD_RES_TYPE(hperh->init.lcd_resld));
-	assert_param(IS_LCD_RES_TYPE(hperh->init.lcd_reshd));
-	assert_param(IS_LCD_BIAS_TYPE(hperh->init.lcd_bias));
-	assert_param(IS_LCD_DUTY_TYPE(hperh->init.lcd_duty));
-	assert_param(IS_LCD_WFS_TYPE(hperh->init.lcd_wfs));
-	assert_param(IS_LCD_PRS_TYPE(hperh->init.lcd_prs));
-	assert_param(IS_LCD_DIV_TYPE(hperh->init.lcd_div));
-	assert_param(IS_LCD_DEAD_TYPE(hperh->init.lcd_dead));
-	assert_param(IS_LCD_PON_TYPE(hperh->init.lcd_pon));
-	assert_param(IS_LCD_VGS_TYPE(hperh->init.lcd_vgs));
-
-	__LOCK(hperh);
-
-	cmu_lcd_clock_select(hperh->init.clock);
-
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_WFS_MSK, hperh->init.lcd_wfs << LCD_FCR_WFS_POS);
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_PRS_MSK, hperh->init.lcd_prs << LCD_FCR_PRS_POSS);
-	for (delay = 0; delay < 3000; delay++);
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_DIV_MSK, hperh->init.lcd_div << LCD_FCR_DIV_POSS);
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_DEAD_MSK, hperh->init.lcd_dead << LCD_FCR_DEAD_POSS);
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_PON_MSK, hperh->init.lcd_pon << LCD_FCR_PON_POSS);
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_VGS_MSK, hperh->init.lcd_vgs << LCD_FCR_VGS_POSS);
-
-	MODIFY_REG(hperh->perh->CR, LCD_CR_DUTY_MSK, hperh->init.lcd_duty << LCD_CR_DUTY_POSS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_BIAS_MSK, hperh->init.lcd_bias << LCD_CR_BIAS_POSS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_VBUFHD_MSK, hperh->init.lcd_vbufhd << LCD_CR_VBUFHD_POS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_VBUFLD_MSK, hperh->init.lcd_vbufld << LCD_CR_VBUFLD_POS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_DSHD_MSK, hperh->init.lcd_dshd << LCD_CR_DSHD_POSS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_DSLD_MSK, hperh->init.lcd_dsld << LCD_CR_DSLD_POSS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_RESHD_MSK, hperh->init.lcd_reshd << LCD_CR_RESHD_POSS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_RESLD_MSK, hperh->init.lcd_resld << LCD_CR_RESLD_POSS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_VSEL_MSK, hperh->init.lcd_vsel << LCD_CR_VSEL_POSS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_VCHPS_MSK, hperh->init.lcd_vchps << LCD_CR_VCHPS_POSS);
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief Enables or disables the LCD controller.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param state: This parameter can be: ENABLE or DISABLE.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lcd_cmd(lcd_handle_t *hperh, type_func_t state)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_FUNC_STATE(state));
-
-	__LOCK(hperh);
-
-	MODIFY_REG(hperh->perh->CR, LCD_CR_OE_MSK, state << LCD_CR_OE_POS);
-	MODIFY_REG(hperh->perh->CR, LCD_CR_EN_MSK, state << LCD_CR_EN_POS);
-
-	__UNLOCK(hperh);
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LCD_Public_Functions_Group2 Config output functions
-  * @brief Config output and blink functions
-  * @{
-  */
-
-/**
-  * @brief Configures the LCD blink mode and blink frequency.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param blink_mode: Specifies the LCD blink mode.
-  * @param blink_freq: Specifies the LCD blink frequency.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lcd_blink_config(lcd_handle_t *hperh, lcd_blink_t blink_mode, lcd_blfrq_t blink_freq)
-{
-	uint16_t delay = 0;
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_BLINK_MODE(blink_mode));
-	assert_param(IS_LCD_BLFRQ_TYPE(blink_freq));
-	__LOCK(hperh);
-
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_BLMOD_MSK, blink_mode << LCD_FCR_BLMOD_POSS);
-	for (delay = 0; delay < 3000; delay++);
-	MODIFY_REG(hperh->perh->FCR, LCD_FCR_BLFRQ_MSK, blink_freq << LCD_FCR_BLFRQ_POSS);
-
-	__UNLOCK(hperh);
-	return OK;
- }
-
-/**
-  * @brief Control segment port enable or disable
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param seg: Specifies the LCD segment index
-  * @param seg_data: Specifies LCD segment data to be written to control segment output enable.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lcd_write_seg(lcd_handle_t *hperh, lcd_seg_t seg, uint32_t seg_data)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_SEG_TYPE(seg));
-	__LOCK(hperh);
-
-	if (seg == SEG_0_TO_31)
-		WRITE_REG(hperh->perh->SEGCR0, seg_data);
-	else
-		WRITE_REG(hperh->perh->SEGCR1, seg_data);
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief Writes a word in the specific LCD buffer to determine display.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param buf: Specifies the LCD buffer index.
-  * @param buf_data: Specifies LCD buffer data to be written to control display.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lcd_write(lcd_handle_t *hperh, uint8_t buf, uint32_t buf_data)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_BUFFER_TYPE(buf));
-
-	__LOCK(hperh);
-	WRITE_REG(hperh->perh->BUF[buf], buf_data);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LCD_Public_Functions_Group3 Peripheral State functions
-  * @brief LCD State functions
-  * @{
-  */
-
-/**
-  * @brief Checks whether the specified LCD flag is set or not.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param lcd_status: Specifies the flag to check.
-  * @retval The new state of LCD_STATUS
-  */
-uint32_t lcd_get_status(lcd_handle_t *hperh, lcd_status_t lcd_status)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_STATUS_TYPE(lcd_status));
-
-	if (lcd_status == LCD_STATUS_ALL)
-		return hperh->perh->SR;
-	else
-		return hperh->perh->SR & lcd_status ? 1 : 0;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LCD_Public_Functions_Group4 Interrupt functions
-  * @brief LCD Interrupt functions
-  * @{
-  */
-
-/**
-  * @brief Enable or disable the specified interrupt
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param it: Specifies the interrupt type to be enabled or disabled
-  *        @arg @ref LCD_IT_SOF Start of frame interrupt enable
-  *        @arg @ref LCD_IT_UDD Update display done interrupt
-  * @param state: New state of the specified interrupt.
-  *        This parameter can be: ENABLE or DISABLE
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lcd_interrupt_config(lcd_handle_t *hperh, lcd_it_t it, type_func_t state)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_IT_TYPE(it));
-	assert_param(IS_FUNC_STATE(state));
-	__LOCK(hperh);
-
-	if (state)
-		SET_BIT(hperh->perh->IE, it);
-	else
-		CLEAR_BIT(hperh->perh->IE, it);
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief Checks whether the specified interrupt has set or not.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param it: Specifies the interrupt type to check
-  *        This parameter can be one of the following values:
-  *        @arg @ref LCD_IT_SOF Start of frame interrupt enable
-  *        @arg @ref LCD_IT_UDD Update display done interrupt
-  * @retval The new state of the LCD_IT
-  */
-flag_status_t lcd_get_it_status(lcd_handle_t *hperh, lcd_it_t it)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_IT_TYPE(it));
-
-	return hperh->perh->IE & it ? SET : RESET;
-}
-
-/**
-  * @brief Checks whether the specified interrupt has occurred or not.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param flag: Specifies the interrupt type to check
-  *        This parameter can be one of the following values:
-  *        @arg @ref LCD_FLAG_SOF Start of frame interrupt enable
-  *        @arg @ref LCD_FLAG_UDD Update display done interrupt
-  * @retval The new state of the LCD_IT
-  */
-it_status_t lcd_get_flag_status(lcd_handle_t *hperh, lcd_flag_t flag)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_FLAG_TYPE(flag));
-
-	return hperh->perh->IF & flag ? SET : RESET;
-}
-
-/**
-  * @brief Clear interrupt state flag
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @param flag: Specifies the interrupt type to clear
-  *        This parameter can be one of the following values:
-  *        @arg @ref LCD_FLAG_SOF Start of frame interrupt enable
-  *        @arg @ref LCD_FLAG_UDD Update display done interrupt
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lcd_clear_flag_status(lcd_handle_t *hperh, lcd_flag_t flag)
-{
-	assert_param(IS_LCD_PERH_TYPE(hperh->perh));
-	assert_param(IS_LCD_FLAG_TYPE(flag));
-
-	__LOCK(hperh);
-	WRITE_REG(hperh->perh->IFCR, flag);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  This function handles LCD event interrupt request.
-  * @param hperh: Pointer to a lcd_handle_t structure that contains
-  *               the configuration information for the specified LCD.
-  * @retval None
-  */
-void lcd_irq_handler(lcd_handle_t *hperh)
-{
-	if (lcd_get_flag_status(hperh, LCD_FLAG_UDD)) {
-		lcd_clear_flag_status(hperh, LCD_FLAG_UDD);
-
-		if (hperh->display_cplt_cbk)
-			hperh->display_cplt_cbk(hperh);
-	}
-
-	if (lcd_get_flag_status(hperh, LCD_FLAG_SOF)) {
-		lcd_clear_flag_status(hperh, LCD_FLAG_SOF);
-
-		if (hperh->frame_start_cbk)
-			hperh->frame_start_cbk(hperh);
-	}
-
-	return;
-}
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-#endif /* ALD_LCD */
-/**
-  * @}
-  */
-/**
-  * @}
-  */

+ 0 - 675
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_lptim.c

@@ -1,675 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_lptim.c
-  * @brief   LPTIM module driver.
-  *	     This is the common part of the LPTIM initialization
-  *
-  * @version V1.0
-  * @date    09 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_lptim.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup LPTIM LPTIM
-  * @brief LPTIM module driver
-  * @{
-  */
-#ifdef ALD_LPTIM
-
-/** @defgroup LPTIM_Public_Functions LPTIM Public Functions
-  * @{
-  */
-
-/** @defgroup LPTIM_Public_Functions_Group1 Initialization functions
-  * @brief    Initialization and Configuration functions
-  *
-  * @{
-  */
-/**
-  * @brief  Reset the LPTIM peripheral.
-  * @param  hperh: Pointer to a lptim_handle_t.
-  * @retval None
-  */
-void lptim_reset(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	hperh->state = LPTIM_STATE_BUSY;
-	LPTIM_DISABLE(hperh);
-	hperh->state = LPTIM_STATE_RESET;
-	__UNLOCK(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Configure the LPTIM trigger mode according to the specified parameters in
-  *         the lptim_trigger_init_t.
-  * @param  hperh: Pointer to a lptim_handle_t.
-  * @param  config: Pointer to a lptim_trigger_init_t.
-  * @retval None
-  */
-void lptim_trigger_config(lptim_handle_t *hperh, lptim_trigger_init_t *config)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_TRIGEN(config->mode));
-	assert_param(IS_LPTIM_TRIGSEL(config->sel));
-
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_TRIGEN_MSK, (config->mode) << LP16T_CON0_TRIGEN_POSS);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_TRIGSEL_MSK, (config->sel) << LP16T_CON0_TRIGSEL_POSS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the LPTIM clock source according to the specified parameters in
-  *         the lptim_clock_source_init_t.
-  * @param  hperh: Pointer to a lptim_handle_t.
-  * @param  config: Pointer to a lptim_clock_source_init_t.
-  * @retval None
-  */
-void lptim_clock_source_config(lptim_handle_t *hperh, lptim_clock_source_init_t *config)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_CKSEL(config->sel));
-	assert_param(IS_LPTIM_CKPOL(config->polarity));
-
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_CKSEL_MSK, (config->sel) << LP16T_CON0_CKSEL_POS);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_CKPOL_MSK, (config->polarity) << LP16T_CON0_CKPOL_POS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the LPTIM trigger filter parameter according to
-  *         the specified parameters in the lptim_trgflt_t.
-  * @param  hperh: Pointer to a lptim_handle_t.
-  * @param  flt: Pointer to a lptim_trgflt_t.
-  * @retval None
-  */
-void lptim_trigger_filter_config(lptim_handle_t *hperh, lptim_trgflt_t flt)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_TRGFLT(flt));
-
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_TRGFLT_MSK, flt << LP16T_CON0_TRGFLT_POSS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the LPTIM clock filter parameter according to
-  *         the specified parameters in the lptim_ckflt_t.
-  * @param  hperh: Pointer to a lptim_handle_t.
-  * @param  flt: Pointer to a lptim_ckflt_t.
-  * @retval None
-  */
-void lptim_clock_filter_config(lptim_handle_t *hperh, lptim_ckflt_t flt)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_TRGFLT(flt));
-
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_CKFLT_MSK, flt << LP16T_CON0_CKFLT_POSS);
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LPTIM_Public_Functions_Group2 LPTIM output toggle functions
-  *  @brief    LPTime output toggle functions
-  *
-  * @verbatim
-  ==============================================================================
-                  ##### Time Output Compare functions #####
-  ==============================================================================
-  [..]
-    This section provides functions allowing to:
-    (+) Initialize the LPTIM Output Toggle.
-    (+) Start the LPTIM Output Toggle.
-    (+) Stop the LPTIM Output Toggle.
-    (+) Start the LPTIM Output Toggle and enable interrupt.
-    (+) Stop the LPTIM Output Toggle and disable interrupt.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIM Output toggle according to the specified
-  *		parameters in the tim_handle_t.
-  * @param  hperh: LPTIM handle
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lptim_toggle_init(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_PRESC(hperh->init.psc));
-
-	__LOCK(hperh);
-	hperh->state = LPTIM_STATE_BUSY;
-
-	cmu_lptim0_clock_select(hperh->init.clock);
-
-	WRITE_REG(hperh->perh->UPDATE, 1);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_WAVE_MSK, LPTIM_WAVE_TOGGLE << LP16T_CON0_WAVE_POSS);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_PRESC_MSK, (hperh->init.psc) << LP16T_CON0_PRESC_POSS);
-	WRITE_REG(hperh->perh->ARR, hperh->init.arr);
-	WRITE_REG(hperh->perh->CMP, hperh->init.cmp);
-	WRITE_REG(hperh->perh->UPDATE, 0);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_ARRWBSY_MSK));
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CMPWBSY_MSK));
-
-	hperh->state = LPTIM_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Starts the LPTIM Output toggle.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_toggle_start(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_MODE(hperh->init.mode));
-
-	LPTIM_ENABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	if (hperh->init.mode == LPTIM_MODE_CONTINUOUS)
-		LPTIM_CNTSTART(hperh);
-	else
-		LPTIM_SNGSTART(hperh);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-
-/**
-  * @brief  Stops the LPTIM Output toggle.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_toggle_stop(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	LPTIM_DISABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-
-/**
-  * @brief  Starts the LPTIM Output toggle in interrupt mode.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_toggle_start_by_it(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_MODE(hperh->init.mode));
-
-	lptim_interrupt_config(hperh, LPTIM_IT_ARRMAT, ENABLE);
-	LPTIM_ENABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	if (hperh->init.mode == LPTIM_MODE_CONTINUOUS)
-		LPTIM_CNTSTART(hperh);
-	else
-		LPTIM_SNGSTART(hperh);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-
-/**
-  * @brief  Stops the LPTIM Output toggle in interrupt mode.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_toggle_stop_by_it(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	lptim_interrupt_config(hperh, LPTIM_IT_ARRMAT, DISABLE);
-	LPTIM_DISABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LPTIM_Public_Functions_Group3 LPTIM output pulse functions
-  *  @brief    LPTime output pulse functions
-  *
-  * @verbatim
-  ==============================================================================
-                  ##### Time Output Compare functions #####
-  ==============================================================================
-  [..]
-    This section provides functions allowing to:
-    (+) Initialize the LPTIM Output pulse.
-    (+) Start the LPTIM Output pulse.
-    (+) Stop the LPTIM Output pulse.
-    (+) Start the LPTIM Output pulse and enable interrupt.
-    (+) Stop the LPTIM Output pulse and disable interrupt.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIM Output pulse according to the specified
-  *		parameters in the tim_handle_t.
-  * @param  hperh: LPTIM handle
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lptim_pulse_init(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_PRESC(hperh->init.psc));
-
-	__LOCK(hperh);
-	hperh->state = LPTIM_STATE_BUSY;
-	cmu_lptim0_clock_select(hperh->init.clock);
-
-	WRITE_REG(hperh->perh->UPDATE, 1);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_WAVE_MSK, LPTIM_WAVE_PULSE << LP16T_CON0_WAVE_POSS);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_PRESC_MSK, (hperh->init.psc) << LP16T_CON0_PRESC_POSS);
-	WRITE_REG(hperh->perh->ARR, hperh->init.arr);
-	WRITE_REG(hperh->perh->CMP, hperh->init.cmp);
-	WRITE_REG(hperh->perh->UPDATE, 0);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_ARRWBSY_MSK));
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CMPWBSY_MSK));
-
-	hperh->state = LPTIM_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Starts the LPTIM Output pulse.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pulse_start(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_MODE(hperh->init.mode));
-
-	LPTIM_ENABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	if (hperh->init.mode == LPTIM_MODE_CONTINUOUS)
-		LPTIM_CNTSTART(hperh);
-	else
-		LPTIM_SNGSTART(hperh);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-
-/**
-  * @brief  Stops the LPTIM Output pulse.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pulse_stop(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	LPTIM_DISABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	return;
-}
-
-/**
-  * @brief  Starts the LPTIM Output pulse in interrupt mode.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pulse_start_by_it(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_MODE(hperh->init.mode));
-
-	lptim_interrupt_config(hperh, LPTIM_IT_ARRMAT, ENABLE);
-	LPTIM_ENABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	if (hperh->init.mode == LPTIM_MODE_CONTINUOUS)
-		LPTIM_CNTSTART(hperh);
-	else
-		LPTIM_SNGSTART(hperh);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-
-/**
-  * @brief  Stops the LPTIM Output pulse in interrupt mode.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pulse_stop_by_it(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	lptim_interrupt_config(hperh, LPTIM_IT_ARRMAT, DISABLE);
-	LPTIM_DISABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LPTIM_Public_Functions_Group4 LPTIM output pwm functions
-  *  @brief    LPTime output pwm functions
-  *
-  * @verbatim
-  ==============================================================================
-                  ##### Time Output Compare functions #####
-  ==============================================================================
-  [..]
-    This section provides functions allowing to:
-    (+) Initialize the LPTIM Output pwm.
-    (+) Start the LPTIM Output pwm.
-    (+) Stop the LPTIM Output pwm.
-    (+) Start the LPTIM Output pwm and enable interrupt.
-    (+) Stop the LPTIM Output pwm and disable interrupt.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIM Output pwm according to the specified
-  *		parameters in the tim_handle_t.
-  * @param  hperh: LPTIM handle
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lptim_pwm_init(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_PRESC(hperh->init.psc));
-
-	__LOCK(hperh);
-	hperh->state = LPTIM_STATE_BUSY;
-
-	WRITE_REG(hperh->perh->UPDATE, 1);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_WAVE_MSK, LPTIM_WAVE_PWM << LP16T_CON0_WAVE_POSS);
-	MODIFY_REG(hperh->perh->CON0, LP16T_CON0_PRESC_MSK, (hperh->init.psc) << LP16T_CON0_PRESC_POSS);
-	WRITE_REG(hperh->perh->ARR, hperh->init.arr);
-	WRITE_REG(hperh->perh->CMP, hperh->init.cmp);
-	WRITE_REG(hperh->perh->UPDATE, 0);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_ARRWBSY_MSK));
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CMPWBSY_MSK));
-
-	hperh->state = LPTIM_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Starts the LPTIM Output pwm.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pwm_start(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_MODE(hperh->init.mode));
-
-	LPTIM_ENABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	if (hperh->init.mode == LPTIM_MODE_CONTINUOUS)
-		LPTIM_CNTSTART(hperh);
-	else
-		LPTIM_SNGSTART(hperh);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-
-/**
-  * @brief  Stops the LPTIM Output pwm.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pwm_stop(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	LPTIM_DISABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	return;
-}
-
-/**
-  * @brief  Starts the LPTIM Output pwm in interrupt mode.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pwm_start_by_it(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_MODE(hperh->init.mode));
-
-	lptim_interrupt_config(hperh, LPTIM_IT_CMPMAT, ENABLE);
-	LPTIM_ENABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	if (hperh->init.mode == LPTIM_MODE_CONTINUOUS)
-		LPTIM_CNTSTART(hperh);
-	else
-		LPTIM_SNGSTART(hperh);
-
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-	return;
-}
-
-/**
-  * @brief  Stops the LPTIM Output pwm in interrupt mode.
-  * @param  hperh: LPTIM handle
-  * @retval None
-  */
-void lptim_pwm_stop_by_it(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	lptim_interrupt_config(hperh, LPTIM_IT_CMPMAT, DISABLE);
-	LPTIM_DISABLE(hperh);
-	while (READ_BIT(hperh->perh->SYNCSTAT, LP16T_SYNCSTAT_CON1WBSY_MSK));
-
-	return;
-}
-/**
-  * @}
-  */
-
-
-/** @defgroup LPTIM_Public_Functions_Group5 Control functions
-  * @brief LPTIM Control functions
-  *
-  * @{
-  */
-/**
-  * @brief  This function handles LPTIM interrupts requests.
-  * @param  hperh: LPTIM  handle
-  * @retval None
-  */
-void lptim_irq_handle(lptim_handle_t *hperh)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-
-	/* Output compare event */
-	if (((lptim_get_it_status(hperh, LPTIM_IT_CMPMAT)) != RESET) &&
-                           ((lptim_get_flag_status(hperh, LPTIM_FLAG_CMPMAT)) != RESET)) {
-		lptim_clear_flag_status(hperh, LPTIM_FLAG_CMPMAT);
-
-		if (hperh->cmp_cbk)
-			hperh->cmp_cbk(hperh);
-	}
-
-	/* Output update event */
-	if (((lptim_get_it_status(hperh, LPTIM_IT_ARRMAT)) != RESET) &&
-                           ((lptim_get_flag_status(hperh, LPTIM_FLAG_ARRMAT)) != RESET)) {
-		lptim_clear_flag_status(hperh, LPTIM_FLAG_ARRMAT);
-
-		if (hperh->update_cbk)
-			hperh->update_cbk(hperh);
-	}
-
-	/* Trigger event */
-	if (((lptim_get_it_status(hperh, LPTIM_IT_EXTTRIG)) != RESET) &&
-                           ((lptim_get_flag_status(hperh, LPTIM_FLAG_EXTTRIG)) != RESET)) {
-		lptim_clear_flag_status(hperh, LPTIM_FLAG_EXTTRIG);
-
-		if (hperh->trig_cbk)
-			hperh->trig_cbk(hperh);
-	}
-
-	return;
-}
-
-/**
-  * @brief  Enables or disables the specified LPTIM interrupts.
-  * @param  hperh: Pointer to a lptim_handle_t structure that contains
-  *         the configuration information for the specified LPTIM module.
-  * @param  it: Specifies the SPI interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref lptim_it_t.
-  * @param  state: New status
-  *           - ENABLE
-  *           - DISABLE
-  * @retval None
-  */
-void lptim_interrupt_config(lptim_handle_t *hperh, lptim_it_t it, type_func_t state)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_IT(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		SET_BIT(hperh->perh->IER, (uint32_t)it);
-	else
-		CLEAR_BIT(hperh->perh->IER, (uint32_t)it);
-	return;
-}
-
-/**
-  * @brief  Checks whether the specified LPTIM interrupt has occurred or not.
-  * @param  hperh: Pointer to a lptim_handle_t structure that contains
-  *         the configuration information for the specified LPTIM module.
-  * @param  it: Specifies the LPTIM interrupt source to check.
-  *         This parameter can be one of the @ref lptim_it_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-it_status_t lptim_get_it_status(lptim_handle_t *hperh, lptim_it_t it)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_IT(it));
-
-	if (READ_BIT(hperh->perh->IER, it))
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Check whether the specified LPTIM flag is set or not.
-  * @param  hperh: Pointer to a lptim_handle_t structure that contains
-  *         the configuration information for the specified LPTIM module.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref lptim_flag_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-flag_status_t lptim_get_flag_status(lptim_handle_t *hperh, lptim_flag_t flag)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_FLAG(flag));
-
-	if (READ_BIT(hperh->perh->ISR, flag))
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Clear the specified LPTIM pending flags.
-  * @param  hperh: Pointer to a lptim_handle_t structure that contains
-  *         the configuration information for the specified LPTIM module.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref lptim_flag_t.
-  * @retval None
-  */
-void lptim_clear_flag_status(lptim_handle_t *hperh, lptim_flag_t flag)
-{
-	assert_param(IS_LPTIM(hperh->perh));
-	assert_param(IS_LPTIM_FLAG(flag));
-
-	WRITE_REG(hperh->perh->IFC, (uint32_t)flag);
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LPTIM_Public_Functions_Group6 Peripheral State functions
- *  @brief   Peripheral State functions
- *
- * @verbatim
-  ==============================================================================
-                        ##### Peripheral State functions #####
-  ==============================================================================
-    [..]
-    This subsection permit to get in run-time the status of the peripheral.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Return the LPTIM state
-  * @param  hperh: LPTIM handle
-  * @retval LPTIM peripheral state
-  */
-lptim_state_t lptim_get_state(lptim_handle_t *hperh)
-{
-	return hperh->state;
-}
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-#endif /* ALD_LPTIM */
-/**
-  * @}
-  */
-/**
-  * @}
-  */

+ 0 - 1192
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_lpuart.c

@@ -1,1192 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_lpuart.c
-  * @brief   Low Power UART module driver.
-  *          This file provides firmware functions to manage the following
-  *          functionalities of the Low Power Universal Asynchronous Receiver
-  *          Transmitter (LPUART) peripheral:
-  *           + Initialization and Configuration functions
-  *           + IO operation functions
-  *           + Peripheral Control functions
-  *           + Peripheral State and Errors functions
-  *
-  * @version V1.0
-  * @date    30 May 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  * @verbatim
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-  [..]
-    The LPUART driver can be used as follows:
-
-    (#) Declare a lpuart_handle_t handle structure.
-
-    (#) Initialize the LPUART resources:
-        (##) Enable the LPUART interface clock.
-        (##) LPUART pins configuration:
-            (+++) Enable the clock for the LPUART GPIOs.
-            (+++) Configure the LPUART pins (TX as alternate function pull-up, RX as alternate function Input).
-        (##) NVIC configuration if you need to use interrupt process (lpuart_send_by_it()
-             and lpuart_recv_by_it() APIs):
-            (+++) Configure the LPUART interrupt priority.
-            (+++) Enable the NVIC LPUART IRQ handle.
-        (##) DMA Configuration if you need to use DMA process (lpuart_send_by_dma()
-             and lpuart_recv_by_dma() APIs):
-            (+++) Declare a DMA handle structure for the Tx/Rx channel.
-            (+++) Enable the DMAx interface clock.
-            (+++) Configure the declared DMA handle structure with the required
-                  Tx/Rx parameters.
-            (+++) Configure the DMA Tx/Rx channel.
-            (+++) Associate the initialized DMA handle to the LPUART DMA Tx/Rx handle.
-
-    (#) Program the Baud Rate, Word Length, Stop Bit, Parity, Hardware
-        flow control and Mode(Receiver/Transmitter) in the hperh Init structure.
-
-    (#) Initialize the LPUART registers by calling the lpuart_init() API.
-
-     [..]
-        Three operation modes are available within this driver:
-
-     *** Polling mode IO operation ***
-     =================================
-     [..]
-       (+) Send an amount of data in blocking mode using lpuart_send()
-       (+) Receive an amount of data in blocking mode using lpuart_recv()
-
-     *** Interrupt mode IO operation ***
-     ===================================
-     [..]
-       (+) Send an amount of data in non blocking mode using lpuart_send_by_it()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode using lpuart_recv_by_it()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk() function is executed and user can
-           add his own code by customization of function pointer hperh->error_cbk()
-
-     *** DMA mode IO operation ***
-     ==============================
-     [..]
-       (+) Send an amount of data in non blocking mode (DMA) using lpuart_send_by_dma()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode (DMA) using lpuart_recv_by_dma()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk() function is executed and user can
-           add his own code by customization of function pointer hperh->error_cbk()
-       (+) Pause the DMA Transfer using lpuart_dma_pause()
-       (+) Resume the DMA Transfer using lpuart_dma_resume()
-       (+) Stop the DMA Transfer using lpuart_dma_stop()
-
-    @endverbatim
-  ******************************************************************************
-  */
-
-#include "ald_lpuart.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup LPUART LPUART
-  * @brief Low Power UART module driver
-  * @{
-  */
-#ifdef ALD_LPUART
-
-/** @defgroup LPUART_Private_Functions   LPUART Private Functions
-  *  @brief   LPUART Private functions
-  * @{
-  */
-
-#ifdef ALD_DMA
-/**
-  * @brief  DMA LPUART transmit process complete callback.
-  * @param  arg: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval None
-  */
-static void lpuart_dma_send_cplt(void *arg)
-{
-	lpuart_handle_t *hperh = (lpuart_handle_t *)arg;
-
-	hperh->tx_count = 0;
-	lpuart_dma_req_config(hperh, LPUART_DMA_REQ_TX, DISABLE);
-	lpuart_interrupt_config(hperh, LPUART_IT_TC, ENABLE);
-}
-
-/**
-  * @brief  DMA LPUART receive process complete callback.
-  * @param  arg: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval None
-  */
-static void lpuart_dma_recv_cplt(void *arg)
-{
-	lpuart_handle_t *hperh = (lpuart_handle_t *)arg;
-
-	hperh->rx_count = 0;
-	lpuart_dma_req_config(hperh, LPUART_DMA_REQ_RX, DISABLE);
-	CLEAR_BIT(hperh->state, LPUART_STATE_RX_MASK);
-
-	if (hperh->rx_cplt_cbk)
-		hperh->rx_cplt_cbk(hperh);
-}
-
-/**
-  * @brief  DMA LPUART communication error callback.
-  * @param  arg: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval None
-  */
-static void lpuart_dma_error(void *arg)
-{
-	lpuart_handle_t *hperh = (lpuart_handle_t *)arg;
-
-	hperh->rx_count  = 0;
-	hperh->tx_count  = 0;
-	hperh->state     = LPUART_STATE_READY;
-	hperh->err_code |= LPUART_ERROR_DMA;
-
-	if (hperh->error_cbk)
-		hperh->error_cbk(hperh);
-}
-#endif
-
-/**
-  * @brief  This function handles uart Communication Timeout.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  flag: specifies the uart flag to check.
-  * @param  status: The new Flag status (SET or RESET).
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t lpuart_wait_flag(lpuart_handle_t *hperh, lpuart_status_t flag, flag_status_t status, uint32_t timeout)
-{
-	uint32_t tick;
-
-	if (timeout == 0)
-		return OK;
-
-	tick = __get_tick();
-
-	/* Waiting for flag */
-	while ((lpuart_get_status(hperh, flag)) != status) {
-		if (((__get_tick()) - tick) > timeout)
-			return TIMEOUT;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __lpuart_send_by_it(lpuart_handle_t *hperh)
-{
-	if ((hperh->state & LPUART_STATE_TX_MASK) == 0x0)
-		return BUSY;
-
-	WRITE_REG(hperh->perh->TXDR, *hperh->tx_buf++);
-
-	if (--hperh->tx_count == 0) {
-		lpuart_interrupt_config(hperh, LPUART_IT_TBEMP, DISABLE);
-		lpuart_interrupt_config(hperh, LPUART_IT_TC, ENABLE);
-	}
-
-	return OK;
-}
-
-
-/**
-  * @brief  Wraps up transmission in non blocking mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __lpuart_end_send_by_it(lpuart_handle_t *hperh)
-{
-	lpuart_interrupt_config(hperh, LPUART_IT_TC, DISABLE);
-	CLEAR_BIT(hperh->state, LPUART_STATE_TX_MASK);
-
-	if (hperh->tx_cplt_cbk)
-		hperh->tx_cplt_cbk(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __lpuart_recv_by_it(lpuart_handle_t *hperh)
-{
-	uint8_t tmp;
-	uint16_t i;
-
-	if ((hperh->state & LPUART_STATE_RX_MASK) == 0x0)
-		return BUSY;
-
-	do {
-		i   = 10000;
-		tmp = hperh->perh->STAT & LPUART_STAT_RXPTR_MSK;
-		*hperh->rx_buf++ = (uint8_t)(hperh->perh->RXDR & 0xFF);
-		--hperh->rx_count;
-
-		while (((hperh->perh->STAT & LPUART_STAT_RXPTR_MSK) != tmp - 1) && (i--));
-	} while (hperh->perh->STAT & LPUART_STAT_RXPTR_MSK);
-
-	if (hperh->rx_count == 0) {
-		lpuart_interrupt_config(hperh, LPUART_IT_RBR, DISABLE);
-		CLEAR_BIT(hperh->state, LPUART_STATE_RX_MASK);
-
-		if (hperh->state == LPUART_STATE_READY) {
-			lpuart_interrupt_config(hperh, LPUART_IT_PERR, DISABLE);
-			lpuart_interrupt_config(hperh, LPUART_IT_FERR, DISABLE);
-		}
-
-		if (hperh->rx_cplt_cbk)
-			hperh->rx_cplt_cbk(hperh);
-	}
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LPUART_Public_Functions LPUART Public Functions
-  * @{
-  */
-
-/** @defgroup LPUART_Public_Functions_Group1 Initialization and Configuration functions
-  *  @brief    Initialization and Configuration functions
-  *
-@verbatim
-===============================================================================
-            ##### Initialization and Configuration functions #####
- ===============================================================================
-    [..]
-    This subsection provides a set of functions allowing to initialize the LPUART
-    and configure LPUART param.
-      (+) For the LPUART only these parameters can be configured:
-        (++) Baud Rate
-        (++) Word Length
-        (++) Stop Bit
-        (++) Parity
-        (++) Hardware flow control
-      (+) For RS485 mode, user also need configure some parameters by
-      lpuart_rs485_config():
-        (++) Enable/disable normal point mode
-	(++) Enable/disable auto-address detect
-	(++) Enable/disable auto-direction
-	(++) Enable/disable address detect
-	(++) Enable/disable address for compare
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Reset LPUART peripheral
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval None
-  */
-void lpuart_reset(lpuart_handle_t *hperh)
-{
-	WRITE_REG(hperh->perh->CON0, 0x3000);
-	WRITE_REG(hperh->perh->CON1, 0x4);
-	WRITE_REG(hperh->perh->CLKDIV, 0x0);
-	WRITE_REG(hperh->perh->FIFOCON, 0x0);
-	WRITE_REG(hperh->perh->IER, 0x0);
-	hperh->err_code = LPUART_ERROR_NONE;
-	hperh->state    = LPUART_STATE_RESET;
-
-	__UNLOCK(hperh);
-	return;
-}
-
-/**
-  * @brief  Initializes the LPUART according to the specified
-  *         parameters in the lpuart_handle_t.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval None
-  */
-void lpuart_init(lpuart_handle_t *hperh)
-{
-	uint32_t tmp;
-
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_BAUDRATE(hperh->init.baud));
-	assert_param(IS_LPUART_WORD_LENGTH(hperh->init.word_length));
-	assert_param(IS_LPUART_STOPBITS(hperh->init.stop_bits));
-	assert_param(IS_LPUART_PARITY(hperh->init.parity));
-	assert_param(IS_LPUART_MODE(hperh->init.mode));
-	assert_param(IS_LPUART_HARDWARE_FLOW_CONTROL(hperh->init.fctl));
-
-	if ((hperh->init.clock != CMU_LP_PERH_CLOCK_SEL_LOSC)
-			&& (hperh->init.clock != CMU_LP_PERH_CLOCK_SEL_LRC))
-		hperh->init.clock = CMU_LP_PERH_CLOCK_SEL_LRC;
-
-	cmu_lpuart0_clock_select(hperh->init.clock);
-	lpuart_reset(hperh);
-	LPUART_UPDATE_DISABLE(hperh);
-
-	tmp = READ_REG(hperh->perh->CON0);
-	MODIFY_REG(tmp, LPUART_CON0_DATLENTH_MSK, hperh->init.word_length << LPUART_CON0_DATLENTH_POSS);
-	MODIFY_REG(tmp, LPUART_CON0_STPLENTH_MSK, hperh->init.stop_bits << LPUART_CON0_STPLENTH_POS);
-
-	if (hperh->init.parity == LPUART_PARITY_NONE)
-		CLEAR_BIT(tmp, LPUART_CON0_PARCHKE_MSK);
-	else
-		SET_BIT(tmp, LPUART_CON0_PARCHKE_MSK);
-
-	if (hperh->init.parity == LPUART_PARITY_EVEN)
-		SET_BIT(tmp, LPUART_CON0_EVENPARSEL_MSK);
-	else
-		CLEAR_BIT(tmp, LPUART_CON0_EVENPARSEL_MSK);
-
-	MODIFY_REG(tmp, LPUART_CON0_ATRTSE_MSK, (hperh->init.fctl & 1) << LPUART_CON0_ATRTSE_POS);
-	MODIFY_REG(tmp, LPUART_CON0_ATCTSE_MSK, ((hperh->init.fctl >> 1) & 1) << LPUART_CON0_ATCTSE_POS);
-	WRITE_REG(hperh->perh->CON0, tmp);
-	WRITE_REG(hperh->perh->CLKDIV, (32768 << 8) / hperh->init.baud);
-
-	if (hperh->init.mode == LPUART_MODE_IrDA)
-		CLEAR_BIT(hperh->perh->CON1, LPUART_CON1_IRRXINV_MSK);
-
-	MODIFY_REG(hperh->perh->CON0, LPUART_CON0_MODESEL_MSK, hperh->init.mode << LPUART_CON0_MODESEL_POSS);
-	LPUART_UPDATE_ENABLE(hperh);
-
-	while (hperh->perh->SYNCSTAT & 0xF)
-		;
-
-	hperh->state = LPUART_STATE_READY;
-	return;
-}
-
-/**
-  * @brief  Configure the RS485 mode according to the specified
-  *         parameters in the lpuart_rs485_config_Typedef.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  config: Specifies the RS485 parameters.
-  * @retval None
-  */
-void lpuart_rs485_config(lpuart_handle_t *hperh, lpuart_rs485_config_t *config)
-{
-	uint32_t tmp;
-
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_FUNC_STATE(config->RS485_NMM));
-	assert_param(IS_FUNC_STATE(config->RS485_AAD));
-	assert_param(IS_FUNC_STATE(config->RS485_AUD));
-	assert_param(IS_FUNC_STATE(config->RS485_ADD_DET));
-
-	tmp = READ_REG(hperh->perh->CON1);
-	MODIFY_REG(tmp, LPUART_CON1_NMPMOD_MSK, config->RS485_NMM << LPUART_CON1_NMPMOD_POS);
-	MODIFY_REG(tmp, LPUART_CON1_ATADETE_MSK, config->RS485_AAD << LPUART_CON1_ATADETE_POS);
-	MODIFY_REG(tmp, LPUART_CON1_ATDIRM_MSK, config->RS485_AUD << LPUART_CON1_ATDIRM_POS);
-	MODIFY_REG(tmp, LPUART_CON1_ADETE_MSK, config->RS485_ADD_DET << LPUART_CON1_ADETE_POS);
-	MODIFY_REG(tmp, LPUART_CON1_ADDCMP_MSK, config->RS485_ADDCMP << LPUART_CON1_ADDCMP_POSS);
-	WRITE_REG(hperh->perh->CON1, tmp);
-
-	return;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup LPUART_Public_Functions_Group2 IO operation functions
-  * @brief    LPUART Transmit and Receive functions
-  * @verbatim
-  ==============================================================================
-                      ##### IO operation functions #####
-  ==============================================================================
-  [..]
-    This subsection provides a set of functions allowing to manage the LPUART data transfers.
-
-    (#) There are two modes of transfer:
-       (++) Blocking mode: The communication is performed in polling mode.
-            The status of all data processing is returned by the same function
-            after finishing transfer.
-       (++) Non blocking mode: The communication is performed using Interrupts
-            or DMA, these APIs return the status.
-            The end of the data processing will be indicated through the
-            dedicated LPUART IRQ when using Interrupt mode or the DMA IRQ when
-            using DMA mode.
-            The hperh->tx_cplt_cbk(), hperh->rx_cplt_cbk() user callbacks
-            will be executed respectively at the end of the transmit or receive process.
-            The hperh->error_cbk() user callback will be executed when
-            a communication error is detected.
-
-    (#) Blocking mode APIs are:
-        (++) lpuart_send()
-        (++) lpuart_recv()
-
-    (#) Non Blocking mode APIs with Interrupt are:
-        (++) lpuart_send_by_it()
-        (++) lpuart_recv_by_it()
-        (++) lpuart_irq_handle()
-
-    (#) Non Blocking mode functions with DMA are:
-        (++) lpuart_send_by_dma()
-        (++) lpuart_recv_by_dma()
-        (++) lpuart_dma_pause()
-        (++) lpuart_dma_resume()
-        (++) lpuart_dma_stop()
-
-    (#) A set of Transfer Complete Callbacks are provided in non blocking mode:
-        (++) hperh->tx_cplt_cbk()
-        (++) hperh->rx_cplt_cbk()
-        (++) hperh->error_cbk()
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Sends an amount of data in blocking mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_send(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if ((hperh->state != LPUART_STATE_READY) && (hperh->state != LPUART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-	hperh->err_code = LPUART_ERROR_NONE;
-	SET_BIT(hperh->state, LPUART_STATE_TX_MASK);
-
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-
-	while (hperh->tx_count-- > 0) {
-		if (lpuart_wait_flag(hperh, LPUART_STAT_TXEMP, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = LPUART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		WRITE_REG(hperh->perh->TXDR, *buf++);
-
-		if (lpuart_wait_flag(hperh, LPUART_STAT_TXEMP, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = LPUART_STATE_READY;
-			return TIMEOUT;
-		}
-	}
-
-	if (lpuart_wait_flag(hperh, LPUART_STAT_TXIDLE, SET, timeout) != OK) {
-		__UNLOCK(hperh);
-		hperh->state = LPUART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	CLEAR_BIT(hperh->state, LPUART_STATE_TX_MASK);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in blocking mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_recv(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if ((hperh->state != LPUART_STATE_READY) && (hperh->state != LPUART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-
-	hperh->err_code = LPUART_ERROR_NONE;
-	SET_BIT(hperh->state, LPUART_STATE_RX_MASK);
-
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-
-	/* Check the remain data to be received */
-	while (hperh->rx_count-- > 0) {
-		if (lpuart_wait_flag(hperh, LPUART_STAT_RXEMP, RESET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = LPUART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		*buf++ = (uint8_t)(hperh->perh->RXDR & 0xFF);
-	}
-
-	CLEAR_BIT(hperh->state, LPUART_STATE_RX_MASK);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_send_by_it(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if ((hperh->state != LPUART_STATE_READY) && (hperh->state != LPUART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = LPUART_ERROR_NONE;
-	SET_BIT(hperh->state, LPUART_STATE_TX_MASK);
-
-	__UNLOCK(hperh);
-	lpuart_interrupt_config(hperh, LPUART_IT_TBEMP, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_recv_by_it(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if ((hperh->state != LPUART_STATE_READY) && (hperh->state != LPUART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->err_code = LPUART_ERROR_NONE;
-	SET_BIT(hperh->state, LPUART_STATE_RX_MASK);
-
-	__UNLOCK(hperh);
-
-	lpuart_interrupt_config(hperh, LPUART_IT_PERR, ENABLE);
-	lpuart_interrupt_config(hperh, LPUART_IT_FERR, ENABLE);
-	lpuart_interrupt_config(hperh, LPUART_IT_RBR, ENABLE);
-
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as LPUART transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_send_by_dma(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if ((hperh->state != LPUART_STATE_READY) && (hperh->state != LPUART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = LPUART_ERROR_NONE;
-	SET_BIT(hperh->state, LPUART_STATE_TX_MASK);
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	/* Set the dma parameters */
-	hperh->hdmatx.cplt_cbk = lpuart_dma_send_cplt;
-	hperh->hdmatx.cplt_arg = (void *)hperh;
-	hperh->hdmatx.err_cbk  = lpuart_dma_error;
-	hperh->hdmatx.err_arg  = (void *)hperh;
-
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src     = (void *)buf;
-	hperh->hdmatx.config.dst     = (void *)&hperh->perh->TXDR;
-	hperh->hdmatx.config.size    = size;
-	hperh->hdmatx.config.src_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel    = DMA_MSEL_LPUART0;
-	hperh->hdmatx.config.msigsel = DMA_MSIGSEL_LPUART_TXEMPTY;
-	hperh->hdmatx.config.channel = channel;
-
-	if (hperh->init.mode == LPUART_MODE_RS485) {
-		hperh->hdmatx.config.src_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmatx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmatx);
-	lpuart_clear_flag_status(hperh, LPUART_IF_TC);
-	__UNLOCK(hperh);
-	lpuart_dma_req_config(hperh, LPUART_DMA_REQ_TX, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  channel: DMA channel as LPUART receive
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_recv_by_dma(lpuart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if ((hperh->state != LPUART_STATE_READY) && (hperh->state != LPUART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->err_code = LPUART_ERROR_NONE;
-	SET_BIT(hperh->state, LPUART_STATE_RX_MASK);
-
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	/* Set the dma parameters */
-	hperh->hdmarx.cplt_cbk = lpuart_dma_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.err_cbk  = lpuart_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-
-	dma_config_struct(&hperh->hdmarx.config);
-	hperh->hdmarx.config.src     = (void *)&hperh->perh->RXDR;
-	hperh->hdmarx.config.dst     = (void *)buf;
-	hperh->hdmarx.config.size    = size;
-	hperh->hdmarx.config.src_inc = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msel    = DMA_MSEL_LPUART0;
-	hperh->hdmarx.config.msigsel = DMA_MSIGSEL_LPUART_RNR;
-	hperh->hdmarx.config.channel = channel;
-
-	if (hperh->init.mode == LPUART_MODE_RS485) {
-		hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmarx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmarx);
-	__UNLOCK(hperh);
-	lpuart_dma_req_config(hperh, LPUART_DMA_REQ_RX, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Pauses the DMA Transfer.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_dma_pause(lpuart_handle_t *hperh)
-{
-	__LOCK(hperh);
-
-	if (hperh->state == LPUART_STATE_BUSY_TX) {
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_TX, DISABLE);
-	}
-	else if (hperh->state == LPUART_STATE_BUSY_RX) {
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_RX, DISABLE);
-	}
-	else if (hperh->state == LPUART_STATE_BUSY_TX_RX) {
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_TX, DISABLE);
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_RX, DISABLE);
-	}
-	else {
-		__UNLOCK(hperh);
-		return ERROR;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Resumes the DMA Transfer.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_dma_resume(lpuart_handle_t *hperh)
-{
-	__LOCK(hperh);
-
-	if (hperh->state == LPUART_STATE_BUSY_TX) {
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_TX, ENABLE);
-	}
-	else if (hperh->state == LPUART_STATE_BUSY_RX) {
-		lpuart_clear_flag_status(hperh, LPUART_IF_RXOV);
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_RX, ENABLE);
-	}
-	else if (hperh->state == LPUART_STATE_BUSY_TX_RX) {
-		lpuart_clear_flag_status(hperh, LPUART_IF_RXOV);
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_TX, ENABLE);
-		lpuart_dma_req_config(hperh, LPUART_DMA_REQ_RX, ENABLE);
-	}
-	else {
-		__UNLOCK(hperh);
-		return ERROR;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Stops the DMA Transfer.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t lpuart_dma_stop(lpuart_handle_t *hperh)
-{
-	lpuart_dma_req_config(hperh, LPUART_DMA_REQ_TX, DISABLE);
-	lpuart_dma_req_config(hperh, LPUART_DMA_REQ_RX, DISABLE);
-
-	hperh->state = LPUART_STATE_READY;
-	return OK;
-}
-#endif
-
-/**
-  * @brief  This function handles LPUART interrupt request.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval None
-  */
-void lpuart_irq_handle(lpuart_handle_t *hperh)
-{
-	uint32_t flag;
-	uint32_t source;
-
-	/* Handle CTS wakeup */
-	flag = lpuart_get_flag_status(hperh, LPUART_IF_CTSWK);
-	source = lpuart_get_it_status(hperh, LPUART_IT_CTSWK);
-	if ((flag != RESET) && (source != RESET))
-		lpuart_clear_flag_status(hperh, LPUART_IF_CTSWK);
-
-	/* Handle DATA wakeup */
-	flag = lpuart_get_flag_status(hperh, LPUART_IF_DATWK);
-	source = lpuart_get_it_status(hperh, LPUART_IT_DATWK);
-	if ((flag != RESET) && (source != RESET))
-		lpuart_clear_flag_status(hperh, LPUART_IF_DATWK);
-
-	/* Handle parity error */
-	flag   = lpuart_get_flag_status(hperh, LPUART_IF_PERR);
-	source = lpuart_get_it_status(hperh, LPUART_IT_PERR);
-	if ((flag != RESET) && (source != RESET))
-		hperh->err_code |= LPUART_ERROR_PE;
-
-	/* Handle frame error */
-	flag   = lpuart_get_flag_status(hperh, LPUART_IF_FERR);
-	source = lpuart_get_it_status(hperh, LPUART_IT_FERR);
-	if ((flag != RESET) && (source != RESET))
-		hperh->err_code |= LPUART_ERROR_FE;
-
-	/* Handle overflow error */
-	flag   = lpuart_get_flag_status(hperh, LPUART_IF_RXOV);
-	source = lpuart_get_it_status(hperh, LPUART_IT_RXOV);
-	if ((flag != RESET) && (source != RESET))
-		hperh->err_code |= LPUART_ERROR_ORE;
-
-	/* Receive */
-	flag   = lpuart_get_flag_status(hperh, LPUART_IF_RBR);
-	source = lpuart_get_it_status(hperh, LPUART_IT_RBR);
-	if ((flag != RESET) && (source != RESET))
-		__lpuart_recv_by_it(hperh);
-
-	/* Transmite */
-	flag   = lpuart_get_flag_status(hperh, LPUART_IF_TBEMP);
-	source = lpuart_get_it_status(hperh, LPUART_IT_TBEMP);
-	if ((flag != RESET) && (source != RESET))
-		__lpuart_send_by_it(hperh);
-
-	/* End Transmite */
-	flag   = lpuart_get_flag_status(hperh, LPUART_IF_TC);
-	source = lpuart_get_it_status(hperh, LPUART_IT_TC);
-	if ((flag != RESET) && (source != RESET))
-		__lpuart_end_send_by_it(hperh);
-
-	/* Handle error state */
-	if (hperh->err_code != LPUART_ERROR_NONE) {
-		lpuart_clear_flag_status(hperh, LPUART_IF_PERR);
-		lpuart_clear_flag_status(hperh, LPUART_IF_FERR);
-		lpuart_clear_flag_status(hperh, LPUART_IF_RXOV);
-		hperh->state = LPUART_STATE_READY;
-
-		if (hperh->error_cbk)
-			hperh->error_cbk(hperh);
-	}
-}
-/**
-  * @}
-  */
-
-/** @defgroup LPUART_Public_Functions_Group3 Peripheral Control functions
-  *  @brief   Low Power UART control functions
-  *
-  * @verbatim
-  ==============================================================================
-                      ##### Peripheral Control functions #####
-  ==============================================================================
-  [..]
-    This subsection provides a set of functions allowing to control the LPUART:
-    (+) lpuart_interrupt_config() API can be helpful to configure LPUART interrupt source.
-    (+) lpuart_tx_interval_config() API can be helpful to configure TX interval.
-    (+) lpuart_dma_req_config() API can be helpful to configure LPUART DMA request.
-    (+) lpuart_rx_fifo_it_config() API can be helpful to configure LPUART RX FIFO interrupt.
-    (+) lpuart_rx_fifo_rts_config() API can be helpful to configure RTS threshold value.
-    (+) lpuart_get_flag_status() API can get the status of LPUART flag.
-    (+) lpuart_clear_flag_status() API can clear LPUART flag.
-    (+) lpuart_get_it_status() API can get the status of interrupt source.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Enable/disable the specified LPUART interrupts.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  it: Specifies the LPUART interrupt sources to be enabled or
-  *         disabled. This parameter can be one of the @ref lpuart_it_t.
-  * @param  status: New state of the specified LPUART interrupts.
-  *         This parameter can be:
-  *             @arg ENABLE
-  *             @arg DISABLE
-  * @retval None
-  */
-void lpuart_interrupt_config(lpuart_handle_t *hperh, lpuart_it_t it, type_func_t status)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_IT(it));
-	assert_param(IS_FUNC_STATE(status));
-
-	if (status == ENABLE)
-		SET_BIT(hperh->perh->IER, it);
-	else
-		CLEAR_BIT(hperh->perh->IER, it);
-
-	return;
-}
-
-/**
-  * @brief  Configure transmite interval.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  val: The value of interval.
-  * @retval None
-  */
-void lpuart_tx_interval_config(lpuart_handle_t *hperh, uint8_t val)
-{
-	assert_param(IS_LPUART(hperh->perh));
-
-	MODIFY_REG(hperh->perh->CON0, LPUART_CON0_INTERVAL_MSK, val << LPUART_CON0_INTERVAL_POSS);
-	return;
-}
-
-/**
-  * @brief  Configure LPUART DMA request.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  req: The DMA type:
-  *             @arg LPUART_DMA_REQ_TX
-  *             @arg LPUART_DMA_REQ_RX
-  * @param  status: New state of the specified DMA request.
-  *         This parameter can be:
-  *             @arg ENABLE
-  *             @arg DISABLE
-  * @retval None
-  */
-void lpuart_dma_req_config(lpuart_handle_t *hperh, lpuart_dma_req_t req, type_func_t status)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_DMAREQ(req));
-	assert_param(IS_FUNC_STATE(status));
-
-	if (req == LPUART_DMA_REQ_TX) {
-		if (status == ENABLE)
-			SET_BIT(hperh->perh->CON0, LPUART_CON0_TXDMAE_MSK);
-		else
-			CLEAR_BIT(hperh->perh->CON0, LPUART_CON0_TXDMAE_MSK);
-	}
-	else {
-		if (status == ENABLE)
-			SET_BIT(hperh->perh->CON0, LPUART_CON0_RXDMAE_MSK);
-		else
-			CLEAR_BIT(hperh->perh->CON0, LPUART_CON0_RXDMAE_MSK);
-	}
-
-	return;
-}
-
-/**
-  * @brief  Configure receive FIFO interrupt threshold value.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  config: The value of RX FIFO interrupt threshold value.
-  * @retval None
-  */
-void lpuart_rx_fifo_it_config(lpuart_handle_t *hperh, lpuart_rxfifo_t config)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_RXFIFO(config));
-
-	MODIFY_REG(hperh->perh->FIFOCON, LPUART_FIFOCON_RXTRGLVL_MSK, config << LPUART_FIFOCON_RXTRGLVL_POSS);
-	return;
-}
-
-/**
-  * @brief  Configure receive FIFO RTS threshold value.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  config: The value of RX FIFO RTS threshold value.
-  * @retval None
-  */
-void lpuart_rx_fifo_rts_config(lpuart_handle_t *hperh, lpuart_rxfifo_t config)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_RXFIFO(config));
-
-	MODIFY_REG(hperh->perh->FIFOCON, LPUART_FIFOCON_RTSTRGLVL_MSK, config << LPUART_FIFOCON_RTSTRGLVL_POSS);
-	return;
-}
-
-/**
-  * @brief  Send address in RS485 mode.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  addr: the address of RS485 device.
-  * @param  timeout: Timeout duration
-  * @retval The hal status.
-  */
-ald_status_t lpuart_rs485_send_addr(lpuart_handle_t *hperh, uint16_t addr, uint32_t timeout)
-{
-	assert_param(IS_LPUART(hperh->perh));
-
-	if ((hperh->state != LPUART_STATE_READY) && (hperh->state != LPUART_STATE_BUSY_RX))
-		return BUSY;
-
-	SET_BIT(hperh->state, LPUART_STATE_TX_MASK);
-
-	if (lpuart_wait_flag(hperh, LPUART_STAT_TXEMP, SET, timeout) != OK) {
-		hperh->state = LPUART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	WRITE_REG(hperh->perh->TXDR, addr | 0x100);
-
-	if (lpuart_wait_flag(hperh, LPUART_STAT_TXEMP, RESET, timeout) != OK) {
-		hperh->state = LPUART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	if (lpuart_wait_flag(hperh, LPUART_STAT_TXIDLE, SET, timeout) != OK) {
-		hperh->state = LPUART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	CLEAR_BIT(hperh->state, LPUART_STATE_TX_MASK);
-	return OK;
-}
-
-/**
-  * @brief  Get the status of LPUART status.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  flag: Specifies the LPUART status flag.
-  *         This parameter can be one of the @ref lpuart_status_t.
-  * @retval Status:
-  *           - RESET
-  *           - SET
-  */
-flag_status_t lpuart_get_status(lpuart_handle_t *hperh, lpuart_status_t flag)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_STAT(flag));
-
-	if (READ_BIT(hperh->perh->STAT, flag))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Get the status of LPUART interrupt flag.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  flag: Specifies the LPUART interrupt flag.
-  *         This parameter can be one of the @ref lpuart_flag_t.
-  * @retval Status:
-  *           - RESET
-  *           - SET
-  */
-flag_status_t lpuart_get_flag_status(lpuart_handle_t *hperh, lpuart_flag_t flag)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_IF(flag));
-
-	if (READ_BIT(hperh->perh->IFLAG, flag))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Clear the LPUART interrupt flag.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  flag: Specifies the LPUART interrupt flag.
-  *         This parameter can be one of the @ref lpuart_flag_t.
-  * @retval None
-  */
-void lpuart_clear_flag_status(lpuart_handle_t *hperh, lpuart_flag_t flag)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_IF(flag));
-
-	WRITE_REG(hperh->perh->IFC, flag);
-	return;
-}
-
-/**
-  * @brief  Get the status of LPUART interrupt source.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @param  it: Specifies the LPUART interrupt source.
-  *         This parameter can be one of the @ref lpuart_it_t.
-  * @retval Status:
-  *           - RESET
-  *           - SET
-  */
-it_status_t lpuart_get_it_status(lpuart_handle_t *hperh, lpuart_it_t it)
-{
-	assert_param(IS_LPUART(hperh->perh));
-	assert_param(IS_LPUART_IT(it));
-
-	if (READ_BIT(hperh->perh->IER, it))
-		return SET;
-
-	return RESET;
-}
-/**
-  * @}
-  */
-
-/** @defgroup LPUART_Public_Functions_Group4 Peripheral State and Errors functions
-  *  @brief   LPUART State and Errors functions
-  *
-@verbatim
-  ==============================================================================
-                 ##### Peripheral State and Errors functions #####
-  ==============================================================================
- [..]
-   This subsection provides a set of functions allowing to return the State of
-   LPUART communication process, return Peripheral Errors occurred during communication
-   process
-   (+) lpuart_get_state() API can be helpful to check in run-time the state of the LPUART peripheral.
-   (+) lpuart_get_error() check in run-time errors that could be occurred during communication.
-
-@endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Returns the LPUART state.
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART module.
-  * @retval HAL state
-  */
-lpuart_state_t lpuart_get_state(lpuart_handle_t *hperh)
-{
-	return hperh->state;
-}
-
-/**
-  * @brief  Return the LPUART error code
-  * @param  hperh: Pointer to a lpuart_handle_t structure that contains
-  *         the configuration information for the specified LPUART.
-  * @retval LPUART Error Code
-  */
-uint32_t lpuart_get_error(lpuart_handle_t *hperh)
-{
-	return hperh->err_code;
-}
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#endif /* ALD_LPUART */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 317
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_pis.c

@@ -1,317 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_pis.c
-  * @brief   PIS module driver.
-  *
-  * @version V1.0
-  * @date    27 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_pis.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup PIS PIS
-  * @brief PIS module driver
-  * @{
-  */
-#ifdef ALD_PIS
-
-/** @defgroup PIS_Public_Functions PIS Public Functions
-  * @{
-  */
-
-/** @defgroup PIS_Public_Functions_Group1 Initialization functions
-  * @brief Initialization and Configuration functions
-  * @{
-  */
-
-/**
-  * @brief  Create the PIS mode according to the specified parameters in
-  *         the pis_handle_t and create the associated handle.
-  * @param  hperh: Pointer to a pis_handle_t structure that contains
-  *         the configuration information for the specified PIS module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t pis_create(pis_handle_t *hperh)
-{
-	pis_divide_t temp;
-	uint8_t clock_menu = 0;
-
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_PIS_SRC(hperh->init.producer_src));
-	assert_param(IS_PIS_TRIG(hperh->init.consumer_trig));
-	assert_param(IS_PIS_CLOCK(hperh->init.producer_clk));
-	assert_param(IS_PIS_CLOCK(hperh->init.consumer_clk));
-	assert_param(IS_PIS_EDGE(hperh->init.producer_edge));
-
-	__LOCK(hperh);
-	hperh->perh = PIS;
-
-	/* get location of consumer in channel and position of con0/con1
-	 * accord to comsumer_trig information */
-	temp.HalfWord       = (hperh->init.consumer_trig);
-	hperh->consumer_ch  = (pis_ch_t)(temp.ch);
-	hperh->consumer_con = (pis_con_t)(temp.con);
-	hperh->consumer_pos = (1 << temp.shift);
-
-	/* union producer clock and consumer clock */
-	clock_menu = (hperh->init.producer_clk << 4) | (hperh->init.consumer_clk);
-
-	if (hperh->perh->CH_CON[hperh->consumer_ch] != 0) {
-		__UNLOCK(hperh);
-		return BUSY;
-	}
-
-	MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SRCS_MSK, ((hperh->init.producer_src) >> 4) << PIS_CH0_CON_SRCS_POSS);
-	MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_MSIGS_MSK, ((hperh->init.producer_src) & 0xf) << PIS_CH0_CON_MSIGS_POSS);
-
-	/* configure sync clock, judging by producer clock with consumer clock */
-	switch (clock_menu) {
-	case 0x00:
-	case 0x11:
-	case 0x22:
-	case 0x33:
-		MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SYNCSEL_MSK, 0 << PIS_CH0_CON_SYNCSEL_POSS);
-		break;
-	case 0x01:
-		MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SYNCSEL_MSK, 5 << PIS_CH0_CON_SYNCSEL_POSS);
-		break;
-	case 0x02:
-	case 0x12:
-		MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SYNCSEL_MSK, 6 << PIS_CH0_CON_SYNCSEL_POSS);
-		break;
-	case 0x21:
-		MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SYNCSEL_MSK, 4 << PIS_CH0_CON_SYNCSEL_POSS);
-		break;
-	case 0x30:
-		MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SYNCSEL_MSK, 1 << PIS_CH0_CON_SYNCSEL_POSS);
-		break;
-	case 0x31:
-		MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SYNCSEL_MSK, 2 << PIS_CH0_CON_SYNCSEL_POSS);
-		break;
-	case 0x32:
-		MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_SYNCSEL_MSK, 3 << PIS_CH0_CON_SYNCSEL_POSS);
-	default:
-		break;
-	}
-
-	MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_PULCK_MSK, hperh->init.consumer_clk << PIS_CH0_CON_PULCK_POSS);
-	MODIFY_REG(hperh->perh->CH_CON[hperh->consumer_ch], PIS_CH0_CON_EDGS_MSK, hperh->init.producer_edge << PIS_CH0_CON_EDGS_POSS);
-	hperh->check_info = hperh->perh->CH_CON[hperh->consumer_ch];
-
-	/* enable consumer bit, switch pin of consumer */
-	switch (hperh->consumer_con) {
-	case PIS_CON_0:
-		PIS->TAR_CON0 |= hperh->consumer_pos;
-		break;
-	case PIS_CON_1:
-		PIS->TAR_CON1 |= hperh->consumer_pos;
-		break;
-	default:
-		break;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Destroy the PIS mode according to the specified parameters in
-  *         the pis_init_t and create the associated handle.
-  * @param  hperh: Pointer to a pis_handle_t structure that contains
-  *         the configuration information for the specified PIS module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t pis_destroy(pis_handle_t *hperh)
-{
-	assert_param(IS_PIS(hperh->perh));
-
-	if (hperh->check_info != hperh->perh->CH_CON[hperh->consumer_ch])
-		return ERROR;
-
-	__LOCK(hperh);
-
-	CLEAR_BIT(PIS->CH_OER, (1 << hperh->consumer_ch));
-	WRITE_REG(hperh->perh->CH_CON[hperh->consumer_ch], 0x0);
-
-	switch (hperh->consumer_con) {
-	case PIS_CON_0:
-		PIS->TAR_CON0 &= ~(hperh->consumer_pos);
-		break;
-	case PIS_CON_1:
-		PIS->TAR_CON1 &= ~(hperh->consumer_pos);
-		break;
-	default:
-		break;
-	}
-
-	hperh->state = PIS_STATE_RESET;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup PIS_Public_Functions_Group2 Operation functions
-  * @brief PIS output enable or disable functions
-  * @{
-  */
-
-/**
-  * @brief  Start the PIS output function.
-  * @param  hperh: Pointer to a pis_handle_t structure that contains
-  *         the configuration information for the specified PIS module.
-  * @param  ch: The PIS channel enable output
-  *	    This parameter can be one of the following values:
-  *		@arg PIS_OUT_CH_0
-  *		@arg PIS_OUT_CH_1
-  *		@arg PIS_OUT_CH_2
-  *		@arg PIS_OUT_CH_3
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t pis_output_start(pis_handle_t *hperh, pis_out_ch_t ch)
-{
-	assert_param(IS_PIS(hperh->perh));
-	assert_param(IS_PIS_OUPUT_CH(ch));
-	__LOCK(hperh);
-	SET_BIT(PIS->CH_OER, (1 << ch));
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Stop the PIS output function.
-  * @param  hperh: Pointer to a pis_handle_t structure that contains
-  *         the configuration information for the specified PIS module.
-  * @param  ch: The PIS channel disable output
-  *	    This parameter can be one of the following values:
-  *		@arg PIS_OUT_CH_0
-  *		@arg PIS_OUT_CH_1
-  *		@arg PIS_OUT_CH_2
-  *		@arg PIS_OUT_CH_3
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t pis_output_stop(pis_handle_t *hperh, pis_out_ch_t ch)
-{
-	assert_param(IS_PIS(hperh->perh));
-	assert_param(IS_PIS_OUPUT_CH(ch));
-	__LOCK(hperh);
-	CLEAR_BIT(PIS->CH_OER, (1 << ch));
-	__UNLOCK(hperh);
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup PIS_Public_Functions_Group3 Peripheral State and Errors functions
-  *  @brief   PIS State and Errors functions
-  * @{
-  */
-
-/**
-  * @brief  Returns the PIS state.
-  * @param  hperh: Pointer to a pis_handle_t structure that contains
-  *         the configuration information for the specified PIS module.
-  * @retval ALD state
-  */
-pis_state_t pis_get_state(pis_handle_t *hperh)
-{
-	assert_param(IS_PIS(hperh->perh));
-	return hperh->state;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup PIS_Public_Functions_Group4 modulate output functions
-  *  @brief   PIS modulate output signal functions
-  * @{
-  */
-
-/**
-  * @brief  Config the PIS modulate signal function
-  * @param  hperh: Pointer to a pis_handle_t structure that contains
-  *         the configuration information for the specified PIS module.
-  * @param  config: Pointer to a pis_modulate_config_t structure that
-  *         contains the selected target (UART0,UART1,UART2,UART3 or
-  *         LPUART0) how to modulate the target output signal.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t pis_modu_config(pis_handle_t *hperh, pis_modulate_config_t *config)
-{
-	assert_param(IS_PIS(hperh->perh));
-	assert_param(IS_PIS_MODU_TARGET(config->target));
-	assert_param(IS_PIS_MODU_LEVEL(config->level));
-	assert_param(IS_PIS_MODU_SRC(config->src));
-	assert_param(IS_PIS_MODU_CHANNEL(config->channel));
-	__LOCK(hperh);
-
-	switch (config->target) {
-	case PIS_UART0_TX:
-		MODIFY_REG(hperh->perh->UART0_TXMCR, PIS_TXMCR_TXMLVLS_MSK, config->level << PIS_TXMCR_TXMLVLS_POS);
-		MODIFY_REG(hperh->perh->UART0_TXMCR, PIS_TXMCR_TXMSS_MSK, config->src << PIS_TXMCR_TXMSS_POSS);
-		MODIFY_REG(hperh->perh->UART0_TXMCR, PIS_TXMCR_TXSIGS_MSK, config->channel << PIS_TXMCR_TXSIGS_POSS);
-		break;
-
-	case PIS_UART1_TX:
-		MODIFY_REG(hperh->perh->UART1_TXMCR, PIS_TXMCR_TXMLVLS_MSK, config->level << PIS_TXMCR_TXMLVLS_POS);
-		MODIFY_REG(hperh->perh->UART1_TXMCR, PIS_TXMCR_TXMSS_MSK, config->src << PIS_TXMCR_TXMSS_POSS);
-		MODIFY_REG(hperh->perh->UART1_TXMCR, PIS_TXMCR_TXSIGS_MSK, config->channel << PIS_TXMCR_TXSIGS_POSS);
-		break;
-
-	case PIS_UART2_TX:
-		MODIFY_REG(hperh->perh->UART2_TXMCR, PIS_TXMCR_TXMLVLS_MSK, config->level << PIS_TXMCR_TXMLVLS_POS);
-		MODIFY_REG(hperh->perh->UART2_TXMCR, PIS_TXMCR_TXMSS_MSK, config->src << PIS_TXMCR_TXMSS_POSS);
-		MODIFY_REG(hperh->perh->UART2_TXMCR, PIS_TXMCR_TXSIGS_MSK, config->channel << PIS_TXMCR_TXSIGS_POSS);
-		break;
-
-	case PIS_UART3_TX:
-		MODIFY_REG(hperh->perh->UART3_TXMCR, PIS_TXMCR_TXMLVLS_MSK, config->level << PIS_TXMCR_TXMLVLS_POS);
-		MODIFY_REG(hperh->perh->UART3_TXMCR, PIS_TXMCR_TXMSS_MSK, config->src << PIS_TXMCR_TXMSS_POSS);
-		MODIFY_REG(hperh->perh->UART3_TXMCR, PIS_TXMCR_TXSIGS_MSK, config->channel << PIS_TXMCR_TXSIGS_POSS);
-		break;
-
-	case PIS_LPUART0_TX:
-		MODIFY_REG(hperh->perh->LPUART0_TXMCR, PIS_TXMCR_TXMLVLS_MSK, config->level << PIS_TXMCR_TXMLVLS_POS);
-		MODIFY_REG(hperh->perh->LPUART0_TXMCR, PIS_TXMCR_TXMSS_MSK, config->src << PIS_TXMCR_TXMSS_POSS);
-		MODIFY_REG(hperh->perh->LPUART0_TXMCR, PIS_TXMCR_TXSIGS_MSK, config->channel << PIS_TXMCR_TXSIGS_POSS);
-		break;
-
-	default:
-		break;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-#endif /* ALD_PIS */
-/**
-  * @}
-  */
-/**
-  * @}
-  */

+ 0 - 283
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_pmu.c

@@ -1,283 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_pmu.c
-  * @brief   PMU module driver.
-  *
-  * @version V1.0
-  * @date    04 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_pmu.h"
-#include "ald_bkpc.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup PMU PMU
-  * @brief PMU module driver
-  * @{
-  */
-#ifdef ALD_PMU
-
-
-/** @defgroup PMU_Private_Functions PMU Private Functions
-  * @{
-  */
-
-/**
-  * @brief  PMU module interrupt handler
-  * @retval None
-  */
-void LVD_Handler(void)
-{
-	SYSCFG_UNLOCK();
-	SET_BIT(PMU->LVDCR, PMU_LVDCR_LVDCIF_MSK);
-	SYSCFG_LOCK();
-
-	lvd_irq_cbk();
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup PMU_Public_Functions PMU Public Functions
-  * @{
-  */
-
-/** @addtogroup PMU_Public_Functions_Group1 Low Power Mode
-  * @brief Low power mode select functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Low power mode select functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to:
-      (+) Enter stop1 mode.
-      (+) Enter stop2 mode.
-      (+) Enter standby mode.
-      (+) Get wakeup status.
-      (+) Clear wakeup status.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Enter stop1 mode
-  * @retval None
-  */
-void pmu_stop1_enter(void)
-{
-	SYSCFG_UNLOCK();
-	SET_BIT(PMU->CR, PMU_CR_LPSTOP_MSK);
-	MODIFY_REG(PMU->CR, PMU_CR_LPM_MSK, PMU_LP_STOP1 << PMU_CR_LPM_POSS);
-	SYSCFG_LOCK();
-
-	SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
-	SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
-	__WFI();
-	SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
-
-	return;
-}
-
-/**
-  * @brief  Enter stop2 mode
-  * @retval None
-  */
-void pmu_stop2_enter(void)
-{
-	SYSCFG_UNLOCK();
-	SET_BIT(PMU->CR, PMU_CR_LPSTOP_MSK);
-	MODIFY_REG(PMU->CR, PMU_CR_LPM_MSK, PMU_LP_STOP2 << PMU_CR_LPM_POSS);
-	SYSCFG_LOCK();
-
-	SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
-	SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
-	__WFI();
-	SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
-
-	return;
-
-}
-
-/**
-  * @brief  Enter standby mode
-  * @param  port: The port whick wake up the standby mode.
-  * @retval None
-  */
-void pmu_standby_enter(pmu_standby_wakeup_sel_t port)
-{
-	assert_param(IS_PMU_STANDBY_PORT_SEL(port));
-
-	if (port != PMU_STANDBY_PORT_NONE) {
-		BKPC_UNLOCK();
-		SET_BIT(PMU->CR, PMU_CR_LPSTOP_MSK);
-		MODIFY_REG(BKPC->CR, BKPC_CR_WKPS_MSK, port << BKPC_CR_WKPS_POSS);
-		SET_BIT(BKPC->CR, BKPC_CR_WKPEN_MSK);
-		BKPC_LOCK();
-
-		SYSCFG_UNLOCK();
-		MODIFY_REG(PMU->CR, PMU_CR_WKPS_MSK, port << PMU_CR_WKPS_POSS);
-		SET_BIT(PMU->CR, PMU_CR_WKPEN_MSK);
-		MODIFY_REG(PMU->CR, PMU_CR_LPM_MSK, PMU_LP_STANDBY << PMU_CR_LPM_POSS);
-		SYSCFG_LOCK();
-	}
-
-	SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
-	SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
-	__WFI();
-	SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
-
-	return;
-}
-
-/**
-  * @brief  Configures low power mode. The system clock must
-  *         be less than 2MHz. Such as: LOSC or LRC.
-  * @param  vol: LDO output voltage select in low power mode.
-  * @param  state: New state, ENABLE/DISABLE;
-  * @retval None
-  */
-void pmu_lprun_config(pmu_ldo_lpmode_output_t vol, type_func_t state)
-{
-	assert_param(IS_FUNC_STATE(state));
-	SYSCFG_UNLOCK();
-
-	if (state) {
-		assert_param(IS_PMU_LDO_LPMODE_OUTPUT(vol));
-
-		MODIFY_REG(PMU->CR, PMU_CR_LPVS_MSK, vol << PMU_CR_LPVS_POSS);
-		SET_BIT(PMU->CR, PMU_CR_LPRUN_MSK);
-	}
-	else {
-		CLEAR_BIT(PMU->CR, PMU_CR_LPRUN_MSK);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Get wakup status.
-  * @param  sr: Status bit.
-  * @retval Status.
-  */
-flag_status_t pmu_get_status(pmu_status_t sr)
-{
-	assert_param(IS_PMU_STATUS(sr));
-
-	if (READ_BIT(PMU->SR, sr))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Clear wakup status.
-  * @param  sr: Status bit.
-  * @retval None
-  */
-void pmu_clear_status(pmu_status_t sr)
-{
-	assert_param(IS_PMU_STATUS(sr));
-	SYSCFG_UNLOCK();
-
-	if (sr == PMU_SR_WUF)
-		SET_BIT(PMU->CR, PMU_CR_CWUF_MSK);
-	else
-		SET_BIT(PMU->CR, PMU_CR_CSTANDBYF_MSK);
-
-	SYSCFG_LOCK();
-	return;
-}
-
-
-/**
-  * @}
-  */
-
-/** @addtogroup PMU_Public_Functions_Group2 LVD Configure
-  * @brief LVD configure functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### LVD configure functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to:
-      (+) Configure lvd parameters.
-      (+) Interrupt callback function.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Configure lvd using specified parameters.
-  * @param  sel: LVD threshold voltage.
-  * @param  mode: LVD trigger mode.
-  * @param  state: New state, ENABLE/DISABLE;
-  * @retval None
-  */
-void pmu_lvd_config(pmu_lvd_voltage_sel_t sel, pmu_lvd_trigger_mode_t mode, type_func_t state)
-{
-	assert_param(IS_FUNC_STATE(state));
-	SYSCFG_UNLOCK();
-
-	if (state) {
-		assert_param(IS_PMU_LVD_VOL_SEL(sel));
-		assert_param(IS_PMU_LVD_TRIGGER_MODE(mode));
-
-		MODIFY_REG(PMU->LVDCR, PMU_LVDCR_LVDS_MSK, sel << PMU_LVDCR_LVDS_POSS);
-		MODIFY_REG(PMU->LVDCR, PMU_LVDCR_LVIFS_MSK, mode << PMU_LVDCR_LVIFS_POSS);
-		SET_BIT(PMU->LVDCR, PMU_LVDCR_LVDFLT_MSK);
-		SET_BIT(PMU->LVDCR, PMU_LVDCR_LVDCIF_MSK);
-		SET_BIT(PMU->LVDCR, PMU_LVDCR_LVDIE_MSK);
-		SET_BIT(PMU->LVDCR, PMU_LVDCR_LVDEN_MSK);
-	}
-	else {
-		SET_BIT(PMU->LVDCR, PMU_LVDCR_LVDCIF_MSK);
-		CLEAR_BIT(PMU->LVDCR, PMU_LVDCR_LVDIE_MSK);
-		CLEAR_BIT(PMU->LVDCR, PMU_LVDCR_LVDEN_MSK);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Interrupt callback function.
-  * @note   This function is declared as __weak to be overwritten in case of other
-  *         implementations in user file.
-  * @retval None
-  */
-__weak void lvd_irq_cbk(void)
-{
-	return;
-}
-/**
-  * @}
-  */
-
-
-/**
-  * @}
-  */
-#endif /* ALD_PMU */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 143
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_rmu.c

@@ -1,143 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_rmu.c
-  * @brief   RMU module driver.
-  *
-  * @version V1.0
-  * @date    04 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_rmu.h"
-#include "ald_syscfg.h"
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup RMU RMU
-  * @brief RMU module driver
-  * @{
-  */
-#ifdef ALD_RMU
-
-/** @defgroup RMU_Public_Functions RMU Public Functions
-  * @{
-  */
-
-/**
-  * @brief  Configure BOR parameters.
-  * @param  flt: filter time.
-  * @param  vol: The voltage.
-  * @param  state: The new status: ENABLE/DISABLE.
-  * @retval None
-  */
-void rmu_bor_config(rmu_bor_filter_t flt, rmu_bor_vol_t vol, type_func_t state)
-{
-	assert_param(IS_FUNC_STATE(state));
-
-	SYSCFG_UNLOCK();
-
-	if (state) {
-		assert_param(IS_RMU_BORFLT(flt));
-		assert_param(IS_RMU_BORVOL(vol));
-
-		MODIFY_REG(RMU->CR, RMU_CR_BORFLT_MSK, flt << RMU_CR_BORFLT_POSS);
-		MODIFY_REG(RMU->CR, RMU_CR_BORVS_MSK, vol << RMU_CR_BORVS_POSS);
-		SET_BIT(RMU->CR, RMU_CR_BOREN_MSK);
-	}
-	else {
-		CLEAR_BIT(RMU->CR, RMU_CR_BOREN_MSK);
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @brief  Get specified reset status
-  * @param  state: Speicifies the type of the reset,
-  * @retval The status: SET/RESET.
-  */
-flag_status_t rmu_get_reset_status(rmu_state_t state)
-{
-	assert_param(IS_RMU_STATE(state));
-
-	if (READ_BIT(RMU->RSTSR, state))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Clear the specified reset status
-  * @param  state: Specifies the type of the reset,
-  * @retval None
-  */
-void rmu_clear_reset_status(rmu_state_t state)
-{
-	assert_param(IS_RMU_STATE_CLEAR(state));
-
-	SYSCFG_UNLOCK();
-	WRITE_REG(RMU->CRSTSR, state);
-	SYSCFG_LOCK();
-
-	return;
-}
-/**
-  * @brief  Reset peripheral device
-  * @param  perh: The peripheral device,
-  * @retval None
-  */
-void rmu_reset_periperal(rmu_peripheral_t perh)
-{
-	uint32_t idx, pos;
-
-	assert_param(IS_RMU_PERH(perh));
-
-	idx = (perh >> 27) & 0x7;
-	pos = perh & ~(0x7 << 27);
-	SYSCFG_UNLOCK();
-
-	switch (idx) {
-	case 0:
-		WRITE_REG(RMU->AHB1RSTR, pos);
-		break;
-
-	case 1:
-		WRITE_REG(RMU->AHB2RSTR, pos);
-		break;
-
-	case 2:
-		WRITE_REG(RMU->APB1RSTR, pos);
-		break;
-
-	case 4:
-		WRITE_REG(RMU->APB2RSTR, pos);
-		break;
-
-	default:
-		break;
-	}
-
-	SYSCFG_LOCK();
-	return;
-}
-
-/**
-  * @}
-  */
-#endif /* ALD_RMU */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 1193
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_rtc.c

@@ -1,1193 +0,0 @@
-/**
-  ******************************************************************************
-  * @file    ald_rtc.c
-  * @brief   RTC module driver.
-  *          This file provides firmware functions to manage the following
-  *          functionalities of the RTC peripheral:
-  *           + Initialization  functions
-  *           + Time and date functions
-  *           + Alarm functions
-  *           + Time stamp functions
-  *           + Tamper functions
-  *           + Wake-up functions
-  *           + Clock output functions
-  *           + Peripheral Control functions
-  * @version V1.0
-  * @date    25 Apr 2017
-  * @author  AE Team
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  ********************************************************************************
-  * @verbatim
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-    [..]
-      (+) Enable the RTC controller interface clock.
-      (+) Select the RTC source clock(default LOSC).
-      (+) Configure the RTC asynchronous prescaler, synchronous prescaler and hour
-          format using the rtc_init() function.
-
-     *** Time and date operation ***
-     =================================
-     [..]
-       (+) To configure the time use the rtc_set_time() function.
-       (+) To configure the date use the rtc_set_date() function.
-       (+) To read the time use the rtc_get_time() function.
-       (+) To read the date use the rtc_get_date() function.
-
-     *** Alarm operation ***
-     ===================================
-     [..]
-       (+) To configure the alarm use rtc_set_alarm() function
-       (+) To read the alarm use rtc_get_alarm() function
-       (+) To cancel the alarm use rtc_alarm_cmd() function
-
-     *** Time stamp operation ***
-     ===================================
-     [..]
-       (+) To configure the time stamp use rtc_set_time_stamp() function
-       (+) To read the time stamp use rtc_get_time_stamp() function
-       (+) To cancel the time stamp use rtc_cancel_time_stamp() function
-
-     *** Tamper operation ***
-     ===================================
-     [..]
-       (+) To configure the tamper use rtc_set_tamper() function
-       (+) To cancel the tamper use rtc_alarm_cmd() function
-
-     *** Wake-up operation ***
-     ===================================
-     [..]
-       (+) To configure the wake-up parameters use rtc_set_wakeup() function
-       (+) To read the re-load register value use rtc_get_wakeup_timer_value() function
-       (+) To cancel the wake-up use rtc_cancel_wakeup() function
-
-     *** Output clock operation ***
-     ===================================
-     [..]
-       (+) To configure the clock output type use rtc_set_clock_output() function
-       (+) To cancel the clock output use rtc_cancel_clock_output() function
-
-     *** Control functions ***
-     ===================================
-     [..]
-       (+) Configure interrupt enable/disable.
-       (+) Enable/disable alarm.
-       (+) Configure rtc shift.
-       (+) Calibrate time.
-       (+) Get interrupt source status.
-       (+) Get interrupt flag status.
-       (+) Clear interrupt flag.
-
-  ==================================================================
-                  ##### RTC and low power modes #####
-  ==================================================================
-  [..] The MCU can be woken up from a low power mode by an RTC alternate function.
-  [..] The RTC alternate functions are the RTC alarms (Alarm A and Alarm B),
-       RTC wake-up, RTC tamper event detection and RTC time stamp event detection.
-       These RTC alternate functions can wake up the system from the Stop and
-       Standby low power modes.
-  [..] The system can also wake up from low power modes without depending
-       on an external interrupt (Auto-wake-up mode), by using the RTC alarm
-       or the RTC wake-up events.
-  [..] The RTC provides a programmable time base for waking up from the Stop or
-       Standby mode at regular intervals. Wake-up from STOP and STANDBY modes
-       is possible only when the RTC clock source is LSE or LSI.
-
-     *** RTC driver macros list ***
-     =============================================
-     [..]
-       Below the list of most used macros in RTC driver.
-
-      (+) RTC_UNLOCK() Disable the protect.
-      (+) RTC_LOCK() Enable the protect.
-      (+) RTC_BY_PASS_ENABLE() Enable the by-pass shadow register.
-      (+) RTC_BY_PASS_DISABLE() Disable the by-pass shadow register.
-      (+) RTC_SUMMER_TIME_ENABLE() Enable summer time.
-      (+) RTC_SUMMER_TIME_DISABLE() Disable summer time.
-      (+) RTC_WINTER_TIME_ENABLE() Enable winter time.
-      (+) RTC_WINTER_TIME_DISABLE() Disable winter time.
-     [..]
-      (@) You can refer to the RTC driver header file for used the macros
-
-    @endverbatim
-  ******************************************************************************
-  */
-
-#include "ald_rtc.h"
-#include "ald_bkpc.h"
-#include "ald_temp.h"
-#include "ald_syscfg.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup RTC RTC
-  * @brief RTC module driver
-  * @{
-  */
-#ifdef ALD_RTC
-
-/** @addtogroup RTC_Private_Functions  RTC Private Functions
-  * @{
-  */
-/**
-  * @brief  Converts form 2 digit BCD to Binary.
-  * @param  bcd: BCD value to be converted.
-  * @retval Converted word.
-  */
-static uint32_t bcd_to_dec(uint32_t bcd)
-{
-	return ((bcd & 0xF) + ((bcd >> 4) & 0xF) * 10);
-}
-
-/**
-  * @brief  Converts a 2 digit decimal to BCD format.
-  * @param  dec: Byte to be converted.
-  * @retval Converted byte.
-  */
-static uint32_t dec_to_bcd(uint32_t dec)
-{
-	return (((dec / 10) << 4) | (dec % 10));
-}
-
-/**
-  * @brief  Time and Date consistency check.
-  * @param  t_last: Last time.
-  * @param  d_last: Last date.
-  * @param  time: Current time.
-  * @param  date: Current time.
-  * @retval status:
-  *           0 - Not consistency
-  *           1 - Consistency
-  */
-static int32_t rtc_consistency_check(rtc_time_t *t_last,
-			rtc_date_t *d_last, rtc_time_t *time, rtc_date_t *date)
-{
-	if (t_last->second != time->second)
-		return 0;
-	if (t_last->minute != time->minute)
-		return 0;
-	if (t_last->hour != time->hour)
-		return 0;
-	if (d_last->day != date->day)
-		return 0;
-	if (d_last->month != date->month)
-		return 0;
-	if (d_last->year != date->year)
-		return 0;
-
-	return 1;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions RTC Public Functions
-  * @{
-  */
-
-/** @defgroup RTC_Public_Functions_Group1 Initialization functions
-  * @brief    Initialization functions
-  *
-  * @verbatim
- ===============================================================================
-              ##### Initialization function #####
- ===============================================================================
-   [..] This section provides functions allowing to initialize and configure the
-         RTC Prescaler (Synchronous and Asynchronous), RTC Hour format, disable
-         RTC registers Write protection.
-         (#) The RTC Prescaler is programmed to generate the RTC 1Hz time base.
-             It is split into 2 programmable prescalers to minimize power consumption.
-             (++) A 7-bit asynchronous prescaler and a 13-bit synchronous prescaler.
-             (++) When both prescalers are used, it is recommended to configure the
-                 asynchronous prescaler to a high value to minimize power consumption.
-         (#) All RTC registers are Write protected. Writing to the RTC registers
-             is enabled by writing a key into the Write Protection register.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Reset RTC register.
-  * @retval None
-  */
-void rtc_reset(void)
-{
-	RTC_UNLOCK();
-
-	WRITE_REG(RTC->CON, 0x0);
-	WRITE_REG(RTC->TAMPCON, 0x0);
-	WRITE_REG(RTC->WUMAT, 0x0);
-	WRITE_REG(RTC->IER, 0x0);
-	WRITE_REG(RTC->IFCR, ~0x0);
-
-	RTC_LOCK();
-	return;
-}
-
-/**
-  * @brief  Initialize the RTC module.
-  * @param  init: Pointer to rtc_init_t structure which contains
-  *         the configuration parameters.
-  * @retval None
-  */
-void rtc_init(rtc_init_t *init)
-{
-	assert_param(IS_RTC_HOUR_FORMAT(init->hour_format));
-	assert_param(IS_RTC_OUTPUT_SEL(init->output));
-	assert_param(IS_RTC_OUTPUT_POLARITY(init->output_polarity));
-
-	rtc_reset();
-	RTC_UNLOCK();
-
-	MODIFY_REG(RTC->CON, RTC_CON_HFM_MSK, init->hour_format << RTC_CON_HFM_POS);
-	MODIFY_REG(RTC->CON, RTC_CON_EOS_MSK, init->output << RTC_CON_EOS_POSS);
-	MODIFY_REG(RTC->CON, RTC_CON_POL_MSK, init->output_polarity << RTC_CON_POL_POS);
-	MODIFY_REG(RTC->PSR, RTC_PSR_SPRS_MSK, init->synch_pre_div << RTC_PSR_SPRS_POSS);
-	MODIFY_REG(RTC->PSR, RTC_PSR_APRS_MSK, init->asynch_pre_div << RTC_PSR_APRS_POSS);
-	SET_BIT(RTC->CON, RTC_CON_GO_MSK);
-
-	RTC_LOCK();
-	return;
-}
-
-/**
-  * @brief  Configure the RTC source.
-  * @param  sel: RTC source type.
-  * @retval None
-  */
-void rtc_source_selcet(rtc_source_sel_t sel)
-{
-	assert_param(IS_RTC_SOURCE_SEL(sel));
-
-	BKPC_UNLOCK();
-	MODIFY_REG(BKPC->PCCR, BKPC_PCCR_RTCCS_MSK, sel << BKPC_PCCR_RTCCS_POSS);
-
-	if (sel == RTC_SOURCE_LOSC) {
-		SET_BIT(BKPC->CR, BKPC_CR_LOSCEN_MSK);
-	}
-	else if (sel == RTC_SOURCE_LRC) {
-		SET_BIT(BKPC->CR, BKPC_CR_LRCEN_MSK);
-	}
-	else {
-		; /* do nothing */
-	}
-
-	BKPC_LOCK();
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions_Group2 Time and Date functions
-  * @brief    RTC Time and Date functions
-  *
-  * @verbatim
- ===============================================================================
-                 ##### Time and Date functions #####
- ===============================================================================
-
- [..] This section provides functions allowing:
-     [#]
-       (+) To configure the time use the rtc_set_time() function.
-       (+) To configure the date use the rtc_set_date() function.
-       (+) To read the time use the rtc_get_time() function.
-       (+) To read the date use the rtc_get_date() function.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Set specified time.
-  * @param  time: pointer to a rtc_time_t structure.
-  * @param  format: Data format.
-  * @retval ALD status.
-  */
-ald_status_t  rtc_set_time(rtc_time_t *time, rtc_format_t format)
-{
-	uint32_t tmp;
-
-	assert_param(IS_RTC_FORMAT(format));
-
-	if (format == RTC_FORMAT_DEC) {
-		assert_param(IS_RTC_SECOND(time->second));
-		assert_param(IS_RTC_MINUTE(time->minute));
-		assert_param(IS_RTC_HOUR(time->hour));
-
-		tmp = (dec_to_bcd(time->second)) |
-			(dec_to_bcd(time->minute) << 8) |
-			(dec_to_bcd(time->hour) << 16);
-	}
-	else {
-		assert_param(IS_RTC_SECOND(bcd_to_dec(time->second)));
-		assert_param(IS_RTC_MINUTE(bcd_to_dec(time->minute)));
-		assert_param(IS_RTC_HOUR(bcd_to_dec(time->hour)));
-
-		tmp = time->second | (time->minute << 8) | (time->hour << 16);
-	}
-
-	RTC_UNLOCK();
-	WRITE_REG(RTC->TIME, tmp);
-	WRITE_REG(RTC->SSEC, time->sub_sec);
-	RTC_LOCK();
-
-	tmp = __get_tick();
-
-	while (READ_BIT(RTC->CON, RTC_CON_BUSY_MSK)) {
-		if ((__get_tick() - tmp) > RTC_TIMEOUT_VALUE)
-			return TIMEOUT;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Set specified date.
-  * @param  date: pointer to a rtc_date_t structure.
-  * @param  format: Data format.
-  * @retval ALD status.
-  */
-ald_status_t rtc_set_date(rtc_date_t *date, rtc_format_t format)
-{
-	uint32_t tmp;
-
-	assert_param(IS_RTC_FORMAT(format));
-
-	if (format == RTC_FORMAT_DEC) {
-		assert_param(IS_RTC_DAY(date->day));
-		assert_param(IS_RTC_MONTH(date->month));
-		assert_param(IS_RTC_YEAR(date->year));
-
-		tmp = (dec_to_bcd(date->day)) |
-			(dec_to_bcd(date->month) << 8) |
-			(dec_to_bcd(date->year) << 16) |
-			(dec_to_bcd(date->week) << 24);
-	}
-	else {
-		assert_param(IS_RTC_DAY(bcd_to_dec(date->day)));
-		assert_param(IS_RTC_MONTH(bcd_to_dec(date->month)));
-		assert_param(IS_RTC_YEAR(bcd_to_dec(date->year)));
-
-		tmp = date->day | (date->month << 8) |
-			(date->year << 16) | (date->week << 24);
-	}
-
-	RTC_UNLOCK();
-	WRITE_REG(RTC->DATE, tmp);
-	RTC_LOCK();
-
-	tmp = __get_tick();
-
-	while (READ_BIT(RTC->CON, RTC_CON_BUSY_MSK)) {
-		if ((__get_tick() - tmp) > RTC_TIMEOUT_VALUE)
-			return TIMEOUT;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Get current time.
-  * @param  time: pointer to a rtc_time_t structure.
-  * @param  format: Data format.
-  * @retval None
-  */
-void rtc_get_time(rtc_time_t *time, rtc_format_t format)
-{
-	uint32_t tmp;
-
-	assert_param(time != NULL);
-	assert_param(IS_RTC_FORMAT(format));
-
-	time->sub_sec = RTC->SSEC & 0xFFFF;
-	tmp = RTC->TIME;
-
-	if (format == RTC_FORMAT_DEC) {
-		time->second = bcd_to_dec(tmp & 0x7F);
-		time->minute = bcd_to_dec((tmp >> 8) & 0x7F);
-		time->hour   = bcd_to_dec((tmp >> 16) & 0x7F);
-	}
-	else {
-		time->second = tmp & 0x7F;
-		time->minute = (tmp >> 8) & 0x7F;
-		time->hour   = (tmp >> 16) & 0x7F;
-	}
-
-	return;
-}
-
-/**
-  * @brief  Get current date.
-  * @param  date: pointer to a rtc_date_t structure.
-  * @param  format: Data format.
-  * @retval None
-  */
-void rtc_get_date(rtc_date_t *date, rtc_format_t format)
-{
-	uint32_t tmp = RTC->DATE;
-
-	assert_param(date != NULL);
-	assert_param(IS_RTC_FORMAT(format));
-
-	if (format == RTC_FORMAT_DEC) {
-		date->day   = bcd_to_dec(tmp & 0x3F);
-		date->month = bcd_to_dec((tmp >> 8) & 0x1F);
-		date->year  = bcd_to_dec((tmp >> 16) & 0xFF);
-		date->week  = bcd_to_dec((tmp >> 24) & 0x7);
-	}
-	else {
-		date->day   = tmp & 0x3F;
-		date->month = (tmp >> 8) & 0x1F;
-		date->year  = (tmp >> 16) & 0xFF;
-		date->week  = (tmp >> 24) & 0x7;
-	}
-
-	return;
-}
-
-/**
-  * @brief  Get time and date consistency.
-  * @param  date: pointer to a rtc_date_t structure.
-  * @param  time: pointer to a rtc_time_t structure.
-  * @param  format: Data format.
-  * @retval Status:
-  *            0 - Consistency
-  *           -1 - Not consistency
-  */
-int32_t rtc_get_date_time(rtc_date_t *date, rtc_time_t *time, rtc_format_t format)
-{
-	int32_t nr = 3;
-	rtc_date_t d_last;
-	rtc_time_t t_last;
-
-	while (nr--) {
-		rtc_get_time(&t_last, format);
-		rtc_get_date(&d_last, format);
-		rtc_get_time(time, format);
-		rtc_get_date(date, format);
-
-		if (rtc_consistency_check(&t_last, &d_last, time, date))
-			return 0;
-	}
-
-	return -1;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions_Group3 Alarm functions
-  * @brief    RTC alarm functions
-  *
-  * @verbatim
- ===============================================================================
-                 ##### Alarm functions #####
- ===============================================================================
-
- [..] This section provides functions allowing:
-     [#]
-       (+) To configure the alarm use rtc_set_alarm() function
-       (+) To read the alarm use rtc_get_alarm() function
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Set alarm.
-  * @param  alarm: pointer to rtc_alarm_t struct.
-  * @param  format: Data format.
-  * @retval None
-  */
-void rtc_set_alarm(rtc_alarm_t *alarm, rtc_format_t format)
-{
-	unsigned int tmp, ss_tmp;
-
-	assert_param(IS_RTC_ALARM(alarm->idx));
-	assert_param(IS_RTC_ALARM_SEL(alarm->sel));
-	assert_param(IS_RTC_ALARM_SS_MASK(alarm->ss_mask));
-	assert_param(IS_RTC_FORMAT(format));
-
-	if (format == RTC_FORMAT_DEC) {
-		assert_param(IS_RTC_SECOND(alarm->time.second));
-		assert_param(IS_RTC_MINUTE(alarm->time.minute));
-		assert_param(IS_RTC_HOUR(alarm->time.hour));
-
-		tmp = (dec_to_bcd(alarm->time.second)) |
-		      (dec_to_bcd(alarm->time.minute) << 8) |
-		      (dec_to_bcd(alarm->time.hour) << 16) |
-		      alarm->mask;
-
-		if (alarm->sel == RTC_SELECT_DAY) {
-			assert_param(IS_RTC_DAY(alarm->day));
-
-			tmp |= (dec_to_bcd(alarm->day) << 24);
-			tmp &= 0x7FFFFFFF; /* Reset bit31 */
-		}
-		else {
-			tmp |= (1 << (alarm->week + 24));
-			tmp |= 0x80000000; /* Set bit31 */
-		}
-	}
-	else {
-		assert_param(IS_RTC_SECOND(bcd_to_dec(alarm->time.second)));
-		assert_param(IS_RTC_MINUTE(bcd_to_dec(alarm->time.minute)));
-		assert_param(IS_RTC_HOUR(bcd_to_dec(alarm->time.hour)));
-
-		tmp = alarm->time.second |
-		      (alarm->time.minute << 8) |
-		      (alarm->time.hour << 16) |
-		      alarm->mask;
-
-		if (alarm->sel == RTC_SELECT_DAY) {
-			assert_param(IS_RTC_DAY(bcd_to_dec(alarm->day)));
-
-			tmp |= (alarm->day << 24);
-			tmp &= 0x7FFFFFFF; /* Reset bit31 */
-		}
-		else {
-			tmp |= (1 << (alarm->week + 24));
-			tmp |= 0x80000000; /* Set bit31 */
-		}
-	}
-
-	ss_tmp = (alarm->time.sub_sec & 0x7F) |
-	         (alarm->ss_mask << 24);
-
-	RTC_UNLOCK();
-
-	if (alarm->idx == RTC_ALARM_A) {
-		WRITE_REG(RTC->ALMA, tmp);
-		WRITE_REG(RTC->ALMASSEC, ss_tmp);
-		SET_BIT(RTC->CON, RTC_CON_ALMAEN_MSK);
-	}
-	else {
-		WRITE_REG(RTC->ALMB, tmp);
-		WRITE_REG(RTC->ALMBSSEC, ss_tmp);
-		SET_BIT(RTC->CON, RTC_CON_ALMBEN_MSK);
-	}
-
-	RTC_LOCK();
-	return;
-}
-
-/**
-  * @brief  Get alarm parameters.
-  * @param  alarm: pointer to rtc_alarm_t struct.
-  * @param  format: Data format.
-  * @retval None
-  */
-void rtc_get_alarm(rtc_alarm_t *alarm, rtc_format_t format)
-{
-	uint8_t week;
-	uint32_t tmp, ss_tmp;
-
-	assert_param(alarm != NULL);
-	assert_param(IS_RTC_FORMAT(format));
-
-	if (alarm->idx == RTC_ALARM_A) {
-		tmp    = RTC->ALMA;
-		ss_tmp = RTC->ALMASSEC;
-	}
-	else {
-		tmp    = RTC->ALMB;
-		ss_tmp = RTC->ALMBSSEC;
-	}
-
-	if ((tmp >> 31) & 0x1) {
-		alarm->sel = RTC_SELECT_WEEK;
-		week = ((tmp >> 24) & 0x7F);
-
-		switch (week) {
-		case 1:
-			alarm->week = 0;
-			break;
-		case 2:
-			alarm->week = 1;
-			break;
-		case 4:
-			alarm->week = 2;
-			break;
-		case 8:
-			alarm->week = 3;
-			break;
-		case 16:
-			alarm->week = 4;
-			break;
-		case 32:
-			alarm->week = 5;
-			break;
-		case 64:
-			alarm->week = 6;
-			break;
-		default:
-			break;
-		}
-	}
-	else {
-		alarm->sel = RTC_SELECT_DAY;
-
-		if (format == RTC_FORMAT_DEC)
-			alarm->day = bcd_to_dec((tmp >> 24) & 0x3F);
-		else
-			alarm->day = (tmp >> 24) & 0x3F;
-	}
-
-	if (format == RTC_FORMAT_DEC) {
-		alarm->time.second  = bcd_to_dec(tmp & 0x7F);
-		alarm->time.minute  = bcd_to_dec((tmp >> 8) & 0x7F);
-		alarm->time.hour    = bcd_to_dec((tmp >> 16) & 0x3F);
-	}
-	else {
-		alarm->time.second  = tmp & 0x7F;
-		alarm->time.minute  = (tmp >> 8) & 0x7F;
-		alarm->time.hour    = (tmp >> 16) & 0x3F;
-	}
-
-	alarm->time.sub_sec = ss_tmp & 0x7FFF;
-	alarm->ss_mask      = (rtc_sub_second_mask_t)((ss_tmp >> 24) & 0xF);
-	alarm->mask         = tmp & ALARM_MASK_ALL;
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions_Group4 Time stamp functions
-  * @brief    RTC time stamp functions
-  *
-  * @verbatim
- ===============================================================================
-                 ##### Time stamp functions #####
- ===============================================================================
-
- [..] This section provides functions allowing:
-     [#]
-       (+) To configure the time stamp use rtc_set_time_stamp() function
-       (+) To read the time stamp use rtc_get_time_stamp() function
-       (+) To cancel the time stamp use rtc_cancel_time_stamp() function
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Set time stamp.
-  * @param  sel: time stamp signal select:
-  *           @arg RTC_TS_SIGNAL_SEL_TAMPER0
-  *           @arg RTC_TS_SIGNAL_SEL_TAMPER1
-  * @param  style: time stamp trigger style:
-  *           @arg RTC_TS_RISING_EDGE
-  *           @arg RTC_TS_FALLING_EDGE
-  * @retval None
-  */
-void rtc_set_time_stamp(rtc_ts_signal_sel_t sel, rtc_ts_trigger_style_t style)
-{
-	assert_param(IS_RTC_TS_SIGNAL(sel));
-	assert_param(IS_RTC_TS_STYLE(style));
-
-	RTC_UNLOCK();
-
-	CLEAR_BIT(RTC->CON, RTC_CON_TSEN_MSK);
-	MODIFY_REG(RTC->CON, RTC_CON_TSSEL_MSK, style << RTC_CON_TSSEL_POS);
-	MODIFY_REG(RTC->CON, RTC_CON_TSPIN_MSK, sel << RTC_CON_TSPIN_POS);
-	SET_BIT(RTC->CON, RTC_CON_TSEN_MSK);
-
-	RTC_LOCK();
-	return;
-}
-
-/**
-  * @brief  Cancel time stamp.
-  * @retval None
-  */
-void rtc_cancel_time_stamp(void)
-{
-	RTC_UNLOCK();
-	CLEAR_BIT(RTC->CON, RTC_CON_TSEN_MSK);
-	RTC_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Get time stamp value.
-  * @param  ts_time: pointer to rtc_time_t structure.
-  * @param  ts_date: pointer to rtc_date_t structure.
-  * @param  format: Data format.
-  * @retval None
-  */
-void rtc_get_time_stamp(rtc_time_t *ts_time, rtc_date_t *ts_date, rtc_format_t format)
-{
-	uint32_t tmp0, tmp1;
-
-	assert_param(ts_time != NULL);
-	assert_param(ts_date != NULL);
-	assert_param(IS_RTC_FORMAT(format));
-
-	ts_time->sub_sec = RTC->TSSSEC & 0xFFFF;
-	tmp0 = RTC->TSTIME;
-	tmp1 = RTC->TSDATE;
-
-	if (format == RTC_FORMAT_DEC) {
-		ts_time->second = bcd_to_dec(tmp0 & 0x7F);
-		ts_time->minute = bcd_to_dec((tmp0 >> 8) & 0x7F);
-		ts_time->hour   = bcd_to_dec((tmp0 >> 16) & 0x3F);
-		ts_date->day    = bcd_to_dec(tmp1 & 0x3F);
-		ts_date->month  = bcd_to_dec((tmp1 >> 8) & 0x1F);
-		ts_date->year   = bcd_to_dec((tmp1 >> 16) & 0xFF);
-		ts_date->week   = bcd_to_dec((tmp1 >> 24) & 0x7);
-	}
-	else {
-		ts_time->second = tmp0 & 0x7F;
-		ts_time->minute = (tmp0 >> 8) & 0x7F;
-		ts_time->hour   = (tmp0 >> 16) & 0x3F;
-		ts_date->day    = tmp1 & 0x3F;
-		ts_date->month  = (tmp1 >> 8) & 0x1F;
-		ts_date->year   = (tmp1 >> 16) & 0xFF;
-		ts_date->week   = (tmp1 >> 24) & 0x7;
-	}
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions_Group5 Tamper functions
-  * @brief    RTC tamper functions
-  *
-  * @verbatim
- ===============================================================================
-                 ##### Tamper functions #####
- ===============================================================================
-
- [..] This section provides functions allowing:
-     [#]
-       (+) To configure the tamper use rtc_set_tamper() function
-       (+) To cancel the tamper use rtc_alarm_cmd() function
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Set tamper parameters.
-  * @param  tamper: pointer to rtc_tamper_t structure.
-  * @retval None
-  */
-void rtc_set_tamper(rtc_tamper_t *tamper)
-{
-	assert_param(IS_RTC_TAMPER(tamper->idx));
-	assert_param(IS_RTC_TAMPER_TRIGGER(tamper->trig));
-	assert_param(IS_RTC_TAMPER_SAMPLING_FREQ(tamper->freq));
-	assert_param(IS_RTC_TAMPER_DURATION(tamper->dur));
-	assert_param(IS_FUNC_STATE(tamper->ts));
-
-	RTC_UNLOCK();
-	MODIFY_REG(RTC->TAMPCON, RTC_TAMPCON_TAMPTS_MSK, tamper->ts << RTC_TAMPCON_TAMPTS_POS);
-	MODIFY_REG(RTC->TAMPCON, RTC_TAMPCON_TAMPCKS_MSK, tamper->freq << RTC_TAMPCON_TAMPCKS_POSS);
-	MODIFY_REG(RTC->TAMPCON, RTC_TAMPCON_TAMPFLT_MSK, tamper->dur << RTC_TAMPCON_TAMPFLT_POSS);
-
-	if (tamper->idx == RTC_TAMPER_0) {
-		MODIFY_REG(RTC->TAMPCON, RTC_TAMPCON_TAMP1LV_MSK, tamper->trig << RTC_TAMPCON_TAMP1LV_POS);
-		SET_BIT(RTC->TAMPCON, RTC_TAMPCON_TAMP1EN_MSK);
-	}
-	else {
-		MODIFY_REG(RTC->TAMPCON, RTC_TAMPCON_TAMP2LV_MSK, tamper->trig << RTC_TAMPCON_TAMP2LV_POS);
-		SET_BIT(RTC->TAMPCON, RTC_TAMPCON_TAMP2EN_MSK);
-	}
-
-	RTC_LOCK();
-	return;
-}
-
-/**
-  * @brief  Cancel tamper.
-  * @param  idx: index of tamper:
-  *           @arg RTC_TAMPER_0
-  *           @arg RTC_TAMPER_1
-  * @retval None
-  */
-void rtc_cancel_tamper(rtc_tamper_idx_t idx)
-{
-	assert_param(IS_RTC_TAMPER(idx));
-
-	RTC_UNLOCK();
-
-	if (idx == RTC_TAMPER_0)
-		CLEAR_BIT(RTC->TAMPCON, RTC_TAMPCON_TAMP1EN_MSK);
-	else
-		CLEAR_BIT(RTC->TAMPCON, RTC_TAMPCON_TAMP2EN_MSK);
-
-	RTC_LOCK();
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions_Group6 Wake-up functions
-  * @brief    RTC wake-up functions
-  *
-  * @verbatim
- ===============================================================================
-                 ##### Wake-up functions #####
- ===============================================================================
-
- [..] This section provides functions allowing:
-     [#]
-       (+) To configure the wake-up parameters use rtc_set_wakeup() function
-       (+) To read the re-load register value use rtc_get_wakeup_timer_value() function
-       (+) To cancel the wake-up use rtc_cancel_wakeup() function
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Set wake-up parameters.
-  * @param  clock: pointer to rtc_wakeup_clock_t structure.
-  * @param  value: re-load value.
-  * @retval None
-  */
-void rtc_set_wakeup(rtc_wakeup_clock_t clock, uint16_t value)
-{
-	assert_param(IS_RTC_WAKEUP_CLOCK(clock));
-
-	RTC_UNLOCK();
-	MODIFY_REG(RTC->CON, RTC_CON_WUCKS_MSK, clock << RTC_CON_WUCKS_POSS);
-	WRITE_REG(RTC->WUMAT, value & 0xFFFF);
-	SET_BIT(RTC->CON, RTC_CON_WUTE_MSK);
-	RTC_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Cancel wake-up.
-  * @retval None
-  */
-void rtc_cancel_wakeup(void)
-{
-	RTC_UNLOCK();
-	CLEAR_BIT(RTC->CON, RTC_CON_WUTE_MSK);
-	RTC_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Get wake-up re-load register value.
-  * @retval Value of re-load register.
-  */
-uint16_t rtc_get_wakeup_timer_value(void)
-{
-	return RTC->WUMAT & 0xFFFF;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions_Group7 Clock output functions
-  * @brief    RTC clock output functions
-  *
-  * @verbatim
- ===============================================================================
-                 ##### Clock output functions #####
- ===============================================================================
-
- [..] This section provides functions allowing:
-     [#]
-       (+) To configure the clock output type use rtc_set_clock_output() function
-       (+) To cancel the clock output use rtc_cancel_clock_output() function
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Set clock output parameters.
-  * @param  clock: pointer to rtc_clock_output_t structure.
-  * @retval ALD status.
-  */
-ald_status_t rtc_set_clock_output(rtc_clock_output_t clock)
-{
-	uint32_t cnt = 4000;
-	assert_param(IS_RTC_CLOCK_OUTPUT(clock));
-
-	SYSCFG_UNLOCK();
-
-	if (clock == RTC_CLOCK_OUTPUT_EXA_1) {
-		SET_BIT(CMU->CLKENR, CMU_CLKENR_PLL2EN_MSK);
-		while ((READ_BIT(CMU->PLLCFG, CMU_PLLCFG_PLL2LCKN_MSK)) && (--cnt));
-		cnt = 4000;
-		while ((!(READ_BIT(CMU->CLKSR, CMU_CLKSR_PLL2RDY_MSK))) && (--cnt));
-	}
-	else {
-		CLEAR_BIT(CMU->CLKENR, CMU_CLKENR_PLL2EN_MSK);
-	}
-
-	SYSCFG_LOCK();
-	RTC_UNLOCK();
-	MODIFY_REG(RTC->CON, RTC_CON_CKOS_MSK, clock << RTC_CON_CKOS_POSS);
-	SET_BIT(RTC->CON, RTC_CON_CKOE_MSK);
-	RTC_LOCK();
-
-	return OK;
-}
-
-/**
-  * @brief  Cancel clock output.
-  * @retval None
-  */
-void rtc_cancel_clock_output(void)
-{
-	RTC_UNLOCK();
-	CLEAR_BIT(RTC->CON, RTC_CON_CKOE_MSK);
-	RTC_LOCK();
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup RTC_Public_Functions_Group8 Control functions
-  * @brief    RTC control functions
-  *
-  * @verbatim
- ===============================================================================
-                 ##### Control functions #####
- ===============================================================================
-
- [..] This section provides functions allowing:
-     [#]
-       (+) Configure interrupt enable/disable.
-       (+) Enable/disable alarm.
-       (+) Configure rtc shift.
-       (+) Calibrate time.
-       (+) Get interrupt source status.
-       (+) Get interrupt flag status.
-       (+) Clear interrupt flag.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Enable/disable the specified RTC interrupts.
-  * @param  it: Specifies the RTC interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref rtc_it_t.
-  * @param  state: New state of the specified RTC interrupts.
-  *         This parameter can be:
-  *           @arg ENABLE
-  *           @arg DISABLE
-  * @retval None
-  */
-void rtc_interrupt_config(rtc_it_t it, type_func_t state)
-{
-	assert_param(IS_RTC_IT(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	RTC_UNLOCK();
-
-	if (state == ENABLE)
-		SET_BIT(RTC->IER, it);
-	else
-		CLEAR_BIT(RTC->IER, it);
-
-	RTC_LOCK();
-	return;
-}
-
-/**
-  * @brief  Enable/Disable alarm.
-  * @param  idx: index of alarm:
-  *           @arg RTC_ALARM_A
-  *           @arg RTC_ALARM_B
-  * @param  state: New status of the specified alarm:
-  *           @arg ENABLE
-  *           @arg DISABLE
-  * @retval None
-  */
-void rtc_alarm_cmd(rtc_alarm_idx_t idx, type_func_t state)
-{
-	assert_param(IS_RTC_ALARM(idx));
-	assert_param(IS_FUNC_STATE(state));
-
-	RTC_UNLOCK();
-
-	if (idx == RTC_ALARM_A)
-		MODIFY_REG(RTC->CON, RTC_CON_ALMAEN_MSK, state << RTC_CON_ALMAEN_POS);
-	else
-		MODIFY_REG(RTC->CON, RTC_CON_ALMBEN_MSK, state << RTC_CON_ALMBEN_POS);
-
-	RTC_LOCK();
-	return;
-}
-
-/**
-  * @brief  Set shift parameters.
-  * @param  add_1s: Enable/Disable added 1 second.
-  * @param  sub_ss: value of sub-sconde.
-  * @retval ALD status.
-  */
-ald_status_t rtc_set_shift(type_func_t add_1s, uint16_t sub_ss)
-{
-	uint32_t tick;
-
-	assert_param(IS_FUNC_STATE(add_1s));
-	assert_param(IS_SHIFT_SUB_SS(sub_ss));
-
-	RTC_UNLOCK();
-	MODIFY_REG(RTC->SSECTR, RTC_SSECTR_TRIM_MSK, sub_ss << RTC_SSECTR_TRIM_POSS);
-	MODIFY_REG(RTC->SSECTR, RTC_SSECTR_INC_MSK, add_1s << RTC_SSECTR_INC_POS);
-	RTC_LOCK();
-
-	tick = __get_tick();
-
-	while (READ_BIT(RTC->CON, RTC_CON_SSEC_MSK)) {
-		if ((__get_tick() - tick) > RTC_TIMEOUT_VALUE)
-			return TIMEOUT;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Set calibation
-  * @param  config: pointer to rtc_cali_t structure.
-  * @retval None
-  */
-void rtc_set_cali(rtc_cali_t *config)
-{
-	assert_param(IS_RTC_CALI_FREQ(config->cali_freq));
-	assert_param(IS_RTC_CALI_TC(config->tc));
-	assert_param(IS_RTC_CALC_FREQ(config->calc_freq));
-	assert_param(IS_RTC_CALI_CALC(config->calc));
-	assert_param(IS_FUNC_STATE(config->acc));
-
-	RTC_UNLOCK();
-	RTC_CALI_UNLOCK();
-
-	MODIFY_REG(RTC->CALCON, RTC_CALCON_CALP_MSK, config->cali_freq << RTC_CALCON_CALP_POSS);
-	MODIFY_REG(RTC->CALCON, RTC_CALCON_TCM_MSK, config->tc << RTC_CALCON_TCM_POSS);
-	MODIFY_REG(RTC->CALCON, RTC_CALCON_TCP_MSK, config->calc_freq << RTC_CALCON_TCP_POSS);
-	MODIFY_REG(RTC->CALCON, RTC_CALCON_ALG_MSK, config->calc << RTC_CALCON_ALG_POS);
-	MODIFY_REG(RTC->CALCON, RTC_CALCON_DCMACC_MSK, config->acc << RTC_CALCON_DCMACC_POS);
-	SET_BIT(RTC->CALCON, RTC_CALCON_CALEN_MSK);
-
-	RTC_CALI_LOCK();
-	RTC_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Cancel calibration
-  * @retval None
-  */
-void rtc_cancel_cali(void)
-{
-	RTC_CALI_UNLOCK();
-	CLEAR_BIT(RTC->CALCON, RTC_CALCON_CALEN_MSK);
-	RTC_CALI_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Get calibration status.
-  * @retval ALD status.
-  */
-ald_status_t rtc_get_cali_status(void)
-{
-	if (READ_BIT(RTC->CALCON, RTC_CALCON_ERR_MSK))
-		return ERROR;
-	else
-		return OK;
-}
-
-/**
-  * @brief  Write temperature value.
-  * @param  temp: the value of temperature.
-  * @retval None
-  */
-void rtc_write_temp(uint16_t temp)
-{
-	RTC_CALI_UNLOCK();
-	MODIFY_REG(RTC->TEMPR, RTC_TEMPR_VAL_MSK, temp << RTC_TEMPR_VAL_POSS);
-	RTC_CALI_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Get the status of RTC interrupt source.
-  * @param  it: Specifies the RTC interrupt source.
-  *         This parameter can be one of the @ref rtc_it_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-it_status_t rtc_get_it_status(rtc_it_t it)
-{
-	assert_param(IS_RTC_IT(it));
-
-	if (READ_BIT(RTC->IER, it))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Get the status of RTC interrupt flag.
-  * @param  flag: Specifies the RTC interrupt flag.
-  *         This parameter can be one of the @ref rtc_flag_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t rtc_get_flag_status(rtc_flag_t flag)
-{
-	assert_param(IS_RTC_IF(flag));
-
-	if (READ_BIT(RTC->IFR, flag))
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Clear the specified RTC pending flag.
-  * @param  flag: specifies the flag to check.
-  * @retval None.
-  */
-void rtc_clear_flag_status(rtc_flag_t flag)
-{
-	assert_param(IS_RTC_IF(flag));
-
-	RTC_UNLOCK();
-	WRITE_REG(RTC->IFCR, flag);
-	RTC_LOCK();
-
-	return;
-}
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-#endif /* ALD_RTC */
-/**
-  * @}
-  */
-/**
-  * @}
-  */

+ 0 - 1740
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_spi.c

@@ -1,1740 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_spi.c
-  * @brief   SPI module driver.
-  *          This file provides firmware functions to manage the following
-  *          functionalities of SPI peripheral:
-  *           + Initialization functions
-  *           + IO operation functions
-  *           + Peripheral Control functions
-  *           + Peripheral State functions
-  *
-  * @version V1.0
-  * @date    13 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  @verbatim
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-    [..]
-      The SPI driver can be used as follows:
-
-      (#) Declare a spi_handle_t structure, for example:
-          spi_handle_t hperh;
-
-      (#) Initialize the SPI low level resources:
-          (##) Enable the SPIx interface clock
-          (##) SPI pins configuration
-              (+++) Enable the clock for the SPI GPIOs
-              (+++) Configure these SPI pins as push-pull
-          (##) NVIC configuration if you need to use interrupt process
-               by implementing the mcu_irq_config() API.
-	       Invoked spi_irq_handle() function in SPI-IRQ function
-          (##) DMA Configuration if you need to use DMA process
-              (+++) Define ALD_DMA in ald_conf.h
- 	      (+++) Enable the DMAx clock
-
-      (#) Program the Mode, Direction , Data size, Baudrate Prescaler, NSS
-          management, Clock polarity and phase, FirstBit and CRC configuration in the hspi Init structure.
-
-      (#) Initialize the SPI module by invoking the spi_init() API.
-
-     [..]
-       Circular mode restriction:
-      (#) The DMA circular mode cannot be used when the SPI is configured in these modes:
-          (##) Master 2Lines RxOnly
-          (##) Master 1Line Rx
-      (#) When the SPI DMA Pause/Stop features are used, we must use the following APIs
-          the spi_dma_pause()/ spi_dma_stop().
-
-  * @endverbatim
-  */
-
-#include "ald_spi.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup SPI SPI
-  * @brief SPI module driver
-  * @{
-  */
-#ifdef ALD_SPI
-
-/** @addtogroup SPI_Private_Functions   SPI Private Functions
-  * @{
-  */
-static ald_status_t spi_wait_flag(spi_handle_t *hperh, spi_flag_t flag, flag_status_t status, uint32_t timeout);
-static ald_status_t spi_wait_flag_irq(spi_handle_t *hperh, spi_flag_t flag, flag_status_t status, uint32_t timeout);
-static void __spi_send_by_it(spi_handle_t *hperh);
-static void __spi_recv_by_it(spi_handle_t *hperh);
-static void __spi_send_recv_by_it(spi_handle_t *hperh, spi_sr_status_t status);
-#ifdef ALD_DMA
-static void spi_dma_send_cplt(void *arg);
-static void spi_dma_recv_cplt(void *arg);
-static void spi_dma_send_recv_cplt(void *arg);
-static void spi_dma_error(void *arg);
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup SPI_Public_Functions SPI Public Functions
-  * @{
-  */
-
-/** @defgroup SPI_Public_Functions_Group1 Initialization functions
-  * @brief Initialization and Configuration functions
-  *
-  * @verbatim
- ===============================================================================
-              ##### Initialization and de-initialization functions #####
- ===============================================================================
-    [..]  This subsection provides a set of functions allowing to initialize and
-          reset the SPIx peripheral:
-
-      (+) User must configure all related peripherals resources
-          (CLOCK, GPIO, DMA, NVIC).
-
-      (+) Call the function spi_init() to configure the selected device with
-          the selected configuration:
-        (++) Mode
-        (++) Direction
-        (++) Data Size
-        (++) Clock Polarity and Phase
-        (++) NSS Management
-        (++) BaudRate Prescaler
-        (++) FirstBit
-        (++) TIMode
-        (++) CRC Calculation
-        (++) CRC Polynomial if CRC enabled
-
-      (+) Call the function spi_reset() to reset the selected SPIx periperal.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Reset the SPI peripheral.
-  * @param  hperh: Pointer to a spi_handle_t structure that contains
-  *         the configuration information for the specified SPI module.
-  * @retval None
-  */
-void spi_reset(spi_handle_t *hperh)
-{
-	hperh->perh->CON1    = 0x0;
-	hperh->perh->CON2    = 0x0;
-	hperh->perh->CRCPOLY = 0x00000007;
-
-	SPI_RESET_HANDLE_STATE(hperh);
-	__UNLOCK(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Initializes the SPI mode according to the specified parameters in
-  *         the SPI_init_t and create the associated handle.
-  * @param  hperh: Pointer to a spi_handle_t structure that contains
-  *         the configuration information for the specified SPI module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_init(spi_handle_t *hperh)
-{
-	uint32_t tmp = 0;
-
-	assert_param(IS_SPI(hperh->perh));
-	assert_param(IS_SPI_MODE(hperh->init.mode));
-	assert_param(IS_SPI_DIRECTION(hperh->init.dir));
-	assert_param(IS_SPI_BAUD(hperh->init.baud));
-	assert_param(IS_FUNC_STATE(hperh->init.first_bit));
-	assert_param(IS_FUNC_STATE(hperh->init.ss_en));
-	assert_param(IS_FUNC_STATE(hperh->init.crc_calc));
-	assert_param(IS_SPI_DATASIZE(hperh->init.data_size));
-	assert_param(IS_SPI_CPHA(hperh->init.phase));
-	assert_param(IS_SPI_CPOL(hperh->init.polarity));
-
-	if (hperh == NULL)
-		return ERROR;
-
-	spi_reset(hperh);
-
-	tmp = hperh->perh->CON1;
-
-	if (hperh->init.mode == SPI_MODE_MASTER)
-		tmp |= 1 << SPI_CON1_SSOUT_POS;
-
-	tmp |= ((hperh->init.phase << SPI_CON1_CPHA_POS) | (hperh->init.polarity << SPI_CON1_CPOL_POS) |
-	        (hperh->init.baud << SPI_CON1_BAUD_POSS) | (hperh->init.data_size << SPI_CON1_FLEN_POS) |
-		(hperh->init.mode << SPI_CON1_MSTREN_POS) | (hperh->init.ss_en << SPI_CON1_SSEN_POS) |
-		(hperh->init.first_bit << SPI_CON1_LSBFST_POS));
-
-	hperh->perh->CON1 = tmp;
-
-	if (hperh->init.dir == SPI_DIRECTION_2LINES) {
-		CLEAR_BIT(hperh->perh->CON1, SPI_CON1_BIDEN_MSK);
-		CLEAR_BIT(hperh->perh->CON1, SPI_CON1_RXO_MSK);
-	}
-	else if (hperh->init.dir == SPI_DIRECTION_2LINES_RXONLY) {
-		CLEAR_BIT(hperh->perh->CON1, SPI_CON1_BIDEN_MSK);
-		SET_BIT(hperh->perh->CON1, SPI_CON1_RXO_MSK);
-	}
-	else {
-		SET_BIT(hperh->perh->CON1, SPI_CON1_BIDEN_MSK);
-	}
-
-	/* configure CRC */
-	hperh->perh->CON1   |= (hperh->init.crc_calc << SPI_CON1_CRCEN_POS);
-	hperh->perh->CRCPOLY = hperh->init.crc_poly;
-
-	hperh->err_code = SPI_ERROR_NONE;
-	hperh->state    = SPI_STATE_READY;
-
-	if (hperh->init.dir == SPI_DIRECTION_2LINES)
-		SPI_ENABLE(hperh);
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup SPI_Public_Functions_Group2 IO operation functions
-  * @brief SPI Transmit and Receive functions
-  *
-  * @verbatim
-  ==============================================================================
-                      ##### IO operation functions #####
- ===============================================================================
-    This subsection provides a set of functions allowing to manage the SPI
-    data transfers.
-
-    [..] The SPI supports master or slave mode:
-
-    (#) There are two modes of transfer:
-       (++) Blocking mode: The communication is performed in polling mode.
-            The ALD status of all data processing is returned by the same function
-            after finishing transfer.
-       (++) No-Blocking mode: The communication is performed using Interrupts
-            or DMA, These APIs return the ALD status.
-            The end of the data processing will be indicated through the
-            dedicated SPI IRQ when using Interrupt mode or the DMA IRQ when
-            using DMA mode.
-            The hperh->tx_cplt_cbk(), hperh->rx_cplt_cbk() and hperh->tx_rx_cplt_cbk() user callbacks
-            will be executed respectivelly at the end of the transmit or Receive process
-            The hperh->err_cbk() user callback will be executed when a communication error is detected
-
-    (#) APIs provided for these 2 transfer modes (Blocking mode or Non blocking mode using either Interrupt or DMA)
-        exist for 1Line (simplex) and 2Lines (full duplex) modes.
-
-  * @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  transmit one byte fast in blocking mode.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  data: Data to be sent
-  * @retval status:
-  *           -  0 Success
-  *           - -1 Failed
-  */
-int32_t spi_send_byte_fast(spi_handle_t *hperh, uint8_t data)
-{
-	uint16_t cnt = 2000, temp;
-
-	hperh->perh->DATA = data;
-	while (((hperh->perh->STAT & (1 << SPI_STAT_TXBE_POS)) == 0) && (--cnt));
-
-	while ((hperh->perh->STAT & (1 << SPI_STAT_RXBNE_POS)) == 0);
-	temp = hperh->perh->DATA;
-	UNUSED(temp);
-
-	return cnt == 0 ? -1 : 0;
-}
-
-/**
-  * @brief  Receive one byte fast in blocking mode.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval Data.
-  */
-uint8_t spi_recv_byte_fast(spi_handle_t *hperh)
-{
-	uint16_t cnt = 2000;
-
-	if (hperh->init.mode == SPI_MODE_MASTER) {
-		hperh->perh->DATA = 0xFF;
-		while (((hperh->perh->STAT & (1 << SPI_STAT_TXBE_POS)) == 0) && (--cnt));
-	}
-
-	cnt = 2000;
-	while (((hperh->perh->STAT & (1 << SPI_STAT_RXBNE_POS)) == 0) && (--cnt));
-	return (uint8_t)hperh->perh->DATA;
-}
-
-/**
-  * @brief  transmit an amount of data in blocking mode.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_send(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->state    = SPI_STATE_BUSY_TX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->rx_buf   = NULL;
-	hperh->rx_size  = 0;
-	hperh->rx_count = 0;
-
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-	if (hperh->init.dir == SPI_DIRECTION_1LINE)
-		SPI_1LINE_TX(hperh);
-	if (READ_BIT(hperh->perh->CON1, SPI_CON1_SPIEN_MSK) == 0)
-		SPI_ENABLE(hperh);
-
-	if ((hperh->init.mode == SPI_MODE_SLAVER) || (hperh->tx_count == 1)) {
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			hperh->perh->DATA = *hperh->tx_buf;
-			++hperh->tx_buf;
-			--hperh->tx_count;
-		}
-		else {
-			hperh->perh->DATA = (*(uint16_t *)hperh->tx_buf);
-			hperh->tx_buf += 2;
-			--hperh->tx_count;
-		}
-	}
-
-	while (hperh->tx_count > 0) {
-		if (spi_wait_flag(hperh, SPI_IF_TXBE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-				SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			hperh->perh->DATA = *hperh->tx_buf;
-			++hperh->tx_buf;
-			--hperh->tx_count;
-		}
-		else {
-			hperh->perh->DATA = (*(uint16_t *)hperh->tx_buf);
-			hperh->tx_buf += 2;
-			--hperh->tx_count;
-		}
-	}
-
-	if (hperh->init.crc_calc)
-		SPI_CRCNEXT_ENABLE(hperh);
-
- 	if ((spi_wait_flag(hperh, SPI_IF_TXBE, SET, timeout) != OK)
-			|| (spi_wait_flag(hperh, SPI_IF_BUSY, RESET, timeout) != OK)) {
- 		if (hperh->init.crc_calc)
- 			SPI_CRC_RESET(hperh);
-
- 		hperh->state = SPI_STATE_READY;
- 		__UNLOCK(hperh);
- 		return TIMEOUT;
- 	}
-
-	if (hperh->init.dir == SPI_DIRECTION_2LINES)
-		spi_clear_flag_status(hperh, SPI_IF_OVE);
-
-	hperh->state = SPI_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receive an amount of data in blocking mode.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_recv(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	uint16_t temp;
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_RX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->tx_buf   = NULL;
-	hperh->tx_size  = 0;
-	hperh->tx_count = 0;
-
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-	if (hperh->init.dir == SPI_DIRECTION_1LINE_RX)
-		SPI_1LINE_RX(hperh);
-
-	if ((hperh->init.mode == SPI_MODE_MASTER) && (hperh->init.dir == SPI_DIRECTION_2LINES)) {
-		__UNLOCK(hperh);
-		hperh->state = SPI_STATE_READY;
-		return spi_send_recv(hperh, buf, buf, size, timeout);
-	}
-
-	if ((hperh->init.dir == SPI_DIRECTION_2LINES_RXONLY) || (hperh->init.dir == SPI_DIRECTION_1LINE_RX))
-		SPI_ENABLE(hperh);
-
-	while (hperh->rx_count > 1) {
-		if (spi_wait_flag(hperh, SPI_IF_RXBNE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-				SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			*hperh->rx_buf = hperh->perh->DATA;
-			++hperh->rx_buf;
-			--hperh->rx_count;
-		}
-		else {
-			*(uint16_t *)hperh->rx_buf = hperh->perh->DATA;
-			hperh->rx_buf += 2;
-			--hperh->rx_count;
-		}
-	}
-
-	if (hperh->init.crc_calc)
-		SPI_CRCNEXT_ENABLE(hperh);
-
-	if (spi_wait_flag(hperh, SPI_IF_RXBNE, SET, timeout) != OK) {
-		if (hperh->init.crc_calc)
-			SPI_CRC_RESET(hperh);
-
-		hperh->state = SPI_STATE_READY;
-		__UNLOCK(hperh);
-		return TIMEOUT;
-	}
-
-	if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-		*hperh->rx_buf = hperh->perh->DATA;
-		++hperh->rx_buf;
-		--hperh->rx_count;
-	}
-	else {
-		*(uint16_t *)hperh->rx_buf = hperh->perh->DATA;
-		hperh->rx_buf += 2;
-		--hperh->rx_count;
-	}
-
-	if (hperh->init.crc_calc) {
-		if (spi_wait_flag(hperh, SPI_IF_RXBNE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-				SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		temp = hperh->perh->DATA;
-		UNUSED(temp);
-	}
-
-	if ((hperh->init.crc_calc) && (spi_get_flag_status(hperh, SPI_IF_CRCERR) != RESET)) {
-		hperh->err_code |= SPI_ERROR_CRC;
-		SPI_CRC_RESET(hperh);
-		spi_clear_flag_status(hperh, SPI_IF_CRCERR);
-		hperh->state = SPI_STATE_READY;
-		__UNLOCK(hperh);
-		return ERROR;
-	}
-
-	hperh->state = SPI_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Full-Duplex Send receive an amount of data in full-duplex mode (blocking mode).
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  tx_buf: Pointer to data transmitted buffer
-  * @param  rx_buf: Pointer to data received buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_send_recv(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size, uint32_t timeout)
-{
-	uint16_t temp;
-
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (hperh->init.dir != SPI_DIRECTION_2LINES)
-		return ERROR;
-	if (tx_buf == NULL || rx_buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_TX_RX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->tx_buf   = tx_buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->rx_buf   = rx_buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-
-	if ((hperh->init.mode == SPI_MODE_SLAVER) || ((hperh->init.mode == SPI_MODE_SLAVER) && (hperh->tx_size == 1))) {
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			hperh->perh->DATA = *hperh->tx_buf;
-			++hperh->tx_buf;
-			--hperh->tx_count;
-		}
-		else {
-			hperh->perh->DATA = (*(uint16_t *)hperh->tx_buf);
-			hperh->tx_buf += 2;
-			--hperh->tx_count;
-		}
-	}
-
-	if (hperh->tx_buf == 0) {
-		if (hperh->init.crc_calc)
-			SPI_CRCNEXT_ENABLE(hperh);
-
-		if (spi_wait_flag(hperh, SPI_IF_TXBE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-				SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			*hperh->rx_buf = hperh->perh->DATA;
-			++hperh->rx_buf;
-			--hperh->rx_count;
-		}
-		else {
-			(*(uint16_t *)hperh->rx_buf) = hperh->perh->DATA;
-			hperh->rx_buf += 2;
-			--hperh->rx_count;
-		}
-	}
-
-	while (hperh->tx_count > 0) {
-		if (spi_wait_flag(hperh, SPI_IF_TXBE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-				SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			hperh->perh->DATA = *hperh->tx_buf;
-			++hperh->tx_buf;
-			--hperh->tx_count;
-		}
-		else {
-			hperh->perh->DATA = (*(uint16_t *)hperh->tx_buf);
-			hperh->tx_buf += 2;
-			--hperh->tx_count;
-		}
-
-		if ((hperh->tx_count == 0) && (hperh->init.crc_calc))
-			SPI_CRCNEXT_ENABLE(hperh);
-
-		if (spi_wait_flag(hperh, SPI_IF_RXBNE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-				SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			*hperh->rx_buf = hperh->perh->DATA;
-			++hperh->rx_buf;
-			--hperh->rx_count;
-		}
-		else {
-			(*(uint16_t *)hperh->rx_buf) = hperh->perh->DATA;
-
-			hperh->rx_buf += 2;
-			--hperh->rx_count;
-		}
-	}
-
-	if (hperh->init.mode == SPI_MODE_SLAVER) {
-		if (spi_wait_flag(hperh, SPI_IF_RXBNE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-			SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-			*hperh->rx_buf = hperh->perh->DATA;
-			++hperh->rx_buf;
-			--hperh->rx_count;
-		}
-		else {
-			(*(uint16_t *)hperh->rx_buf) = hperh->perh->DATA;
-
-			hperh->rx_buf += 2;
-			--hperh->rx_count;
-		}
-	}
-
-	if (hperh->init.crc_calc) {
-		if (spi_wait_flag(hperh, SPI_IF_RXBNE, SET, timeout) != OK) {
-			if (hperh->init.crc_calc)
-				SPI_CRC_RESET(hperh);
-
-			hperh->state = SPI_STATE_READY;
-			__UNLOCK(hperh);
-			return TIMEOUT;
-		}
-
-		temp = hperh->perh->DATA;
-		UNUSED(temp);
-	}
-
-	if ((spi_wait_flag(hperh, SPI_IF_BUSY, RESET, timeout) != OK)) {
-		if (hperh->init.crc_calc)
-			SPI_CRC_RESET(hperh);
-
-		hperh->state = SPI_STATE_READY;
-		__UNLOCK(hperh);
-		return TIMEOUT;
-	}
-
-	if ((hperh->init.crc_calc) && (spi_get_flag_status(hperh, SPI_IF_CRCERR) != RESET)) {
-		hperh->err_code |= SPI_ERROR_CRC;
-		SPI_CRC_RESET(hperh);
-		spi_clear_flag_status(hperh, SPI_IF_CRCERR);
-		hperh->state = SPI_STATE_READY;
-		__UNLOCK(hperh);
-
-		return ERROR;
-	}
-
-	hperh->state = SPI_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Wraps up transmission in non blocking mode.
-  * @param  hperh: pointer to a spi_handle_t structure.
-  * @param  buf: Pointer to data transmitted buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_send_by_it(spi_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_TX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->rx_buf   = NULL;
-	hperh->rx_size  = 0;
-	hperh->rx_count = 0;
-	__UNLOCK(hperh);
-
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-
-	if (hperh->init.dir == SPI_DIRECTION_1LINE)
-		SPI_1LINE_TX(hperh);
-
-	if (hperh->init.dir == SPI_DIRECTION_2LINES) {
-		spi_interrupt_config(hperh, SPI_IT_TXBE, ENABLE);
-	}
-	else {
-		spi_interrupt_config(hperh, SPI_IT_TXBE, ENABLE);
-		spi_interrupt_config(hperh, SPI_IT_ERR, ENABLE);
-	}
-
-	if (READ_BIT(hperh->perh->CON1, SPI_CON1_SPIEN_MSK) == 0)
-		SPI_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  buf: Pointer to data received buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_recv_by_it(spi_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (buf == NULL || size == 0)
-		return ERROR;
-	if ((hperh->init.dir == SPI_DIRECTION_2LINES) && (hperh->init.mode == SPI_MODE_MASTER))
-		return ERROR;	/* Please call spi_send_recv_by_it() */
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_RX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->tx_buf   = NULL;
-	hperh->tx_size  = 0;
-	hperh->tx_count = 0;
-	__UNLOCK(hperh);
-
-	if (hperh->init.dir == SPI_DIRECTION_1LINE_RX)
-		SPI_1LINE_RX(hperh);
-
-	if (hperh->init.crc_calc == ENABLE)
-		SPI_CRC_RESET(hperh);
-
-	spi_interrupt_config(hperh, SPI_IT_RXBNE, ENABLE);
-	spi_interrupt_config(hperh, SPI_IT_ERR, ENABLE);
-
-	if ((hperh->init.dir == SPI_DIRECTION_2LINES_RXONLY) || (hperh->init.dir == SPI_DIRECTION_1LINE_RX))
-		SPI_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Transmit and Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a spi_handle_t structure that contains
-  *         the configuration information for the specified SPI module.
-  * @param  tx_buf: Pointer to data transmitted buffer
-  * @param  rx_buf: Pointer to data received buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_send_recv_by_it(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (tx_buf == NULL || rx_buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_TX_RX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->tx_buf   = tx_buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->rx_buf   = rx_buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	__UNLOCK(hperh);
-
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-
-	spi_interrupt_config(hperh, SPI_IT_RXBNE, ENABLE);
-	spi_interrupt_config(hperh, SPI_IT_TXBE, ENABLE);
- 	spi_interrupt_config(hperh, SPI_IT_ERR, ENABLE);
-
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Transmit an amount of data used dma channel
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as SPI transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_send_by_dma(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_TX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->rx_buf   = NULL;
-	hperh->rx_size  = 0;
-	hperh->rx_count = 0;
-
-	if (hperh->init.dir == SPI_DIRECTION_1LINE)
-		SPI_1LINE_TX(hperh);
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	hperh->hdmatx.cplt_arg = (void *)hperh;
-	hperh->hdmatx.cplt_cbk = spi_dma_send_cplt;
-	hperh->hdmatx.err_arg  = (void *)hperh;
-	hperh->hdmatx.err_cbk  = spi_dma_error;
-
-	/* Configure SPI DMA transmit */
-	dma_config_struct(&(hperh->hdmatx.config));
-	hperh->hdmatx.config.data_width = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_SIZE_BYTE : DMA_DATA_SIZE_HALFWORD;
-	hperh->hdmatx.config.src        = (void *)buf;
-	hperh->hdmatx.config.dst        = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size       = size;
-	hperh->hdmatx.config.src_inc    = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_INC_BYTE : DMA_DATA_INC_HALFWORD;
-	hperh->hdmatx.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel       = hperh->perh == SPI0 ? DMA_MSEL_SPI0 : (hperh->perh == SPI1 ? DMA_MSEL_SPI1 : DMA_MSEL_SPI2);
-	hperh->hdmatx.config.msigsel    = DMA_MSIGSEL_SPI_TXEMPTY;
-	hperh->hdmatx.config.channel    = channel;
-	dma_config_basic(&(hperh->hdmatx));
-
-	__UNLOCK(hperh);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, ENABLE);
-
-	if (READ_BIT(hperh->perh->CON1, SPI_CON1_SPIEN_MSK) == 0)
-		SPI_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receive an amount of data used dma channel
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as SPI transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_recv_by_dma(spi_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY)
-		return BUSY;
-	if (buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_RX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->tx_buf   = NULL;
-	hperh->tx_size  = 0;
-	hperh->tx_count = 0;
-
-	if (hperh->init.dir == SPI_DIRECTION_1LINE_RX)
-		SPI_1LINE_RX(hperh);
-	if ((hperh->init.dir == SPI_DIRECTION_2LINES) && (hperh->init.mode == SPI_MODE_MASTER)) {
-		__UNLOCK(hperh);
-		return ERROR;	/* Please use spi_send_recv_by_dma() */
-	}
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.cplt_cbk = spi_dma_recv_cplt;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-	hperh->hdmarx.err_cbk  = spi_dma_error;
-
-	/* Configure DMA Receive */
-	dma_config_struct(&(hperh->hdmarx.config));
-	hperh->hdmarx.config.data_width = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_SIZE_BYTE : DMA_DATA_SIZE_HALFWORD;
-	hperh->hdmarx.config.src        = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst        = (void *)buf;
-	hperh->hdmarx.config.size       = size;
-	hperh->hdmarx.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc    = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_INC_BYTE : DMA_DATA_INC_HALFWORD;;
-	hperh->hdmarx.config.msel       = hperh->perh == SPI0 ? DMA_MSEL_SPI0 : (hperh->perh == SPI1 ? DMA_MSEL_SPI1 : DMA_MSEL_SPI2);
-	hperh->hdmarx.config.msigsel    = DMA_MSIGSEL_SPI_RNR;
-	hperh->hdmarx.config.channel    = channel;
-	dma_config_basic(&(hperh->hdmarx));
-
-	__UNLOCK(hperh);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, ENABLE);
-
-	if ((hperh->init.dir == SPI_DIRECTION_2LINES_RXONLY) || (hperh->init.dir == SPI_DIRECTION_1LINE_RX))
-		SPI_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Transmit and Receive an amount of data used dma channel
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  tx_buf: Pointer to data buffer
-  * @param  rx_buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  tx_channel: DMA channel as SPI transmit
-  * @param  rx_channel: DMA channel as SPI receive
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t spi_send_recv_by_dma(spi_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size, uint8_t tx_channel, uint8_t rx_channel)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	if (hperh->state != SPI_STATE_READY && hperh->state != SPI_STATE_BUSY_RX)
-		return BUSY;
-	if (tx_buf == NULL || rx_buf == NULL || size == 0)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state    = SPI_STATE_BUSY_RX;
-	hperh->err_code = SPI_ERROR_NONE;
-
-	hperh->tx_buf   = tx_buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->rx_buf   = rx_buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	hperh->hdmatx.cplt_arg = NULL;
-	hperh->hdmatx.cplt_cbk = NULL;
-	hperh->hdmatx.err_arg  = (void *)hperh;
-	hperh->hdmatx.err_cbk  = spi_dma_error;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.cplt_cbk = spi_dma_send_recv_cplt;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-	hperh->hdmarx.err_cbk  = spi_dma_error;
-
-	if (hperh->init.crc_calc)
-		SPI_CRC_RESET(hperh);
-
-	/* Configure SPI DMA transmit */
-	dma_config_struct(&(hperh->hdmatx.config));
-	hperh->hdmatx.config.data_width = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_SIZE_BYTE : DMA_DATA_SIZE_HALFWORD;
-	hperh->hdmatx.config.src        = (void *)tx_buf;
-	hperh->hdmatx.config.dst        = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size       = size;
-	hperh->hdmatx.config.src_inc    = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_INC_BYTE : DMA_DATA_INC_HALFWORD;
-	hperh->hdmatx.config.dst_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel       = hperh->perh == SPI0 ? DMA_MSEL_SPI0 : (hperh->perh == SPI1 ? DMA_MSEL_SPI1 : DMA_MSEL_SPI2);
-	hperh->hdmatx.config.msigsel    = DMA_MSIGSEL_SPI_TXEMPTY;
-	hperh->hdmatx.config.channel    = tx_channel;
-	dma_config_basic(&(hperh->hdmatx));
-
-	/* Configure DMA Receive */
-	dma_config_struct(&(hperh->hdmarx.config));
-	hperh->hdmarx.config.data_width = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_SIZE_BYTE : DMA_DATA_SIZE_HALFWORD;
-	hperh->hdmarx.config.src        = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst        = (void *)rx_buf;
-	hperh->hdmarx.config.size       = size;
-	hperh->hdmarx.config.src_inc    = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc    = hperh->init.data_size == SPI_DATA_SIZE_8 ? DMA_DATA_INC_BYTE : DMA_DATA_INC_HALFWORD;;
-	hperh->hdmarx.config.msel       = hperh->perh == SPI0 ? DMA_MSEL_SPI0 : (hperh->perh == SPI1 ? DMA_MSEL_SPI1 : DMA_MSEL_SPI2);
-	hperh->hdmarx.config.msigsel    = DMA_MSIGSEL_SPI_RNR;
-	hperh->hdmarx.config.channel    = rx_channel;
-	dma_config_basic(&(hperh->hdmarx));
-
-	__UNLOCK(hperh);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, ENABLE);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Pauses the DMA Transfer.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval Status
-  */
-ald_status_t spi_dma_pause(spi_handle_t *hperh)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	__LOCK(hperh);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, DISABLE);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, DISABLE);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Resumes the DMA Transfer.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval Status
-  */
-ald_status_t spi_dma_resume(spi_handle_t *hperh)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	__LOCK(hperh);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, ENABLE);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, ENABLE);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Stops the DMA Transfer.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval Status
-  */
-ald_status_t spi_dma_stop(spi_handle_t *hperh)
-{
-	assert_param(IS_SPI(hperh->perh));
-
-	__LOCK(hperh);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, DISABLE);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, DISABLE);
-	__UNLOCK(hperh);
-
-	hperh->state = SPI_STATE_READY;
-	return OK;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup SPI_Public_Functions_Group3 Control functions
-  * @brief SPI Control functions
-  *
-  * @verbatim
-   ===============================================================================
-                      ##### Peripheral Control functions #####
-   ===============================================================================
-    [..]
-    This subsection provides a set of functions allowing to control the SPI.
-     (+) Handle interrupt about SPI module. The spi_irq_handle() function must
-         be invoked by SPI-IRQ function.
-     (+) Configure the interrupt DISABLE/ENABLE.
-     (+) Configure the DMA request.
-     (+) Get interrupt source status.
-     (+) Get interrupt flag status.
-     (+) Clear interrupt flag
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  This function handles SPI interrupt request.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval None
-  */
-void spi_irq_handle(spi_handle_t *hperh)
-{
-	if ((hperh->state == SPI_STATE_BUSY_RX) || (hperh->state == SPI_STATE_BUSY_TX)) {
-		if ((spi_get_it_status(hperh, SPI_IT_RXBNE) != RESET) && (spi_get_flag_status(hperh, SPI_IF_RXBNE) != RESET))
-			__spi_recv_by_it(hperh);
-
-		if ((spi_get_it_status(hperh, SPI_IT_TXBE) != RESET) && (spi_get_flag_status(hperh, SPI_IF_TXBE) != RESET))
-			__spi_send_by_it(hperh);
-	}
-
-	else if (hperh->state == SPI_STATE_BUSY_TX_RX) {
-		if (hperh->tx_size == hperh->tx_count) {
-			if ((spi_get_it_status(hperh, SPI_IT_TXBE) != RESET) && (spi_get_flag_status(hperh, SPI_IF_TXBE) != RESET))
-				__spi_send_recv_by_it(hperh, SPI_SR_TXBE);
-		}
-		else {
-			if ((spi_get_it_status(hperh, SPI_IT_TXBE) != RESET) && (spi_get_flag_status(hperh, SPI_IF_TXBE) != RESET)
-			   && (spi_get_it_status(hperh, SPI_IT_RXBNE) != RESET) && (spi_get_flag_status(hperh, SPI_IF_RXBNE) != RESET))
-				__spi_send_recv_by_it(hperh, SPI_SR_TXBE_RXBNE);
-		}
-	}
-
-	if ((spi_get_it_status(hperh, SPI_IT_ERR) != RESET)) {
-		if (spi_get_flag_status(hperh, SPI_IF_CRCERR) != RESET) {
-			hperh->err_code |= SPI_ERROR_CRC;
-			spi_clear_flag_status(hperh, SPI_IF_CRCERR);
-		}
-		if (spi_get_flag_status(hperh, SPI_IF_MODF) != RESET) {
-			hperh->err_code |= SPI_ERROR_MODF;
-			spi_clear_flag_status(hperh, SPI_IF_MODF);
-		}
-		if (spi_get_flag_status(hperh, SPI_IF_OVE) != RESET) {
-			if (hperh->state != SPI_STATE_BUSY_TX) {
-				hperh->err_code |= SPI_ERROR_OVE;
-				spi_clear_flag_status(hperh, SPI_IF_OVE);
-			}
-		}
-
-		if (hperh->err_code != SPI_ERROR_NONE) {
- 			spi_interrupt_config(hperh, SPI_IT_RXBNE, DISABLE);
- 			spi_interrupt_config(hperh, SPI_IT_TXBE, DISABLE);
- 			spi_interrupt_config(hperh, SPI_IT_ERR, DISABLE);
-			hperh->state = SPI_STATE_READY;
-
-			if (hperh->err_cbk)
-				hperh->err_cbk(hperh);
-		}
-	}
-
-	return;
-}
-
-/**
-  * @brief  Enables or disables the specified SPI interrupts.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  it: Specifies the SPI interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref spi_it_t.
-  * @param  state: New status
-  *           - ENABLE
-  *           - DISABLE
-  * @retval None
-  */
-void spi_interrupt_config(spi_handle_t *hperh, spi_it_t it, type_func_t state)
-{
-	assert_param(IS_SPI(hperh->perh));
-	assert_param(IS_SPI_IT(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		hperh->perh->CON2 |= (uint32_t)it;
-	else
-		hperh->perh->CON2 &= ~((uint32_t)it);
-
-	return;
-}
-
-/**
-  * @brief  Configure the specified SPI speed.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  speed: Specifies the SPI speed.
-  *         This parameter can be one of the @ref spi_baud_t.
-  * @retval None
-  */
-void spi_speed_config(spi_handle_t *hperh, spi_baud_t speed)
-{
-	uint32_t tmp = 0;
-	assert_param(IS_SPI(hperh->perh));
-	assert_param(IS_SPI_BAUD(speed));
-
-	tmp = hperh->perh->CON1;
-	tmp &= ~(0x7 << SPI_CON1_BAUD_POSS);
-	tmp |= (speed << SPI_CON1_BAUD_POSS);
-	hperh->perh->CON1 = tmp;
-	return;
-}
-
-/**
-  * @brief  Enables or disables the dma request.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  req: Specifies the SPI dma request sources to be enabled or disabled.
-  *         This parameter can be one of the @ref spi_dma_req_t.
-  * @param  state: New status
-  *           - ENABLE
-  *           - DISABLE
-  * @retval None
-  */
-void spi_dma_req_config(spi_handle_t *hperh, spi_dma_req_t req, type_func_t state)
-{
-	assert_param(IS_SPI(hperh->perh));
-	assert_param(IS_SPI_DMA_REQ(req));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE) {
-		if (req == SPI_DMA_REQ_TX)
-			SET_BIT(hperh->perh->CON2, SPI_CON2_TXDMA_MSK);
-		else
-			SET_BIT(hperh->perh->CON2, SPI_CON2_RXDMA_MSK);
-	}
-	else {
-		if (req == SPI_DMA_REQ_TX)
-			CLEAR_BIT(hperh->perh->CON2, SPI_CON2_TXDMA_MSK);
-		else
-			CLEAR_BIT(hperh->perh->CON2, SPI_CON2_RXDMA_MSK);
-	}
-
-	return;
-}
-
-/**
-  * @brief  Checks whether the specified SPI interrupt has occurred or not.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  it: Specifies the SPI interrupt source to check.
-  *         This parameter can be one of the @ref spi_it_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-it_status_t spi_get_it_status(spi_handle_t *hperh, spi_it_t it)
-{
-	assert_param(IS_SPI(hperh->perh));
-	assert_param(IS_SPI_IT(it));
-
-	if (hperh->perh->CON2 & it)
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Check whether the specified SPI flag is set or not.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref spi_flag_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-flag_status_t spi_get_flag_status(spi_handle_t *hperh, spi_flag_t flag)
-{
-	assert_param(IS_SPI(hperh->perh));
-	assert_param(IS_SPI_IF(flag));
-
-	if (hperh->perh->STAT & flag)
-		return SET;
-
-	return RESET;
-}
-
-/** @brief  Clear the specified SPI pending flags.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref spi_flag_t.
-  * @retval None
-  */
-void spi_clear_flag_status(spi_handle_t *hperh, spi_flag_t flag)
-{
-	uint32_t temp;
-
-	assert_param(IS_SPI(hperh->perh));
-	assert_param(IS_SPI_IF(flag));
-
-	if (flag == SPI_IF_CRCERR) {
-		SET_BIT(hperh->perh->STAT, SPI_STAT_CRCERR_MSK);
-		return;
-	}
-	if (flag == SPI_IF_OVE) {
-		temp = hperh->perh->DATA;
-		temp = hperh->perh->STAT;
-		UNUSED(temp);
-		return;
-	}
-	if (flag == SPI_IF_MODF) {
-		temp = hperh->perh->STAT;
-		UNUSED(temp);
-		hperh->perh->CON1 = hperh->perh->CON1;
-		return;
-	}
-
-	return;
-}
-
-/**
-  * @brief  This function handles SPI communication timeout.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  flag: specifies the SPI flag to check.
-  * @param  status: The new Flag status (SET or RESET).
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t spi_wait_flag(spi_handle_t *hperh, spi_flag_t flag, flag_status_t status, uint32_t timeout)
-{
-	uint32_t tick = __get_tick();
-
-	assert_param(timeout > 0);
-
-	while ((spi_get_flag_status(hperh, flag)) != status) {
-		if (((__get_tick()) - tick) > timeout) {
-			spi_interrupt_config(hperh, SPI_IT_TXBE, DISABLE);
-			spi_interrupt_config(hperh, SPI_IT_RXBNE, DISABLE);
-			spi_interrupt_config(hperh, SPI_IT_ERR, DISABLE);
-			return TIMEOUT;
-		}
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  This function handles SPI communication timeout in interrupt function.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  flag: specifies the SPI flag to check.
-  * @param  status: The new Flag status (SET or RESET).
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t spi_wait_flag_irq(spi_handle_t *hperh, spi_flag_t flag, flag_status_t status, uint32_t timeout)
-{
-	assert_param(timeout > 0);
-
-	while (((spi_get_flag_status(hperh, flag)) != status) && (--timeout));
-
-	if (timeout)
-		return OK;
-
-	spi_interrupt_config(hperh, SPI_IT_TXBE, DISABLE);
-	spi_interrupt_config(hperh, SPI_IT_RXBNE, DISABLE);
-	spi_interrupt_config(hperh, SPI_IT_ERR, DISABLE);
-
-	return TIMEOUT;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup SPI_Public_Functions_Group4 Peripheral State and Errors functions
-  *  @brief   SPI State and Errors functions
-  *
-  * @verbatim
- ===============================================================================
-                      ##### Peripheral State and Errors functions #####
- ===============================================================================
-    [..]
-    This subsection provides a set of functions allowing to control the SPI.
-     (+) spi_get_state() API can check in run-time the state of the SPI peripheral
-     (+) spi_get_error() check in run-time Errors occurring during communication
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Returns the SPI state.
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval ALD state
-  */
-spi_state_t spi_get_state(spi_handle_t *hperh)
-{
-	assert_param(IS_SPI(hperh->perh));
-	return hperh->state;
-}
-
-/**
-  * @brief  Return the SPI error code
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval SPI Error Code
-  */
-uint32_t spi_get_error(spi_handle_t *hperh)
-{
-	assert_param(IS_SPI(hperh->perh));
-	return hperh->err_code;
-}
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup SPI_Private_Functions SPI Private Functions
-  * @brief   SPI Private functions
-  * @{
-  */
-
-/**
-  * @brief  handle program when an tx empty interrupt flag arrived in non block mode
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-static void __spi_send_by_it(spi_handle_t *hperh)
-{
-	if (hperh->tx_count == 0) {
-		spi_interrupt_config(hperh, SPI_IT_TXBE, DISABLE);
-		hperh->state = SPI_STATE_READY;
-
-		if (hperh->init.dir == SPI_DIRECTION_2LINES)
-			spi_clear_flag_status(hperh, SPI_IF_OVE);
-
-		if ((spi_wait_flag_irq(hperh, SPI_IF_BUSY, RESET, 5000)) != OK) {
-			if (hperh->err_cbk)
-				hperh->err_cbk(hperh);
-
-			return;
-		}
-
-		if (hperh->tx_cplt_cbk)
-			hperh->tx_cplt_cbk(hperh);
-
-		return;
-	}
-
-	if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-		hperh->perh->DATA = *hperh->tx_buf;
-		++hperh->tx_buf;
-	}
-	else {
-		hperh->perh->DATA    = *(uint16_t *)hperh->tx_buf;
-		hperh->tx_buf       += 2;
-	}
-	--hperh->tx_count;
-
-	if (hperh->tx_count == 0) {
-		if (hperh->init.crc_calc)
-			SPI_CRCNEXT_ENABLE(hperh);
-	}
-
-	return;
-}
-
-/**
-  * @brief  handle program when an rx no empty interrupt flag arrived in non block mode
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-static void __spi_recv_by_it(spi_handle_t *hperh)
-{
-	uint16_t temp;
-	if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-		*hperh->rx_buf = hperh->perh->DATA;
-		++hperh->rx_buf;
-	}
-	else {
-		*(uint16_t *)hperh->rx_buf = hperh->perh->DATA;
-		hperh->rx_buf             += 2;
-	}
-	--hperh->rx_count;
-
-	if ((hperh->rx_count == 1) && (hperh->init.crc_calc))
-		SPI_CRCNEXT_ENABLE(hperh);
-
-	if (hperh->rx_count == 0) {
-		spi_interrupt_config(hperh, SPI_IT_RXBNE, DISABLE);
-		hperh->state = SPI_STATE_READY;
-
-		if ((hperh->init.crc_calc) && (spi_get_flag_status(hperh, SPI_IF_CRCERR) != RESET)) {
-			hperh->err_code |= SPI_ERROR_CRC;
-			spi_clear_flag_status(hperh, SPI_IF_CRCERR);
-
-			if (hperh->err_cbk)
-				hperh->err_cbk(hperh);
-
-			return;
-		}
-
-		if (hperh->init.crc_calc) {
-			temp = hperh->perh->DATA;
-			UNUSED(temp);
-		}
-
-		if (hperh->rx_cplt_cbk)
-			hperh->rx_cplt_cbk(hperh);
-	}
-
-	return;
-}
-
-/**
-  * @brief  handle program when an rx no empty interrupt flag arrived in non block mode(2 lines)
-  * @param  hperh: Pointer to a spi_handle_t structure.
-  * @param  status: SR.TXE or SR.RXNE set.
-  * @retval Status, see @ref ald_status_t.
-  */
-static void __spi_send_recv_by_it(spi_handle_t *hperh, spi_sr_status_t status)
-{
-	assert_param(IS_SPI_SR_STATUS(status));
-
-	if (hperh->rx_count != 0) {
-		if ((status == SPI_SR_RXBNE) || (status == SPI_SR_TXBE_RXBNE)) {
-			if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-				*hperh->rx_buf = hperh->perh->DATA;
-				++hperh->rx_buf;
-			}
-			else {
-				*(uint16_t *)hperh->rx_buf = hperh->perh->DATA;
-				hperh->rx_buf += 2;
-			}
-
-			--hperh->rx_count;
-		}
-	}
-
-	if (hperh->tx_count != 0) {
-		if ((status == SPI_SR_TXBE) || (status == SPI_SR_TXBE_RXBNE)) {
-			if (hperh->tx_count == 1) {
-				if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-					hperh->perh->DATA = *hperh->tx_buf;
-					++hperh->tx_buf;
-				}
-				else {
-					hperh->perh->DATA = *(uint16_t *)hperh->tx_buf;
-					hperh->tx_buf       += 2;
-				}
-
-				--hperh->tx_count;
-
-				if (hperh->init.crc_calc)
-					SPI_CRCNEXT_ENABLE(hperh);
-			}
-			else {
-				if (hperh->init.data_size == SPI_DATA_SIZE_8) {
-					hperh->perh->DATA = *hperh->tx_buf;
-					++hperh->tx_buf;
-				}
-				else {
-					hperh->perh->DATA = *(uint16_t *)hperh->tx_buf;
-					hperh->tx_buf       += 2;
-				}
-
-				if (--hperh->tx_count == 0) {
-					if (hperh->init.crc_calc)
-						SPI_CRCNEXT_ENABLE(hperh);
-					spi_interrupt_config(hperh, SPI_IT_TXBE, DISABLE);
-				}
-			}
-		}
-	}
-
-	if (hperh->rx_count == 0) {
-		spi_interrupt_config(hperh, SPI_IT_TXBE, DISABLE);
-		spi_interrupt_config(hperh, SPI_IT_RXBNE, DISABLE);
-		spi_interrupt_config(hperh, SPI_IT_ERR, DISABLE);
-		hperh->state = SPI_STATE_READY;
-
-		if ((hperh->init.crc_calc) && (spi_get_flag_status(hperh, SPI_IF_CRCERR) != RESET)) {
-			hperh->err_code |= SPI_ERROR_CRC;
-			spi_clear_flag_status(hperh, SPI_IF_CRCERR);
-
-			if (hperh->err_cbk)
-				hperh->err_cbk(hperh);
-
-			return;
-		}
-
-		if (hperh->tx_rx_cplt_cbk)
-			hperh->tx_rx_cplt_cbk(hperh);
-	}
-
-	return;
-}
-
-
-#ifdef ALD_DMA
-/**
-  * @brief  DMA SPI transmit process complete callback.
-  * @param  arg: Pointer to a spi_handle_t structure.
-  * @retval None
-  */
-static void spi_dma_send_cplt(void *arg)
-{
-	uint16_t delay;
-	spi_handle_t *hperh = (spi_handle_t *)arg;
-
-	hperh->tx_count = 0;
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, DISABLE);
-	hperh->state = SPI_STATE_READY;
-
-	if (hperh->init.dir == SPI_DIRECTION_2LINES)
-		spi_clear_flag_status(hperh, SPI_IF_OVE);
-
-	if ((spi_wait_flag_irq(hperh, SPI_IF_BUSY, RESET, 5000)) != OK)
-		hperh->err_code |= SPI_ERROR_FLAG;
-
-	for (delay = 0; delay < 3000; delay++);
-
-	if (hperh->err_code == SPI_ERROR_NONE) {
-		if (hperh->tx_cplt_cbk)
-			hperh->tx_cplt_cbk(hperh);
-	}
-	else {
-		if (hperh->err_cbk)
-			hperh->err_cbk(hperh);
-	}
-
-	return;
-}
-
-/**
-  * @brief  DMA SPI receive process complete callback.
-  * @param  arg: Pointer to a spi_handle_t structure.
-  * @retval None
-  */
-static void spi_dma_recv_cplt(void *arg)
-{
-	uint32_t tmp;
-	spi_handle_t *hperh = (spi_handle_t *)arg;
-
-	hperh->rx_count = 0;
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, DISABLE);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, DISABLE);
-	hperh->state = SPI_STATE_READY;
-
-	if (hperh->init.crc_calc) {
-		if ((spi_wait_flag_irq(hperh, SPI_IF_RXBNE, SET, 5000)) != OK)
-			hperh->err_code |= SPI_ERROR_FLAG;
-
-		tmp = hperh->perh->DATA;
-		UNUSED(tmp);
-
-		if (spi_get_flag_status(hperh, SPI_IF_CRCERR) == SET) {
-			SET_BIT(hperh->err_code, SPI_ERROR_CRC);
-			SPI_CRC_RESET(hperh);
-			spi_clear_flag_status(hperh, SPI_IF_CRCERR);
-		}
-	}
-
-	if (hperh->err_code == SPI_ERROR_NONE) {
-		if (hperh->rx_cplt_cbk)
-			hperh->rx_cplt_cbk(hperh);
-	}
-	else {
-		if (hperh->err_cbk)
-			hperh->err_cbk(hperh);
-	}
-
-	return;
-}
-
-/**
-  * @brief  DMA SPI transmit and receive process complete callback.
-  * @param  arg: Pointer to a SPI_handle_t structure.
-  * @retval None
-  */
-static void spi_dma_send_recv_cplt(void *arg)
-{
-	uint32_t tmp;
-	uint16_t delay;
-	spi_handle_t *hperh = (spi_handle_t *)arg;
-
-	if (hperh->init.crc_calc) {
-		if ((spi_wait_flag_irq(hperh, SPI_IF_RXBNE, SET, 5000)) != OK)
-			hperh->err_code |= SPI_ERROR_FLAG;
-
-		tmp = hperh->perh->DATA;
-		UNUSED(tmp);
-
-		if (spi_get_flag_status(hperh, SPI_IF_CRCERR) == SET) {
-			SET_BIT(hperh->err_code, SPI_ERROR_CRC);
-			spi_clear_flag_status(hperh, SPI_IF_CRCERR);
-		}
-	}
-
-	if ((spi_wait_flag_irq(hperh, SPI_IF_BUSY, RESET, 5000)) != OK)
-		hperh->err_code |= SPI_ERROR_FLAG;
-
-	for (delay = 0; delay < 3000; delay++);
-
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, DISABLE);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, DISABLE);
-	hperh->tx_count = 0;
-	hperh->rx_count = 0;
-	hperh->state    = SPI_STATE_READY;
-
-	if (hperh->err_code == SPI_ERROR_NONE) {
-		if (hperh->tx_rx_cplt_cbk)
-			hperh->tx_rx_cplt_cbk(hperh);
-	}
-	else {
-		if (hperh->err_cbk)
-			hperh->err_cbk(hperh);
-	}
-
-	return;
-}
-
-/**
-  * @brief  DMA SPI communication error callback.
-  * @param  arg: Pointer to a spi_handle_t structure that contains
-  *         the configuration information for the specified SPI module.
-  * @retval None
-  */
-static void spi_dma_error(void *arg)
-{
-	spi_handle_t *hperh = (spi_handle_t *)arg;
-
-	spi_dma_req_config(hperh, SPI_DMA_REQ_TX, DISABLE);
-	spi_dma_req_config(hperh, SPI_DMA_REQ_RX, DISABLE);
-	SET_BIT(hperh->err_code, SPI_ERROR_DMA);
-
- 	hperh->tx_count = 0;
- 	hperh->rx_count = 0;
-	hperh->state    = SPI_STATE_READY;
-
-	if (hperh->err_cbk)
-		hperh->err_cbk(hperh);
-
-	return;
-}
-#endif /* ALD_DMA */
-/**
-  * @}
-  */
-#endif /* ALD_SPI */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 209
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_temp.c

@@ -1,209 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_temp.c
-  * @brief   TEMP module driver.
-  *
-  * @version V1.0
-  * @date    15 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_temp.h"
-#include "ald_bkpc.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup TEMP TEMP
-  * @brief TEMP module driver
-  * @{
-  */
-#ifdef ALD_TEMP
-
-
-/** @defgroup TEMP_Private_Variables TEMP Private Variables
-  * @{
-  */
-temp_cbk __temp_cbk;
-/**
-  * @}
-  */
-
-/** @defgroup TEMP_Public_Functions TEMP Public Functions
-  * @{
-  */
-
-/** @addtogroup TEMP_Public_Functions_Group1 Initialization functions
-  * @brief Initialization functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Initialization functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to initialize the TEMP:
-      (+) This parameters can be configured:
-        (++) Update Cycle
-        (++) Output Mode
-        (++) Perscaler
-      (+) Select TEMP source clock(default LOSC)
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Initializes the TEMP according to the specified
-  *         parameters in the temp_init_t.
-  * @param  init: Pointer to a temp_init_t structure that contains
-  *         the configuration information.
-  * @retval None
-  */
-void temp_init(temp_init_t *init)
-{
-	assert_param(IS_TEMP_UPDATE_CYCLE(init->cycle));
-	assert_param(IS_TEMP_OUTPUT_MODE(init->mode));
-
-	TEMP_UNLOCK();
-	MODIFY_REG(TEMP->CR, TEMP_CR_TSU_MSK, init->cycle << TEMP_CR_TSU_POSS);
-	MODIFY_REG(TEMP->CR, TEMP_CR_TOM_MSK, init->mode << TEMP_CR_TOM_POSS);
-	MODIFY_REG(TEMP->CR, TEMP_CR_CTN_MSK, init->ctn << TEMP_CR_CTN_POS);
-	MODIFY_REG(TEMP->PSR, TEMP_PSR_PRS_MSK, init->psc << TEMP_PSR_PRS_POSS);
-	TEMP_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  Configure the TEMP source.
-  * @param  sel: TEMP source type.
-  * @retval None
-  */
-void temp_source_selcet(temp_source_sel_t sel)
-{
-	assert_param(IS_TEMP_SOURCE_SEL(sel));
-
-	BKPC_UNLOCK();
-	MODIFY_REG(BKPC->PCCR, BKPC_PCCR_TEMPCS_MSK, sel << BKPC_PCCR_TEMPCS_POSS);
-
-	if (sel == TEMP_SOURCE_LOSC) {
-		SET_BIT(BKPC->CR, BKPC_CR_LOSCEN_MSK);
-	}
-	else if (sel == TEMP_SOURCE_LRC) {
-		SET_BIT(BKPC->CR, BKPC_CR_LRCEN_MSK);
-	}
-	else {
-		; /* do nothing */
-	}
-
-	BKPC_LOCK();
-	return;
-}
-/**
-  * @}
-  */
-
-/** @addtogroup TEMP_Public_Functions_Group2 Peripheral Control functions
-  * @brief Peripheral Control functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Peripheral Control functions #####
-  ==============================================================================
-  [..]  This section provides functions allowing to:
-    (+) temp_get_value() API can get the current temperature.
-    (+) temp_get_value_by_it() API can get the current temperature by interrupt.
-    (+) temp_irq_handle() API can handle the interrupt request.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Get the current temperature
-  * @param  temp: The value of current temperature.
-  * @retval ALD status:
-  *         @arg @ref OK    The value is valid
-  *         @arg @ref ERROR The value is invalid
-  */
-ald_status_t temp_get_value(uint16_t *temp)
-{
-	TEMP_UNLOCK();
-	SET_BIT(TEMP->IFCR, TEMP_IFCR_TEMP_MSK);
-	SET_BIT(TEMP->CR, TEMP_CR_EN_MSK);
-	TEMP_LOCK();
-
-	while (!(READ_BIT(TEMP->IF, TEMP_IF_TEMP_MSK)));
-
-	TEMP_UNLOCK();
-	SET_BIT(TEMP->IFCR, TEMP_IFCR_TEMP_MSK);
-	TEMP_LOCK();
-
-	if (READ_BIT(TEMP->DR, TEMP_DR_ERR_MSK))
-		return ERROR;
-
-	*temp = READ_BITS(TEMP->DR, TEMP_DR_DATA_MSK, TEMP_DR_DATA_POSS);
-	return OK;
-}
-
-/**
-  * @brief  Get the current temperature by interrupt
-  * @param  cbk: The callback function
-  * @retval None
-  */
-void temp_get_value_by_it(temp_cbk cbk)
-{
-	__temp_cbk = cbk;
-
-	TEMP_UNLOCK();
-	SET_BIT(TEMP->IFCR, TEMP_IFCR_TEMP_MSK);
-	SET_BIT(TEMP->IE, TEMP_IE_TEMP_MSK);
-	SET_BIT(TEMP->CR, TEMP_CR_EN_MSK);
-	TEMP_LOCK();
-
-	return;
-}
-
-/**
-  * @brief  This function handles TEMP interrupt request.
-  * @retval None
-  */
-void temp_irq_handle(void)
-{
-	TEMP_UNLOCK();
-	SET_BIT(TEMP->IFCR, TEMP_IFCR_TEMP_MSK);
-	TEMP_LOCK();
-
-	if (__temp_cbk == NULL)
-		return;
-
-	if (READ_BIT(TEMP->DR, TEMP_DR_ERR_MSK)) {
-		__temp_cbk(0, ERROR);
-		return;
-	}
-
-	__temp_cbk(READ_BITS(TEMP->DR, TEMP_DR_DATA_MSK, TEMP_DR_DATA_POSS), OK);
-
-	return;
-}
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-#endif /* ALD_TEMP */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 3709
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_timer.c

@@ -1,3709 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_timer.c
-  * @brief   TIMER module driver.
-  *	     This is the common part of the TIMER initialization
-  *
-  * @version V1.0
-  * @date    06 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include <string.h>
-#include "ald_timer.h"
-#include "ald_cmu.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup TIMER TIMER
-  * @brief TIMER module driver
-  * @{
-  */
-#ifdef ALD_TIMER
-
-/** @defgroup TIMER_Private_Functions TIMER Private Functions
-  * @{
-  */
-static void timer_base_set_config(TIMER_TypeDef *TIMERx, timer_base_init_t *init);
-static void timer_oc1_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config);
-static void timer_oc2_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config);
-static void timer_oc3_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config);
-static void timer_oc4_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config);
-static void timer_ccx_channel_cmd(TIMER_TypeDef* TIMERx, timer_channel_t ch, type_func_t state);
-static void timer_ccxn_channel_cmd(TIMER_TypeDef* TIMERx, timer_channel_t ch, type_func_t state);
-static void timer_ti1_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter);
-static void timer_ti1_set_config_stage(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity, uint32_t filter);
-static void timer_ti2_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter);
-static void timer_ti2_set_config_stage(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity, uint32_t filter);
-static void timer_ti3_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter);
-static void timer_ti4_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter);
-static void timer_etr_set_config(TIMER_TypeDef* TIMERx, timer_etr_psc_t psc, timer_clock_polarity_t polarity, uint32_t filter);
-static void timer_slave_set_config(timer_handle_t *hperh, timer_slave_config_t *config);
-#ifdef ALD_DMA
-static void timer_dma_oc_cplt(void *arg);
-static void timer_dma_capture_cplt(void *arg);
-static void timer_dma_period_elapse_cplt(void *arg);
-static void timer_dma_error(void *arg);
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup  TIMER_Public_Functions TIMER Public Functions
-  * @{
-  */
-
-/** @defgroup TIMER_Public_Functions_Group1 TIMER Base functions
-  * @brief    Time Base functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Timer Base functions #####
-  ==============================================================================
-  [..]
-    This section provides functions allowing to:
-    (+) Initialize and configure the TIMER base.
-    (+) Reset the TIMER base.
-    (+) Start the Time Base.
-    (+) Stop the Time Base.
-    (+) Start the Time Base and enable interrupt.
-    (+) Stop the Time Base and disable interrupt.
-    (+) Start the Time Base and enable DMA transfer.
-    (+) Stop the Time Base and disable DMA transfer.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER Time base Unit according to the specified
-  *         parameters in the timer_handle_t and create the associated handle.
-  * @param  hperh: TIMER base handle
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_base_init(timer_handle_t *hperh)
-{
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_COUNTER_MODE(hperh->init.mode));
-	assert_param(IS_TIMER_CLOCK_DIVISION(hperh->init.clk_div));
-
-	if (hperh->state == TIMER_STATE_RESET)
-		hperh->lock = UNLOCK;
-
-	hperh->state = TIMER_STATE_BUSY;
-	timer_base_set_config(hperh->perh, &hperh->init);
-	hperh->state = TIMER_STATE_READY;
-
-	return OK;
-}
-
-/**
-  * @brief  Reset the TIMER base peripheral
-  * @param  hperh: TIMER base handle
-  * @retval Status, see @ref ald_status_t.
-  */
-void timer_base_reset(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	hperh->state = TIMER_STATE_BUSY;
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_RESET;
-	__UNLOCK(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER Base generation.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_base_start(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	hperh->state = TIMER_STATE_BUSY;
-	TIMER_ENABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Base generation.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_base_stop(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	hperh->state = TIMER_STATE_BUSY;
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER Base generation in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_base_start_by_it(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	timer_interrupt_config(hperh, TIMER_IT_UPDATE, ENABLE);
-	TIMER_ENABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Base generation in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_base_stop_by_it(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	timer_interrupt_config(hperh, TIMER_IT_UPDATE, DISABLE);
-	TIMER_DISABLE(hperh);
-
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER Base generation in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  hdma: Pointer to dma_handle_t.
-  * @param  buf: The source Buffer address.
-  * @param  len: The length of buffer to be transferred from memory to TIMER peripheral
-  * @param  dma_ch: Channel of DMA.
-  * @retval Status, see @ref ald_status_t.
-*/
-ald_status_t timer_base_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-                                  uint16_t *buf, uint32_t len, uint8_t dma_ch)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	if ((hperh->state == TIMER_STATE_BUSY))
-		 return BUSY;
-	if ((hperh->state == TIMER_STATE_READY)) {
-		if (((uint32_t)buf == 0 ) || (len == 0))
-			return ERROR;
-	}
-
-	hperh->state   = TIMER_STATE_BUSY;
-
-	if (hdma->perh == NULL)
-		hdma->perh = DMA0;
-
-	hdma->cplt_cbk = timer_dma_period_elapse_cplt;
-	hdma->cplt_arg = (void *)hperh;
-	hdma->err_cbk  = timer_dma_error;
-	hdma->err_arg  = (void *)hperh;
-
-	dma_config_struct(&hdma->config);
-	hdma->config.src        = (void *)buf;
-	hdma->config.dst        = (void *)&hperh->perh->AR;
-	hdma->config.size       = len;
-	hdma->config.data_width = DMA_DATA_SIZE_HALFWORD;
-	hdma->config.src_inc    = DMA_DATA_INC_HALFWORD;
-	hdma->config.dst_inc    = DMA_DATA_INC_NONE;
-	hdma->config.msigsel    = DMA_MSIGSEL_TIMER_UPDATE;
-	hdma->config.channel    = dma_ch;
-
-	if (hperh->perh == TIMER0)
-		hdma->config.msel = DMA_MSEL_TIMER0;
-	else if (hperh->perh == TIMER1)
-		hdma->config.msel = DMA_MSEL_TIMER1;
-	else if (hperh->perh == TIMER2)
-		hdma->config.msel = DMA_MSEL_TIMER2;
-	else if (hperh->perh == TIMER3)
-		hdma->config.msel = DMA_MSEL_TIMER3;
-	else if (hperh->perh == TIMER4)
-		hdma->config.msel = DMA_MSEL_TIMER4;
-	else if (hperh->perh == TIMER5)
-		hdma->config.msel = DMA_MSEL_TIMER5;
-	else if (hperh->perh == TIMER6)
-		hdma->config.msel = DMA_MSEL_TIMER6;
-	else if (hperh->perh == TIMER7)
-		hdma->config.msel = DMA_MSEL_TIMER7;
-	else
-		;
-
-	dma_config_basic(hdma);
-	timer_dma_req_config(hperh, TIMER_DMA_UPDATE, ENABLE);
-	TIMER_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Stops the TIMER Base generation in DMA mode.
-  * @param  hperh: TIMER handle
-  * @retval None
-*/
-void timer_base_stop_by_dma(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	timer_dma_req_config(hperh, TIMER_DMA_UPDATE, DISABLE);
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-
-	return;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group2 TIMER Output Compare functions
-  *  @brief   Time Output Compare functions
-  *
-  * @verbatim
-  ==============================================================================
-                  ##### Time Output Compare functions #####
-  ==============================================================================
-  [..]
-    This section provides functions allowing to:
-    (+) Initialize and configure the TIMER Output Compare.
-    (+) Start the Time Output Compare.
-    (+) Stop the Time Output Compare.
-    (+) Start the Time Output Compare and enable interrupt.
-    (+) Stop the Time Output Compare and disable interrupt.
-    (+) Start the Time Output Compare and enable DMA transfer.
-    (+) Stop the Time Output Compare and disable DMA transfer.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER Output Compare according to the specified
-  *         parameters in the timer_handle_t and create the associated handle.
-  * @param  hperh: TIMER handle
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_oc_init(timer_handle_t *hperh)
-{
-	return timer_base_init(hperh);
-}
-
-/**
-  * @brief  Starts the TIMER Output Compare signal generation.
-  * @param  hperh: TIMER handle
-  * @param  ch : TIMER Channel to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_oc_start(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_ENABLE(hperh);
-
-	TIMER_ENABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Output Compare signal generation.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channel to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_oc_stop(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	timer_ccx_channel_cmd(hperh->perh, ch, DISABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_DISABLE(hperh);
-
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER Output Compare signal generation in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channel to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_oc_start_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_interrupt_config(hperh, TIMER_IT_CC1, ENABLE);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_interrupt_config(hperh, TIMER_IT_CC2, ENABLE);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_interrupt_config(hperh, TIMER_IT_CC3, ENABLE);
-		break;
-
-	case TIMER_CHANNEL_4:
-		timer_interrupt_config(hperh, TIMER_IT_CC4, ENABLE);
-		break;
-
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_ENABLE(hperh);
-
-	TIMER_ENABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Output Compare signal generation in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channel to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_oc_stop_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_interrupt_config(hperh, TIMER_IT_CC1, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_interrupt_config(hperh, TIMER_IT_CC2, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_interrupt_config(hperh, TIMER_IT_CC3, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_4:
-		timer_interrupt_config(hperh, TIMER_IT_CC4, DISABLE);
-		break;
-
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, DISABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_DISABLE(hperh);
-
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER Output Compare signal generation in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @param  hdma: Pointer to dma_handle_t.
-  * @param  buf: The source Buffer address.
-  * @param  len: The length of buffer to be transferred from memory to TIMER peripheral
-  * @param  dma_ch: Channel of DMA.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_oc_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                      dma_handle_t *hdma, uint16_t *buf, uint32_t len, uint8_t dma_ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	if ((hperh->state == TIMER_STATE_BUSY))
-		 return BUSY;
-	if ((hperh->state == TIMER_STATE_READY)) {
-		if (((uint32_t)buf == 0 ) || (len == 0))
-			return ERROR;
-	}
-
-	hperh->state   = TIMER_STATE_BUSY;
-
-	if (hdma->perh == NULL)
-		hdma->perh = DMA0;
-
-	hdma->cplt_cbk = timer_dma_oc_cplt;
-	hdma->cplt_arg = (void *)hperh;
-	hdma->err_cbk  = timer_dma_error;
-	hdma->err_arg  = (void *)hperh;
-
-	dma_config_struct(&hdma->config);
-	hdma->config.src        = (void *)buf;
-	hdma->config.size       = len;
-	hdma->config.data_width = DMA_DATA_SIZE_HALFWORD;
-	hdma->config.src_inc    = DMA_DATA_INC_HALFWORD;
-	hdma->config.dst_inc    = DMA_DATA_INC_NONE;
-	hdma->config.channel    = dma_ch;
-
-	if (hperh->perh == TIMER0)
-		hdma->config.msel = DMA_MSEL_TIMER0;
-	else if (hperh->perh == TIMER1)
-		hdma->config.msel = DMA_MSEL_TIMER1;
-	else if (hperh->perh == TIMER2)
-		hdma->config.msel = DMA_MSEL_TIMER2;
-	else if (hperh->perh == TIMER3)
-		hdma->config.msel = DMA_MSEL_TIMER3;
-	else if (hperh->perh == TIMER4)
-		hdma->config.msel = DMA_MSEL_TIMER4;
-	else if (hperh->perh == TIMER5)
-		hdma->config.msel = DMA_MSEL_TIMER5;
-	else if (hperh->perh == TIMER6)
-		hdma->config.msel = DMA_MSEL_TIMER6;
-	else if (hperh->perh == TIMER7)
-		hdma->config.msel = DMA_MSEL_TIMER7;
-	else
-		;//do nothing
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		hdma->config.dst     = (void *)&hperh->perh->CCVAL1;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH1;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_1;
-		break;
-
-	case TIMER_CHANNEL_2:
-		hdma->config.dst     = (void *)&hperh->perh->CCVAL2;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH2;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_2;
-		break;
-
-	case TIMER_CHANNEL_3:
-		hdma->config.dst     = (void *)&hperh->perh->CCVAL3;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH3;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC3, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_3;
-		break;
-
-	case TIMER_CHANNEL_4:
-		hdma->config.dst     = (void *)&hperh->perh->CCVAL4;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH4;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC4, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_4;
-		break;
-
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_ENABLE(hperh);
-
-	TIMER_ENABLE(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Stops the TIMER Output Compare signal generation in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-*/
-void timer_oc_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_dma_req_config(hperh, TIMER_DMA_CC3, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_4:
-		timer_dma_req_config(hperh, TIMER_DMA_CC4, DISABLE);
-		break;
-
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, DISABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_DISABLE(hperh);
-
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup  TIMER_Public_Functions_Group3 TIMER PWM functions
-  * @brief     TIMER PWM functions
-  *
-  * @verbatim
-	==============================================================================
-	##### Time PWM functions #####
-	==============================================================================
-	[..]
-		This section provides functions allowing to:
-		(+) Initialize and configure the TIMER PWM.
-		(+) Start the Time PWM.
-		(+) Stop the Time PWM.
-		(+) Start the Time PWM and enable interrupt.
-		(+) Stop the Time PWM and disable interrupt.
-		(+) Start the Time PWM and enable DMA transfer.
-		(+) Stop the Time PWM and disable DMA transfer.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER PWM Time Base according to the specified
-  *         parameters in the timer_handle_t and create the associated handle.
-  * @param  hperh: TIMER handle
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_pwm_init(timer_handle_t *hperh)
-{
-	return timer_base_init(hperh);
-}
-
-/**
-  * @brief  Starts the PWM signal generation.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_pwm_start(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_oc_start(hperh, ch);
-	return;
-}
-
-/**
-  * @brief  Stops the PWM signal generation.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_pwm_stop(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_oc_stop(hperh, ch);
-	return;
-}
-
-/**
-  * @brief  Starts the PWM signal generation in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channel to be disabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_pwm_start_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_oc_start_by_it(hperh, ch);
-	return;
-}
-
-/**
-  * @brief  Stops the PWM signal generation in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_pwm_stop_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_oc_stop_by_it(hperh, ch);
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER PWM signal generation in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @param  hdma: Pointer to dma_handle_t.
-  * @param  buf: The source Buffer address.
-  * @param  len: The length of buffer to be transferred from memory to TIMER peripheral
-  * @param  dma_ch: Channel of DMA.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_pwm_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                      dma_handle_t *hdma, uint16_t *buf, uint32_t len, uint8_t dma_ch)
-{
-	return timer_oc_start_by_dma(hperh, ch, hdma, buf, len, dma_ch);
-}
-
-/**
-  * @brief  Stops the TIMER PWM signal generation in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_pwm_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_oc_stop_by_dma(hperh, ch);
-	return;
-}
-#endif
-/**
-  * @brief  Set the PWM freq.
-  * @param  hperh: TIMER handle
-  * @param  freq: PWM freq to set
-  * @retval None
-  */
-void timer_pwm_set_freq(timer_handle_t *hperh, uint16_t freq)
-{
-	uint32_t _arr = cmu_get_pclk1_clock() / (hperh->init.prescaler + 1) / freq - 1;
-
-	WRITE_REG(hperh->perh->AR, _arr);
-	hperh->init.period   = _arr;
-}
-
-/**
-  * @brief  Set the PWM duty.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @param  duty: PWM duty to set
-  * @retval None
-  */
-void timer_pwm_set_duty(timer_handle_t *hperh, timer_channel_t ch, uint16_t duty)
-{
-	uint32_t tmp = (hperh->init.period + 1) * duty / 100 - 1;
-
-	if (ch == TIMER_CHANNEL_1)
-		WRITE_REG(hperh->perh->CCVAL1, tmp);
-	else if (ch == TIMER_CHANNEL_2)
-		WRITE_REG(hperh->perh->CCVAL2, tmp);
-	else if (ch == TIMER_CHANNEL_3)
-		WRITE_REG(hperh->perh->CCVAL3, tmp);
-	else if (ch == TIMER_CHANNEL_4)
-		WRITE_REG(hperh->perh->CCVAL4, tmp);
-	else {
-		;/* do nothing */
-	}
-}
-
-/**
-  * @brief  Set capture the PWM.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be captured the PWM
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_pwm_set_input(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_PWM_INPUT_INSTANCE(hperh->perh, ch));
-
-	CLEAR_BIT(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK);
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CC1SSEL_MSK, TIMER_IC_SEL_DIRECT << TIMER_CHMR1_CC1SSEL_POSS);
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CC2SSEL_MSK, TIMER_IC_SEL_INDIRECT << TIMER_CHMR1_CC2SSEL_POSS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC1POL_MSK, TIMER_IC_POLARITY_RISE << TIMER_CCEP_CC1POL_POS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC1NPOL_MSK, TIMER_IC_POLARITY_RISE << TIMER_CCEP_CC1NPOL_POS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC2POL_MSK, TIMER_IC_POLARITY_FALL << TIMER_CCEP_CC2POL_POS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC2NPOL_MSK, TIMER_IC_POLARITY_FALL << TIMER_CCEP_CC2NPOL_POS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI1FP1 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_RESET << TIMER_SMCON_SMODS_POSS);
-		break;
-	case TIMER_CHANNEL_2:
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CC1SSEL_MSK, TIMER_IC_SEL_INDIRECT << TIMER_CHMR1_CC1SSEL_POSS);
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CC2SSEL_MSK, TIMER_IC_SEL_DIRECT << TIMER_CHMR1_CC2SSEL_POSS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC1POL_MSK, TIMER_IC_POLARITY_RISE << TIMER_CCEP_CC1POL_POS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC1NPOL_MSK, TIMER_IC_POLARITY_FALL << TIMER_CCEP_CC1NPOL_POS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC2POL_MSK, TIMER_IC_POLARITY_FALL << TIMER_CCEP_CC2POL_POS);
-		MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC2NPOL_MSK, TIMER_IC_POLARITY_RISE << TIMER_CCEP_CC2NPOL_POS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI2FP2 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_RESET << TIMER_SMCON_SMODS_POSS);
-		break;
-	default:
-		break;
-	}
-
-	SET_BIT(hperh->perh->CCEP, TIMER_CCEP_CC1EN_MSK);
-	SET_BIT(hperh->perh->CCEP, TIMER_CCEP_CC2EN_MSK);
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group4 TIMER Input Capture functions
-  * @brief    Time Input Capture functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Time Input Capture functions #####
-  ==============================================================================
- [..]
-   This section provides functions allowing to:
-   (+) Initialize and configure the TIMER Input Capture.
-   (+) Start the Time Input Capture.
-   (+) Stop the Time Input Capture.
-   (+) Start the Time Input Capture and enable interrupt.
-   (+) Stop the Time Input Capture and disable interrupt.
-   (+) Start the Time Input Capture and enable DMA transfer.
-   (+) Stop the Time Input Capture and disable DMA transfer.
-
-  * @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER Input Capture Time base according to the specified
-  *         parameters in the timer_handle_t and create the associated handle.
-  * @param  hperh: TIMER handle
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_ic_init(timer_handle_t *hperh)
-{
-	return timer_base_init(hperh);
-}
-
-/**
-  * @brief  Starts the TIMER Input Capture measurement.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_ic_start(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
-	TIMER_ENABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Input Capture measurement.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_ic_stop(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	timer_ccx_channel_cmd(hperh->perh, ch, DISABLE);
-	TIMER_DISABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER Input Capture measurement in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_ic_start_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_interrupt_config(hperh, TIMER_IT_CC1, ENABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_interrupt_config(hperh, TIMER_IT_CC2, ENABLE);
-		break;
-	case TIMER_CHANNEL_3:
-		timer_interrupt_config(hperh, TIMER_IT_CC3, ENABLE);
-		break;
-	case TIMER_CHANNEL_4:
-		timer_interrupt_config(hperh, TIMER_IT_CC4, ENABLE);
-		break;
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
-	TIMER_ENABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Input Capture measurement in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_ic_stop_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_interrupt_config(hperh, TIMER_IT_CC1, DISABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_interrupt_config(hperh, TIMER_IT_CC2, DISABLE);
-		break;
-	case TIMER_CHANNEL_3:
-		timer_interrupt_config(hperh, TIMER_IT_CC3, DISABLE);
-		break;
-	case TIMER_CHANNEL_4:
-		timer_interrupt_config(hperh, TIMER_IT_CC4, DISABLE);
-		break;
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, DISABLE);
-	TIMER_DISABLE(hperh);
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER Input Capture measurement in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @param  hdma: Pointer to dma_handle_t.
-  * @param  buf: The destination Buffer address.
-  * @param  len: The length of buffer to be transferred TIMER peripheral to memory
-  * @param  dma_ch: Channel of DMA.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_ic_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                      dma_handle_t *hdma, uint16_t *buf, uint32_t len, uint8_t dma_ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	if ((hperh->state == TIMER_STATE_BUSY))
-		 return BUSY;
-	if ((hperh->state == TIMER_STATE_READY)) {
-		if (((uint32_t)buf == 0 ) || (len == 0))
-			return ERROR;
-	}
-
-	hperh->state   = TIMER_STATE_BUSY;
-
-	if (hdma->perh == NULL)
-		hdma->perh = DMA0;
-
-	hdma->cplt_cbk = timer_dma_capture_cplt;
-	hdma->cplt_arg = (void *)hperh;
-	hdma->err_cbk  = timer_dma_error;
-	hdma->err_arg  = (void *)hperh;
-
-	dma_config_struct(&hdma->config);
-	hdma->config.dst        = (void *)buf;
-	hdma->config.size       = len;
-	hdma->config.data_width = DMA_DATA_SIZE_HALFWORD;
-	hdma->config.src_inc    = DMA_DATA_INC_NONE;
-	hdma->config.dst_inc    = DMA_DATA_INC_HALFWORD;
-	hdma->config.channel    = dma_ch;
-
-	if (hperh->perh == TIMER0)
-		hdma->config.msel = DMA_MSEL_TIMER0;
-	else if (hperh->perh == TIMER1)
-		hdma->config.msel = DMA_MSEL_TIMER1;
-	else if (hperh->perh == TIMER2)
-		hdma->config.msel = DMA_MSEL_TIMER2;
-	else if (hperh->perh == TIMER3)
-		hdma->config.msel = DMA_MSEL_TIMER3;
-	else if (hperh->perh == TIMER4)
-		hdma->config.msel = DMA_MSEL_TIMER4;
-	else if (hperh->perh == TIMER5)
-		hdma->config.msel = DMA_MSEL_TIMER5;
-	else if (hperh->perh == TIMER6)
-		hdma->config.msel = DMA_MSEL_TIMER6;
-	else if (hperh->perh == TIMER7)
-		hdma->config.msel = DMA_MSEL_TIMER7;
-	else
-		;/* do nothing */
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		hdma->config.src     = (void *)&hperh->perh->CCVAL1;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH1;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_1;
-		break;
-
-	case TIMER_CHANNEL_2:
-		hdma->config.src     = (void *)&hperh->perh->CCVAL2;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH2;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_2;
-		break;
-
-	case TIMER_CHANNEL_3:
-		hdma->config.src     = (void *)&hperh->perh->CCVAL3;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH3;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC3, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_3;
-		break;
-
-	case TIMER_CHANNEL_4:
-		hdma->config.src     = (void *)&hperh->perh->CCVAL4;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH4;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC4, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_4;
-		break;
-
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
-	TIMER_ENABLE(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Stops the TIMER Input Capture measurement in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_ic_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, DISABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, DISABLE);
-		break;
-	case TIMER_CHANNEL_3:
-		timer_dma_req_config(hperh, TIMER_DMA_CC3, DISABLE);
-		break;
-	case TIMER_CHANNEL_4:
-		timer_dma_req_config(hperh, TIMER_DMA_CC4, DISABLE);
-		break;
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, DISABLE);
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group5 TIMER One Pulse functions
-  * @brief    Time One Pulse functions
-  *
-  * @verbatim
-  ==============================================================================
-                        ##### Time One Pulse functions #####
-  ==============================================================================
-  [..]
-    This section provides functions allowing to:
-    (+) Initialize and configure the TIMER One Pulse.
-    (+) Start the Time One Pulse.
-    (+) Stop the Time One Pulse.
-    (+) Start the Time One Pulse and enable interrupt.
-    (+) Stop the Time One Pulse and disable interrupt.
-    (+) Start the Time One Pulse and enable DMA transfer.
-    (+) Stop the Time One Pulse and disable DMA transfer.
-
-  * @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER One Pulse Time Base according to the specified
-  *         parameters in the timer_handle_t and create the associated handle.
-  * @param  hperh: TIMER handle
-  * @param  mode: Select the One pulse mode.
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_OP_MODE_SINGLE: Only one pulse will be generated.
-  *            @arg TIMER_OP_MODE_REPEAT: Repetitive pulses wil be generated.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_one_pulse_init(timer_handle_t *hperh, timer_op_mode_t mode)
-{
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_COUNTER_MODE(hperh->init.mode));
-	assert_param(IS_TIMER_CLOCK_DIVISION(hperh->init.clk_div));
-	assert_param(IS_TIMER_OP_MODE(mode));
-
-	if (hperh->state == TIMER_STATE_RESET)
-		hperh->lock = UNLOCK;
-
-	hperh->state = TIMER_STATE_BUSY;
-	timer_base_set_config(hperh->perh, &hperh->init);
-	MODIFY_REG(hperh->perh->CON1, TIMER_CON1_SPMEN_MSK, mode << TIMER_CON1_SPMEN_POS);
-	hperh->state = TIMER_STATE_READY;
-
-	return OK;
-}
-
-/**
-  * @brief  Starts the TIMER One Pulse signal generation.
-  * @param  hperh: TIMER One Pulse handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_start(timer_handle_t *hperh, timer_op_output_channel_t ch)
-{
-	/* Enable the Capture compare and the Input Capture channels
-	 * (in the OPM Mode the two possible channels that can be used are TIMER_CHANNEL_1 and TIMER_CHANNEL_2)
-	 * if TIMER_CHANNEL_1 is used as output, the TIMER_CHANNEL_2 will be used as input and
-	 * if TIMER_CHANNEL_1 is used as input, the TIMER_CHANNEL_2 will be used as output
-	 * in all combinations, the TIMER_CHANNEL_1 and TIMER_CHANNEL_2 should be enabled together
-	 */
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_ENABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER One Pulse signal generation.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_stop(timer_handle_t *hperh, timer_op_output_channel_t ch)
-{
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_DISABLE(hperh);
-
-	TIMER_DISABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER One Pulse signal generation in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_start_by_it(timer_handle_t *hperh, timer_op_output_channel_t ch)
-{
-	/* Enable the Capture compare and the Input Capture channels
-	 * (in the OPM Mode the two possible channels that can be used are TIMER_CHANNEL_1 and TIMER_CHANNEL_2)
-	 * if TIMER_CHANNEL_1 is used as output, the TIMER_CHANNEL_2 will be used as input and
-	 * if TIMER_CHANNEL_1 is used as input, the TIMER_CHANNEL_2 will be used as output
-	 * in all combinations, the TIMER_CHANNEL_1 and TIMER_CHANNEL_2 should be enabled together
-	 */
-	timer_interrupt_config(hperh, TIMER_IT_CC1, ENABLE);
-	timer_interrupt_config(hperh, TIMER_IT_CC2, ENABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_ENABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER One Pulse signal generation in interrupt mode.
-  * @param  hperh : TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_OP_OUTPUT_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_stop_by_it(timer_handle_t *hperh, timer_op_output_channel_t ch)
-{
-	timer_interrupt_config(hperh, TIMER_IT_CC1, DISABLE);
-	timer_interrupt_config(hperh, TIMER_IT_CC2, DISABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-
-	if (IS_TIMER_BREAK_INSTANCE(hperh->perh) != RESET)
-		TIMER_MOE_DISABLE(hperh);
-
-	TIMER_DISABLE(hperh);
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group6 TIMER Encoder functions
-  * @brief    TIMER Encoder functions
-  *
-  * @verbatim
-	==============================================================================
-	##### Time Encoder functions #####
-	==============================================================================
-	[..]
-		This section provides functions allowing to:
-		(+) Initialize and configure the TIMER Encoder.
-		(+) Start the Time Encoder.
-		(+) Stop the Time Encoder.
-		(+) Start the Time Encoder and enable interrupt.
-		(+) Stop the Time Encoder and disable interrupt.
-		(+) Start the Time Encoder and enable DMA transfer.
-		(+) Stop the Time Encoder and disable DMA transfer.
-
-  * @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER Encoder Interface and create the associated handle.
-  * @param  hperh: TIMER handle
-  * @param  config: TIMER Encoder Interface configuration structure
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_encoder_init(timer_handle_t *hperh,  timer_encoder_init_t *config)
-{
-	if (hperh == NULL)
-		return ERROR;
-
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_ENCODER_MODE(config->mode));
-	assert_param(IS_TIMER_IC_POLARITY(config->ic1_polarity));
-	assert_param(IS_TIMER_IC_POLARITY(config->ic2_polarity));
-	assert_param(IS_TIMER_IC_SELECT(config->ic1_sel));
-	assert_param(IS_TIMER_IC_SELECT(config->ic2_sel));
-	assert_param(IS_TIMER_IC_PSC(config->ic1_psc));
-	assert_param(IS_TIMER_IC_PSC(config->ic2_psc));
-	assert_param(IS_TIMER_IC_FILTER(config->ic1_filter));
-	assert_param(IS_TIMER_IC_FILTER(config->ic2_filter));
-
-	if (hperh->state == TIMER_STATE_RESET)
-		hperh->lock = UNLOCK;
-
-	hperh->state = TIMER_STATE_BUSY;
-	CLEAR_BIT(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK);
-	timer_base_set_config(hperh->perh, &hperh->init);
-
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, config->mode << TIMER_SMCON_SMODS_POSS);
-	MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CC1SSEL_MSK, config->ic1_sel << TIMER_CHMR1_CC1SSEL_POSS);
-	MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CC2SSEL_MSK, config->ic2_sel << TIMER_CHMR1_CC2SSEL_POSS);
-	MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_IC1PRES_MSK, config->ic1_psc << TIMER_CHMR1_IC1PRES_POSS);
-	MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_IC2PRES_MSK, config->ic2_psc << TIMER_CHMR1_IC2PRES_POSS);
-	MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_I1FLT_MSK, config->ic1_filter << TIMER_CHMR1_I1FLT_POSS);
-	MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_I2FLT_MSK, config->ic2_filter << TIMER_CHMR1_I2FLT_POSS);
-	MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC1POL_MSK, (config->ic1_polarity & 0x1) << TIMER_CCEP_CC1POL_POS);
-	MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC1NPOL_MSK, ((config->ic1_polarity >> 1) & 0x1) << TIMER_CCEP_CC1NPOL_POS);
-	MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC2POL_MSK, (config->ic2_polarity & 0x1) << TIMER_CCEP_CC2POL_POS);
-	MODIFY_REG(hperh->perh->CCEP, TIMER_CCEP_CC2NPOL_MSK, ((config->ic2_polarity >> 1) & 0x1) << TIMER_CCEP_CC2NPOL_POS);
-
-	hperh->state = TIMER_STATE_READY;
-	return OK;
-}
-
-/**
-  * @brief  Starts the TIMER Encoder Interface.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_ALL: TIMER Channel 1 and TIMER Channel 2 are selected
-  * @retval None
-  */
-void timer_encoder_start(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-		break;
-	default:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-		break;
-	}
-
-	TIMER_ENABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Encoder Interface.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_ALL: TIMER Channel 1 and TIMER Channel 2 are selected
-  * @retval None
-  */
-void timer_encoder_stop(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-		break;
-	default:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-		break;
-	}
-
-	TIMER_DISABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER Encoder Interface in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_ALL: TIMER Channel 1 and TIMER Channel 2 are selected
-  * @retval None
-  */
-void timer_encoder_start_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC1, ENABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC2, ENABLE);
-		break;
-	default:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC1, ENABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC2, ENABLE);
-		break;
-	}
-
-	TIMER_ENABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER Encoder Interface in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_ALL: TIMER Channel 1 and TIMER Channel 2 are selected
-  * @retval None
-  */
-void timer_encoder_stop_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC1, DISABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC2, DISABLE);
-		break;
-	default:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC1, DISABLE);
-		timer_interrupt_config(hperh, TIMER_IT_CC2, DISABLE);
-		break;
-	}
-
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER Encoder Interface in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_ALL: TIMER Channel 1 and TIMER Channel 2 are selected
-  * @param  hdma1: Pointer to dma_handle_t.
-  * @param  hdma2: Pointer to dma_handle_t.
-  * @param  buf1: The destination Buffer address. Reading data from CCR1.
-  * @param  buf2: The destination Buffer address. Reading data from CCR2.
-  * @param  len: The length of buffer to be transferred TIMER peripheral to memory
-  * @param  dma_ch1: Channel of DMA.
-  * @param  dma_ch2: Channel of DMA.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_encoder_start_by_dma(timer_handle_t *hperh, timer_channel_t ch,
-                           dma_handle_t *hdma1, dma_handle_t *hdma2, uint16_t *buf1,
-			   uint16_t *buf2, uint32_t len, uint8_t dma_ch1, uint8_t dma_ch2)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-
-	if ((hperh->state == TIMER_STATE_BUSY))
-		 return BUSY;
-	if ((hperh->state == TIMER_STATE_READY)) {
-		if (((uint32_t)buf1 == 0) || ((uint32_t)buf2 == 0) || (len == 0))
-			return ERROR;
-	}
-
-	if (hdma1->perh == NULL)
-		hdma1->perh = DMA0;
-	if (hdma2->perh == NULL)
-		hdma2->perh = DMA0;
-
-	hperh->state    = TIMER_STATE_BUSY;
-	hdma1->cplt_cbk = timer_dma_capture_cplt;
-	hdma1->cplt_arg = (void *)hperh;
-	hdma1->err_cbk  = timer_dma_error;
-	hdma1->err_arg  = (void *)hperh;
-
-	dma_config_struct(&hdma1->config);
-	hdma1->config.size       = len;
-	hdma1->config.data_width = DMA_DATA_SIZE_HALFWORD;
-	hdma1->config.src_inc    = DMA_DATA_INC_NONE;
-	hdma1->config.dst_inc    = DMA_DATA_INC_HALFWORD;
-
-	if (hperh->perh == TIMER0)
-		hdma1->config.msel = DMA_MSEL_TIMER0;
-	else if (hperh->perh == TIMER1)
-		hdma1->config.msel = DMA_MSEL_TIMER1;
-	else if (hperh->perh == TIMER2)
-		hdma1->config.msel = DMA_MSEL_TIMER2;
-	else if (hperh->perh == TIMER3)
-		hdma1->config.msel = DMA_MSEL_TIMER3;
-	else if (hperh->perh == TIMER4)
-		hdma1->config.msel = DMA_MSEL_TIMER4;
-	else if (hperh->perh == TIMER5)
-		hdma1->config.msel = DMA_MSEL_TIMER5;
-	else if (hperh->perh == TIMER6)
-		hdma1->config.msel = DMA_MSEL_TIMER6;
-	else if (hperh->perh == TIMER7)
-		hdma1->config.msel = DMA_MSEL_TIMER7;
-	else
-		;/* do nothing */
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		hdma1->config.src     = (void *)&hperh->perh->CCVAL1;
-		hdma1->config.dst     = (void *)buf1;
-		hdma1->config.msigsel = DMA_MSIGSEL_TIMER_CH1;
-		hdma1->config.channel = dma_ch1;
-		dma_config_basic(hdma1);
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, ENABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-		TIMER_ENABLE(hperh);
-		break;
-
-	case TIMER_CHANNEL_2:
-		hdma1->config.src     = (void *)&hperh->perh->CCVAL2;
-		hdma1->config.dst     = (void *)buf2;
-		hdma1->config.msigsel = DMA_MSIGSEL_TIMER_CH2;
-		hdma1->config.channel = dma_ch2;
-		dma_config_basic(hdma1);
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, ENABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-		TIMER_ENABLE(hperh);
-		break;
-
-	default:
-		hdma2->cplt_cbk = timer_dma_capture_cplt;
-		hdma2->cplt_arg = (void *)hperh;
-		hdma2->err_cbk  = timer_dma_error;
-		hdma2->err_arg  = (void *)hperh;
-		memcpy(&hdma2->config, &hdma1->config, sizeof(dma_config_t));
-
-		hdma1->config.src     = (void *)&hperh->perh->CCVAL1;
-		hdma1->config.dst     = (void *)buf1;
-		hdma1->config.msigsel = DMA_MSIGSEL_TIMER_CH1;
-		hdma1->config.channel = dma_ch1;
-		dma_config_basic(hdma1);
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, ENABLE);
-
-		hdma2->config.src     = (void *)&hperh->perh->CCVAL2;
-		hdma2->config.dst     = (void *)buf2;
-		hdma2->config.msigsel = DMA_MSIGSEL_TIMER_CH2;
-		hdma2->config.channel = dma_ch2;
-		dma_config_basic(hdma2);
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, ENABLE);
-
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, ENABLE);
-		TIMER_ENABLE(hperh);
-		break;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Stops the TIMER Encoder Interface in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_ALL: TIMER Channel 1 and TIMER Channel 2 are selected
-  * @retval None
-  */
-void timer_encoder_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, DISABLE);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, DISABLE);
-		break;
-	default:
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-		timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_2, DISABLE);
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, DISABLE);
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, DISABLE);
-		break;
-	}
-
-	TIMER_DISABLE(hperh);
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group7 TIMER Hall Sensor functions
-  * @brief    TIMER Hall Sensor functions
-  *
-  * @verbatim
-	==============================================================================
-	##### Time Hall Sensor functions #####
-	==============================================================================
-	[..]
-		This section provides functions allowing to:
-		(+) Initialize and configure the TIMER hall sensor.
-		(+) Start the hall sensor.
-		(+) Stop the hall sensor.
-		(+) Start the hall sensor and enable interrupt.
-		(+) Stop the hall sensor and disable interrupt.
-		(+) Start the hall sensor and enable DMA transfer.
-		(+) Stop the hal sensor and disable DMA transfer.
-
-  * @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER Encoder Interface and create the associated handle.
-  * @param  hperh: TIMER handle
-  * @param  config: TIMER Encoder Interface configuration structure
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_hall_sensor_init(timer_handle_t *hperh,  timer_hall_sensor_init_t *config)
-{
-	timer_oc_init_t oc;
-
-	assert_param(IS_TIMER_XOR_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_COUNTER_MODE(hperh->init.mode));
-	assert_param(IS_TIMER_CLOCK_DIVISION(hperh->init.clk_div));
-	assert_param(IS_TIMER_IC_POLARITY(config->polarity));
-	assert_param(IS_TIMER_IC_PSC(config->psc));
-	assert_param(IS_TIMER_IC_FILTER(config->filter));
-
-	if (hperh->state == TIMER_STATE_RESET)
-		hperh->lock = UNLOCK;
-
-	hperh->state = TIMER_STATE_READY;
-	timer_base_set_config(hperh->perh, &hperh->init);
-	timer_ti1_set_config(hperh->perh, config->polarity, TIMER_IC_SEL_TRC, config->filter);
-
-	MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_IC1PRES_MSK, config->psc << TIMER_CHMR1_IC1PRES_POSS);
-	SET_BIT(hperh->perh->CON2, TIMER_CON2_I1FSEL_MSK);
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI1F_ED << TIMER_SMCON_TSSEL_POSS);
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_RESET << TIMER_SMCON_SMODS_POSS);
-
-	oc.oc_mode        = TIMER_OC_MODE_PWM2;
-	oc.pulse          = config->delay;
-	oc.oc_polarity    = TIMER_OC_POLARITY_HIGH;
-	oc.ocn_polarity   = TIMER_OCN_POLARITY_HIGH;
-	oc.oc_fast_en     = DISABLE;
-	oc.oc_idle        = TIMER_OC_IDLE_RESET;
-	oc.ocn_idle       = TIMER_OCN_IDLE_RESET;
-	timer_oc2_set_config(hperh->perh, &oc);
-
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_TRGO_OC2REF << TIMER_SMCON_SMODS_POSS);
-	return OK;
-}
-/**
-  * @brief  Starts the TIMER hall sensor interface.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_hall_sensor_start(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_XOR_INSTANCE(hperh->perh));
-
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-	TIMER_ENABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER hall sensor interface.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_hall_sensor_stop(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_XOR_INSTANCE(hperh->perh));
-
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-	TIMER_DISABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER hall sensor interface in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_hall_sensor_start_by_it(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_XOR_INSTANCE(hperh->perh));
-
-	timer_interrupt_config(hperh, TIMER_IT_CC1, ENABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-	TIMER_ENABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER hall sensor interface in interrupt mode.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_hall_sensor_stop_by_it(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_XOR_INSTANCE(hperh->perh));
-
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-	timer_interrupt_config(hperh, TIMER_IT_CC1, DISABLE);
-	TIMER_DISABLE(hperh);
-
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER hall sensor interface in DMA mode.
-  * @param  hperh: TIMER handle
-  * @param  hdma: Pointer to dma_handle_t.
-  * @param  buf: The destination Buffer address. Reading data from CCR1.
-  * @param  len: The length of buffer to be transferred TIMER peripheral to memory
-  * @param  dma_ch: Channel of DMA.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_hall_sensor_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-		                       uint16_t *buf, uint32_t len, uint8_t dma_ch)
-{
-	assert_param(IS_TIMER_XOR_INSTANCE(hperh->perh));
-
-	if ((hperh->state == TIMER_STATE_BUSY))
-		 return BUSY;
-	if ((hperh->state == TIMER_STATE_READY)) {
-		if (((uint32_t)buf == 0) ||  (len == 0))
-			return ERROR;
-	}
-
-	if (hdma->perh == NULL)
-		hdma->perh = DMA0;
-
-	hperh->state   = TIMER_STATE_BUSY;
-	hdma->cplt_cbk = timer_dma_capture_cplt;
-	hdma->cplt_arg = (void *)hperh;
-	hdma->err_cbk  = timer_dma_error;
-	hdma->err_arg  = (void *)hperh;
-
-	dma_config_struct(&hdma->config);
-	hdma->config.size       = len;
-	hdma->config.data_width = DMA_DATA_SIZE_HALFWORD;
-	hdma->config.src_inc    = DMA_DATA_INC_NONE;
-	hdma->config.dst_inc    = DMA_DATA_INC_HALFWORD;
-
-	if (hperh->perh == TIMER0)
-		hdma->config.msel = DMA_MSEL_TIMER0;
-	else if (hperh->perh == TIMER6)
-		hdma->config.msel = DMA_MSEL_TIMER6;
-	else
-		;/* do nothing */
-
-	hdma->config.src     = (void *)&hperh->perh->CCVAL1;
-	hdma->config.dst     = (void *)buf;
-	hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH1;
-	hdma->config.channel = dma_ch;
-	dma_config_basic(hdma);
-	timer_dma_req_config(hperh, TIMER_DMA_CC1, ENABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, ENABLE);
-	TIMER_ENABLE(hperh);
-
-	return OK;
-}
-/**
-  * @brief  Stops the TIMER hall sensor interface in DMA mode.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_hall_sensor_stop_by_dma(timer_handle_t *hperh)
-{
-	assert_param(IS_TIMER_XOR_INSTANCE(hperh->perh));
-
-	timer_dma_req_config(hperh, TIMER_DMA_CC1, DISABLE);
-	timer_ccx_channel_cmd(hperh->perh, TIMER_CHANNEL_1, DISABLE);
-	TIMER_DISABLE(hperh);
-
-	return;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group8 TIMER complementary output compare functions
-  * @brief    TIMER complementary output compare functions
-  *
-  * @verbatim
-	==============================================================================
-	##### Time complementary output compare functions #####
-	==============================================================================
-	[..]
-		This section provides functions allowing to:
-		(+) Start the Time complementary output compare.
-		(+) Stop the Time complementary output compare.
-		(+) Start the Time complementary output compare and enable interrupt.
-		(+) Stop the Time complementary output compare and disable interrupt.
-		(+) Start the Time complementary output compare and enable DMA transfer.
-		(+) Stop the Time complementary output compare and disable DMA transfer.
-
-  * @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Starts the TIMER output compare signal generation on the complementary output.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_ocn_start(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCXN_INSTANCE(hperh->perh, ch));
-
-	timer_ccxn_channel_cmd(hperh->perh, ch, ENABLE);
-	TIMER_MOE_ENABLE(hperh);
-	TIMER_ENABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER output compare signal generation on the complementary output.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_ocn_stop(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCXN_INSTANCE(hperh->perh, ch));
-
-	timer_ccxn_channel_cmd(hperh->perh, ch, DISABLE);
-	TIMER_MOE_DISABLE(hperh);
-	TIMER_DISABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Starts the TIMER output compare signal generation on the complementary output.
-  *         in interrupt mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_ocn_start_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCXN_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_interrupt_config(hperh, TIMER_IT_CC1, ENABLE);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_interrupt_config(hperh, TIMER_IT_CC2, ENABLE);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_interrupt_config(hperh, TIMER_IT_CC3, ENABLE);
-		break;
-	default:
-		break;
-	}
-
-	timer_interrupt_config(hperh, TIMER_IT_BREAK, ENABLE);
-	timer_ccxn_channel_cmd(hperh->perh, ch, ENABLE);
-	TIMER_MOE_ENABLE(hperh);
-	TIMER_ENABLE(hperh);
-
-	return;
-}
-
-/**
-  * @brief  Stops the TIMER output compare signal generation on the complementary output.
-  *         in interrupt mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_ocn_stop_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCXN_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_interrupt_config(hperh, TIMER_IT_CC1, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_interrupt_config(hperh, TIMER_IT_CC2, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_interrupt_config(hperh, TIMER_IT_CC3, DISABLE);
-		break;
-	default:
-		break;
-	}
-
-	if ((!(READ_BIT(hperh->perh->CCEP, TIMER_CCEP_CC1NEN_MSK)))
-			&& (!(READ_BIT(hperh->perh->CCEP, TIMER_CCEP_CC2NEN_MSK)))
-			&& (!(READ_BIT(hperh->perh->CCEP, TIMER_CCEP_CC3NEN_MSK)))) {
-		timer_interrupt_config(hperh, TIMER_IT_BREAK, DISABLE);
-	}
-
-	timer_ccxn_channel_cmd(hperh->perh, ch, DISABLE);
-	TIMER_MOE_DISABLE(hperh);
-	TIMER_DISABLE(hperh);
-
-	return;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER output compare signal generation on the complementary output.
-  *         in DMA mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @param  hdma: Pointer to dma_handle_t.
-  * @param  buf: The destination Buffer address. Reading data from CCRx.
-  * @param  len: The length of buffer to be transferred TIMER peripheral to memory
-  * @param  dma_ch: Channel of DMA.
-  * @retval None
-  */
-ald_status_t timer_ocn_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-		          timer_channel_t ch, uint16_t *buf, uint32_t len, uint8_t dma_ch)
-{
-	assert_param(IS_TIMER_CCXN_INSTANCE(hperh->perh, ch));
-
-	if ((hperh->state == TIMER_STATE_BUSY))
-		 return BUSY;
-	if ((hperh->state == TIMER_STATE_READY)) {
-		if (((uint32_t)buf == 0 ) || (len == 0))
-			return ERROR;
-	}
-
-	hperh->state   = TIMER_STATE_BUSY;
-
-	if (hdma->perh == NULL)
-		hdma->perh = DMA0;
-
-	hdma->cplt_cbk = timer_dma_oc_cplt;
-	hdma->cplt_arg = (void *)hperh;
-	hdma->err_cbk  = timer_dma_error;
-	hdma->err_arg  = (void *)hperh;
-
-	dma_config_struct(&hdma->config);
-	hdma->config.src        = (void *)buf;
-	hdma->config.size       = len;
-	hdma->config.data_width = DMA_DATA_SIZE_HALFWORD;
-	hdma->config.src_inc    = DMA_DATA_INC_HALFWORD;
-	hdma->config.dst_inc    = DMA_DATA_INC_NONE;
-	hdma->config.channel    = dma_ch;
-	hdma->config.msel       = DMA_MSEL_TIMER0;
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		hdma->config.dst     = (void *)&hperh->perh->CCVAL1;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH1;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_1;
-		break;
-
-	case TIMER_CHANNEL_2:
-		hdma->config.dst     = (void *)&hperh->perh->CCVAL2;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH2;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_2;
-		break;
-
-	case TIMER_CHANNEL_3:
-		hdma->config.dst     = (void *)&hperh->perh->CCVAL3;
-		hdma->config.msigsel = DMA_MSIGSEL_TIMER_CH3;
-		dma_config_basic(hdma);
-		timer_dma_req_config(hperh, TIMER_DMA_CC3, ENABLE);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_3;
-		break;
-
-	default:
-		break;
-	}
-
-	timer_ccx_channel_cmd(hperh->perh, ch, ENABLE);
-	TIMER_MOE_ENABLE(hperh);
-	TIMER_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Starts the TIMER output compare signal generation on the complementary output.
-  *         in DMA mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_ocn_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCXN_INSTANCE(hperh->perh, ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_dma_req_config(hperh, TIMER_DMA_CC1, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_dma_req_config(hperh, TIMER_DMA_CC2, DISABLE);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_dma_req_config(hperh, TIMER_DMA_CC3, DISABLE);
-		break;
-	default:
-		break;
-	}
-
-	timer_ccxn_channel_cmd(hperh->perh, ch, DISABLE);
-	TIMER_MOE_DISABLE(hperh);
-	TIMER_DISABLE(hperh);
-
-	return;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group9 TIMER complementary PWM functions
-  * @brief    TIMER complementary PWM functions
-  *
-  * @verbatim
-	==============================================================================
-	##### Time complementary PWM functions #####
-	==============================================================================
-	[..]
-		This section provides functions allowing to:
-		(+) Start the Time complementary PWM.
-		(+) Stop the Time complementary PWM.
-		(+) Start the Time complementary PWM and enable interrupt.
-		(+) Stop the Time complementary PWM and disable interrupt.
-		(+) Start the Time complementary PWM and enable DMA transfer.
-		(+) Stop the Time complementary PWM and disable DMA transfer.
-
-  * @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Starts the TIMER PWM signal generation on the complementary output.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_pwmn_start(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_start(hperh, ch);
-}
-
-/**
-  * @brief  Stops the TIMER PWM signal generation on the complementary output.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_pwmn_stop(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_stop(hperh, ch);
-}
-
-/**
-  * @brief  Starts the TIMER PWM signal generation on the complementary output.
-  *         in interrupt mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_pwmn_start_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_start_by_it(hperh, ch);
-}
-
-/**
-  * @brief  Stops the TIMER PWM signal generation on the complementary output.
-  *         in interrupt mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_pwmn_stop_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_stop_by_it(hperh, ch);
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Starts the TIMER PWM signal generation on the complementary output.
-  *         in DMA mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @param  hdma: Pointer to dma_handle_t.
-  * @param  buf: The destination Buffer address. Reading data from CCRx.
-  * @param  len: The length of buffer to be transferred TIMER peripheral to memory
-  * @param  dma_ch: Channel of DMA.
-  * @retval None
-  */
-ald_status_t timer_pwmn_start_by_dma(timer_handle_t *hperh, dma_handle_t *hdma,
-		          timer_channel_t ch, uint16_t *buf, uint32_t len, uint8_t dma_ch)
-{
-	return timer_ocn_start_by_dma(hperh, hdma, ch, buf, len, dma_ch);
-}
-
-/**
-  * @brief  Starts the TIMER PWM signal generation on the complementary output.
-  *         in DMA mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  * @retval None
-  */
-void timer_pwmn_stop_by_dma(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_stop_by_dma(hperh, ch);
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group10 TIMER complementary one pulse functions
-  * @brief    TIMER complementary one pulse functions
-  *
-  * @verbatim
-	==============================================================================
-	##### Time complementary one pulse functions #####
-	==============================================================================
-	[..]
-		This section provides functions allowing to:
-		(+) Start the Time complementary one pulse.
-		(+) Stop the Time complementary one pulse.
-		(+) Start the Time complementary one pulse and enable interrupt.
-		(+) Stop the Time complementary one pulse and disable interrupt.
-
-  * @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Starts the TIMER one pulse signal generation on the complementary output.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_n_start(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_start(hperh, ch);
-}
-
-/**
-  * @brief  Stops the TIMER one pulse signal generation on the complementary output.
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_n_stop(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_stop(hperh, ch);
-}
-
-/**
-  * @brief  Starts the TIMER one pulse signal generation on the complementary output.
-  *         in interrupt mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be enabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_n_start_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_start_by_it(hperh, ch);
-}
-
-/**
-  * @brief  Stops the TIMER one pulse signal generation on the complementary output.
-  *         in interrupt mode
-  * @param  hperh: TIMER handle
-  * @param  ch: TIMER Channels to be disabled
-  *          This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  * @retval None
-  */
-void timer_one_pulse_n_stop_by_it(timer_handle_t *hperh, timer_channel_t ch)
-{
-	timer_ocn_stop_by_it(hperh, ch);
-}
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group11 Peripheral Control functions
- *  @brief    Peripheral Control functions
- *
- * @verbatim
-  ==============================================================================
-                   ##### Peripheral Control functions #####
-  ==============================================================================
- [..]
-   This section provides functions allowing to:
-      (+) Configure The Input Output channels for OC, PWM, IC or One Pulse mode.
-      (+) Configure External Clock source.
-      (+) Configure Complementary channels, break features and dead timere.
-      (+) Configure Master and the Slave synchronization.
-      (+) Handle TIMER interrupt.
-      (+) Get TIMER compare register's vale.
-      (+) Configure TIMER interrupt ENABLE/DISABLE.
-      (+) Get TIMER interrupt source status.
-      (+) Get TIMER interrupt flag status.
-      (+) Clear TIMER interrupt flag.
-
-    @endverbatim
-  * @{
-  */
-/**
-  * @brief  Initializes the TIMER Output Compare Channels according to the specified
-  *         parameters in the timer_oc_init_t.
-  * @param  hperh: TIMER handle
-  * @param  config: TIMER Output Compare configuration structure
-  * @param  ch: TIMER Channels to be enabled
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_oc_config_channel(timer_handle_t *hperh, timer_oc_init_t* config, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CCX_INSTANCE(hperh->perh, ch));
-	assert_param(IS_TIMER_OC_MODE(config->oc_mode));
-	assert_param(IS_TIMER_OC_POLARITY(config->oc_polarity));
-
-	__LOCK(hperh);
-	hperh->state = TIMER_STATE_BUSY;
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_oc1_set_config(hperh->perh, config);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_oc2_set_config(hperh->perh, config);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_oc3_set_config(hperh->perh, config);
-		break;
-
-	case TIMER_CHANNEL_4:
-		timer_oc4_set_config(hperh->perh, config);
-		break;
-
-	default:
-		break;
-	}
-
-	hperh->state = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Initializes the TIMER Input Capture Channels according to the specified
-  *         parameters in the timer_ic_init_t.
-  * @param  hperh: TIMER handle
-  * @param  config: TIMER Input Capture configuration structure
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4 selected
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_ic_config_channel(timer_handle_t *hperh, timer_ic_init_t* config, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_IC_POLARITY(config->polarity));
-	assert_param(IS_TIMER_IC_SELECT(config->sel));
-	assert_param(IS_TIMER_IC_PSC(config->psc));
-	assert_param(IS_TIMER_IC_FILTER(config->filter));
-
-	__LOCK(hperh);
-	hperh->state = TIMER_STATE_BUSY;
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		timer_ti1_set_config(hperh->perh, config->polarity, config->sel, config->filter);
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_IC1PRES_MSK, config->psc << TIMER_CHMR1_IC1PRES_POSS);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_ti2_set_config(hperh->perh, config->polarity, config->sel, config->filter);
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_IC2PRES_MSK, config->psc << TIMER_CHMR1_IC2PRES_POSS);
-		break;
-
-	case TIMER_CHANNEL_3:
-		timer_ti3_set_config(hperh->perh, config->polarity, config->sel, config->filter);
-		MODIFY_REG(hperh->perh->CHMR2, TIMER_CHMR2_IC3PRES_MSK, config->psc << TIMER_CHMR2_IC3PRES_POSS);
-		break;
-
-	case TIMER_CHANNEL_4:
-		timer_ti4_set_config(hperh->perh, config->polarity, config->sel, config->filter);
-		MODIFY_REG(hperh->perh->CHMR2, TIMER_CHMR2_IC4PRES_MSK, config->psc << TIMER_CHMR2_IC4PRES_POSS);
-		break;
-
-	default:
-		break;
-	}
-
-	hperh->state = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Initializes the TIMER One Pulse Channels according to the specified
-  *         parameters in the timer_one_pulse_init_t.
-  * @param  hperh: TIMER handle
-  * @param  config: TIMER One Pulse configuration structure
-  * @param  ch_out: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  * @param  ch_in: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2 selected
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_one_pulse_config_channel(timer_handle_t *hperh, timer_one_pulse_init_t *config,
-                                                   timer_channel_t ch_out,  timer_channel_t ch_in)
-{
-	timer_oc_init_t tmp;
-
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_OC_MODE(config->mode));
-	assert_param(IS_TIMER_OC_POLARITY(config->oc_polarity));
-	assert_param(IS_TIMER_OCN_POLARITY(config->ocn_polarity));
-	assert_param(IS_TIMER_OCIDLE_STATE(config->oc_idle));
-	assert_param(IS_TIMER_OCNIDLE_STATE(config->ocn_idle));
-	assert_param(IS_TIMER_IC_POLARITY(config->polarity));
-	assert_param(IS_TIMER_IC_SELECT(config->sel));
-	assert_param(IS_TIMER_IC_FILTER(config->filter));
-
-	if (ch_out == ch_in)
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->state = TIMER_STATE_BUSY;
-
-	tmp.oc_mode        = config->mode;
-	tmp.pulse          = config->pulse;
-	tmp.oc_polarity    = config->oc_polarity;
-	tmp.ocn_polarity   = config->ocn_polarity;
-	tmp.oc_idle  = config->oc_idle;
-	tmp.ocn_idle = config->ocn_idle;
-
-	switch (ch_out) {
-	case TIMER_CHANNEL_1:
-		timer_oc1_set_config(hperh->perh, &tmp);
-		break;
-	case TIMER_CHANNEL_2:
-		timer_oc2_set_config(hperh->perh, &tmp);
-		break;
-	default:
-		break;
-	}
-
-	switch (ch_in) {
-	case TIMER_CHANNEL_1:
-		timer_ti1_set_config(hperh->perh, config->polarity, config->sel, config->filter);
-		CLEAR_BIT(hperh->perh->CHMR1, TIMER_CHMR1_IC1PRES_MSK);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI1FP1 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_TRIG << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_CHANNEL_2:
-		timer_ti2_set_config(hperh->perh, config->polarity, config->sel, config->filter);
-		CLEAR_BIT(hperh->perh->CHMR1, TIMER_CHMR1_IC2PRES_MSK);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI2FP2 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_TRIG << TIMER_SMCON_SMODS_POSS);
-		break;
-	default:
-		break;
-	}
-
-	hperh->state = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Configures the OCRef clear feature
-  * @param  hperh: TIMER handle
-  * @param  config: pointer to a TIMER_ClearInputConfigTypeDef structure that
-  *         contains the OCREF clear feature and parameters for the TIMER peripheral.
-  * @param  ch: specifies the TIMER Channel
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1: TIMER Channel 1
-  *            @arg TIMER_CHANNEL_2: TIMER Channel 2
-  *            @arg TIMER_CHANNEL_3: TIMER Channel 3
-  *            @arg TIMER_CHANNEL_4: TIMER Channel 4
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_config_oc_ref_clear(timer_handle_t *hperh, timer_clear_input_config_t *config, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-	assert_param(IS_FUNC_STATE(config->state));
-	assert_param(IS_TIMER_CLEAR_INPUT_SOURCE(config->source));
-	assert_param(IS_TIMER_CLEAR_INPUT_POLARITY(config->polarity));
-	assert_param(IS_TIMER_ETR_PSC(config->psc));
-	assert_param(IS_TIMER_IC_FILTER(config->filter));
-
-	if (config->source == TIMER_INPUT_NONE) {
-		timer_etr_set_config(hperh->perh, TIMER_ETR_PSC_DIV1, TIMER_CLK_POLARITY_NO_INV, 0);
-	}
-	else {
-		timer_etr_set_config(hperh->perh, config->psc,
-				(timer_clock_polarity_t)config->polarity, config->filter);
-	}
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CH1OCLREN_MSK, config->state << TIMER_CHMR1_CH1OCLREN_POS);
-		break;
-
-	case TIMER_CHANNEL_2:
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CH2OCLREN_MSK, config->state << TIMER_CHMR1_CH2OCLREN_POS);
-		break;
-
-	case TIMER_CHANNEL_3:
-		assert_param(IS_TIMER_CC4_INSTANCE(hperh->perh));
-		MODIFY_REG(hperh->perh->CHMR2, TIMER_CHMR2_CH3OCLREN_MSK, config->state << TIMER_CHMR2_CH3OCLREN_POS);
-		break;
-
-	case TIMER_CHANNEL_4:
-		assert_param(IS_TIMER_CC4_INSTANCE(hperh->perh));
-		MODIFY_REG(hperh->perh->CHMR2, TIMER_CHMR2_CH4OCLREN_MSK, config->state << TIMER_CHMR2_CH4OCLREN_POS);
-		break;
-
-	default:
-		break;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Configures the clock source to be used
-  * @param  hperh: TIMER handle
-  * @param  config: pointer to a timer_clock_config_t structure that
-  *         contains the clock source information for the TIMER peripheral.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_config_clock_source(timer_handle_t *hperh, timer_clock_config_t *config)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_CLOCK_SOURCE(config->source));
-	assert_param(IS_TIMER_CLOCK_POLARITY(config->polarity));
-	assert_param(IS_TIMER_ETR_PSC(config->psc));
-	assert_param(IS_TIMER_IC_FILTER(config->filter));
-
-	__LOCK(hperh);
-	hperh->state = TIMER_STATE_BUSY;
-	WRITE_REG(hperh->perh->SMCON, 0x0);
-
-	switch (config->source) {
-	case TIMER_SRC_INTER:
-		CLEAR_BIT(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK);
-		break;
-
-	case TIMER_SRC_ETRMODE1:
-		timer_etr_set_config(hperh->perh, config->psc, config->polarity, config->filter);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_ETRF << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_SRC_ETRMODE2:
-		timer_etr_set_config(hperh->perh, config->psc, config->polarity, config->filter);
-		SET_BIT(hperh->perh->SMCON, TIMER_SMCON_ECM2EN_MSK);
-		break;
-
-	case TIMER_SRC_TI1:
-		timer_ti1_set_config_stage(hperh->perh, (timer_ic_polarity_t)config->polarity, config->filter);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI1FP1 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_SRC_TI2:
-		timer_ti2_set_config_stage(hperh->perh, (timer_ic_polarity_t)config->polarity, config->filter);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI2FP2 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_SRC_TI1ED:
-		timer_ti1_set_config_stage(hperh->perh, (timer_ic_polarity_t)config->polarity, config->filter);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_TI1F_ED << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_SRC_ITR0:
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_ITR0 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_SRC_ITR1:
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_ITR1 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_SRC_ITR2:
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_ITR2 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-
-	case TIMER_SRC_ITR3:
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, TIMER_TS_ITR3 << TIMER_SMCON_TSSEL_POSS);
-		MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, TIMER_MODE_EXTERNAL1 << TIMER_SMCON_SMODS_POSS);
-		break;
-	default:
-		break;
-	}
-
-	hperh->state = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Selects the signal connected to the TI1 input: direct from CH1_input
-  *         or a XOR combination between CH1_input, CH2_input & CH3_input
-  * @param  hperh: TIMER handle.
-  * @param  ti1_select: Indicate whether or not channel 1 is connected to the
-  *         output of a XOR gate.
-  *         This parameter can be one of the following values:
-  *            @arg 0: The TIMERx_CH1 pin is connected to TI1 input
-  *            @arg 1: The TIMERx_CH1, CH2 and CH3
-  *            pins are connected to the TI1 input (XOR combination)
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_config_ti1_input(timer_handle_t *hperh, uint32_t ti1_select)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-
-	MODIFY_REG(hperh->perh->CON2, TIMER_CON2_I1FSEL_MSK, ti1_select << TIMER_CON2_I1FSEL_POS);
-	return OK;
-}
-
-/**
-  * @brief  Configures the TIMER in Slave mode
-  * @param  hperh: TIMER handle.
-  * @param  config: pointer to a timer_slave_config_t structure that
-  *         contains the selected trigger (internal trigger input, filtered
-  *         timerer input or external trigger input) and the Slave
-  *         mode (Disable, Reset, Gated, Trigger, External clock mode 1).
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_slave_config_sync(timer_handle_t *hperh, timer_slave_config_t *config)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_SLAVE_MODE(config->mode));
-	assert_param(IS_TIMER_TS(config->input));
-	assert_param(IS_TIMER_CLOCK_POLARITY(config->polarity));
-	assert_param(IS_TIMER_ETR_PSC(config->psc));
-	assert_param(IS_TIMER_IC_FILTER(config->filter));
-
-	__LOCK(hperh);
-	hperh->state = TIMER_STATE_BUSY;
-
-	timer_slave_set_config(hperh, config);
-	timer_interrupt_config(hperh, TIMER_IT_TRIGGER, DISABLE);
-	timer_dma_req_config(hperh, TIMER_DMA_TRIGGER, DISABLE);
-
-	hperh->state = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Configures the TIMER in Slave mode in interrupt mode
-  * @param  hperh: TIMER handle.
-  * @param  config: pointer to a timer_slave_config_t structure that
-  *         contains the selected trigger (internal trigger input, filtered
-  *         timerer input or external trigger input) and the ) and the Slave
-  *         mode (Disable, Reset, Gated, Trigger, External clock mode 1).
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_slave_config_sync_by_it(timer_handle_t *hperh, timer_slave_config_t *config)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_SLAVE_MODE(config->mode));
-	assert_param(IS_TIMER_TS(config->input));
-	assert_param(IS_TIMER_CLOCK_POLARITY(config->polarity));
-	assert_param(IS_TIMER_ETR_PSC(config->psc));
-	assert_param(IS_TIMER_IC_FILTER(config->filter));
-
-	__LOCK(hperh);
-	hperh->state = TIMER_STATE_BUSY;
-
-	timer_slave_set_config(hperh, config);
-	timer_interrupt_config(hperh, TIMER_IT_TRIGGER, ENABLE);
-	timer_dma_req_config(hperh, TIMER_DMA_TRIGGER, DISABLE);
-
-	hperh->state = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Generate a software event
-  * @param  hperh: TIMER handle
-  * @param  event: specifies the event source.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t timer_generate_event(timer_handle_t *hperh, timer_event_source_t event)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_EVENT_SOURCE(event));
-
-	__LOCK(hperh);
-	hperh->state          = TIMER_STATE_BUSY;
-	WRITE_REG(hperh->perh->SGE, event);
-	hperh->state          = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Read the captured value from Capture Compare unit
-  * @param  hperh: TIMER handle.
-  * @param  ch: TIMER Channels to be enabled
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1 : TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2 : TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3 : TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4 : TIMER Channel 4 selected
-  * @retval Captured value
-  */
-uint32_t timer_read_capture_value(timer_handle_t *hperh, timer_channel_t ch)
-{
-	uint32_t tmp;
-
-	__LOCK(hperh);
-	hperh->state = TIMER_STATE_BUSY;
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		tmp = hperh->perh->CCVAL1;
-		break;
-	case TIMER_CHANNEL_2:
-		tmp = hperh->perh->CCVAL2;
-		break;
-	case TIMER_CHANNEL_3:
-		tmp = hperh->perh->CCVAL3;
-		break;
-	case TIMER_CHANNEL_4:
-		tmp = hperh->perh->CCVAL4;
-		break;
-	default:
-		break;
-	}
-
-	hperh->state = TIMER_STATE_READY;
-	__UNLOCK(hperh);
-	return tmp;
-}
-
-/**
-  * @brief  Sets TIMER output mode.
-  * @param  hperh: TIMER handle.
-  * @param  mode: TIMER output mode.
-  * @param  ch: TIMER Channels.
-  *         This parameter can be one of the following values:
-  *            @arg TIMER_CHANNEL_1 : TIMER Channel 1 selected
-  *            @arg TIMER_CHANNEL_2 : TIMER Channel 2 selected
-  *            @arg TIMER_CHANNEL_3 : TIMER Channel 3 selected
-  *            @arg TIMER_CHANNEL_4 : TIMER Channel 4 selected
-  * @retval None
-  */
-void timer_set_output_mode(timer_handle_t *hperh, timer_oc_mode_t mode, timer_channel_t ch)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_OC_MODE(mode));
-	assert_param(IS_TIMER_CHANNELS(ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CH1OMOD_MSK, mode << TIMER_CHMR1_CH1OMOD_POSS);
-		break;
-	case TIMER_CHANNEL_2:
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_CH2OMOD_MSK, mode << TIMER_CHMR1_CH2OMOD_POSS);
-		break;
-	case TIMER_CHANNEL_3:
-		MODIFY_REG(hperh->perh->CHMR2, TIMER_CHMR2_CH3OMOD_MSK, mode << TIMER_CHMR2_CH3OMOD_POSS);
-		break;
-	case TIMER_CHANNEL_4:
-		MODIFY_REG(hperh->perh->CHMR2, TIMER_CHMR2_CH4OMOD_MSK, mode << TIMER_CHMR2_CH4OMOD_POSS);
-		break;
-	default:
-		break;
-	}
-
-	return;
-}
-
-/**
-  * @brief  Configure the channel in commutation event.
-  * @param  hperh: TIMER handel
-  * @param  config: Parameters of the channel.
-  * @retval None
-  */ 
-void timer_com_change_config(timer_handle_t *hperh, timer_com_channel_config_t *config)
-{
-	uint32_t cm1, cm2, cce;
-
-	assert_param(IS_TIMER_COM_EVENT_INSTANCE(hperh->perh));
-	assert_param(IS_FUNC_STATE(config->ch[0].en));
-	assert_param(IS_FUNC_STATE(config->ch[0].n_en));
-	assert_param(IS_TIMER_OC_MODE(config->ch[0].mode));
-	assert_param(IS_FUNC_STATE(config->ch[1].en));
-	assert_param(IS_FUNC_STATE(config->ch[1].n_en));
-	assert_param(IS_TIMER_OC_MODE(config->ch[1].mode));
-	assert_param(IS_FUNC_STATE(config->ch[2].en));
-	assert_param(IS_FUNC_STATE(config->ch[2].n_en));
-	assert_param(IS_TIMER_OC_MODE(config->ch[2].mode));
-
-	TIMER_MOE_DISABLE(hperh);
-	TIMER_DISABLE(hperh);
-
-	cm1 = hperh->perh->CHMR1;
-	cm2 = hperh->perh->CHMR2;
-	cce = hperh->perh->CCEP;
-
-	MODIFY_REG(cm1, (0x7 << 4), (config->ch[0].mode << 4));
-	MODIFY_REG(cm1, (0x7 << 12), (config->ch[1].mode << 12));
-	MODIFY_REG(cm2, (0x7 << 4), (config->ch[2].mode << 4));
-	MODIFY_REG(cce, (0x1 << 0), (config->ch[0].en << 0));
-	MODIFY_REG(cce, (0x1 << 2), (config->ch[0].n_en << 2));
-	MODIFY_REG(cce, (0x1 << 4), (config->ch[1].en << 4));
-	MODIFY_REG(cce, (0x1 << 6), (config->ch[1].n_en << 6));
-	MODIFY_REG(cce, (0x1 << 8), (config->ch[2].en << 8));
-	MODIFY_REG(cce, (0x1 << 10), (config->ch[2].n_en << 10));
-
-	WRITE_REG(hperh->perh->CHMR1, cm1);
-	WRITE_REG(hperh->perh->CHMR2, cm2);
-	WRITE_REG(hperh->perh->CCEP, cce);
-
-	TIMER_MOE_ENABLE(hperh);
-	TIMER_ENABLE(hperh);
-	return;
-}
-
-/**
-  * @brief  Configure the TIMER commutation event sequence.
-  * @param  hperh: TIMER handel
-  * @param  ts: the internal trigger corresponding to the timerer interfacing
-  *         with the hall sensor.
-  *         This parameter can be one of the following values:
-  *           @arg TIMER_TS_ITR0
-  *           @arg TIMER_TS_ITR1
-  *           @arg TIMER_TS_ITR2
-  *           @arg TIMER_TS_ITR3
-  * @param  trgi: the commutation event source.
-  *         This parameter can be one of the following values:
-  *           @arg ENABLE: Commutation event source is TRGI
-  *           @arg DISABLE: Commutation event source is set by software using the COMG bit
-  * @retval None
-  */ 
-void timer_com_event_config(timer_handle_t *hperh, timer_ts_t ts, type_func_t trgi)
-{
-	assert_param(IS_TIMER_COM_EVENT_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_TS(ts));
-	assert_param(IS_FUNC_STATE(trgi));
-
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, ts << TIMER_SMCON_TSSEL_POSS);
-	SET_BIT(hperh->perh->CON2, TIMER_CON2_CCPCEN_MSK);
-	MODIFY_REG(hperh->perh->CON2, TIMER_CON2_CCUSEL_MSK, trgi << TIMER_CON2_CCUSEL_POS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the TIMER commutation event sequence with interrupt.
-  * @param  hperh: TIMER handel
-  * @param  ts: the internal trigger corresponding to the timerer interfacing
-  *         with the hall sensor.
-  *         This parameter can be one of the following values:
-  *           @arg TIMER_TS_ITR0
-  *           @arg TIMER_TS_ITR1
-  *           @arg TIMER_TS_ITR2
-  *           @arg TIMER_TS_ITR3
-  * @param  trgi: the commutation event source.
-  *         This parameter can be one of the following values:
-  *           @arg ENABLE: Commutation event source is TRGI
-  *           @arg DISABLE: Commutation event source is set by software using the COMG bit
-  * @retval None
-  */
-void timer_com_event_config_it(timer_handle_t *hperh, timer_ts_t ts, type_func_t trgi)
-{
-	timer_com_event_config(hperh, ts, trgi);
-	timer_interrupt_config(hperh, TIMER_IT_COM, ENABLE);
-}
-
-/**
-  * @brief  Configure the break, dead timere, lock level state.
-  * @param  hperh: TIMER handle
-  * @param  config: Pointer to the timer_break_dead_timere_t structure.
-  * @retval None
-  */ 
-void timer_break_dead_time_config(timer_handle_t *hperh, timer_break_dead_time_t *config)
-{
-	uint32_t tmp;
-
-	assert_param(IS_TIMER_BREAK_INSTANCE(hperh->perh));
-	assert_param(IS_FUNC_STATE(config->off_run));
-	assert_param(IS_FUNC_STATE(config->off_idle));
-	assert_param(IS_TIMER_CLOCK_LEVEL(config->lock_level));
-	assert_param(IS_TIMER_DEAD_TIMERE(config->dead_time));
-	assert_param(IS_FUNC_STATE(config->break_state));
-	assert_param(IS_TIMER_BREAK_POLARITY(config->polarity));
-	assert_param(IS_FUNC_STATE(config->auto_out));
-
-	tmp = READ_REG(hperh->perh->BDCFG);
-	MODIFY_REG(tmp, TIMER_BDCFG_OFFSSR_MSK, config->off_run << TIMER_BDCFG_OFFSSR_POS);
-	MODIFY_REG(tmp, TIMER_BDCFG_OFFSSI_MSK, config->off_idle << TIMER_BDCFG_OFFSSI_POS);
-	MODIFY_REG(tmp, TIMER_BDCFG_LOCKLVL_MSK, config->lock_level << TIMER_BDCFG_LOCKLVL_POSS);
-	MODIFY_REG(tmp, TIMER_BDCFG_DT_MSK, config->dead_time << TIMER_BDCFG_DT_POSS);
-	MODIFY_REG(tmp, TIMER_BDCFG_BRKEN_MSK, config->break_state << TIMER_BDCFG_BRKEN_POS);
-	MODIFY_REG(tmp, TIMER_BDCFG_BRKP_MSK, config->polarity << TIMER_BDCFG_BRKP_POS);
-	MODIFY_REG(tmp, TIMER_BDCFG_AOEN_MSK, config->auto_out << TIMER_BDCFG_AOEN_POS);
-	WRITE_REG(hperh->perh->BDCFG, tmp);
-
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-
-/**
-  * @brief  Configure the master mode
-  * @param  hperh: TIMER handle
-  * @param  config: Pointer to the timer_master_config_t structure.
-  * @retval None
-  */ 
-void timer_master_sync_config(timer_handle_t *hperh, timer_master_config_t *config)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_MASTER_MODE_SEL(config->sel));
-	assert_param(IS_FUNC_STATE(config->master_en));
-
-	hperh->state = TIMER_STATE_BUSY;
-	MODIFY_REG(hperh->perh->CON2, TIMER_CON2_TRGOSEL_MSK, config->sel << TIMER_CON2_TRGOSEL_POSS);
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_MSCFG_MSK, config->master_en << TIMER_SMCON_MSCFG_POS);
-	hperh->state = TIMER_STATE_READY;
-
-	return;
-}
-
-/**
-  * @brief  This function handles TIMER interrupts requests.
-  * @param  hperh: TIMER handle
-  * @retval None
-  */
-void timer_irq_handle(timer_handle_t *hperh)
-{
-	uint32_t reg = hperh->perh->IFM;
-
-	/* Capture or compare 1 event */
-	if (READ_BIT(reg, TIMER_FLAG_CC1)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_CC1);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_1;
-
-		/* Input capture event */
-		if (READ_BIT(hperh->perh->CHMR1, TIMER_CHMR1_CC1SSEL_MSK)) {
-			if (hperh->capture_cbk)
-				hperh->capture_cbk(hperh);
-		}
-		else {	/* Output compare event */
-			if (hperh->delay_elapse_cbk)
-				hperh->delay_elapse_cbk(hperh);
-			if (hperh->pwm_pulse_finish_cbk)
-				hperh->pwm_pulse_finish_cbk(hperh);
-		}
-
-		hperh->ch = TIMER_ACTIVE_CHANNEL_CLEARED;
-	}
-	/* Capture or compare 2 event */
-	if (READ_BIT(reg, TIMER_FLAG_CC2)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_CC2);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_2;
-
-		/* Input capture event */
-		if (READ_BIT(hperh->perh->CHMR1, TIMER_CHMR1_CC2SSEL_MSK)) {
-			if (hperh->capture_cbk)
-				hperh->capture_cbk(hperh);
-		}
-		else {	/* Output compare event */
-			if (hperh->delay_elapse_cbk)
-				hperh->delay_elapse_cbk(hperh);
-			if (hperh->pwm_pulse_finish_cbk)
-				hperh->pwm_pulse_finish_cbk(hperh);
-		}
-
-		hperh->ch = TIMER_ACTIVE_CHANNEL_CLEARED;
-	}
-	/* Capture or compare 3 event */
-	if (READ_BIT(reg, TIMER_FLAG_CC3)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_CC3);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_3;
-
-		/* Input capture event */
-		if (READ_BIT(hperh->perh->CHMR2, TIMER_CHMR2_CC3SSEL_MSK)) {
-			if (hperh->capture_cbk)
-				hperh->capture_cbk(hperh);
-		}
-		else {	/* Output compare event */
-			if (hperh->delay_elapse_cbk)
-				hperh->delay_elapse_cbk(hperh);
-			if (hperh->pwm_pulse_finish_cbk)
-				hperh->pwm_pulse_finish_cbk(hperh);
-		}
-
-		hperh->ch = TIMER_ACTIVE_CHANNEL_CLEARED;
-	}
-	/* Capture or compare 4 event */
-	if (READ_BIT(reg, TIMER_FLAG_CC4)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_CC4);
-		hperh->ch = TIMER_ACTIVE_CHANNEL_4;
-
-		/* Input capture event */
-		if (READ_BIT(hperh->perh->CHMR2, TIMER_CHMR2_CC4SSEL_MSK)) {
-			if (hperh->capture_cbk)
-				hperh->capture_cbk(hperh);
-		}
-		else {	/* Output compare event */
-			if (hperh->delay_elapse_cbk)
-				hperh->delay_elapse_cbk(hperh);
-			if (hperh->pwm_pulse_finish_cbk)
-				hperh->pwm_pulse_finish_cbk(hperh);
-		}
-
-		hperh->ch = TIMER_ACTIVE_CHANNEL_CLEARED;
-	}
-
-	/* TIMER Update event */
-	if (READ_BIT(reg, TIMER_FLAG_UPDATE)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_UPDATE);
-
-		if (hperh->period_elapse_cbk)
-			hperh->period_elapse_cbk(hperh);
-	}
-
-	/* TIMER Break input event */
-	if (READ_BIT(reg, TIMER_FLAG_BREAK)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_BREAK);
-
-		if (hperh->break_cbk)
-			hperh->break_cbk(hperh);
-	}
-
-	/* TIMER Trigger detection event */
-	if (READ_BIT(reg, TIMER_FLAG_TRIGGER)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_TRIGGER);
-
-		if (hperh->trigger_cbk)
-			hperh->trigger_cbk(hperh);
-	}
-
-	/* TIMER commutation event */
-	if (READ_BIT(reg, TIMER_FLAG_COM)) {
-		timer_clear_flag_status(hperh, TIMER_FLAG_COM);
-
-		if (hperh->com_cbk)
-			hperh->com_cbk(hperh);
-	}
-
-	return;
-}
-
-/**
-  * @brief  Configure DMA request source.
-  * @param  hperh: TIMER handle
-  * @param  req: DMA request source.
-  * @param  state: New state of the specified DMA request.
-  * @retval None
-  */
-void timer_dma_req_config(timer_handle_t *hperh, timer_dma_req_t req, type_func_t state)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_DMA_REQ(req));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		SET_BIT(hperh->perh->DIER, req);
-	else
-		CLEAR_BIT(hperh->perh->DIER, req);
-
-	return;
-}
-
-/**
-  * @brief  Enable/disable the specified TIMER interrupts.
-  * @param  hperh: Pointer to a timer_handle_t structure.
-  * @param  it: Specifies the timer interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref timer_it_t.
-  * @param  state: New state of the specified TIMER interrupts.
-  *         This parameter can be:
-  *             @arg ENABLE
-  *             @arg DISABLE
-  * @retval None
-  */
-void timer_interrupt_config(timer_handle_t *hperh, timer_it_t it, type_func_t state)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_IT(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		SET_BIT(hperh->perh->DIER, it);
-	else
-		CLEAR_BIT(hperh->perh->DIER, it);
-
-	return;
-}
-
-/**
-  * @brief  Get the status of TIMER interrupt source.
-  * @param  hperh: Pointer to a timer_handle_t structure.
-  * @param  it: Specifies the TIMER interrupt source.
-  *         This parameter can be one of the @ref timer_it_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-it_status_t timer_get_it_status(timer_handle_t *hperh, timer_it_t it)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_IT(it));
-
-	if (hperh->perh->DIVS & it)
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Get the status of TIMER interrupt flag.
-  * @param  hperh: Pointer to a timer_handle_t structure.
-  * @param  flag: Specifies the TIMER interrupt flag.
-  *         This parameter can be one of the @ref timer_flag_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t timer_get_flag_status(timer_handle_t *hperh, timer_flag_t flag)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_FLAG(flag));
-
-	if (hperh->perh->RIF & flag)
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Clear the TIMER interrupt flag.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  flag: Specifies the TIMER interrupt flag.
-  *         This parameter can be one of the @ref timer_flag_t.
-  * @retval None
-  */
-void timer_clear_flag_status(timer_handle_t *hperh, timer_flag_t flag)
-{
-	assert_param(IS_TIMER_INSTANCE(hperh->perh));
-	assert_param(IS_TIMER_FLAG(flag));
-
-	hperh->perh->ICR = flag;
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup TIMER_Public_Functions_Group12 Peripheral State functions
-  * @brief    Peripheral State functions
-  *
-  * @verbatim
-  ==============================================================================
-                        ##### Peripheral State functions #####
-  ==============================================================================
-    [..]
-    This subsection permit to get in run-timere the status of the peripheral
-    and the data flow.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Return the TIMER Base state
-  * @param  hperh: TIMER handle
-  * @retval TIMER peripheral state
-  */
-timer_state_t timer_get_state(timer_handle_t *hperh)
-{
-	return hperh->state;
-}
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-
-/** @addtogroup TIMER_Private_Functions
-  * @{
-  */
-
-#ifdef ALD_DMA
-/**
-  * @brief  TIMER DMA out compare complete callback.
-  * @param  arg: pointer to TIMER handle.
-  * @retval None
-  */
-void timer_dma_oc_cplt(void *arg)
-{
-	timer_handle_t *hperh = (timer_handle_t *)arg;
-
-	if (hperh->delay_elapse_cbk)
-		hperh->delay_elapse_cbk(hperh);
-
-	if (hperh->pwm_pulse_finish_cbk)
-		hperh->pwm_pulse_finish_cbk(hperh);
-
-	hperh->ch = TIMER_ACTIVE_CHANNEL_CLEARED;
-	return;
-}
-
-/**
-  * @brief  TIMER DMA Capture complete callback.
-  * @param  arg: pointer to TIMER handle.
-  * @retval None
-  */
-void timer_dma_capture_cplt(void *arg)
-{
-	timer_handle_t *hperh = (timer_handle_t *)arg;
-
-	if (hperh->capture_cbk)
-		hperh->capture_cbk(hperh);
-
-	hperh->ch = TIMER_ACTIVE_CHANNEL_CLEARED;
-	return;
-}
-
-/**
-  * @brief  TIMER DMA Period Elapse complete callback.
-  * @param  arg: pointer to TIMER handle.
-  * @retval None
-  */
-void timer_dma_period_elapse_cplt(void *arg)
-{
-	timer_handle_t *hperh = (timer_handle_t *)arg;
-
-	if (hperh->period_elapse_cbk)
-		hperh->period_elapse_cbk(hperh);
-
-	hperh->state = TIMER_STATE_READY;
-	return;
-}
-
-/**
-  * @brief  TIMER DMA error callback
-  * @param  arg: pointer to TIMER handle.
-  * @retval None
-  */
-void timer_dma_error(void *arg)
-{
-	timer_handle_t *hperh = (timer_handle_t *)arg;
-
-	hperh->state = TIMER_STATE_READY;
-	if (hperh->error_cbk)
-		hperh->error_cbk(hperh);
-
-	return;
-}
-#endif
-
-/**
-  * @brief  Time Base configuration
-  * @param  TIMERx: TIMER periheral
-  * @param  init: TIMER Base configuration structure
-  * @retval None
-  */
-static void timer_base_set_config(TIMER_TypeDef *TIMERx, timer_base_init_t *init)
-{
-	assert_param(IS_TIMER_COUNTER_MODE(init->mode));
-	assert_param(IS_TIMER_CLOCK_DIVISION(init->clk_div));
-
-	if (init->mode == TIMER_CNT_MODE_UP || init->mode == TIMER_CNT_MODE_DOWN) {
-		CLEAR_BIT(TIMERx->CON1, TIMER_CON1_CMSEL_MSK);
-		MODIFY_REG(TIMERx->CON1, TIMER_CON1_DIRSEL_MSK, init->mode << TIMER_CON1_DIRSEL_POS);
-	}
-	else {
-		MODIFY_REG(TIMERx->CON1, TIMER_CON1_CMSEL_MSK, (init->mode - 1) << TIMER_CON1_CMSEL_POSS);
-	}
-
-	if (IS_TIMER_CLOCK_DIVISION_INSTANCE(TIMERx))
-		MODIFY_REG(TIMERx->CON1, TIMER_CON1_DFCKSEL_MSK, init->clk_div << TIMER_CON1_DFCKSEL_POSS);
-
-	WRITE_REG(TIMERx->AR, init->period);
-	WRITE_REG(TIMERx->PRES, init->prescaler);
-
-	if (IS_TIMER_REPETITION_COUNTER_INSTANCE(TIMERx))
-		WRITE_REG(TIMERx->REPAR, init->re_cnt);
-
-	return;
-}
-
-/**
-  * @brief  Time Ouput Compare 1 configuration
-  * @param  TIMERx: Select the TIMER peripheral
-  * @param  oc_config: The ouput configuration structure
-  * @retval None
-  */
-static void timer_oc1_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC1EN_MSK);
-	CLEAR_BIT(TIMERx->CHMR1, TIMER_CHMR1_CH1OMOD_MSK);
-	CLEAR_BIT(TIMERx->CHMR1, TIMER_CHMR1_CC1SSEL_MSK);
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_CH1OMOD_MSK, oc_config->oc_mode << TIMER_CHMR1_CH1OMOD_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1POL_MSK, oc_config->oc_polarity << TIMER_CCEP_CC1POL_POS);
-
-	if (IS_TIMER_CCXN_INSTANCE(TIMERx, TIMER_CHANNEL_1)) {
-		assert_param(IS_TIMER_OCN_POLARITY(oc_config->ocn_polarity));
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1NPOL_MSK, oc_config->ocn_polarity << TIMER_CCEP_CC1NPOL_POS);
-		CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC1NEN_MSK);
-	}
-
-	if (IS_TIMER_BREAK_INSTANCE(TIMERx)) {
-		assert_param(IS_TIMER_OCNIDLE_STATE(oc_config->ocn_idle));
-		assert_param(IS_TIMER_OCIDLE_STATE(oc_config->oc_idle));
-
-		MODIFY_REG(TIMERx->CON2, TIMER_CON2_OISS1_MSK, oc_config->oc_idle << TIMER_CON2_OISS1_POS);
-		MODIFY_REG(TIMERx->CON2, TIMER_CON2_OISS1N_MSK, oc_config->ocn_idle << TIMER_CON2_OISS1N_POS);
-	}
-
-	WRITE_REG(TIMERx->CCVAL1, oc_config->pulse);
-}
-
-/**
-  * @brief  Time Ouput Compare 2 configuration
-  * @param  TIMERx: Select the TIMER peripheral
-  * @param  oc_config: The ouput configuration structure
-  * @retval None
-  */
-static void timer_oc2_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC2EN_MSK);
-	CLEAR_BIT(TIMERx->CHMR1, TIMER_CHMR1_CH2OMOD_MSK);
-	CLEAR_BIT(TIMERx->CHMR1, TIMER_CHMR1_CC2SSEL_MSK);
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_CH2OMOD_MSK, oc_config->oc_mode << TIMER_CHMR1_CH2OMOD_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2POL_MSK, oc_config->oc_polarity << TIMER_CCEP_CC2POL_POS);
-
-	if (IS_TIMER_CCXN_INSTANCE(TIMERx, TIMER_CHANNEL_2)) {
-		assert_param(IS_TIMER_OCN_POLARITY(oc_config->ocn_polarity));
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2NPOL_MSK, oc_config->ocn_polarity << TIMER_CCEP_CC2NPOL_POS);
-		CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC2NEN_MSK);
-	}
-
-	if (IS_TIMER_BREAK_INSTANCE(TIMERx)) {
-		assert_param(IS_TIMER_OCNIDLE_STATE(oc_config->ocn_idle));
-		assert_param(IS_TIMER_OCIDLE_STATE(oc_config->oc_idle));
-
-		MODIFY_REG(TIMERx->CON2, TIMER_CON2_OISS2_MSK, oc_config->oc_idle << TIMER_CON2_OISS2_POS);
-		MODIFY_REG(TIMERx->CON2, TIMER_CON2_OISS2N_MSK, oc_config->ocn_idle << TIMER_CON2_OISS2N_POS);
-	}
-
-	WRITE_REG(TIMERx->CCVAL2, oc_config->pulse);
-}
-
-/**
-  * @brief  Time Ouput Compare 3 configuration
-  * @param  TIMERx: Select the TIMER peripheral
-  * @param  oc_config: The ouput configuration structure
-  * @retval None
-  */
-static void timer_oc3_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC3EN_MSK);
-	CLEAR_BIT(TIMERx->CHMR2, TIMER_CHMR2_CH3OMOD_MSK);
-	CLEAR_BIT(TIMERx->CHMR2, TIMER_CHMR2_CC3SSEL_MSK);
-	MODIFY_REG(TIMERx->CHMR2, TIMER_CHMR2_CH3OMOD_MSK, oc_config->oc_mode << TIMER_CHMR2_CH3OMOD_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC3POL_MSK, oc_config->oc_polarity << TIMER_CCEP_CC3POL_POS);
-
-	if (IS_TIMER_CCXN_INSTANCE(TIMERx, TIMER_CHANNEL_3)) {
-		assert_param(IS_TIMER_OCN_POLARITY(oc_config->ocn_polarity));
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC3NPOL_MSK, oc_config->ocn_polarity << TIMER_CCEP_CC3NPOL_POS);
-		CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC3NEN_MSK);
-	}
-
-	if (IS_TIMER_BREAK_INSTANCE(TIMERx)) {
-		assert_param(IS_TIMER_OCNIDLE_STATE(oc_config->ocn_idle));
-		assert_param(IS_TIMER_OCIDLE_STATE(oc_config->oc_idle));
-
-		MODIFY_REG(TIMERx->CON2, TIMER_CON2_OISS3_MSK, oc_config->oc_idle << TIMER_CON2_OISS3_POS);
-		MODIFY_REG(TIMERx->CON2, TIMER_CON2_OISS3N_MSK, oc_config->ocn_idle << TIMER_CON2_OISS3N_POS);
-	}
-
-	WRITE_REG(TIMERx->CCVAL3, oc_config->pulse);
-}
-
-/**
-  * @brief  Time Ouput Compare 4 configuration
-  * @param  TIMERx: Select the TIMER peripheral
-  * @param  oc_config: The ouput configuration structure
-  * @retval None
-  */
-static void timer_oc4_set_config(TIMER_TypeDef *TIMERx, timer_oc_init_t *oc_config)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC4EN_MSK);
-	CLEAR_BIT(TIMERx->CHMR2, TIMER_CHMR2_CH4OMOD_MSK);
-	CLEAR_BIT(TIMERx->CHMR2, TIMER_CHMR2_CC4SSEL_MSK);
-	MODIFY_REG(TIMERx->CHMR2, TIMER_CHMR2_CH4OMOD_MSK, oc_config->oc_mode << TIMER_CHMR2_CH4OMOD_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC4POL_MSK, oc_config->oc_polarity << TIMER_CCEP_CC4POL_POS);
-
-	if (IS_TIMER_BREAK_INSTANCE(TIMERx)) {
-		assert_param(IS_TIMER_OCIDLE_STATE(oc_config->oc_idle));
-		MODIFY_REG(TIMERx->CON2, TIMER_CON2_OISS4_MSK, oc_config->oc_idle << TIMER_CON2_OISS4_POS);
-	}
-
-	WRITE_REG(TIMERx->CCVAL4, oc_config->pulse);
-}
-
-/**
-  * @brief  Enables or disables the TIMER Capture Compare Channel x.
-  * @param  TIMERx: Select the TIMER peripheral
-  * @param  ch: specifies the TIMER Channel
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3
-  *		@arg TIMER_CHANNEL_4: TIMER Channel 4
-  * @param  state: specifies the TIMER Channel CCxE bit new state.
-  * @retval None
-  */
-static void timer_ccx_channel_cmd(TIMER_TypeDef* TIMERx, timer_channel_t ch, type_func_t state)
-{
-	assert_param(IS_TIMER_CC2_INSTANCE(TIMERx));
-	assert_param(IS_TIMER_CHANNELS(ch));
-
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1EN_MSK, state << TIMER_CCEP_CC1EN_POS);
-		break;
-
-	case TIMER_CHANNEL_2:
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2EN_MSK, state << TIMER_CCEP_CC2EN_POS);
-		break;
-
-	case TIMER_CHANNEL_3:
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC3EN_MSK, state << TIMER_CCEP_CC3EN_POS);
-		break;
-
-	case TIMER_CHANNEL_4:
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC4EN_MSK, state << TIMER_CCEP_CC4EN_POS);
-		break;
-
-	default:
-		break;
-	}
-}
-/**
-  * @brief  Enables or disables the TIMER Capture Compare Channel xN.
-  * @param  TIMERx: Select the TIMER peripheral
-  * @param  ch: specifies the TIMER Channel
-  *		This parameter can be one of the following values:
-  *		@arg TIMER_CHANNEL_1: TIMER Channel 1
-  *		@arg TIMER_CHANNEL_2: TIMER Channel 2
-  *		@arg TIMER_CHANNEL_3: TIMER Channel 3
-  * @param  state: specifies the TIMER Channel CCxNE bit new state.
-  * @retval None
-  */
-static void timer_ccxn_channel_cmd(TIMER_TypeDef* TIMERx, timer_channel_t ch, type_func_t state)
-{
-	switch (ch) {
-	case TIMER_CHANNEL_1:
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1NEN_MSK, state << TIMER_CCEP_CC1NEN_POS);
-		break;
-
-	case TIMER_CHANNEL_2:
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2NEN_MSK, state << TIMER_CCEP_CC2NEN_POS);
-		break;
-
-	case TIMER_CHANNEL_3:
-		MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC3NEN_MSK, state << TIMER_CCEP_CC3NEN_POS);
-		break;
-
-	default:
-		break;
-	}
-
-}
-
-/**
-  * @brief  Configure the TI1 as Input.
-  * @param  TIMERx: Select the TIMER peripheral.
-  * @param  polarity: The Input Polarity.
-  * @param  sel: specifies the input to be used.
-  * @param  filter: Specifies the Input Capture Filter.
-  *         This parameter must be a value between 0x00 and 0x0F.
-  * @retval None
-  */
-static void timer_ti1_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC1EN_MSK);
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_CC1SSEL_MSK, sel << TIMER_CHMR1_CC1SSEL_POSS);
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_I1FLT_MSK, filter << TIMER_CHMR1_I1FLT_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1POL_MSK, (polarity & 0x1) << TIMER_CCEP_CC1POL_POS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1NPOL_MSK, ((polarity >> 1) & 0x1) << TIMER_CCEP_CC1NPOL_POS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the Polarity and Filter for TI1.
-  * @param  TIMERx: Select the TIMER peripheral.
-  * @param  polarity: The Input Polarity.
-  * @param  filter: Specifies the Input Capture Filter.
-  *         This parameter must be a value between 0x00 and 0x0F.
-  * @retval None
-  */
-static void timer_ti1_set_config_stage(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity, uint32_t filter)
-{
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_I1FLT_MSK, filter << TIMER_CHMR1_I1FLT_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1POL_MSK, (polarity & 0x1) << TIMER_CCEP_CC1POL_POS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC1NPOL_MSK, ((polarity >> 1) & 0x1) << TIMER_CCEP_CC1NPOL_POS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the TI2 as Input.
-  * @param  TIMERx: Select the TIMER peripheral.
-  * @param  polarity: The Input Polarity.
-  * @param  sel: specifies the input to be used.
-  * @param  filter: Specifies the Input Capture Filter.
-  *         This parameter must be a value between 0x00 and 0x0F.
-  * @retval None
-  */
-static void timer_ti2_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC2EN_MSK);
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_CC2SSEL_MSK, sel << TIMER_CHMR1_CC2SSEL_POSS);
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_I2FLT_MSK, filter << TIMER_CHMR1_I2FLT_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2POL_MSK, (polarity & 0x1) << TIMER_CCEP_CC2POL_POS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2NPOL_MSK, ((polarity >> 1) & 0x1) << TIMER_CCEP_CC2NPOL_POS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the Polarity and Filter for TI2.
-  * @param  TIMERx: Select the TIMER peripheral.
-  * @param  polarity: The Input Polarity.
-  * @param  filter: Specifies the Input Capture Filter.
-  *         This parameter must be a value between 0x00 and 0x0F.
-  * @retval None
-  */
-static void timer_ti2_set_config_stage(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity, uint32_t filter)
-{
-	MODIFY_REG(TIMERx->CHMR1, TIMER_CHMR1_I2FLT_MSK, filter << TIMER_CHMR1_I2FLT_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2POL_MSK, (polarity & 0x1) << TIMER_CCEP_CC2POL_POS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC2NPOL_MSK, ((polarity >> 1) & 0x1) << TIMER_CCEP_CC2NPOL_POS);
-	return;
-}
-
-/**
-  * @brief  Configure the TI3 as Input.
-  * @param  TIMERx: Select the TIMER peripheral.
-  * @param  polarity: The Input Polarity.
-  * @param  sel: specifies the input to be used.
-  * @param  filter: Specifies the Input Capture Filter.
-  *         This parameter must be a value between 0x00 and 0x0F.
-  * @retval None
-  */
-static void timer_ti3_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC3EN_MSK);
-	MODIFY_REG(TIMERx->CHMR2, TIMER_CHMR2_CC3SSEL_MSK, sel << TIMER_CHMR2_CC3SSEL_POSS);
-	MODIFY_REG(TIMERx->CHMR2, TIMER_CHMR2_I3FLT_MSK, filter << TIMER_CHMR2_I3FLT_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC3POL_MSK, (polarity & 0x1) << TIMER_CCEP_CC3POL_POS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC3NPOL_MSK, ((polarity >> 1) & 0x1) << TIMER_CCEP_CC3NPOL_POS);
-
-	return;
-}
-
-/**
-  * @brief  Configure the TI4 as Input.
-  * @param  TIMERx: Select the TIMER peripheral.
-  * @param  polarity: The Input Polarity.
-  * @param  sel: specifies the input to be used.
-  * @param  filter: Specifies the Input Capture Filter.
-  *         This parameter must be a value between 0x00 and 0x0F.
-  * @retval None
-  */
-static void timer_ti4_set_config(TIMER_TypeDef *TIMERx, timer_ic_polarity_t polarity,
-                                   timer_ic_select_t sel, uint32_t filter)
-{
-	CLEAR_BIT(TIMERx->CCEP, TIMER_CCEP_CC4EN_MSK);
-	MODIFY_REG(TIMERx->CHMR2, TIMER_CHMR2_CC4SSEL_MSK, sel << TIMER_CHMR2_CC4SSEL_POSS);
-	MODIFY_REG(TIMERx->CHMR2, TIMER_CHMR2_I4FLT_MSK, filter << TIMER_CHMR2_I4FLT_POSS);
-	MODIFY_REG(TIMERx->CCEP, TIMER_CCEP_CC4POL_MSK, (polarity & 0x1) << TIMER_CCEP_CC4POL_POS);
-
-	return;
-}
-
-/**
-  * @brief  Configures the TIMERx External Trigger (ETR).
-  * @param  TIMERx: Select the TIMER peripheral
-  * @param  psc: The external Trigger Prescaler.
-  * @param  polarity: The external Trigger Polarity.
-  * @param  filter: External Trigger Filter.
-  *         This parameter must be a value between 0x00 and 0x0F
-  * @retval None
-  */
-static void timer_etr_set_config(TIMER_TypeDef* TIMERx, timer_etr_psc_t psc, timer_clock_polarity_t polarity, uint32_t filter)
-{
-	MODIFY_REG(TIMERx->SMCON, TIMER_SMCON_ETFLT_MSK, filter << TIMER_SMCON_ETFLT_POSS);
-	MODIFY_REG(TIMERx->SMCON, TIMER_SMCON_ETPSEL_MSK, psc << TIMER_SMCON_ETPSEL_POSS);
-	CLEAR_BIT(TIMERx->SMCON, TIMER_SMCON_ECM2EN_MSK);
-	MODIFY_REG(TIMERx->SMCON, TIMER_SMCON_ETPOL_MSK, polarity << TIMER_SMCON_ETPOL_POS);
-	return;
-}
-
-/**
-  * @brief  Time Slave configuration
-  * @param  hperh: pointer to a timer_handle_t structure that contains
-  *         the configuration information for TIMER module.
-  * @param  config: The slave configuration structure
-  * @retval None
-  */
-static void timer_slave_set_config(timer_handle_t *hperh, timer_slave_config_t *config)
-{
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_TSSEL_MSK, config->input << TIMER_SMCON_TSSEL_POSS);
-	MODIFY_REG(hperh->perh->SMCON, TIMER_SMCON_SMODS_MSK, config->mode << TIMER_SMCON_SMODS_POSS);
-
-	switch (config->input) {
-	case TIMER_TS_ETRF:
-		timer_etr_set_config(hperh->perh, config->psc, config->polarity, config->filter);
-		break;
-
-	case TIMER_TS_TI1F_ED:
-		CLEAR_BIT(hperh->perh->CCEP, TIMER_CCEP_CC1EN_MSK);
-		MODIFY_REG(hperh->perh->CHMR1, TIMER_CHMR1_I1FLT_MSK, config->filter << TIMER_CHMR1_I1FLT_POSS);
-		break;
-
-	case TIMER_TS_TI1FP1:
-		timer_ti1_set_config_stage(hperh->perh, (timer_ic_polarity_t)config->polarity, config->filter);
-		break;
-
-	case TIMER_TS_TI2FP2:
-		timer_ti2_set_config_stage(hperh->perh, (timer_ic_polarity_t)config->polarity, config->filter);
-		break;
-
-	default:
-		break;
-	}
-}
-/**
-  * @}
-  */
-#endif /* ALD_TIMER */
-/**
-  * @}
-  */
-/**
-  * @}
-  */

+ 0 - 220
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_trng.c

@@ -1,220 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_trng.c
-  * @brief   TRNG module driver.
-  *
-  * @version V1.0
-  * @date    04 Dec 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  */
-
-#include "ald_trng.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup TRNG TRNG
-  * @brief TRNG module driver
-  * @{
-  */
-#ifdef ALD_TRNG
-
-/** @defgroup TRNG_Public_Functions TRNG Public Functions
-  * @{
-  */
-
-/** @addtogroup TRNG_Public_Functions_Group1 Initialization functions
-  * @brief Initialization functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Initialization functions #####
-  ==============================================================================
-    [..]  This section provides functions allowing to initialize the TRNG:
-      (+) This parameters can be configured:
-        (++) Word Width
-        (++) Seed Type
-        (++) Seed
-        (++) Start Time
-        (++) Adjust parameter
-
-    @endverbatim
-  * @{
-  */
-
-
-/**
-  * @brief  Initializes the TRNG according to the specified
-  *         parameters in the trng_init_t.
-  * @param  init: Pointer to a trng_init_t structure that contains
-  *         the configuration information.
-  * @retval None
-  */
-void trng_init(trng_init_t *init)
-{
-	assert_param(IS_TRNG_DATA_WIDTH(init->data_width));
-	assert_param(IS_TRNG_SEED_TYPE(init->seed_type));
-	assert_param(IS_TRNG_ADJC(init->adjc));
-
-	SET_BIT(TRNG->CR, TRNG_CR_TRNGSEL_MSK);
-	MODIFY_REG(TRNG->CR, TRNG_CR_DSEL_MSK, (init->data_width) << TRNG_CR_DSEL_POSS);
-	MODIFY_REG(TRNG->CR, TRNG_CR_SDSEL_MSK, (init->seed_type) << TRNG_CR_SDSEL_POSS);
-	MODIFY_REG(TRNG->CR, TRNG_CR_ADJC_MSK, (init->adjc) << TRNG_CR_ADJC_POSS);
-
-	if (init->adjc == 0) {
-		MODIFY_REG(TRNG->CR, TRNG_CR_ADJC_MSK, (0) << TRNG_CR_ADJC_POSS);
-	}
-	else {
-		MODIFY_REG(TRNG->CR, TRNG_CR_ADJC_MSK, (1) << TRNG_CR_ADJC_POSS);
-	}
-
-	WRITE_REG(TRNG->SEED, init->seed);
-	MODIFY_REG(TRNG->CFGR, TRNG_CFGR_TSTART_MSK, (init->t_start) << TRNG_CFGR_TSTART_POSS);
-	MODIFY_REG(TRNG->CR, TRNG_CR_POSTEN_MSK, (init->posten) << TRNG_CR_POSTEN_MSK);
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @addtogroup TRNG_Public_Functions_Group2 Peripheral Control functions
-  * @brief Peripheral Control functions
-  *
-  * @verbatim
-  ==============================================================================
-              ##### Peripheral Control functions #####
-  ==============================================================================
-  [..]  This section provides functions allowing to:
-    (+) trng_get_result() API can Get the result.
-    (+) trng_interrupt_config() API can be helpful to configure TRNG interrupt source.
-    (+) trng_get_it_status() API can get the status of interrupt source.
-    (+) trng_get_status() API can get the status of SR register.
-    (+) trng_get_flag_status() API can get the status of interrupt flag.
-    (+) trng_clear_flag_status() API can clear interrupt flag.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Get the result.
-  * @retval The resultl
-  */
-uint32_t trng_get_result(void)
-{
-	return (uint32_t)TRNG->DR;
-}
-
-/**
-  * @brief  Enable/disable the specified interrupts.
-  * @param  it: Specifies the interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref trng_it_t.
-  * @param  state: New state of the specified interrupts.
-  *         This parameter can be:
-  *             @arg ENABLE
-  *             @arg DISABLE
-  * @retval None
-  */
-void trng_interrupt_config(trng_it_t it, type_func_t state)
-{
-	assert_param(IS_TRNG_IT(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state)
-		SET_BIT(TRNG->IER, it);
-	else
-		CLEAR_BIT(TRNG->IER, it);
-
-	return;
-}
-
-/**
-  * @brief  Get the status of SR register.
-  * @param  status: Specifies the TRNG status type.
-  *         This parameter can be one of the @ref trng_status_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t trng_get_status(trng_status_t status)
-{
-	assert_param(IS_TRNG_STATUS(status));
-
-	if (READ_BIT(TRNG->SR, status))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Get the status of interrupt source.
-  * @param  it: Specifies the interrupt source.
-  *         This parameter can be one of the @ref trng_it_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-it_status_t trng_get_it_status(trng_it_t it)
-{
-	assert_param(IS_TRNG_IT(it));
-
-	if (READ_BIT(TRNG->IER, it))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Get the status of interrupt flag.
-  * @param  flag: Specifies the interrupt flag.
-  *         This parameter can be one of the @ref trng_flag_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t trng_get_flag_status(trng_flag_t flag)
-{
-	assert_param(IS_TRNG_FLAG(flag));
-
-	if (READ_BIT(TRNG->IFR, flag))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Clear the interrupt flag.
-  * @param  flag: Specifies the interrupt flag.
-  *         This parameter can be one of the @ref trng_flag_t.
-  * @retval None
-  */
-void trng_clear_flag_status(trng_flag_t flag)
-{
-	assert_param(IS_TRNG_FLAG(flag));
-	WRITE_REG(TRNG->IFCR, flag);
-
-	return;
-}
-/**
-  * @}
-  */
-/**
-  * @}
-  */
-#endif /* ALD_TRNG */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 1182
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_uart.c

@@ -1,1182 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_uart.c
-  * @brief   UART module driver.
-  *          This file provides firmware functions to manage the following
-  *          functionalities of the Universal Asynchronous Receiver Transmitter (UART) peripheral:
-  *           + Initialization and Configuration functions
-  *           + IO operation functions
-  *           + Peripheral Control functions
-  *           + Peripheral State and Errors functions
-  *
-  * @version V1.0
-  * @date    21 Nov 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  * @verbatim
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-  [..]
-    The UART driver can be used as follows:
-
-    (#) Declare a uart_handle_t handle structure.
-
-    (#) Initialize the UART low level resources:
-        (##) Enable the UARTx interface clock.
-        (##) UART pins configuration:
-            (+++) Enable the clock for the UART GPIOs.
-            (+++) Configure the UART pins (TX as alternate function pull-up, RX as alternate function Input).
-        (##) NVIC configuration if you need to use interrupt process (uart_send_by_it()
-             and uart_recv_by_it() APIs):
-            (+++) Configure the uart interrupt priority.
-            (+++) Enable the NVIC UART IRQ handle.
-        (##) DMA Configuration if you need to use DMA process (uart_send_by_dma()
-             and uart_recv_by_dma() APIs):
-            (+++) Select the DMA Tx/Rx channel.
-            (+++) Associate the initialized DMA handle to the UART DMA Tx/Rx handle.
-
-    (#) Program the Baud Rate, Word Length, Stop Bit, Parity, Hardware
-        flow control and Mode(Receiver/Transmitter) in the hperh Init structure.
-
-    (#) Initialize the UART registers by calling the uart_init() API.
-
-     [..]
-        Three operation modes are available within this driver:
-
-     *** Polling mode IO operation ***
-     =================================
-     [..]
-       (+) Send an amount of data in blocking mode using uart_send()
-       (+) Receive an amount of data in blocking mode using uart_recv()
-
-     *** Interrupt mode IO operation ***
-     ===================================
-     [..]
-       (+) Send an amount of data in non blocking mode using uart_send_by_it()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode using uart_recv_by_it()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk() function is executed and user can
-           add his own code by customization of function pointer hperh->error_cbk()
-
-     *** DMA mode IO operation ***
-     ==============================
-     [..]
-       (+) Send an amount of data in non blocking mode (DMA) using uart_send_by_dma()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode (DMA) using uart_recv_by_dma()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-           add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk() function is executed and user can
-           add his own code by customization of function pointer hperh->error_cbk()
-       (+) Pause the DMA Transfer using uart_dma_pause()
-       (+) Resume the DMA Transfer using uart_dma_resume()
-       (+) Stop the DMA Transfer using uart_dma_stop()
-
-    @endverbatim
-  ******************************************************************************
-  */
-
-#include "ald_uart.h"
-#include "ald_cmu.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup UART UART
-  * @brief UART module driver
-  * @{
-  */
-#ifdef ALD_UART
-
-/** @defgroup UART_Private_Functions   UART Private Functions
-  *  @brief   UART Private functions
-  * @{
-  */
-#ifdef ALD_DMA
-/**
-  * @brief  DMA uart transmit process complete callback.
-  * @param  arg: Pointer to a uart_handle_t structure.
-  * @retval None
-  */
-static void uart_dma_send_cplt(void *arg)
-{
-	uart_handle_t *hperh = (uart_handle_t *)arg;
-
-	if (hperh->state == UART_STATE_BUSY_TX)
-		uart_dma_req_config(hperh, DISABLE);
-
-	hperh->tx_count = 0;
-	uart_interrupt_config(hperh, UART_IT_TC, ENABLE);
-	return;
-}
-
-/**
-  * @brief  DMA uart receive process complete callback.
-  * @param  arg: Pointer to a uart_handle_t structure.
-  * @retval None
-  */
-static void uart_dma_recv_cplt(void *arg)
-{
-	uart_handle_t *hperh = (uart_handle_t *)arg;
-
-	if (hperh->state == UART_STATE_BUSY_RX)
-		uart_dma_req_config(hperh, DISABLE);
-
-	hperh->rx_count = 0;
-	CLEAR_BIT(hperh->state, UART_STATE_RX_MASK);
-
-	if (hperh->rx_cplt_cbk)
-		hperh->rx_cplt_cbk(hperh);
-
-	return;
-}
-
-/**
-  * @brief  DMA uart communication error callback.
-  * @param  arg: Pointer to a uart_handle_t structure.
-  * @retval None
-  */
-static void uart_dma_error(void *arg)
-{
-	uart_handle_t *hperh = (uart_handle_t *)arg;
-
-	hperh->rx_count  = 0;
-	hperh->tx_count  = 0;
-	hperh->state     = UART_STATE_READY;
-	hperh->err_code |= UART_ERROR_DMA;
-	uart_dma_req_config(hperh, DISABLE);
-
-	if (hperh->error_cbk)
-		hperh->error_cbk(hperh);
-
-	return;
-}
-#endif
-
-/**
-  * @brief  This function handles uart Communication Timeout.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  flag: specifies the uart flag to check.
-  * @param  status: The new Flag status (SET or RESET).
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t uart_wait_flag(uart_handle_t *hperh, uart_status_t flag, flag_status_t status, uint32_t timeout)
-{
-	uint32_t tick;
-
-	if (timeout == 0)
-		return ERROR;
-
-	tick = __get_tick();
-
-	/* Waiting for flag */
-	while ((uart_get_status(hperh, flag)) != status) {
-		if (((__get_tick()) - tick) > timeout)
-			return TIMEOUT;
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __uart_send_by_it(uart_handle_t *hperh)
-{
-	if ((hperh->state & UART_STATE_TX_MASK) == 0x0)
-		return BUSY;
-
-	WRITE_REG(hperh->perh->TBR, (uint8_t)(*hperh->tx_buf++ & 0x00FF));
-
-	if (--hperh->tx_count == 0) {
-		uart_clear_flag_status(hperh, UART_IF_TC);
-		uart_interrupt_config(hperh, UART_IT_TXS, DISABLE);
-		uart_interrupt_config(hperh, UART_IT_TC, ENABLE);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Wraps up transmission in non blocking mode.
-  * @param  hperh: pointer to a uart_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __uart_end_send_by_it(uart_handle_t *hperh)
-{
-	if (!(READ_BIT(hperh->perh->SR, UART_SR_TEM_MSK)))
-		return OK;
-
-	uart_interrupt_config(hperh, UART_IT_TC, DISABLE);
-	CLEAR_BIT(hperh->state, UART_STATE_TX_MASK);
-	if (hperh->tx_cplt_cbk)
-		hperh->tx_cplt_cbk(hperh);
-	
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __uart_recv_by_it(uart_handle_t *hperh)
-{
-	if ((hperh->state & UART_STATE_RX_MASK) == 0x0)
-		return BUSY;
-
-	*hperh->rx_buf++ = (uint8_t)(hperh->perh->RBR & 0xFF);
-
-	if (--hperh->rx_count == 0) {
-		uart_interrupt_config(hperh, UART_IT_RXRD, DISABLE);
-		CLEAR_BIT(hperh->state, UART_STATE_RX_MASK);
-
-		if (hperh->rx_cplt_cbk)
-			hperh->rx_cplt_cbk(hperh);
-	}
-
-	return OK;
-}
-/**
-  * @}
-  */
-
-/** @defgroup UART_Public_Functions UART Public Functions
-  * @{
-  */
-
-/** @defgroup UART_Public_Functions_Group1 Initialization and Configuration functions
-  * @brief    Initialization and Configuration functions
-  *
-  * @verbatim
-===============================================================================
-            ##### Initialization and Configuration functions #####
- ===============================================================================
-    [..]
-    This subsection provides a set of functions allowing to initialize the UARTx
-    and configure UARTx param.
-      (+) For the UARTx only these parameters can be configured:
-        (++) Baud Rate
-        (++) Word Length
-        (++) Stop Bit
-        (++) Parity
-        (++) Hardware flow control
-      (+) For RS485 mode, user also need configure some parameters by
-          uart_rs485_config():
-        (++) Enable/disable normal point mode
-	(++) Enable/disable auto-direction
-	(++) Enable/disable address detection invert
-	(++) Enable/disable address for compare
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Reset UART peripheral
-  * @param  hperh: Pointer to a uart_handle_t structure that contains
-  *         the configuration information for the specified uart module.
-  * @retval None
-  */
-void uart_reset(uart_handle_t *hperh)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	WRITE_REG(hperh->perh->BRR, 0x0);
-	WRITE_REG(hperh->perh->LCR, 0x0);
-	WRITE_REG(hperh->perh->MCR, 0x0);
-	WRITE_REG(hperh->perh->CR, 0x0);
-	WRITE_REG(hperh->perh->RTOR, 0x0);
-	WRITE_REG(hperh->perh->FCR, 0x0);
-	WRITE_REG(hperh->perh->IDR, 0xFFF);
-
-	hperh->err_code = UART_ERROR_NONE;
-	hperh->state    = UART_STATE_RESET;
-
-	__UNLOCK(hperh);
-	return;
-}
-
-/**
-  * @brief  Initializes the UARTx according to the specified
-  *         parameters in the uart_handle_t.
-  * @param  hperh: Pointer to a uart_handle_t structure that contains
-  *         the configuration information for the specified UART module.
-  * @retval None
-  */
-void uart_init(uart_handle_t *hperh)
-{
-	uint32_t tmp;
-
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_BAUDRATE(hperh->init.baud));
-	assert_param(IS_UART_WORD_LENGTH(hperh->init.word_length));
-	assert_param(IS_UART_STOPBITS(hperh->init.stop_bits));
-	assert_param(IS_UART_PARITY(hperh->init.parity));
-	assert_param(IS_UART_MODE(hperh->init.mode));
-	assert_param(IS_UART_HARDWARE_FLOW_CONTROL(hperh->init.fctl));
-
-	uart_reset(hperh);
-
-	tmp = READ_REG(hperh->perh->LCR);
-	MODIFY_REG(tmp, UART_LCR_DLS_MSK, hperh->init.word_length << UART_LCR_DLS_POSS);
-	MODIFY_REG(tmp, UART_LCR_STOP_MSK, hperh->init.stop_bits << UART_LCR_STOP_POS);
-	MODIFY_REG(tmp, UART_LCR_PEN_MSK, (hperh->init.parity == UART_PARITY_NONE ? 0 : 1) << UART_LCR_PEN_POS);
-	MODIFY_REG(tmp, UART_LCR_PS_MSK, (hperh->init.parity == UART_PARITY_EVEN ? 1 : 0) << UART_LCR_PS_POS);
-	WRITE_REG(hperh->perh->LCR, tmp);
-	MODIFY_REG(hperh->perh->MCR, UART_MCR_AFCEN_MSK, hperh->init.fctl << UART_MCR_AFCEN_POS);
-	SET_BIT(hperh->perh->LCR, UART_LCR_BRWEN_MSK);
-	WRITE_REG(hperh->perh->BRR, cmu_get_pclk1_clock() / hperh->init.baud);
-	CLEAR_BIT(hperh->perh->LCR, UART_LCR_BRWEN_MSK);
-	SET_BIT(hperh->perh->FCR, UART_FCR_FIFOEN_MSK);
-	SET_BIT(hperh->perh->FCR, UART_FCR_RFRST_MSK);
-	SET_BIT(hperh->perh->FCR, UART_FCR_TFRST_MSK);
-	MODIFY_REG(hperh->perh->FCR, UART_FCR_RXTL_MSK, 0 << UART_FCR_RXTL_POSS);
-	MODIFY_REG(hperh->perh->FCR, UART_FCR_TXTL_MSK, 0 << UART_FCR_TXTL_POSS);
-	SET_BIT(hperh->perh->LCR, UART_LCR_RXEN_MSK);
-
-	if (hperh->init.mode == UART_MODE_LIN)
-		SET_BIT(hperh->perh->MCR, UART_MCR_LINEN_MSK);
-	else if (hperh->init.mode == UART_MODE_IrDA)
-		SET_BIT(hperh->perh->MCR, UART_MCR_IREN_MSK);
-	else if (hperh->init.mode == UART_MODE_RS485)
-		SET_BIT(hperh->perh->MCR, UART_MCR_AADEN_MSK);
-	else if (hperh->init.mode == UART_MODE_HDSEL)
-		SET_BIT(hperh->perh->MCR, UART_MCR_HDSEL_MSK);
-	else
-		;/* do nothing */
-
-	if (hperh->init.fctl)
-		SET_BIT(hperh->perh->MCR, UART_MCR_RTSCTRL_MSK);
-	if (hperh->init.mode == UART_MODE_IrDA)
-		SET_BIT(hperh->perh->LCR, UART_LCR_RXINV_MSK);
-
-	hperh->state    = UART_STATE_READY;
-	hperh->err_code = UART_ERROR_NONE;
-	return;
-}
-
-/**
-  * @brief  Configure the RS485 mode according to the specified
-  *         parameters in the uart_rs485_config_t.
-  * @param  hperh: Pointer to a uart_handle_t structure that contains
-  *         the configuration information for the specified UART module.
-  * @param  config: Specifies the RS485 parameters.
-  * @retval None
-  */
-void uart_rs485_config(uart_handle_t *hperh, uart_rs485_config_t *config)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_FUNC_STATE(config->normal));
-	assert_param(IS_FUNC_STATE(config->dir));
-	assert_param(IS_FUNC_STATE(config->invert));
-
-	MODIFY_REG(hperh->perh->MCR, UART_MCR_AADNOR_MSK, config->normal << UART_MCR_AADNOR_POS);
-	MODIFY_REG(hperh->perh->MCR, UART_MCR_AADDIR_MSK, config->dir << UART_MCR_AADDIR_POS);
-	MODIFY_REG(hperh->perh->MCR, UART_MCR_AADINV_MSK, config->invert << UART_MCR_AADINV_POS);
-	MODIFY_REG(hperh->perh->CR, UART_CR_ADDR_MSK, config->addr << UART_CR_ADDR_POSS);
-
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup UART_Public_Functions_Group2 IO operation functions
-  * @brief UART Transmit and Receive functions
-  * @verbatim
-  ==============================================================================
-                      # IO operation functions #
-  ==============================================================================
-  [..]
-    This subsection provides a set of functions allowing to manage the UART data transfers.
-
-    (#) There are two modes of transfer:
-       (++) Blocking mode: The communication is performed in polling mode.
-            The Status of all data processing is returned by the same function
-            after finishing transfer.
-       (++) Non blocking mode: The communication is performed using Interrupts
-            or DMA, these APIs return the Status.
-            The end of the data processing will be indicated through the
-            dedicated UART IRQ when using Interrupt mode or the DMA IRQ when
-            using DMA mode.
-            The hperh->tx_cplt_cbk(), hperh->rx_cplt_cbk() user callbacks
-            will be executed respectively at the end of the transmit or receive process.
-            The hperh->error_cbk() user callback will be executed when
-            a communication error is detected.
-
-    (#) Blocking mode APIs are:
-        (++) uart_send()
-        (++) uart_recv()
-
-    (#) Non Blocking mode APIs with Interrupt are:
-        (++) uart_send_by_it()
-        (++) uart_recv_by_it()
-        (++) uart_irq_handle()
-
-    (#) Non Blocking mode functions with DMA are:
-        (++) uart_send_by_dma()
-        (++) uart_recv_by_dma()
-        (++) uart_dma_pause()
-        (++) uart_dma_resume()
-        (++) uart_dma_stop()
-
-    (#) A set of transfer complete callbacks are provided in non blocking mode:
-        (++) hperh->tx_cplt_cbk()
-        (++) hperh->rx_cplt_cbk()
-        (++) hperh->error_cbk()
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Sends an amount of data in blocking mode.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_send(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	if ((hperh->state != UART_STATE_READY) && (hperh->state != UART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-	hperh->err_code = UART_ERROR_NONE;
-	SET_BIT(hperh->state, UART_STATE_TX_MASK);
-
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-
-	while (hperh->tx_count-- > 0) {
-		if (uart_wait_flag(hperh, UART_STATUS_TBEM, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = UART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		WRITE_REG(hperh->perh->TBR, (*buf++ & 0xFF));
-	}
-
-	if (uart_wait_flag(hperh, UART_STATUS_TEM, SET, timeout) != OK) {
-		__UNLOCK(hperh);
-		hperh->state = UART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	CLEAR_BIT(hperh->state, UART_STATE_TX_MASK);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in blocking mode.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_recv(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	if ((hperh->state != UART_STATE_READY) && (hperh->state != UART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-
-	hperh->err_code = UART_ERROR_NONE;
-	SET_BIT(hperh->state, UART_STATE_RX_MASK);
-
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-
-	while (hperh->rx_count-- > 0) {
-		if (uart_wait_flag(hperh, UART_STATUS_DR, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = UART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		*buf++ = (uint8_t)(hperh->perh->RBR & 0xFF);
-	}
-
-	CLEAR_BIT(hperh->state, UART_STATE_RX_MASK);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_send_by_it(uart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	if ((hperh->state != UART_STATE_READY) && (hperh->state != UART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = UART_ERROR_NONE;
-	SET_BIT(hperh->state, UART_STATE_TX_MASK);
-	__UNLOCK(hperh);
-
-	if (((uart_get_status(hperh, UART_STATUS_TBEM)) == SET)
-			&& ((uart_get_flag_status(hperh, UART_IF_TXS)) == RESET)) {
-		WRITE_REG(hperh->perh->TBR, (*hperh->tx_buf++ & 0xFF));
-		--hperh->tx_count;
-	}
-
-	if (hperh->tx_count == 0) {
-		uart_interrupt_config(hperh, UART_IT_TC, ENABLE);
-		return OK;
-	}
-
-	uart_interrupt_config(hperh, UART_IT_TXS, ENABLE);
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_recv_by_it(uart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	if ((hperh->state != UART_STATE_READY) && (hperh->state != UART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->err_code = UART_ERROR_NONE;
-	SET_BIT(hperh->state, UART_STATE_RX_MASK);
-	__UNLOCK(hperh);
-
-	uart_interrupt_config(hperh, UART_IT_RXRD, ENABLE);
-	return OK;
-}
-#ifdef ALD_DMA
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as UART transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_send_by_dma(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	if ((hperh->state != UART_STATE_READY) && (hperh->state != UART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = UART_ERROR_NONE;
-	SET_BIT(hperh->state, UART_STATE_TX_MASK);
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	hperh->hdmatx.cplt_cbk = uart_dma_send_cplt;
-	hperh->hdmatx.cplt_arg = (void *)hperh;
-	hperh->hdmatx.err_cbk  = uart_dma_error;
-	hperh->hdmatx.err_arg  = (void *)hperh;
-
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src     = (void *)buf;
-	hperh->hdmatx.config.dst     = (void *)&hperh->perh->TBR;
-	hperh->hdmatx.config.size    = size;
-	hperh->hdmatx.config.src_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msigsel = DMA_MSIGSEL_UART_TXEMPTY;
-	hperh->hdmatx.config.burst   = ENABLE;
-	hperh->hdmatx.config.channel = channel;
-
-	if (hperh->init.mode == UART_MODE_RS485) {
-		hperh->hdmatx.config.src_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmatx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	if (hperh->perh == UART0)
-		hperh->hdmatx.config.msel = DMA_MSEL_UART0;
-	else if (hperh->perh == UART1)
-		hperh->hdmatx.config.msel = DMA_MSEL_UART1;
-	else if (hperh->perh == UART2)
-		hperh->hdmatx.config.msel = DMA_MSEL_UART2;
-	else if (hperh->perh == UART3)
-		hperh->hdmatx.config.msel = DMA_MSEL_UART3;
-	else
-		;	/* do nothing */
-
-	dma_config_basic(&hperh->hdmatx);
-
-	__UNLOCK(hperh);
-	uart_clear_flag_status(hperh, UART_IF_TC);
-	uart_dma_req_config(hperh, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  channel: DMA channel as UART receive
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_recv_by_dma(uart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	if ((hperh->state != UART_STATE_READY) && (hperh->state != UART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->err_code = UART_ERROR_NONE;
-	SET_BIT(hperh->state, UART_STATE_RX_MASK);
-
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	hperh->hdmarx.cplt_cbk = uart_dma_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.err_cbk  = uart_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-
-	dma_config_struct(&hperh->hdmarx.config);
-	hperh->hdmarx.config.src     = (void *)&hperh->perh->RBR;
-	hperh->hdmarx.config.dst     = (void *)buf;
-	hperh->hdmarx.config.size    = size;
-	hperh->hdmarx.config.src_inc = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msigsel = DMA_MSIGSEL_UART_RNR;
-	hperh->hdmarx.config.burst   = ENABLE;
-	hperh->hdmarx.config.channel = channel;
-
-	if (hperh->init.mode == UART_MODE_RS485) {
-		hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmarx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	if (hperh->perh == UART0)
-		hperh->hdmarx.config.msel = DMA_MSEL_UART0;
-	else if (hperh->perh == UART1)
-		hperh->hdmarx.config.msel = DMA_MSEL_UART1;
-	else if (hperh->perh == UART2)
-		hperh->hdmarx.config.msel = DMA_MSEL_UART2;
-	else if (hperh->perh == UART3)
-		hperh->hdmarx.config.msel = DMA_MSEL_UART3;
-	else
-		;
-
-	dma_config_basic(&hperh->hdmarx);
-	__UNLOCK(hperh);
-	uart_dma_req_config(hperh, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Pauses the DMA Transfer.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_dma_pause(uart_handle_t *hperh)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	uart_dma_req_config(hperh, DISABLE);
-	return OK;
-}
-
-/**
-  * @brief  Resumes the DMA Transfer.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_dma_resume(uart_handle_t *hperh)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	uart_dma_req_config(hperh, ENABLE);
-	return OK;
-}
-
-/**
-  * @brief  Stops the DMA Transfer.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t uart_dma_stop(uart_handle_t *hperh)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	uart_dma_req_config(hperh, DISABLE);
-	hperh->state = UART_STATE_READY;
-	return OK;
-}
-#endif
-
-/**
-  * @brief  This function handles UART interrupt request.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval None
-  */
-void uart_irq_handle(uart_handle_t *hperh)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	/* Handle parity error */
-	if ((uart_get_status(hperh, UART_STATUS_PE)) != RESET)
-		hperh->err_code |= UART_ERROR_PE;
-
-	/* Handle frame error */
-	if ((uart_get_status(hperh, UART_STATUS_FE)) != RESET)
-		hperh->err_code |= UART_ERROR_FE;
-
-	/* Handle overflow error */
-	if ((uart_get_status(hperh, UART_STATUS_OE)) != RESET)
-		hperh->err_code |= UART_ERROR_ORE;
-
-	/* Receive */
-	if ((uart_get_mask_flag_status(hperh, UART_IF_RXRD)) != RESET) {
-		uart_clear_flag_status(hperh, UART_IF_RXRD);
-		__uart_recv_by_it(hperh);
-	}
-
-	/* Transmite */
-	if ((uart_get_mask_flag_status(hperh, UART_IF_TXS)) != RESET) {
-		uart_clear_flag_status(hperh, UART_IF_TXS);
-		__uart_send_by_it(hperh);
-	}	
-
-	/* End Transmite */
-	if ((uart_get_mask_flag_status(hperh, UART_IF_TC)) != RESET) {
-		uart_clear_flag_status(hperh, UART_IF_TC);
-		__uart_end_send_by_it(hperh);
-	}
-
-	/* Handle error state */
-	if (hperh->err_code != UART_ERROR_NONE) {
-		hperh->state = UART_STATE_READY;
-
-		if (hperh->error_cbk)
-			hperh->error_cbk(hperh);
-	}
-}
-/**
-  * @}
-  */
-
-/** @defgroup UART_Public_Functions_Group3 Peripheral Control functions
-  *  @brief   UART control functions
-  *
-  * @verbatim
-  ==============================================================================
-                      ##### Peripheral Control functions #####
-  ==============================================================================
-  [..]
-    This subsection provides a set of functions allowing to control the UART:
-    (+) uart_interrupt_config() API can be helpful to configure UART interrupt source.
-    (+) uart_dma_req_config() API can be helpful to configure UART DMA request.
-    (+) uart_tx_fifo_config() API can be helpful to configure UART TX FIFO paramters.
-    (+) uart_rx_fifo_config() API can be helpful to configure UART RX FIFO paramters.
-    (+) uart_lin_send_break() API can send a frame of break in LIN mode.
-    (+) uart_lin_detect_break_len_config() API can be helpful to configure the length of break frame.
-    (+) uart_auto_baud_config() API can be helpful to configure detection data mode.
-    (+) uart_get_it_status() API can get the status of interrupt source.
-    (+) uart_get_status() API can get the status of UART_SR register.
-    (+) uart_get_flag_status() API can get the status of UART flag.
-    (+) uart_get_mask_flag_status() API can get status os flag and interrupt source.
-    (+) uart_clear_flag_status() API can clear UART flag.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Enable/disable the specified UART interrupts.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  it: Specifies the UART interrupt sources to be enabled or disabled.
-  *         This parameter can be one of the @ref uart_it_t.
-  * @param  state: New state of the specified UART interrupts.
-  *         This parameter can be:
-  *             @arg ENABLE
-  *             @arg DISABLE
-  * @retval None
-  */
-void uart_interrupt_config(uart_handle_t *hperh, uart_it_t it, type_func_t state)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_IT(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		WRITE_REG(hperh->perh->IER, it);
-	else
-		WRITE_REG(hperh->perh->IDR, it);
-
-	return;
-}
-
-/**
-  * @brief  Configure UART DMA request.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  state: New state of the specified DMA request.
-  *         This parameter can be:
-  *             @arg ENABLE
-  *             @arg DISABLE
-  * @retval None
-  */
-void uart_dma_req_config(uart_handle_t *hperh, type_func_t state)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state == ENABLE)
-		SET_BIT(hperh->perh->MCR, UART_MCR_DMAEN_MSK);
-	else
-		CLEAR_BIT(hperh->perh->MCR, UART_MCR_DMAEN_MSK);
-
-	return;
-}
-
-/**
-  * @brief  Configure transmit fifo parameters.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  config: Transmit fifo trigger level.
-  * @param  level: Transmit fifo level.
-  * @retval None
-  */
-void uart_tx_fifo_config(uart_handle_t *hperh, uart_rxfifo_t config, uint8_t level)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_TXFIFO_TYPE(config));
-
-	SET_BIT(hperh->perh->FCR, UART_FCR_TFRST_MSK);
-	MODIFY_REG(hperh->perh->FCR, UART_FCR_TXTL_MSK, config << UART_FCR_TXTL_POSS);
-	MODIFY_REG(hperh->perh->FCR, UART_FCR_TXFL_MSK, level << UART_FCR_TXFL_POSS);
-	SET_BIT(hperh->perh->FCR, UART_FCR_FIFOEN_MSK);
-
-	return;
-}
-
-/**
-  * @brief  Configure receive fifo parameters.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  config: Receive fifo trigger level.
-  * @param  level: Receive fifo level.
-  * @retval None
-  */
-void uart_rx_fifo_config(uart_handle_t *hperh, uart_rxfifo_t config, uint8_t level)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_RXFIFO_TYPE(config));
-
-	SET_BIT(hperh->perh->FCR, UART_FCR_RFRST_MSK);
-	MODIFY_REG(hperh->perh->FCR, UART_FCR_RXTL_MSK, config << UART_FCR_RXTL_POSS);
-	MODIFY_REG(hperh->perh->FCR, UART_FCR_RXFL_MSK, level << UART_FCR_RXFL_POSS);
-	SET_BIT(hperh->perh->FCR, UART_FCR_FIFOEN_MSK);
-
-	return;
-}
-
-/**
-  * @brief  request to send a frame of break.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval None
-  */
-void uart_lin_send_break(uart_handle_t *hperh)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	SET_BIT(hperh->perh->MCR, UART_MCR_BKREQ_MSK);
-	return;
-}
-
-/**
-  * @brief  Configure the length of break frame to be detect.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  len: Length of break frame.
-  *           @arg LIN_BREAK_LEN_10B
-  *           @arg LIN_BREAK_LEN_11B
-  * @retval None
-  */
-void uart_lin_detect_break_len_config(uart_handle_t *hperh, uart_lin_break_len_t len)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_LIN_BREAK_LEN(len));
-
-	MODIFY_REG(hperh->perh->MCR, UART_MCR_LINBDL_MSK, len << UART_MCR_LINBDL_POS);
-	return;
-}
-
-/**
-  * @brief  Configure the mode of auto-baud-rate detect.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  mode: The mode of auto-baud-rate detect.
-  *           @arg UART_ABRMOD_1_TO_0
-  *           @arg UART_ABRMOD_1
-  *           @arg UART_ABRMOD_0_TO_1
-  * @retval None
-  */
-void uart_auto_baud_config(uart_handle_t *hperh, uart_auto_baud_mode_t mode)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_AUTO_BAUD_MODE(mode));
-
-	MODIFY_REG(hperh->perh->MCR, UART_MCR_ABRMOD_MSK, mode << UART_MCR_ABRMOD_POSS);
-	return;
-}
-
-/**
-  * @brief  Send address in RS485 mode.
-  * @param  hperh: Pointer to a uart_handle_t structure that contains
-  *         the configuration information for the specified UART module.
-  * @param  addr: the address of RS485 device.
-  * @param  timeout: Timeout duration
-  * @retval The ALD status.
-  */
-ald_status_t uart_rs485_send_addr(uart_handle_t *hperh, uint16_t addr, uint32_t timeout)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-
-	if ((hperh->state != UART_STATE_READY) && (hperh->state != UART_STATE_BUSY_RX))
-		return BUSY;
-
-	SET_BIT(hperh->state, UART_STATE_TX_MASK);
-
-	if (uart_wait_flag(hperh, UART_STATUS_TBEM, SET, timeout) != OK) {
-		hperh->state = UART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	WRITE_REG(hperh->perh->TBR, (addr | 0x100));
-
-	if (uart_wait_flag(hperh, UART_STATUS_TEM, SET, timeout) != OK) {
-		hperh->state = UART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	CLEAR_BIT(hperh->state, UART_STATE_TX_MASK);
-
-	return OK;
-}
-
-/**
-  * @brief  Get the status of UART interrupt source.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  it: Specifies the UART interrupt source.
-  *         This parameter can be one of the @ref uart_it_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-it_status_t uart_get_it_status(uart_handle_t *hperh, uart_it_t it)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_IT(it));
-
-	if (READ_BIT(hperh->perh->IVS, it))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Get the status of UART_SR register.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  status: Specifies the UART status type.
-  *         This parameter can be one of the @ref uart_status_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t uart_get_status(uart_handle_t *hperh, uart_status_t status)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_STATUS(status));
-
-	if (READ_BIT(hperh->perh->SR, status))
-		return SET;
-
-	return RESET;
-}
-
-
-/**
-  * @brief  Get the status of UART interrupt flag.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  flag: Specifies the UART interrupt flag.
-  *         This parameter can be one of the @ref uart_flag_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t uart_get_flag_status(uart_handle_t *hperh, uart_flag_t flag)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_IF(flag));
-
-	if (READ_BIT(hperh->perh->RIF, flag))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Get the status of interrupt flag and interupt source.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  flag: Specifies the UART interrupt flag.
-  *         This parameter can be one of the @ref uart_flag_t.
-  * @retval Status:
-  *           - 0: RESET
-  *           - 1: SET
-  */
-flag_status_t uart_get_mask_flag_status(uart_handle_t *hperh, uart_flag_t flag)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_IF(flag));
-
-	if (READ_BIT(hperh->perh->IFM, flag))
-		return SET;
-
-	return RESET;
-}
-
-/**
-  * @brief  Clear the UART interrupt flag.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @param  flag: Specifies the UART interrupt flag.
-  *         This parameter can be one of the @ref uart_flag_t.
-  * @retval None
-  */
-void uart_clear_flag_status(uart_handle_t *hperh, uart_flag_t flag)
-{
-	assert_param(IS_UART_ALL(hperh->perh));
-	assert_param(IS_UART_IF(flag));
-
-	WRITE_REG(hperh->perh->ICR, flag);
-	return;
-}
-/**
-  * @}
-  */
-
-/** @defgroup UART_Public_Functions_Group4 Peripheral State and Errors functions
-  *  @brief   UART State and Errors functions
-  *
-@verbatim
-  ==============================================================================
-                 ##### Peripheral State and Errors functions #####
-  ==============================================================================
- [..]
-   This subsection provides a set of functions allowing to return the State of
-   UART communication process, return Peripheral Errors occurred during communication
-   process
-   (+) uart_get_state() API can be helpful to check in run-time the state of the UART peripheral.
-   (+) uart_get_error() check in run-time errors that could be occurred during communication.
-
-@endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Returns the UART state.
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval ALD state
-  */
-uart_state_t uart_get_state(uart_handle_t *hperh)
-{
-	return hperh->state;
-}
-
-/**
-  * @brief  Return the UART error code
-  * @param  hperh: Pointer to a uart_handle_t structure.
-  * @retval UART Error Code
-  */
-uint32_t uart_get_error(uart_handle_t *hperh)
-{
-	return hperh->err_code;
-}
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-#endif /* ALD_UART */
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 0 - 2347
bsp/es32f0334/libraries/ES32F033x_ALD_StdPeriph_Driver/Source/ald_usart.c

@@ -1,2347 +0,0 @@
-/**
-  *********************************************************************************
-  *
-  * @file    ald_usart.c
-  * @brief   USART module driver.
-  *          This file provides firmware functions to manage the following
-  *          functionalities of the Universal Synchronous Asynchronous Receiver Transmitter (USART) peripheral:
-  *           + Initialization functions
-  *           + IO operation functions
-  *           + Peripheral Control functions
-  *           + Peripheral State and Errors functions
-  *
-  * @version V1.0
-  * @date    25 Apr 2017
-  * @author  AE Team
-  * @note
-  *
-  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
-  *
-  *********************************************************************************
-  * @verbatim
-  ==============================================================================
-                        ##### How to use this driver #####
-  ==============================================================================
-  [..]
-    The USART ALD driver can be used as follows:
-
-    (#) Declare a usart_handle_t handle structure.
-
-    (#) Initialize the USART handle:
-        (##) Enable the USARTx interface clock.
-        (##) USART pins configuration:
-            (+++) Enable the clock for the USART GPIOs.
-            (+++) Configure the USART pins (TX as alternate function pull-up, RX as alternate function Input).
-        (##) NVIC configuration if you need to use interrupt process (usart_send_by_it()
-             and usart_recv_by_it() APIs):
-            (+++) Configure the USARTx interrupt priority.
-            (+++) Enable the NVIC USART IRQ handle.
-        (##) DMA Configuration if you need to use DMA process (usart_send_by_dma()
-             and usart_recv_by_dma() APIs):
-            (+++) Declare a DMA handle structure for the Tx/Rx channel.
-            (+++) Enable the DMAx interface clock.
-            (+++) Configure the declared DMA handle structure with the required
-                  Tx/Rx parameters.
-            (+++) Configure the DMA Tx/Rx channel.
-            (+++) Associate the initialized DMA handle to the USART DMA Tx/Rx handle.
-
-    (#) Program the baud rate, word length, stop bit, parity, hardware
-        flow control and mode(Receiver/Transmitter) in the hperh Init structure.
-
-    (#) For the USART asynchronous mode, initialize the USART registers by calling
-        the usart_init() API.
-
-    (#) For the USART Half duplex mode, initialize the USART registers by calling
-        the usart_half_duplex_init() API.
-
-    (#) For the LIN mode, initialize the USART registers by calling the usart_lin_init() API.
-
-    (#) For the Multi-Processor mode, initialize the USART registers by calling
-        the usart_multi_processor_init() API.
-
-     [..]
-       (@) The specific USART interrupts (Transmission complete interrupt,
-            RXNE interrupt and Error Interrupts) will be managed using the function
-            usart_interrupt_config inside the transmit and receive process.
-
-     [..]
-        Three operation modes are available within this driver :
-
-     *** Polling mode IO operation ***
-     =================================
-     [..] Asynchronous:
-       (+) Send an amount of data in blocking mode using usart_send()
-       (+) Receive an amount of data in blocking mode using usart_recv()
-
-     [..] Synchronous:
-       (+) Send an amount of data in blocking mode using usart_send_sync()
-       (+) Receive an amount of data in blocking mode using usart_recv_sync()
-
-     *** Interrupt mode IO operation ***
-     ===================================
-     [..] Asynchronous:
-       (+) Send an amount of data in non blocking mode using usart_send_by_it()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode using USART_recv_by_it()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk() function is executed and user can
-            add his own code by customization of function pointer hperh->error_cbk()
-     [..] Synchronous:
-       (+) Send an amount of data in non blocking mode using usart_send_by_it_sync()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode using USART_recv_by_it_sync()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk() function is executed and user can
-            add his own code by customization of function pointer hperh->error_cbk()
-
-     *** DMA mode IO operation ***
-     ==============================
-     [..] Asynchronous:
-       (+) Send an amount of data in non blocking mode (DMA) using usart_send_by_dma()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode (DMA) using usart_recv_by_dma()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk()() function is executed and user can
-            add his own code by customization of function pointer hperh->error_cbk()
-     [..] Synchronous:
-       (+) Send an amount of data in non blocking mode (DMA) using usart_send_by_dma_sync()
-       (+) At transmission end of transfer hperh->tx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->tx_cplt_cbk()
-       (+) Receive an amount of data in non blocking mode (DMA) using usart_recv_by_dma_sync()
-       (+) At reception end of transfer hperh->rx_cplt_cbk() is executed and user can
-            add his own code by customization of function pointer hperh->rx_cplt_cbk()
-       (+) In case of transfer Error, hperh->error_cbk()() function is executed and user can
-            add his own code by customization of function pointer hperh->error_cbk()
-     [..] Utilities:
-       (+) Pause the DMA Transfer using usart_dma_pause()
-       (+) Resume the DMA Transfer using usart_dma_resume()
-       (+) Stop the DMA Transfer using usart_dma_stop()
-
-     *** USART ALD driver macros list ***
-     =============================================
-     [..]
-       Below the list of most used macros in USART ALD driver.
-
-      (+) USART_ENABLE: Enable the USART peripheral
-      (+) USART_DISABLE: Disable the USART peripheral
-      (+) USART_RESET_HANDLE_STATE : Reset USART handle
-      (+) USART_CLEAR_PEFLAG : Clear PE flag
-      (+) USART_CLEAR_FEFLAG: Clear FE flag
-      (+) USART_CLEAR_NEFLAG: Clear NE flag
-      (+) USART_CLEAR_OREFLAG: Clear voerrun flag
-      (+) USART_CLEAR_IDLEFLAG : Clear IDLE flag
-      (+) USART_HWCONTROL_CTS_ENABLE: Enable CTS flow control
-      (+) USART_HWCONTROL_CTS_DISABLE: Disable CTS flow control
-      (+) USART_HWCONTROL_RTS_ENABLE: Enable RTS flow control
-      (+) USART_HWCONTROL_RTS_DISABLE: Disable RTS flow control
-
-     [..]
-       (@) You can refer to the USART Library header file for more useful macros
-
-    @endverbatim
-  ******************************************************************************
-  */
-
-#include "ald_usart.h"
-#include "ald_cmu.h"
-
-
-/** @addtogroup ES32FXXX_ALD
-  * @{
-  */
-
-/** @defgroup USART USART
-  * @brief USART module driver
-  * @{
-  */
-#ifdef ALD_USART
-
-/** @defgroup USART_Private_Variables USART Private Variables
-  * @{
-  */
-uint8_t __frame_mode = 0;
-/**
-  * @}
-  */
-
-/** @addtogroup USART_Private_Functions   USART Private Functions
-  * @{
-  */
-static void usart_set_config (usart_handle_t *hperh);
-static ald_status_t __usart_send_by_it(usart_handle_t *hperh);
-static ald_status_t __usart_end_send_by_it(usart_handle_t *hperh);
-static ald_status_t __usart_recv_by_it(usart_handle_t *hperh);
-static ald_status_t __usart_recv_frame_cplt(usart_handle_t *hperh);
-static ald_status_t __usart_recv_by_it_sync(usart_handle_t *hperh);
-static ald_status_t __usart_send_recv_by_it_sync(usart_handle_t *hperh);
-#ifdef ALD_DMA
-static void usart_dma_send_cplt(void *arg);
-static void usart_dma_recv_cplt(void *arg);
-static void usart_dma_error(void *arg);
-#endif
-static ald_status_t usart_wait_flag(usart_handle_t *hperh, usart_flag_t flag, flag_status_t status, uint32_t timeout);
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Functions USART Public Functions
-  * @{
-  */
-
-/** @defgroup USART_Public_Functions_Group1 Initialization functions
-  * @brief    Initialization and Configuration functions
-  *
-  * @verbatim
-===============================================================================
-            ##### Initialization and Configuration functions #####
- ===============================================================================
-    [..]
-    This subsection provides a set of functions allowing to initialize the USARTx or the USARTy
-    in asynchronous or synchronous mode.
-      (+) For the asynchronous mode only these parameters can be configured:
-        (++) Baud rate
-        (++) Word length
-        (++) Stop bit
-        (++) Parity
-        (++) Hardware flow control
-        (++) Receiver/transmitter modes
-    [..]
-    The usart_init(), usart_half_duplex_init(), usart_lin_init(), usart_multi_processor_init()
-    and usart_clock_init() APIs follow respectively the USART asynchronous, USART Half duplex,
-    LIN, Multi-Processor and synchronous configuration procedures.
-
-    @endverbatim
-  * @{
-  */
-
-/*
-  Additionnal remark: If the parity is enabled, then the MSB bit of the data written
-                      in the data register is transmitted but is changed by the parity bit.
-                      Depending on the frame length defined by the M bit (8-bits or 9-bits),
-                      the possible USART frame formats are as listed in the following table:
-    +-------------------------------------------------------------+
-    |   M bit |  PCE bit  |            USART frame                 |
-    |---------------------|---------------------------------------|
-    |    0    |    0      |    | SB | 8 bit data | STB |          |
-    |---------|-----------|---------------------------------------|
-    |    0    |    1      |    | SB | 7 bit data | PB | STB |     |
-    |---------|-----------|---------------------------------------|
-    |    1    |    0      |    | SB | 9 bit data | STB |          |
-    |---------|-----------|---------------------------------------|
-    |    1    |    1      |    | SB | 8 bit data | PB | STB |     |
-    +-------------------------------------------------------------+
-*/
-
-
-/**
-  * @brief  Reset the USART peripheral.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval None
-  */
-void usart_reset(usart_handle_t *hperh)
-{
-	assert_param(IS_USART(hperh->perh));
-
-	hperh->state = USART_STATE_BUSY;
-	USART_DISABLE(hperh);
-
-	WRITE_REG(hperh->perh->CON0, 0x0);
-	WRITE_REG(hperh->perh->CON1, 0x0);
-	WRITE_REG(hperh->perh->CON2, 0x0);
-
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_RESET;
-
-	__UNLOCK(hperh);
-	return;
-}
-
-/**
-  * @brief  Initializes the USART mode according to the specified parameters in
-  *         the usart_init_t and create the associated handle.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_init(usart_handle_t *hperh)
-{
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_HARDWARE_FLOW_CONTROL(hperh->init.fctl));
-	assert_param(IS_USART_WORD_LENGTH(hperh->init.word_length));
-	assert_param(IS_FUNC_STATE(hperh->init.over_sampling));
-
-	usart_reset(hperh);
-	hperh->state = USART_STATE_BUSY;
-	USART_DISABLE(hperh);
-	usart_set_config(hperh);
-
-	/* In asynchronous mode, the following bits must be kept cleared:
-	 *   - LINEN and CLKEN bits in the USART_CR2 register,
-	 *   - SCEN, HDSEL and IREN  bits in the USART_CR3 register.
-	 */
-	CLEAR_BIT(hperh->perh->CON1, USART_CON1_SCKEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_SMARTEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_HDPSEL_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_IREN_MSK);
-
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_READY;
-	USART_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Initializes the half-duplex mode according to the specified
-  *         parameters in the usart_init_t and create the associated handle.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_half_duplex_init(usart_handle_t *hperh)
-{
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_WORD_LENGTH(hperh->init.word_length));
- 	assert_param(IS_FUNC_STATE(hperh->init.over_sampling));
-
-	usart_reset(hperh);
-	hperh->state = USART_STATE_BUSY;
-	USART_DISABLE(hperh);
-	usart_set_config(hperh);
-
-	/* In half-duplex mode, the following bits must be kept cleared:
-	 *   - LINEN and CLKEN bits in the USART_CR2 register,
-	 *   - SCEN and IREN bits in the USART_CR3 register.*/
-	CLEAR_BIT(hperh->perh->CON1, USART_CON1_SCKEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_SMARTEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_IREN_MSK);
-	SET_BIT(hperh->perh->CON2, USART_CON2_HDPSEL_MSK);
-
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_READY;
-	USART_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Initializes the Multi-Processor mode according to the specified
-  *         parameters in the usart_init_t and create the associated handle.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  addr: USART node address
-  * @param  wakeup: specifies the USART wakeup method.
-  *         This parameter can be one of the following values:
-  *            @arg USART_WAKEUP_IDLE: Wakeup by an idle line detection
-  *            @arg USART_WAKEUP_ADDR: Wakeup by an address mark
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_multi_processor_init(usart_handle_t *hperh, uint8_t addr, usart_wakeup_t wakeup)
-{
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_WAKEUP(wakeup));
-	assert_param(IS_USART_ADDRESS(addr));
-	assert_param(IS_USART_WORD_LENGTH(hperh->init.word_length));
-	assert_param(IS_FUNC_STATE(hperh->init.over_sampling));
-
-	usart_reset(hperh);
-	hperh->state = USART_STATE_BUSY;
-	USART_DISABLE(hperh);
-	usart_set_config(hperh);
-
-	/* In Multi-Processor mode, the following bits must be kept cleared:
-	 *   - LINEN and CLKEN bits in the USART_CR2 register,
-	 *   - SCEN, HDSEL and IREN  bits in the USART_CR3 register */
-	CLEAR_BIT(hperh->perh->CON1, USART_CON1_SCKEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_SMARTEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_HDPSEL_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_IREN_MSK);
-	MODIFY_REG(hperh->perh->CON1, USART_CON1_ADDR_MSK, addr << USART_CON1_ADDR_POSS);
-	MODIFY_REG(hperh->perh->CON0, USART_CON0_WKMOD_MSK, wakeup << USART_CON0_WKMOD_POS);
-
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_READY;
-	USART_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Initializes the synchronization mode according to the specified
-  *         parameters in the usart_init_t and usart_clock_init_t.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  init: USART Clock Init Structure.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_clock_init(usart_handle_t *hperh, usart_clock_init_t *init)
-{
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_WORD_LENGTH(hperh->init.word_length));
-	assert_param(IS_FUNC_STATE(hperh->init.over_sampling));
-
-	usart_reset(hperh);
-	hperh->state = USART_STATE_BUSY;
-	USART_DISABLE(hperh);
-	usart_set_config(hperh);
-
-	/* In Multi-Processor mode, the following bits must be kept cleared:
-	 *   - LINEN and CLKEN bits in the USART_CR2 register,
-	 *   - SCEN, HDSEL and IREN  bits in the USART_CR3 register */
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_SMARTEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_HDPSEL_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_IREN_MSK);
-	MODIFY_REG(hperh->perh->CON1, USART_CON1_SCKEN_MSK, init->clk << USART_CON1_SCKEN_POS);
-	MODIFY_REG(hperh->perh->CON1, USART_CON1_SCKPOL_MSK, init->polarity << USART_CON1_SCKPOL_POS);
-	MODIFY_REG(hperh->perh->CON1, USART_CON1_SCKPHA_MSK, init->phase << USART_CON1_SCKPHA_POS);
-	MODIFY_REG(hperh->perh->CON1, USART_CON1_LBCP_MSK, init->last_bit << USART_CON1_LBCP_POS);
-
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_READY;
-	USART_ENABLE(hperh);
-
-	return OK;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Functions_Group2 IO operation functions
-  * @brief USART Transmit and Receive functions
-  * @{
-  */
-
-/** @defgroup USART_Public_Functions_Group2_1 Asynchronization IO operation functions
-  * @brief Asynchronization IO operation functions
-  *
-  * @verbatim
-  ==============================================================================
-                      ##### IO operation functions #####
-  ==============================================================================
-  [..]
-    This subsection provides a set of functions allowing to manage the USART asynchronous
-    and Half duplex data transfers.
-
-    (#) There are two modes of transfer:
-       (++) Blocking mode: The communication is performed in polling mode.
-            The Status of all data processing is returned by the same function
-            after finishing transfer.
-       (++) Non blocking mode: The communication is performed using Interrupts
-            or DMA, these APIs return the Status.
-            The end of the data processing will be indicated through the
-            dedicated USART IRQ when using Interrupt mode or the DMA IRQ when
-            using DMA mode.
-            The hperh->tx_cplt_cbk(), hperh->rx_cplt_cbk() user callbacks
-            will be executed respectively at the end of the transmit or receive process.
-            The hperh->error_cbk() user callback will be executed when
-            a communication error is detected.
-
-    (#) Blocking mode APIs are:
-        (++) usart_send()
-        (++) usart_recv()
-
-    (#) Non Blocking mode APIs with Interrupt are:
-        (++) usart_send_by_it()
-        (++) usart_recv_by_it()
-        (++) urart_irq_handle()
-
-    (#) Non Blocking mode functions with DMA are:
-        (++) usart_send_by_dma()
-        (++) usart_recv_by_dma()
-        (++) usart_dma_pause()
-        (++) usart_dma_resume()
-        (++) usart_dma_stop()
-
-    (#) A set of Transfer Complete Callbacks are provided in non blocking mode:
-        (++) hperh->tx_cplt_cbk()
-        (++) hperh->rx_cplt_cbk()
-        (++) hperh->error_cbk()
-
-    [..]
-      (@) In the Half duplex communication, it is forbidden to run the transmit
-          and receive process in parallel, the USART state USART_STATE_BUSY_TX_RX
-          can't be useful.
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Sends an amount of data in blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if ((hperh->state != USART_STATE_READY) && (hperh->state != USART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-	hperh->err_code = USART_ERROR_NONE;
-	SET_BIT(hperh->state, USART_STATE_TX_MASK);
-
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-
-	while (hperh->tx_count-- > 0) {
-		if (usart_wait_flag(hperh, USART_FLAG_TXE, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = USART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-			if (hperh->init.parity == USART_PARITY_NONE) {
-				WRITE_REG(hperh->perh->DATA, (*(uint16_t *)buf & (uint16_t)0x01FF));
-				buf += 2;
-			}
-			else {
-				WRITE_REG(hperh->perh->DATA, *buf++);
-			}
-		}
-		else {
-			WRITE_REG(hperh->perh->DATA, *buf++);
-		}
-	}
-
-	if (usart_wait_flag(hperh, USART_FLAG_TC, SET, timeout) != OK) {
-		__UNLOCK(hperh);
-		hperh->state = USART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	CLEAR_BIT(hperh->state, USART_STATE_TX_MASK);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_recv(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if ((hperh->state != USART_STATE_READY) && (hperh->state != USART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-	hperh->err_code = USART_ERROR_NONE;
-	SET_BIT(hperh->state, USART_STATE_RX_MASK);
-
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-
-	while (hperh->rx_count-- > 0) {
-		if (usart_wait_flag(hperh, USART_FLAG_RXNE, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = USART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-			if (hperh->init.parity == USART_PARITY_NONE) {
-				*(uint16_t *)buf = (uint16_t)(hperh->perh->DATA & 0x1FF);
-				buf += 2;
-			}
-			else {
-				*buf = (uint8_t)(hperh->perh->DATA & 0xFF);
-				buf += 1;
-			}
-		}
-		else {
-			if (hperh->init.parity == USART_PARITY_NONE)
-				*buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-			else
-				*buf++ = (uint8_t)(hperh->perh->DATA & 0x7F);
-		}
-	}
-
-	CLEAR_BIT(hperh->state, USART_STATE_RX_MASK);
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send_by_it(usart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if ((hperh->state != USART_STATE_READY) && (hperh->state != USART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-	SET_BIT(hperh->state, USART_STATE_TX_MASK);
-
-	hperh->tx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-
-	__UNLOCK(hperh);
-	usart_interrupt_config(hperh, USART_IT_TXE, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_recv_by_it(usart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if ((hperh->state != USART_STATE_READY) && (hperh->state != USART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-	SET_BIT(hperh->state, USART_STATE_RX_MASK);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-
-	__UNLOCK(hperh);
-	usart_interrupt_config(hperh, USART_IT_PE, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_ERR, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_RXNE, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an frame in interrupt mode
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Maximum amount of data to be received
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_recv_frame_by_it(usart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if ((hperh->state != USART_STATE_READY) && (hperh->state != USART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-	SET_BIT(hperh->state, USART_STATE_RX_MASK);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-
-	__UNLOCK(hperh);
-	usart_interrupt_config(hperh, USART_IT_PE, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_ERR, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_RXNE, ENABLE);
-	__frame_mode = 1;
-
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as USART transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send_by_dma(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if ((hperh->state != USART_STATE_READY) && (hperh->state != USART_STATE_BUSY_RX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-	SET_BIT(hperh->state, USART_STATE_TX_MASK);
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	/* Configure callback function */
-	hperh->hdmatx.cplt_cbk = usart_dma_send_cplt;
-	hperh->hdmatx.cplt_arg = (void *)hperh;
-	hperh->hdmatx.err_cbk  = usart_dma_error;
-	hperh->hdmatx.err_arg  = (void *)hperh;
-
-	/* Configure USART DMA transmit */
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src     = (void *)buf;
-	hperh->hdmatx.config.dst     = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size    = size;
-	hperh->hdmatx.config.src_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel    = hperh->perh == USART0 ? DMA_MSEL_USART0 : DMA_MSEL_USART1;
-	hperh->hdmatx.config.msigsel = DMA_MSIGSEL_USART_TXEMPTY;
-	hperh->hdmatx.config.channel = channel;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B)
-			&& (hperh->init.parity == USART_PARITY_NONE)) {
-		hperh->hdmatx.config.src_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmatx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmatx);
-
-	__UNLOCK(hperh);
-	usart_clear_flag_status(hperh, USART_FLAG_TC);
-	SET_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  channel: DMA channel as USART receive
-  * @note   When the USART parity is enabled (PCE = 1), the received data contain
-  *         the parity bit (MSB position)
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_recv_by_dma(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if ((hperh->state != USART_STATE_READY) && (hperh->state != USART_STATE_BUSY_TX))
-		return BUSY;
-
-	if ((buf == NULL ) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-	SET_BIT(hperh->state, USART_STATE_RX_MASK);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->err_code = USART_ERROR_NONE;
-
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	/* Configure callback function */
-	hperh->hdmarx.cplt_cbk = usart_dma_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.err_cbk  = usart_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-
-	/* Configure DMA Receive */
-	dma_config_struct(&hperh->hdmarx.config);
-	hperh->hdmarx.config.src     = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst     = (void *)buf;
-	hperh->hdmarx.config.size    = size;
-	hperh->hdmarx.config.src_inc = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msel    = hperh->perh == USART0 ? DMA_MSEL_USART0 : DMA_MSEL_USART1;
-	hperh->hdmarx.config.msigsel = DMA_MSIGSEL_USART_RNR;
-	hperh->hdmarx.config.channel = channel;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B)
-			&& (hperh->init.parity == USART_PARITY_NONE)) {
-		hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmarx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmarx);
-
-	__UNLOCK(hperh);
-	SET_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-
-	return OK;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Functions_Group2_2 Synchronization IO operation functions
-  *  @brief   Synchronization IO operation functions
-  *
-  * @verbatim
-  ==============================================================================
-                         ##### IO operation functions #####
-  ==============================================================================
-  [..]
-    This subsection provides a set of functions allowing to manage the USART synchronous
-    data transfers.
-
-  [..]
-    The USART supports master mode only: it cannot receive or send data related to an input
-    clock (SCLK is always an output).
-
-    (#) There are two modes of transfer:
-        (++) Blocking mode: The communication is performed in polling mode.
-             The Status of all data processing is returned by the same function
-             after finishing transfer.
-        (++) No-Blocking mode: The communication is performed using Interrupts
-             or DMA, These API's return the Status.
-             The end of the data processing will be indicated through the
-             dedicated USART IRQ when using Interrupt mode or the DMA IRQ when
-             using DMA mode.
-             The hperh->tx_cplt_cbk(), hperh->rx_cplt_cbk() and hperh->tx_rx_cplt_cbk()
-             user callbacks will be executed respectively at the end of the transmit
-	     or Receive process. The hperh->error_cbk() user callback will be
-	     executed when a communication error is detected
-
-    (#) Blocking mode APIs are :
-        (++) usart_send_sync() in simplex mode
-        (++) usart_recv_sync() in full duplex receive only
-        (++) usart_send_recv_sync() in full duplex mode
-
-    (#) Non Blocking mode APIs with Interrupt are :
-        (++) usart_send_by_it_sync()in simplex mode
-        (++) usart_recv_by_it_sync() in full duplex receive only
-        (++) usart_send_recv_by_it_sync() in full duplex mode
-        (++) usart_irq_handle()
-
-    (#) Non Blocking mode functions with DMA are :
-        (++) usart_send_by_dma_sync()in simplex mode
-        (++) usart_recv_by_dma_sync() in full duplex receive only
-        (++) usart_send_recv_by_dma_symc() in full duplex mode
-        (++) usart_dma_pause()
-        (++) usart_dma_resume()
-        (++) usart_dma_stop()
-
-    (#) A set of Transfer Complete Callbacks are provided in non Blocking mode:
-        (++) hperh->tx_cplt_cbk()
-        (++) hperh->rx_cplt_cbk()
-        (++) hperh->tx_rx_cplt_cbk()
-        (++) hperh->error_cbk()
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Simplex Send an amount of data in blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_TX;
-
-	while (hperh->tx_count-- > 0) {
-		if (usart_wait_flag(hperh, USART_FLAG_TXE, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = USART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		if ((hperh->init.word_length == USART_WORD_LENGTH_9B) && (hperh->init.parity == USART_PARITY_NONE)) {
-			WRITE_REG(hperh->perh->DATA, (*(uint16_t *)buf & 0x1FF));
-			buf += 2;
-		}
-		else {
-			WRITE_REG(hperh->perh->DATA, *buf++);
-		}
-    	}
-
-	if (usart_wait_flag(hperh, USART_FLAG_TC, SET, timeout) != OK) {
-		__UNLOCK(hperh);
-		hperh->state = USART_STATE_READY;
-		return TIMEOUT;
-	}
-
-	hperh->state = USART_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Full-Duplex Receive an amount of data in blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_recv_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_RX;
-
-	while (hperh->rx_count-- > 0) {
-		if (usart_wait_flag(hperh, USART_FLAG_TXE, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = USART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-			WRITE_REG(hperh->perh->DATA, (DUMMY_DATA & 0x1FF));
-
-			if (usart_wait_flag(hperh, USART_FLAG_RXNE, SET, timeout) != OK) {
-				__UNLOCK(hperh);
-				hperh->state = USART_STATE_READY;
-				return TIMEOUT;
-			}
-
-			if (hperh->init.parity == USART_PARITY_NONE) {
-				*(uint16_t *)buf = (uint16_t)(hperh->perh->DATA & 0x1FF);
-				buf += 2;
-			}
-			else {
-				*buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-			}
-		}
-		else {
-			WRITE_REG(hperh->perh->DATA, (DUMMY_DATA & 0xFF));
-
-			if (usart_wait_flag(hperh, USART_FLAG_RXNE, SET, timeout) != OK) {
-				__UNLOCK(hperh);
-				hperh->state = USART_STATE_READY;
-				return TIMEOUT;
-			}
-
-			if (hperh->init.parity == USART_PARITY_NONE)
-				*buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-			else
-				*buf++ = (uint8_t)(hperh->perh->DATA & 0x7F);
-		}
-	}
-
-	hperh->state = USART_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Full-Duplex Send receive an amount of data in full-duplex mode (blocking mode).
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  tx_buf: Pointer to data transmitted buffer
-  * @param  rx_buf: Pointer to data received buffer
-  * @param  size: Amount of data to be sent
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send_recv_sync(usart_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf, uint16_t size, uint32_t timeout)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((tx_buf == NULL) || (rx_buf == NULL) || (size == 0))
-		return  ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_RX;
-
-	while (hperh->tx_count-- > 0) {
-		--hperh->rx_count;
-
-		if (usart_wait_flag(hperh, USART_FLAG_TXE, SET, timeout) != OK) {
-			__UNLOCK(hperh);
-			hperh->state = USART_STATE_READY;
-			return TIMEOUT;
-		}
-
-		if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-			if (hperh->init.parity == USART_PARITY_NONE) {
-				WRITE_REG(hperh->perh->DATA, (*(uint16_t *)tx_buf & 0x1FF));
-				tx_buf += 2;
-			}
-			else {
-				WRITE_REG(hperh->perh->DATA, *tx_buf++);
-			}
-
-			if (usart_wait_flag(hperh, USART_FLAG_RXNE, SET, timeout) != OK) {
-				__UNLOCK(hperh);
-				hperh->state = USART_STATE_READY;
-				return TIMEOUT;
-			}
-
-			if (hperh->init.parity == USART_PARITY_NONE) {
-				*(uint16_t *)rx_buf = (uint16_t)(hperh->perh->DATA & 0x1FF);
-				rx_buf += 2;
-			}
-			else {
-				*rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-			}
-		}
-		else {
-			WRITE_REG(hperh->perh->DATA, *tx_buf++);
-
-			if (usart_wait_flag(hperh, USART_FLAG_RXNE, SET, timeout) != OK) {
-				__UNLOCK(hperh);
-				hperh->state = USART_STATE_READY;
-				return TIMEOUT;
-			}
-
-			if (hperh->init.parity == USART_PARITY_NONE)
-				*rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-			else
-				*rx_buf++ = (uint8_t)(hperh->perh->DATA & 0x7F);
-		}
-	}
-
-	hperh->state = USART_STATE_READY;
-	__UNLOCK(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Simplex Send an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @retval Status, see @ref ald_status_t.
-  * @note   The USART errors are not managed to avoid the overrun error.
-  */
-ald_status_t usart_send_by_it_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_TX;
-
-	/* The USART Error Interrupts: (Frame error, Noise error, Overrun error)
-	 * are not managed by the USART transmit process to avoid the overrun interrupt
-	 * when the USART mode is configured for transmit and receive "USART_MODE_TX_RX"
-	 * to benefit for the frame error and noise interrupts the USART mode should be
-	 * configured only for transmit "USART_MODE_TX"
-	 * The __ALD_USART_ENABLE_IT(hperh, USART_IT_ERR) can be used to enable the Frame error,
-	 * Noise error interrupt
-	 */
-
-	__UNLOCK(hperh);
-	usart_interrupt_config(hperh, USART_IT_TXE, ENABLE);
-
-	return OK;
-}
-
-/**
-  * @brief  Simplex Receive an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_recv_by_it_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_RX;
-
-	__UNLOCK(hperh);
-	usart_interrupt_config(hperh, USART_IT_RXNE, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_PE, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_ERR, ENABLE);
-
-	WRITE_REG(hperh->perh->DATA, (DUMMY_DATA & (uint16_t)0x01FF));
-	return OK;
-}
-
-/**
-  * @brief  Full-Duplex Send receive an amount of data in full-duplex mode (non-blocking).
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  tx_buf: Pointer to data transmitted buffer
-  * @param  rx_buf: Pointer to data received buffer
-  * @param  size: Amount of data to be received
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send_recv_by_it_sync(usart_handle_t *hperh, uint8_t *tx_buf, uint8_t *rx_buf,  uint16_t size)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((tx_buf == NULL) || (rx_buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_buf   = rx_buf;
-	hperh->rx_size  = size;
-	hperh->rx_count = size;
-	hperh->tx_buf   = tx_buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_TX_RX;
-
-	__UNLOCK(hperh);
-	usart_interrupt_config(hperh, USART_IT_RXNE, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_PE, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_ERR, ENABLE);
-	usart_interrupt_config(hperh, USART_IT_TXE, ENABLE);
-
-	return OK;
-}
-
-#ifdef ALD_DMA
-/**
-  * @brief  Simplex Send an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be sent
-  * @param  channel: DMA channel as USART transmit
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send_by_dma_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t channel)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->tx_count = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_TX;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-
-	/* Configure callback function */
-	hperh->hdmatx.cplt_cbk = usart_dma_send_cplt;
-	hperh->hdmatx.cplt_arg = (void *)hperh;
-	hperh->hdmatx.err_cbk  = usart_dma_error;
-	hperh->hdmatx.err_arg  = (void *)hperh;
-
-	/* Configure DMA transmit */
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src     = (void *)buf;
-	hperh->hdmatx.config.dst     = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size    = size;
-	hperh->hdmatx.config.src_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel    = hperh->perh == USART0 ? DMA_MSEL_USART0 : DMA_MSEL_USART1;
-	hperh->hdmatx.config.msigsel = DMA_MSIGSEL_USART_TXEMPTY;
-	hperh->hdmatx.config.channel = channel;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B)
-			&& (hperh->init.parity == USART_PARITY_NONE)) {
-		hperh->hdmatx.config.src_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmatx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmatx);
-
-	__UNLOCK(hperh);
-	usart_clear_flag_status(hperh, USART_FLAG_TC);
-	SET_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-
-	return OK;
-}
-
-/**
-  * @brief  Full-Duplex Receive an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  buf: Pointer to data buffer
-  * @param  size: Amount of data to be received
-  * @param  tx_channel: DMA channel as USART transmit
-  * @param  rx_channel: DMA channel as USART receive
-  * @retval Status, see @ref ald_status_t.
-  * @note   The USART DMA transmit channel must be configured in order to generate the clock for the slave.
-  * @note   When the USART parity is enabled (PCE = 1) the data received contain the parity bit.
-  */
-ald_status_t usart_recv_by_dma_sync(usart_handle_t *hperh, uint8_t *buf, uint16_t size, uint8_t tx_channel, uint8_t rx_channel)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_buf   = buf;
-	hperh->rx_size  = size;
-	hperh->tx_buf   = buf;
-	hperh->tx_size  = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_RX;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	/* Configure DMA callback function */
-	hperh->hdmarx.cplt_cbk = usart_dma_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmarx.err_cbk  = usart_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-
-	/* Configure DMA receive*/
-	dma_config_struct(&hperh->hdmarx.config);
-	hperh->hdmarx.config.src     = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst     = (void *)buf;
-	hperh->hdmarx.config.size    = size;
-	hperh->hdmarx.config.src_inc = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msel    = hperh->perh == USART0 ? DMA_MSEL_USART0 : DMA_MSEL_USART1;
-	hperh->hdmarx.config.msigsel = DMA_MSIGSEL_USART_RNR;
-	hperh->hdmarx.config.channel = rx_channel;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B)
-			&& (hperh->init.parity == USART_PARITY_NONE)) {
-		hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmarx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmarx);
-
-	/* Enable the USART transmit DMA channel: the transmit channel is used in order
-	 * to generate in the non-blocking mode the clock to the slave device,
-	 * this mode isn't a simplex receive mode but a full-duplex receive one
-	 */
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src     = (void *)buf;
-	hperh->hdmatx.config.dst     = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size    = size;
-	hperh->hdmatx.config.src_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel    = hperh->perh == USART0 ? DMA_MSEL_USART0 : DMA_MSEL_USART1;
-	hperh->hdmatx.config.msigsel = DMA_MSIGSEL_USART_TXEMPTY;
-	hperh->hdmatx.config.channel = tx_channel;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B)
-			&& (hperh->init.parity == USART_PARITY_NONE)) {
-		hperh->hdmatx.config.src_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmatx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmatx);
-
-	USART_CLEAR_OREFLAG(hperh);
-	__UNLOCK(hperh);
-	SET_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-	SET_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-
-	return OK;
-}
-
-/**
-  * @brief  Full-Duplex Transmit Receive an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  tx_buf: Pointer to data transmitted buffer
-  * @param  rx_buf: Pointer to data received buffer
-  * @param  size: Amount of data to be received
-  * @param  tx_channel: DMA channel as USART transmit
-  * @param  rx_channel: DMA channel as USART receive
-  * @note   When the USART parity is enabled (PCE = 1) the data received contain the parity bit.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_send_recv_by_dma_sync(usart_handle_t *hperh, uint8_t *tx_buf,
-                    uint8_t *rx_buf, uint16_t size, uint8_t tx_channel, uint8_t rx_channel)
-{
-	if (hperh->state != USART_STATE_READY)
-		return BUSY;
-
-	if ((tx_buf == NULL) || (rx_buf == NULL) || (size == 0))
-		return ERROR;
-
-	__LOCK(hperh);
-
-	hperh->rx_buf   = rx_buf;
-	hperh->rx_size  = size;
-	hperh->tx_buf   = tx_buf;
-	hperh->tx_size  = size;
-	hperh->err_code = USART_ERROR_NONE;
-	hperh->state    = USART_STATE_BUSY_TX_RX;
-
-	if (hperh->hdmatx.perh == NULL)
-		hperh->hdmatx.perh = DMA0;
-	if (hperh->hdmarx.perh == NULL)
-		hperh->hdmarx.perh = DMA0;
-
-	/* Configure DMA callback function */
-	hperh->hdmarx.cplt_cbk = usart_dma_recv_cplt;
-	hperh->hdmarx.cplt_arg = (void *)hperh;
-	hperh->hdmatx.cplt_cbk = usart_dma_send_cplt;
-	hperh->hdmatx.cplt_arg = (void *)hperh;
-	hperh->hdmatx.err_cbk  = usart_dma_error;
-	hperh->hdmatx.err_arg  = (void *)hperh;
-	hperh->hdmarx.err_cbk  = usart_dma_error;
-	hperh->hdmarx.err_arg  = (void *)hperh;
-
-	/* Configure DMA receive */
-	dma_config_struct(&hperh->hdmarx.config);
-	hperh->hdmarx.config.src     = (void *)&hperh->perh->DATA;
-	hperh->hdmarx.config.dst     = (void *)rx_buf;
-	hperh->hdmarx.config.size    = size;
-	hperh->hdmarx.config.src_inc = DMA_DATA_INC_NONE;
-	hperh->hdmarx.config.dst_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmarx.config.msel    = hperh->perh == USART0 ? DMA_MSEL_USART0 : DMA_MSEL_USART1;
-	hperh->hdmarx.config.msigsel = DMA_MSIGSEL_USART_RNR;
-	hperh->hdmarx.config.channel = rx_channel;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B)
-			&& (hperh->init.parity == USART_PARITY_NONE)) {
-		hperh->hdmarx.config.dst_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmarx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmarx);
-
-	/* Configure DMA transmit*/
-	dma_config_struct(&hperh->hdmatx.config);
-	hperh->hdmatx.config.src     = (void *)tx_buf;
-	hperh->hdmatx.config.dst     = (void *)&hperh->perh->DATA;
-	hperh->hdmatx.config.size    = size;
-	hperh->hdmatx.config.src_inc = DMA_DATA_INC_BYTE;
-	hperh->hdmatx.config.dst_inc = DMA_DATA_INC_NONE;
-	hperh->hdmatx.config.msel    = hperh->perh == USART0 ? DMA_MSEL_USART0 : DMA_MSEL_USART1;
-	hperh->hdmatx.config.msigsel = DMA_MSIGSEL_USART_TXEMPTY;
-	hperh->hdmatx.config.channel = tx_channel;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B)
-			&& (hperh->init.parity == USART_PARITY_NONE)) {
-		hperh->hdmatx.config.src_inc    = DMA_DATA_INC_HALFWORD;
-		hperh->hdmatx.config.data_width = DMA_DATA_SIZE_HALFWORD;
-	}
-
-	dma_config_basic(&hperh->hdmatx);
-
-	usart_clear_flag_status(hperh, USART_FLAG_TC);
-	USART_CLEAR_OREFLAG(hperh);
-	__UNLOCK(hperh);
-	SET_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-	SET_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-
-	return OK;
-}
-#endif
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Functions_Group2_3 Utilities functions
-  * @brief    Utilities functions
-  * @{
-  */
-#ifdef ALD_DMA
-/**
-  * @brief  Pauses the DMA Transfer.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_dma_pause(usart_handle_t *hperh)
-{
-	__LOCK(hperh);
-
-	if (hperh->state == USART_STATE_BUSY_TX) {
-		CLEAR_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-	}
-	else if (hperh->state == USART_STATE_BUSY_RX) {
-		CLEAR_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-	}
-	else if (hperh->state == USART_STATE_BUSY_TX_RX) {
-		CLEAR_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-		CLEAR_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-	}
-	else {
-		__UNLOCK(hperh);
-		return ERROR;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Resumes the DMA Transfer.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_dma_resume(usart_handle_t *hperh)
-{
-	__LOCK(hperh);
-
-	if (hperh->state == USART_STATE_BUSY_TX) {
-		SET_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-	}
-	else if (hperh->state == USART_STATE_BUSY_RX) {
-		USART_CLEAR_OREFLAG(hperh);
-		SET_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-	}
-	else if (hperh->state == USART_STATE_BUSY_TX_RX) {
-		USART_CLEAR_OREFLAG(hperh);
-		SET_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-		SET_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-	}
-	else {
-		__UNLOCK(hperh);
-		return ERROR;
-	}
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Stops the DMA Transfer.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_dma_stop(usart_handle_t *hperh)
-{
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-
-	hperh->state = USART_STATE_READY;
-	return OK;
-}
-#endif
-/**
-  * @brief  This function handles USART interrupt request.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval None
-  */
-void usart_irq_handle(usart_handle_t *hperh)
-{
-	uint32_t flag;
-	uint32_t source;
-
-	/* Handle parity error */
-	flag   = usart_get_flag_status(hperh, USART_FLAG_PE);
-	source = usart_get_it_status(hperh, USART_IT_PE);
-	if ((flag != RESET) && (source != RESET))
-		hperh->err_code |= USART_ERROR_PE;
-
-	/* Handle frame error */
-	flag   = usart_get_flag_status(hperh, USART_FLAG_FE);
-	source = usart_get_it_status(hperh, USART_IT_ERR);
-	if ((flag != RESET) && (source != RESET))
-		hperh->err_code |= USART_ERROR_FE;
-
-	/* Handle noise error */
-	flag = usart_get_flag_status(hperh, USART_FLAG_NE);
-	if ((flag != RESET) && (source != RESET))
-		hperh->err_code |= USART_ERROR_NE;
-
-	/* Handle overrun error */
-	flag = usart_get_flag_status(hperh, USART_FLAG_ORE);
-	if ((flag != RESET) && (source != RESET))
-		hperh->err_code |= USART_ERROR_ORE;
-
-	/* Handle idle error */
-	flag   = usart_get_flag_status(hperh, USART_FLAG_IDLE);
-	source = usart_get_it_status(hperh, USART_IT_IDLE);
-	if ((flag != RESET) && (source != RESET))
-		__usart_recv_frame_cplt(hperh);
-
-	/* Handle asynchronous */
-	if (READ_BIT(hperh->perh->CON1, USART_CON1_SCKEN_MSK) == 0) {
-		/* Receiver */
-		flag   = usart_get_flag_status(hperh, USART_FLAG_RXNE);
-		source = usart_get_it_status(hperh, USART_IT_RXNE);
-		if ((flag != RESET) && (source != RESET))
-			__usart_recv_by_it(hperh);
-
-		/* Transmitter */
-		flag   = usart_get_flag_status(hperh, USART_FLAG_TXE);
-		source = usart_get_it_status(hperh, USART_IT_TXE);
-		if ((flag != RESET) && (source != RESET))
-			__usart_send_by_it(hperh);
-	}
-	else {	/* Handle synchronous */
-		/* Receiver */
-		flag   = usart_get_flag_status(hperh, USART_FLAG_RXNE);
-		source = usart_get_it_status(hperh, USART_IT_RXNE);
-		if ((flag != RESET) && (source != RESET)) {
-			if (hperh->state == USART_STATE_BUSY_RX)
-				__usart_recv_by_it_sync(hperh);
-			else
-				__usart_send_recv_by_it_sync(hperh);
-		}
-
-		/* Transmitter */
-		flag   = usart_get_flag_status(hperh, USART_FLAG_TXE);
-		source = usart_get_it_status(hperh, USART_IT_TXE);
-		if ((flag != RESET) && (source != RESET)) {
-			if (hperh->state == USART_STATE_BUSY_TX)
-				__usart_send_by_it(hperh);
-			else
-				__usart_send_recv_by_it_sync(hperh);
-		}
-	}
-
-	/* Handle transmitter end */
-	flag   = usart_get_flag_status(hperh, USART_FLAG_TC);
-	source = usart_get_it_status(hperh, USART_IT_TC);
-	if ((flag != RESET) && (source != RESET))
-		__usart_end_send_by_it(hperh);
-
-	/* Handle error */
-	if (hperh->err_code != USART_ERROR_NONE) {
-		USART_CLEAR_PEFLAG(hperh);
-		hperh->state = USART_STATE_READY;
-
-		if (hperh->error_cbk != NULL)
-			hperh->error_cbk(hperh);
-	}
-}
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Functions_Group3 Peripheral Control functions
-  *  @brief   USART control functions
-  *
-  * @verbatim
-  ==============================================================================
-                      ##### Peripheral Control functions #####
-  ==============================================================================
-  [..]
-    This subsection provides a set of functions allowing to control the USART:
-    (+) usart_lin_send_break() API can be helpful to transmit the break character.
-    (+) usart_multi_processor_enter_mute_mode() API can be helpful to enter the USART in mute mode.
-    (+) usart_multi_processor_exit_mute_mode() API can be helpful to exit the USART mute mode by software.
-    (+) usart_half_duplex_enable_send() API to enable the USART transmitter and disables the USART receiver in Half Duplex mode
-    (+) usart_half_duplex_enable_recv() API to enable the USART receiver and disables the USART transmitter in Half Duplex mode
-    (+) usart_interrupt_config() API to Enables/Disables the specified USART interrupts
-    (+) usart_get_flag_status() API to get USART flag status
-    (+) usart_clear_flag_status() API to clear USART flag status
-    (+) usart_get_it_status() API to Checks whether the specified USART interrupt has occurred or not
-
-    @endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Enters the USART in mute mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_multi_processor_enter_mute_mode(usart_handle_t *hperh)
-{
-	assert_param(IS_USART(hperh->perh));
-
-	__LOCK(hperh);
-
-	hperh->state = USART_STATE_BUSY;
-	SET_BIT(hperh->perh->CON0, USART_CON0_RXWK_MSK);
-	hperh->state = USART_STATE_READY;
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Exits the USART mute mode: wake up software.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_multi_processor_exit_mute_mode(usart_handle_t *hperh)
-{
-	assert_param(IS_USART(hperh->perh));
-
-	__LOCK(hperh);
-
-	hperh->state = USART_STATE_BUSY;
-	CLEAR_BIT(hperh->perh->CON0, USART_CON0_RXWK_MSK);
-	hperh->state = USART_STATE_READY;
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Enables the USART transmitter and disables the USART receiver.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_half_duplex_enable_send(usart_handle_t *hperh)
-{
-	__LOCK(hperh);
-
-	hperh->state = USART_STATE_BUSY;
-	SET_BIT(hperh->perh->CON0, USART_CON0_RXEN_MSK);
-	SET_BIT(hperh->perh->CON0, USART_CON0_TXEN_MSK);
-	hperh->state = USART_STATE_READY;
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Enables the USART receiver and disables the USART transmitter.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-ald_status_t usart_half_duplex_enable_recv(usart_handle_t *hperh)
-{
-	__LOCK(hperh);
-
-	hperh->state = USART_STATE_BUSY;
-	SET_BIT(hperh->perh->CON0, USART_CON0_RXEN_MSK);
-	SET_BIT(hperh->perh->CON0, USART_CON0_TXEN_MSK);
-	hperh->state = USART_STATE_READY;
-
-	__UNLOCK(hperh);
-	return OK;
-}
-
-/**
-  * @brief  Enables or disables the USART's DMA request.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  req: specifies the DMA request.
-  *	      @arg USART_dma_req_tx: USART DMA transmit request
-  *	      @arg USART_dma_req_rx: USART DMA receive request
-  * @param  state: New state of the DMA Request sources.
-  *	      @arg ENABLE
-  *           @arg DISABLE
-  * @return: None
-  */
-void usart_dma_req_config(usart_handle_t *hperh, usart_dma_req_t req, type_func_t state)
-{
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_DMAREQ(req));
-	assert_param(IS_FUNC_STATE(state));
-
-	if (state != DISABLE)
-		SET_BIT(hperh->perh->CON2, req);
-	else
-		CLEAR_BIT(hperh->perh->CON2, req);
-
-	return;
-}
-
-/**
-  * @brief  Enables or disables the specified USART interrupts.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  it: Specifies the USART interrupt sources to be enabled or disabled.
-  *           This parameter can be one of the following values:
-  *           @arg USART_IT_CTS:  CTS change interrupt
-  *           @arg USART_IT_LBD:  LIN Break detection interrupt
-  *           @arg USART_IT_TXE:  Transmit Data Register empty interrupt
-  *           @arg USART_IT_TC:   Transmission complete interrupt
-  *           @arg USART_IT_RXNE: Receive Data register not empty interrupt
-  *           @arg USART_IT_IDLE: Idle line detection interrupt
-  *           @arg USART_IT_PE:   Parity Error interrupt
-  *           @arg USART_IT_ERR:  Error interrupt(Frame error, noise error, overrun error)
-  * @param  state: New status
-  *           - ENABLE
-  *           - DISABLE
-  * @retval None
-  */
-void usart_interrupt_config(usart_handle_t *hperh, usart_it_t it, type_func_t state)
-{
-	uint8_t idx;
-
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_CONFIG_IT(it));
-	assert_param(IS_FUNC_STATE(state));
-
-	idx = (it >> 16) & 0x7;
-	it &= 0xFFFF;
-
-	if (state) {
-		if (idx == 1)
-			SET_BIT(hperh->perh->CON0, it);
-		else if (idx == 2)
-			SET_BIT(hperh->perh->CON1, it);
-		else if (idx == 4)
-			SET_BIT(hperh->perh->CON2, it);
-		else
-			;
-	}
-	else {
-		if (idx == 1)
-			CLEAR_BIT(hperh->perh->CON0, it);
-		else if (idx == 2)
-			CLEAR_BIT(hperh->perh->CON1, it);
-		else if (idx == 4)
-			CLEAR_BIT(hperh->perh->CON2, it);
-		else
-			;
-	}
-
-	return;
-}
-
-/** @brief  Check whether the specified USART flag is set or not.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  flag: specifies the flag to check.
-  *         This parameter can be one of the @ref usart_flag_t.
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-flag_status_t usart_get_flag_status(usart_handle_t *hperh, usart_flag_t flag)
-{
-	flag_status_t status = RESET;
-
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_FLAG(flag));
-
-	if (READ_BIT(hperh->perh->STAT, flag))
-		status = SET;
-
-	return status;
-}
-
-/** @brief  Clear the specified USART pending flags.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  flag: specifies the flag to check.
-  *          This parameter can be any combination of the following values:
-  *            @arg USART_FLAG_TC:   Transmission Complete flag.
-  *            @arg USART_FLAG_RXNE: Receive data register not empty flag.
-  * @note   PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun
-  *          error) and IDLE (Idle line detected) flags are cleared by software
-  *          sequence: a read operation to USART_SR register followed by a read
-  *          operation to USART_DR register.
-  * @note   RXNE flag can be also cleared by a read to the USART_DR register.
-  * @note   TC flag can be also cleared by software sequence: a read operation to
-  *         USART_SR register followed by a write operation to USART_DR register.
-  * @note   TXE flag is cleared only by a write to the USART_DR register.
-  * @retval None
-  */
-void usart_clear_flag_status(usart_handle_t *hperh, usart_flag_t flag)
-{
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_CLEAR_FLAG(flag));
-
-	CLEAR_BIT(hperh->perh->STAT, flag);
-}
-
-/**
-  * @brief  Checks whether the specified USART interrupt has occurred or not.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  it: Specifies the USART interrupt source to check.
-  *	       This parameter can be one of the following values:
-  *	       @arg USART_IT_CTS:  CTS change interrupt
-  *	       @arg USART_IT_LBD:  LIN Break detection interrupt
-  *	       @arg USART_IT_TXE:  Tansmit Data Register empty interrupt
-  *	       @arg USART_IT_TC:   Transmission complete interrupt
-  *	       @arg USART_IT_RXNE: Receive Data register not empty interrupt
-  *	       @arg USART_IT_IDLE: Idle line detection interrupt
-  *	       @arg USART_IT_ORE:  OverRun Error interrupt
-  *	       @arg USART_IT_NE:   Noise Error interrupt
-  *	       @arg USART_IT_FE:   Framing Error interrupt
-  *	       @arg USART_IT_PE:   Parity Error interrupt
-  * @retval Status
-  *           - SET
-  *           - RESET
-  */
-it_status_t usart_get_it_status(usart_handle_t *hperh, usart_it_t it)
-{
-	uint8_t idx;
-	it_status_t status = RESET;
-
-	/* Check the parameters */
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_GET_IT(it));
-
-	idx = (it >> 16) & 0x7;
-	it &= 0xFFFF;
-
-	if (idx == 0) {
-		if (READ_BIT(hperh->perh->STAT, it))
-			status = SET;
-	}
-	else if (idx == 1) {
-		if (READ_BIT(hperh->perh->CON0, it))
-			status = SET;
-	}
-	else if (idx == 2) {
-		if (READ_BIT(hperh->perh->CON1, it))
-			status = SET;
-	}
-	else if (idx == 4) {
-		if (READ_BIT(hperh->perh->CON2, it))
-			status = SET;
-	}
-	else {
-		/* do nothing */
-	}
-
-	return status;
-}
-
-/**
-  * @}
-  */
-
-/** @defgroup USART_Public_Functions_Group4 Peripheral State and Errors functions
-  *  @brief   USART State and Errors functions
-  *
-@verbatim
-  ==============================================================================
-                 ##### Peripheral State and Errors functions #####
-  ==============================================================================
- [..]
-   This subsection provides a set of functions allowing to return the State of
-   USART communication process, return Peripheral Errors occurred during communication
-   process
-   (+) usart_get_state() API can be helpful to check in run-time the state of the USART peripheral.
-   (+) usart_get_error() check in run-time errors that could be occurred during communication.
-
-@endverbatim
-  * @{
-  */
-
-/**
-  * @brief  Returns the USART state.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval USART state
-  */
-usart_state_t usart_get_state(usart_handle_t *hperh)
-{
-	return hperh->state;
-}
-
-/**
-  * @brief  Return the USART error code
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART.
-  * @retval USART Error Code
-  */
-uint32_t usart_get_error(usart_handle_t *hperh)
-{
-	return hperh->err_code;
-}
-
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */
-
-/** @defgroup USART_Private_Functions   USART Private Functions
-  *  @brief   USART Private functions
-  * @{
-  */
-#ifdef ALD_DMA
-/**
-  * @brief  DMA USART transmit process complete callback.
-  * @param  arg: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval None
-  */
-static void usart_dma_send_cplt(void *arg)
-{
-	usart_handle_t *hperh = (usart_handle_t *)arg;
-
-	hperh->tx_count = 0;
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-	usart_interrupt_config(hperh, USART_IT_TC, ENABLE);
-}
-
-/**
-  * @brief  DMA USART receive process complete callback.
-  * @param  arg: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval None
-  */
-static void usart_dma_recv_cplt(void *arg)
-{
-	usart_handle_t *hperh = (usart_handle_t *)arg;
-
-	hperh->rx_count = 0;
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-	CLEAR_BIT(hperh->state, USART_STATE_RX_MASK);
-
-	if (hperh->rx_cplt_cbk != NULL)
-		hperh->rx_cplt_cbk(hperh);
-}
-
-/**
-  * @brief  DMA USART communication error callback.
-  * @param  arg: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval None
-  */
-static void usart_dma_error(void *arg)
-{
-	usart_handle_t *hperh = (usart_handle_t *)arg;
-
-	hperh->rx_count  = 0;
-	hperh->tx_count  = 0;
-	hperh->state     = USART_STATE_READY;
-	hperh->err_code |= USART_ERROR_DMA;
-
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_TXDMAEN_MSK);
-	CLEAR_BIT(hperh->perh->CON2, USART_CON2_RXDMAEN_MSK);
-
-	if (hperh->error_cbk != NULL)
-		hperh->error_cbk(hperh);
-}
-#endif
-/**
-  * @brief  This function handles USART Communication Timeout.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @param  flag: specifies the USART flag to check.
-  * @param  status: The new Flag status (SET or RESET).
-  * @param  timeout: Timeout duration
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t usart_wait_flag(usart_handle_t *hperh, usart_flag_t flag, flag_status_t status, uint32_t timeout)
-{
-	uint32_t tick;
-
-	if (timeout == 0)
-		return OK;
-
-	tick = __get_tick();
-
-	while ((usart_get_flag_status(hperh, flag)) != status) {
-		if (((__get_tick()) - tick) > timeout) {
-			usart_interrupt_config(hperh, USART_IT_TXE, DISABLE);
-			usart_interrupt_config(hperh, USART_IT_RXNE, DISABLE);
-			usart_interrupt_config(hperh, USART_IT_PE, DISABLE);
-			usart_interrupt_config(hperh, USART_IT_ERR, DISABLE);
-
-			return TIMEOUT;
-		}
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Sends an amount of data in non blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __usart_send_by_it(usart_handle_t *hperh)
-{
-	if ((hperh->state != USART_STATE_BUSY_TX) && (hperh->state != USART_STATE_BUSY_TX_RX))
-		return BUSY;
-
-	if ((hperh->init.word_length == USART_WORD_LENGTH_9B) && (hperh->init.parity == USART_PARITY_NONE)) {
-		WRITE_REG(hperh->perh->DATA, (uint16_t)(*(uint16_t *)hperh->tx_buf & (uint16_t)0x01FF));
-		hperh->tx_buf += 2;
-	}
-	else {
-		WRITE_REG(hperh->perh->DATA, *hperh->tx_buf++);
-	}
-
-	if (--hperh->tx_count == 0) {
-		usart_interrupt_config(hperh, USART_IT_TXE, DISABLE);
-		usart_interrupt_config(hperh, USART_IT_TC, ENABLE);
-	}
-
-	return OK;
-}
-
-
-/**
-  * @brief  Wraps up transmission in non blocking mode.
-  * @param  hperh: pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __usart_end_send_by_it(usart_handle_t *hperh)
-{
-	usart_interrupt_config(hperh, USART_IT_TC, DISABLE);
-	CLEAR_BIT(hperh->state, USART_STATE_TX_MASK);
-
-	if (hperh->tx_cplt_cbk != NULL)
-		hperh->tx_cplt_cbk(hperh);
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an amount of data in non blocking mode
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __usart_recv_by_it(usart_handle_t *hperh)
-{
-	if ((hperh->state != USART_STATE_BUSY_RX) && (hperh->state != USART_STATE_BUSY_TX_RX))
-		return BUSY;
-
-	if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-		if (hperh->init.parity == USART_PARITY_NONE) {
-			*(uint16_t *)hperh->rx_buf = (uint16_t)(hperh->perh->DATA & (uint16_t)0x01FF);
-			hperh->rx_buf += 2;
-		}
-		else {
-			*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-		}
-    	}
-	else {
-		if (hperh->init.parity == USART_PARITY_NONE)
-			*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-		else
-			*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0x7F);
-	}
-
-	if (__frame_mode && ((usart_get_it_status(hperh, USART_IT_IDLE)) == RESET))
-		usart_interrupt_config(hperh, USART_IT_IDLE, ENABLE);
-
-	if (--hperh->rx_count == 0) {
-		usart_interrupt_config(hperh, USART_IT_RXNE, DISABLE);
-		CLEAR_BIT(hperh->state, USART_STATE_RX_MASK);
-		__frame_mode = 0;
-
-		if (hperh->state == USART_STATE_READY) {
-			usart_interrupt_config(hperh, USART_IT_PE, DISABLE);
-			usart_interrupt_config(hperh, USART_IT_ERR, DISABLE);
-		}
-
-		if (hperh->rx_cplt_cbk != NULL)
-			hperh->rx_cplt_cbk(hperh);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Receives an frame complete in non blocking mode
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __usart_recv_frame_cplt(usart_handle_t *hperh)
-{
-	if ((hperh->state != USART_STATE_BUSY_RX) && (hperh->state != USART_STATE_BUSY_TX_RX))
-		return BUSY;
-
-	usart_interrupt_config(hperh, USART_IT_IDLE, DISABLE);
-	usart_interrupt_config(hperh, USART_IT_RXNE, DISABLE);
-	CLEAR_BIT(hperh->state, USART_STATE_RX_MASK);
-
-	__frame_mode    = 0;
-	hperh->rx_size -= hperh->rx_count;
-
-	if (hperh->state == USART_STATE_READY) {
-		usart_interrupt_config(hperh, USART_IT_PE, DISABLE);
-		usart_interrupt_config(hperh, USART_IT_ERR, DISABLE);
-	}
-
-	if (hperh->rx_cplt_cbk != NULL)
-		hperh->rx_cplt_cbk(hperh);
-
-	return OK;
-}
-
-
-
-/**
-  * @brief  Simplex Receive an amount of data in non-blocking mode.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __usart_recv_by_it_sync(usart_handle_t *hperh)
-{
-	if (hperh->state != USART_STATE_BUSY_RX)
-		return BUSY;
-
-	if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-
-		if (hperh->init.parity == USART_PARITY_NONE) {
-			*(uint16_t *)hperh->rx_buf = (uint16_t)(hperh->perh->DATA & 0x1FF);
-			hperh->rx_buf += 2;
-		}
-		else {
-			*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-		}
-
-		if (--hperh->rx_count != 0x00)
-			WRITE_REG(hperh->perh->DATA, (DUMMY_DATA & 0x1FF));
-	}
-	else {
-		if (hperh->init.parity == USART_PARITY_NONE)
-			*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-		else
-			*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0x7F);
-
-		if (--hperh->rx_count != 0x00)
-			hperh->perh->DATA = (DUMMY_DATA & 0xFF);
-	}
-
-	if (hperh->rx_count == 0) {
-		usart_interrupt_config(hperh, USART_IT_RXNE, DISABLE);
-		usart_interrupt_config(hperh, USART_IT_PE, DISABLE);
-		usart_interrupt_config(hperh, USART_IT_ERR, DISABLE);
-		hperh->state = USART_STATE_READY;
-
-		if (hperh->rx_cplt_cbk != NULL)
-			hperh->rx_cplt_cbk(hperh);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Full-Duplex Send receive an amount of data in full-duplex mode (non-blocking).
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval Status, see @ref ald_status_t.
-  */
-static ald_status_t __usart_send_recv_by_it_sync(usart_handle_t *hperh)
-{
-	if (hperh->state != USART_STATE_BUSY_TX_RX)
-		return BUSY;
-
-	if (hperh->tx_count != 0) {
-		if (usart_get_flag_status(hperh, USART_FLAG_TXE) != RESET) {
- 			if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-				if (hperh->init.parity == USART_PARITY_NONE) {
-					WRITE_REG(hperh->perh->DATA, (uint16_t)(*(uint16_t *)hperh->tx_buf & 0x1FF));
-					hperh->tx_buf += 2;
-				}
-				else {
-					WRITE_REG(hperh->perh->DATA, *hperh->tx_buf++);
-				}
-			}
-			else {
-				WRITE_REG(hperh->perh->DATA, *hperh->tx_buf++);
-			}
-
-			if (--hperh->tx_count == 0)
-				usart_interrupt_config(hperh, USART_IT_TXE, DISABLE);
-		}
-	}
-
-	if (hperh->rx_count != 0) {
-		if (usart_get_flag_status(hperh, USART_FLAG_RXNE) != RESET) {
-			if (hperh->init.word_length == USART_WORD_LENGTH_9B) {
-				if (hperh->init.parity == USART_PARITY_NONE) {
-					*(uint16_t *)hperh->rx_buf = (uint16_t)(hperh->perh->DATA & 0x1FF);
-					hperh->rx_buf += 2;
-				}
-				else {
-					*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-				}
-			}
-			else {
-				if (hperh->init.parity == USART_PARITY_NONE)
-					*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0xFF);
-				else
-					*hperh->rx_buf++ = (uint8_t)(hperh->perh->DATA & 0x7F);
-			}
-
-			--hperh->rx_count;
-		}
-	}
-
-	if (hperh->rx_count == 0) {
-		usart_interrupt_config(hperh, USART_IT_RXNE, DISABLE);
-		usart_interrupt_config(hperh, USART_IT_PE, DISABLE);
-		usart_interrupt_config(hperh, USART_IT_ERR, DISABLE);
-
-		hperh->state = USART_STATE_READY;
-
-		if (hperh->tx_rx_cplt_cbk != NULL)
-			hperh->tx_rx_cplt_cbk(hperh);
-	}
-
-	return OK;
-}
-
-/**
-  * @brief  Configures the USART peripheral.
-  * @param  hperh: Pointer to a usart_handle_t structure that contains
-  *         the configuration information for the specified USART module.
-  * @retval None
-  */
-static void usart_set_config (usart_handle_t *hperh)
-{
-	uint32_t tmp;
-	uint32_t integer;
-	uint32_t fractional;
-
-	/* Check the parameters */
-	assert_param(IS_USART(hperh->perh));
-	assert_param(IS_USART_BAUDRATE(hperh->init.baud));
-	assert_param(IS_USART_WORD_LENGTH(hperh->init.word_length));
-	assert_param(IS_USART_STOPBITS(hperh->init.stop_bits));
-	assert_param(IS_USART_PARITY(hperh->init.parity));
-	assert_param(IS_USART_MODE(hperh->init.mode));
-	assert_param(IS_USART_HARDWARE_FLOW_CONTROL(hperh->init.fctl));
-
-	MODIFY_REG(hperh->perh->CON1, USART_CON1_STPLEN_MSK, hperh->init.stop_bits << USART_CON1_STPLEN_POSS);
-	tmp = READ_REG(hperh->perh->CON0);
-	MODIFY_REG(tmp, USART_CON0_DLEN_MSK, hperh->init.word_length << USART_CON0_DLEN_POS);
-
-	if (hperh->init.parity == USART_PARITY_NONE)
-		CLEAR_BIT(tmp, USART_CON0_PEN_MSK);
-	else
-		SET_BIT(tmp, USART_CON0_PEN_MSK);
-
-	if (hperh->init.parity == USART_PARITY_ODD)
-		SET_BIT(tmp, USART_CON0_PSEL_MSK);
-	else
-		CLEAR_BIT(tmp, USART_CON0_PSEL_MSK);
-
-	WRITE_REG(hperh->perh->CON0, tmp);
-	MODIFY_REG(hperh->perh->CON2, USART_CON2_RTSEN_MSK, (hperh->init.fctl & 0x1) << USART_CON2_RTSEN_POS);
-	MODIFY_REG(hperh->perh->CON2, USART_CON2_CTSEN_MSK, ((hperh->init.fctl >> 1) & 0x1) << USART_CON2_CTSEN_POS);
-	MODIFY_REG(hperh->perh->CON0, USART_CON0_RXEN_MSK, (hperh->init.mode & 0x1) << USART_CON0_RXEN_POS);
-	MODIFY_REG(hperh->perh->CON0, USART_CON0_TXEN_MSK, ((hperh->init.mode >> 1) & 0x1) << USART_CON0_TXEN_POS);
-
-	if (hperh->init.over_sampling)
-		SET_BIT(hperh->perh->CON0, (1 << 15));
-
-	/* Determine the integer part */
-	if (READ_BIT(hperh->perh->CON0, (1 << 15))) {
-		/* Integer part computing in case Oversampling mode is 8 Samples */
-		integer = ((25 * cmu_get_pclk1_clock()) / (2 * (hperh->init.baud)));
-	}
-	else {
-		/* Integer part computing in case Oversampling mode is 16 Samples */
-		integer = ((25 * cmu_get_pclk1_clock()) / (4 * (hperh->init.baud)));
-	}
-	tmp = (integer / 100) << 4;
-
-	/* Determine the fractional part */
-	fractional = integer - (100 * (tmp >> 4));
-
-	/* Implement the fractional part in the register */
-	if (READ_BIT(hperh->perh->CON0, (1 << 15)))
-    		tmp |= ((((fractional * 8) + 50) / 100) & ((uint8_t)0x07));
-	else
-		tmp |= ((((fractional * 16) + 50) / 100) & ((uint8_t)0x0F));
-
-	WRITE_REG(hperh->perh->BAUDCON, (uint16_t)tmp);
-	return;
-}
-/**
-  * @}
-  */
-
-#endif /* ALD_USART */
-/**
-  * @}
-  */
-
-/**
-  * @}
-  */

+ 1 - 1
bsp/es32f0654/.config

@@ -17,7 +17,7 @@ CONFIG_RT_TICK_PER_SECOND=100
 CONFIG_RT_USING_OVERFLOW_CHECK=y
 CONFIG_RT_USING_HOOK=y
 CONFIG_RT_USING_IDLE_HOOK=y
-CONFIG_RT_IDEL_HOOK_LIST_SIZE=4
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
 CONFIG_IDLE_THREAD_STACK_SIZE=256
 # CONFIG_RT_USING_TIMER_SOFT is not set
 CONFIG_RT_DEBUG=y

+ 2 - 0
bsp/es32f0654/Kconfig

@@ -20,6 +20,8 @@ source "$PKGS_DIR/Kconfig"
 
 config SOC_ES32F0654LT
     bool
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
     default y
 
 source "drivers/Kconfig"

+ 1 - 0
bsp/es32f0654/SConstruct

@@ -17,6 +17,7 @@ except:
 
 TARGET = 'rtthread.' + rtconfig.TARGET_EXT
 
+DefaultEnvironment(tools=[])
 env = Environment(tools = ['mingw'],
     AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
     CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,

+ 1 - 22
bsp/es32f0654/project.uvprojx

@@ -332,7 +332,7 @@
               <MiscControls />
               <Define />
               <Undefine />
-              <IncludePath>.;..\..\include;applications;.;drivers;libraries\CMSIS\Device\EastSoft\ES32F065x\Include;libraries\CMSIS\Include;libraries\ES32F065x_ALD_StdPeriph_Driver\Include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m0;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh</IncludePath>
+              <IncludePath>.;..\..\include;applications;.;drivers;libraries\CMSIS\Device\EastSoft\ES32F065x\Include;libraries\CMSIS\Include;libraries\ES32F065x_ALD_StdPeriph_Driver\Include;..\..\libcpu\arm\common;..\..\libcpu\arm\cortex-m0;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\drivers\include;..\..\components\finsh;..\..\components\libc\compilers\common</IncludePath>
             </VariousControls>
           </Cads>
           <Aads>
@@ -820,13 +820,6 @@
               <FilePath>..\..\components\finsh\shell.c</FilePath>
             </File>
           </Files>
-          <Files>
-            <File>
-              <FileName>symbol.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>..\..\components\finsh\symbol.c</FilePath>
-            </File>
-          </Files>
           <Files>
             <File>
               <FileName>cmd.c</FileName>
@@ -841,20 +834,6 @@
               <FilePath>..\..\components\finsh\msh.c</FilePath>
             </File>
           </Files>
-          <Files>
-            <File>
-              <FileName>msh_cmd.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>..\..\components\finsh\msh_cmd.c</FilePath>
-            </File>
-          </Files>
-          <Files>
-            <File>
-              <FileName>msh_file.c</FileName>
-              <FileType>1</FileType>
-              <FilePath>..\..\components\finsh\msh_file.c</FilePath>
-            </File>
-          </Files>
         </Group>
       </Groups>
     </Target>

+ 1 - 1
bsp/es32f0654/rtconfig.h

@@ -14,7 +14,7 @@
 #define RT_USING_OVERFLOW_CHECK
 #define RT_USING_HOOK
 #define RT_USING_IDLE_HOOK
-#define RT_IDEL_HOOK_LIST_SIZE 4
+#define RT_IDLE_HOOK_LIST_SIZE 4
 #define IDLE_THREAD_STACK_SIZE 256
 #define RT_DEBUG
 #define RT_DEBUG_COLOR

+ 445 - 0
bsp/essemi/es32f0334/.config

@@ -0,0 +1,445 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# RT-Thread Configuration
+#
+
+#
+# RT-Thread Kernel
+#
+CONFIG_RT_NAME_MAX=8
+# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
+# CONFIG_RT_USING_SMP is not set
+CONFIG_RT_ALIGN_SIZE=4
+# CONFIG_RT_THREAD_PRIORITY_8 is not set
+CONFIG_RT_THREAD_PRIORITY_32=y
+# CONFIG_RT_THREAD_PRIORITY_256 is not set
+CONFIG_RT_THREAD_PRIORITY_MAX=32
+CONFIG_RT_TICK_PER_SECOND=100
+CONFIG_RT_USING_OVERFLOW_CHECK=y
+CONFIG_RT_USING_HOOK=y
+CONFIG_RT_USING_IDLE_HOOK=y
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
+CONFIG_IDLE_THREAD_STACK_SIZE=256
+# CONFIG_RT_USING_TIMER_SOFT is not set
+CONFIG_RT_DEBUG=y
+CONFIG_RT_DEBUG_COLOR=y
+# CONFIG_RT_DEBUG_INIT_CONFIG is not set
+# CONFIG_RT_DEBUG_THREAD_CONFIG is not set
+# CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set
+# CONFIG_RT_DEBUG_IPC_CONFIG is not set
+# CONFIG_RT_DEBUG_TIMER_CONFIG is not set
+# CONFIG_RT_DEBUG_IRQ_CONFIG is not set
+# CONFIG_RT_DEBUG_MEM_CONFIG is not set
+# CONFIG_RT_DEBUG_SLAB_CONFIG is not set
+# CONFIG_RT_DEBUG_MEMHEAP_CONFIG is not set
+# CONFIG_RT_DEBUG_MODULE_CONFIG is not set
+
+#
+# Inter-Thread communication
+#
+CONFIG_RT_USING_SEMAPHORE=y
+CONFIG_RT_USING_MUTEX=y
+CONFIG_RT_USING_EVENT=y
+CONFIG_RT_USING_MAILBOX=y
+CONFIG_RT_USING_MESSAGEQUEUE=y
+# CONFIG_RT_USING_SIGNALS is not set
+
+#
+# Memory Management
+#
+CONFIG_RT_USING_MEMPOOL=y
+# CONFIG_RT_USING_MEMHEAP is not set
+# CONFIG_RT_USING_NOHEAP is not set
+CONFIG_RT_USING_SMALL_MEM=y
+# CONFIG_RT_USING_SLAB is not set
+# CONFIG_RT_USING_MEMTRACE is not set
+CONFIG_RT_USING_HEAP=y
+
+#
+# Kernel Device Object
+#
+CONFIG_RT_USING_DEVICE=y
+# CONFIG_RT_USING_DEVICE_OPS is not set
+# CONFIG_RT_USING_INTERRUPT_INFO is not set
+CONFIG_RT_USING_CONSOLE=y
+CONFIG_RT_CONSOLEBUF_SIZE=128
+CONFIG_RT_CONSOLE_DEVICE_NAME="uart1"
+CONFIG_RT_VER_NUM=0x40002
+# CONFIG_RT_USING_CPU_FFS is not set
+# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
+
+#
+# RT-Thread Components
+#
+CONFIG_RT_USING_COMPONENTS_INIT=y
+CONFIG_RT_USING_USER_MAIN=y
+CONFIG_RT_MAIN_THREAD_STACK_SIZE=2048
+CONFIG_RT_MAIN_THREAD_PRIORITY=10
+
+#
+# C++ features
+#
+# CONFIG_RT_USING_CPLUSPLUS is not set
+
+#
+# Command shell
+#
+CONFIG_RT_USING_FINSH=y
+CONFIG_FINSH_THREAD_NAME="tshell"
+CONFIG_FINSH_USING_HISTORY=y
+CONFIG_FINSH_HISTORY_LINES=5
+CONFIG_FINSH_USING_SYMTAB=y
+CONFIG_FINSH_USING_DESCRIPTION=y
+# CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set
+CONFIG_FINSH_THREAD_PRIORITY=20
+CONFIG_FINSH_THREAD_STACK_SIZE=4096
+CONFIG_FINSH_CMD_SIZE=80
+# CONFIG_FINSH_USING_AUTH is not set
+CONFIG_FINSH_USING_MSH=y
+CONFIG_FINSH_USING_MSH_DEFAULT=y
+CONFIG_FINSH_USING_MSH_ONLY=y
+CONFIG_FINSH_ARG_MAX=10
+
+#
+# Device virtual file system
+#
+# CONFIG_RT_USING_DFS is not set
+
+#
+# Device Drivers
+#
+CONFIG_RT_USING_DEVICE_IPC=y
+CONFIG_RT_PIPE_BUFSZ=512
+# CONFIG_RT_USING_SYSTEM_WORKQUEUE is not set
+CONFIG_RT_USING_SERIAL=y
+# CONFIG_RT_SERIAL_USING_DMA is not set
+CONFIG_RT_SERIAL_RB_BUFSZ=64
+# CONFIG_RT_USING_CAN is not set
+# CONFIG_RT_USING_HWTIMER is not set
+# CONFIG_RT_USING_CPUTIME is not set
+# CONFIG_RT_USING_I2C is not set
+CONFIG_RT_USING_PIN=y
+# CONFIG_RT_USING_ADC is not set
+# CONFIG_RT_USING_PWM is not set
+# CONFIG_RT_USING_MTD_NOR is not set
+# CONFIG_RT_USING_MTD_NAND is not set
+# CONFIG_RT_USING_PM is not set
+# CONFIG_RT_USING_RTC is not set
+# CONFIG_RT_USING_SDIO is not set
+# CONFIG_RT_USING_SPI is not set
+# CONFIG_RT_USING_WDT is not set
+# CONFIG_RT_USING_AUDIO is not set
+# CONFIG_RT_USING_SENSOR is not set
+# CONFIG_RT_USING_TOUCH is not set
+# CONFIG_RT_USING_HWCRYPTO is not set
+# CONFIG_RT_USING_PULSE_ENCODER is not set
+# CONFIG_RT_USING_INPUT_CAPTURE is not set
+# CONFIG_RT_USING_WIFI is not set
+
+#
+# Using USB
+#
+# CONFIG_RT_USING_USB_HOST is not set
+# CONFIG_RT_USING_USB_DEVICE is not set
+
+#
+# POSIX layer and C standard library
+#
+# CONFIG_RT_USING_LIBC is not set
+# CONFIG_RT_USING_PTHREADS is not set
+# CONFIG_RT_LIBC_USING_TIME is not set
+
+#
+# Network
+#
+
+#
+# Socket abstraction layer
+#
+# CONFIG_RT_USING_SAL is not set
+
+#
+# Network interface device
+#
+# CONFIG_RT_USING_NETDEV is not set
+
+#
+# light weight TCP/IP stack
+#
+# CONFIG_RT_USING_LWIP is not set
+
+#
+# AT commands
+#
+# CONFIG_RT_USING_AT is not set
+
+#
+# VBUS(Virtual Software BUS)
+#
+# CONFIG_RT_USING_VBUS is not set
+
+#
+# Utilities
+#
+# CONFIG_RT_USING_RYM is not set
+# CONFIG_RT_USING_ULOG is not set
+# CONFIG_RT_USING_UTEST is not set
+
+#
+# RT-Thread online packages
+#
+
+#
+# IoT - internet of things
+#
+# CONFIG_PKG_USING_PAHOMQTT is not set
+# CONFIG_PKG_USING_WEBCLIENT is not set
+# CONFIG_PKG_USING_WEBNET is not set
+# CONFIG_PKG_USING_MONGOOSE is not set
+# CONFIG_PKG_USING_MYMQTT is not set
+# CONFIG_PKG_USING_WEBTERMINAL is not set
+# CONFIG_PKG_USING_CJSON is not set
+# CONFIG_PKG_USING_JSMN is not set
+# CONFIG_PKG_USING_LIBMODBUS is not set
+# CONFIG_PKG_USING_FREEMODBUS is not set
+# CONFIG_PKG_USING_LJSON is not set
+# CONFIG_PKG_USING_EZXML is not set
+# CONFIG_PKG_USING_NANOPB is not set
+
+#
+# Wi-Fi
+#
+
+#
+# Marvell WiFi
+#
+# CONFIG_PKG_USING_WLANMARVELL is not set
+
+#
+# Wiced WiFi
+#
+# CONFIG_PKG_USING_WLAN_WICED is not set
+# CONFIG_PKG_USING_RW007 is not set
+# CONFIG_PKG_USING_COAP is not set
+# CONFIG_PKG_USING_NOPOLL is not set
+# CONFIG_PKG_USING_NETUTILS is not set
+# CONFIG_PKG_USING_PPP_DEVICE is not set
+# CONFIG_PKG_USING_AT_DEVICE is not set
+# CONFIG_PKG_USING_ATSRV_SOCKET is not set
+# CONFIG_PKG_USING_WIZNET is not set
+
+#
+# IoT Cloud
+#
+# CONFIG_PKG_USING_ONENET is not set
+# CONFIG_PKG_USING_GAGENT_CLOUD is not set
+# CONFIG_PKG_USING_ALI_IOTKIT is not set
+# CONFIG_PKG_USING_AZURE is not set
+# CONFIG_PKG_USING_TENCENT_IOTHUB is not set
+# CONFIG_PKG_USING_JIOT-C-SDK is not set
+# CONFIG_PKG_USING_NIMBLE is not set
+# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
+# CONFIG_PKG_USING_IPMSG is not set
+# CONFIG_PKG_USING_LSSDP is not set
+# CONFIG_PKG_USING_AIRKISS_OPEN is not set
+# CONFIG_PKG_USING_LIBRWS is not set
+# CONFIG_PKG_USING_TCPSERVER is not set
+# CONFIG_PKG_USING_PROTOBUF_C is not set
+# CONFIG_PKG_USING_ONNX_PARSER is not set
+# CONFIG_PKG_USING_ONNX_BACKEND is not set
+# CONFIG_PKG_USING_DLT645 is not set
+# CONFIG_PKG_USING_QXWZ is not set
+# CONFIG_PKG_USING_SMTP_CLIENT is not set
+# CONFIG_PKG_USING_ABUP_FOTA is not set
+
+#
+# security packages
+#
+# CONFIG_PKG_USING_MBEDTLS is not set
+# CONFIG_PKG_USING_libsodium is not set
+# CONFIG_PKG_USING_TINYCRYPT is not set
+
+#
+# language packages
+#
+# CONFIG_PKG_USING_LUA is not set
+# CONFIG_PKG_USING_JERRYSCRIPT is not set
+# CONFIG_PKG_USING_MICROPYTHON is not set
+
+#
+# multimedia packages
+#
+# CONFIG_PKG_USING_OPENMV is not set
+# CONFIG_PKG_USING_MUPDF is not set
+# CONFIG_PKG_USING_STEMWIN is not set
+# CONFIG_PKG_USING_WAVPLAYER is not set
+# CONFIG_PKG_USING_TJPGD is not set
+
+#
+# tools packages
+#
+# CONFIG_PKG_USING_CMBACKTRACE is not set
+# CONFIG_PKG_USING_EASYFLASH is not set
+# CONFIG_PKG_USING_EASYLOGGER is not set
+# CONFIG_PKG_USING_SYSTEMVIEW is not set
+# CONFIG_PKG_USING_RDB is not set
+# CONFIG_PKG_USING_QRCODE is not set
+# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
+# CONFIG_PKG_USING_ADBD is not set
+# CONFIG_PKG_USING_COREMARK is not set
+# CONFIG_PKG_USING_DHRYSTONE is not set
+# CONFIG_PKG_USING_NR_MICRO_SHELL is not set
+
+#
+# system packages
+#
+# CONFIG_PKG_USING_GUIENGINE is not set
+# CONFIG_PKG_USING_CAIRO is not set
+# CONFIG_PKG_USING_PIXMAN is not set
+# CONFIG_PKG_USING_LWEXT4 is not set
+# CONFIG_PKG_USING_PARTITION is not set
+# CONFIG_PKG_USING_FAL is not set
+# CONFIG_PKG_USING_SQLITE is not set
+# CONFIG_PKG_USING_RTI is not set
+# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
+# CONFIG_PKG_USING_CMSIS is not set
+# CONFIG_PKG_USING_DFS_YAFFS is not set
+# CONFIG_PKG_USING_LITTLEFS is not set
+# CONFIG_PKG_USING_THREAD_POOL is not set
+# CONFIG_PKG_USING_ROBOTS is not set
+
+#
+# peripheral libraries and drivers
+#
+# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
+# CONFIG_PKG_USING_REALTEK_AMEBA is not set
+# CONFIG_PKG_USING_SHT2X is not set
+# CONFIG_PKG_USING_SHT3X is not set
+# CONFIG_PKG_USING_STM32_SDIO is not set
+# CONFIG_PKG_USING_ICM20608 is not set
+# CONFIG_PKG_USING_U8G2 is not set
+# CONFIG_PKG_USING_BUTTON is not set
+# CONFIG_PKG_USING_PCF8574 is not set
+# CONFIG_PKG_USING_SX12XX is not set
+# CONFIG_PKG_USING_SIGNAL_LED is not set
+# CONFIG_PKG_USING_LEDBLINK is not set
+# CONFIG_PKG_USING_WM_LIBRARIES is not set
+# CONFIG_PKG_USING_KENDRYTE_SDK is not set
+# CONFIG_PKG_USING_INFRARED is not set
+# CONFIG_PKG_USING_ROSSERIAL is not set
+# CONFIG_PKG_USING_AGILE_BUTTON is not set
+# CONFIG_PKG_USING_AGILE_LED is not set
+# CONFIG_PKG_USING_AT24CXX is not set
+# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set
+# CONFIG_PKG_USING_AD7746 is not set
+# CONFIG_PKG_USING_PCA9685 is not set
+# CONFIG_PKG_USING_I2C_TOOLS is not set
+# CONFIG_PKG_USING_NRF24L01 is not set
+# CONFIG_PKG_USING_TOUCH_DRIVERS is not set
+# CONFIG_PKG_USING_LCD_DRIVERS is not set
+# CONFIG_PKG_USING_MAX17048 is not set
+# CONFIG_PKG_USING_RPLIDAR is not set
+
+#
+# miscellaneous packages
+#
+# CONFIG_PKG_USING_LIBCSV is not set
+# CONFIG_PKG_USING_OPTPARSE is not set
+# CONFIG_PKG_USING_FASTLZ is not set
+# CONFIG_PKG_USING_MINILZO is not set
+# CONFIG_PKG_USING_QUICKLZ is not set
+# CONFIG_PKG_USING_MULTIBUTTON is not set
+# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
+# CONFIG_PKG_USING_CANFESTIVAL is not set
+# CONFIG_PKG_USING_ZLIB is not set
+# CONFIG_PKG_USING_DSTR is not set
+# CONFIG_PKG_USING_TINYFRAME is not set
+# CONFIG_PKG_USING_KENDRYTE_DEMO is not set
+# CONFIG_PKG_USING_DIGITALCTRL is not set
+# CONFIG_PKG_USING_UPACKER is not set
+# CONFIG_PKG_USING_UPARAM is not set
+
+#
+# samples: kernel and components samples
+#
+# CONFIG_PKG_USING_KERNEL_SAMPLES is not set
+# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
+# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
+# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
+# CONFIG_PKG_USING_HELLO is not set
+# CONFIG_PKG_USING_VI is not set
+# CONFIG_PKG_USING_NNOM is not set
+# CONFIG_PKG_USING_LIBANN is not set
+# CONFIG_PKG_USING_ELAPACK is not set
+# CONFIG_PKG_USING_ARMv7M_DWT is not set
+# CONFIG_PKG_USING_VT100 is not set
+# CONFIG_PKG_USING_ULAPACK is not set
+# CONFIG_PKG_USING_UKAL is not set
+
+#
+# Hardware Drivers Config
+#
+
+#
+# On-chip Peripheral Drivers
+#
+CONFIG_BSP_USING_GPIO=y
+
+#
+# UART Drivers
+#
+# CONFIG_BSP_USING_UART0 is not set
+CONFIG_BSP_USING_UART1=y
+
+#
+# SPI Drivers
+#
+# CONFIG_BSP_USING_SPI0 is not set
+# CONFIG_BSP_USING_SPI1 is not set
+
+#
+# I2C Drivers
+#
+# CONFIG_BSP_USING_I2C0 is not set
+# CONFIG_BSP_USING_I2C1 is not set
+
+#
+# PWM Drivers
+#
+# CONFIG_BSP_USING_PWM0 is not set
+# CONFIG_BSP_USING_PWM1 is not set
+# CONFIG_BSP_USING_PWM2 is not set
+# CONFIG_BSP_USING_PWM3 is not set
+
+#
+# HWtimer Drivers
+#
+# CONFIG_BSP_USING_HWTIMER0 is not set
+# CONFIG_BSP_USING_HWTIMER1 is not set
+# CONFIG_BSP_USING_HWTIMER2 is not set
+# CONFIG_BSP_USING_HWTIMER3 is not set
+
+#
+# RTC Drivers
+#
+# CONFIG_BSP_USING_RTC is not set
+
+#
+# PM Drivers
+#
+# CONFIG_BSP_USING_PM is not set
+
+#
+# ADC Drivers
+#
+# CONFIG_BSP_USING_ADC is not set
+
+#
+# Onboard Peripheral Drivers
+#
+# CONFIG_BSP_USING_SPI_FLASH is not set
+
+#
+# Offboard Peripheral Drivers
+#
+CONFIG_SOC_ES32F0334LT=y

+ 4 - 3
bsp/es32f0334/Kconfig → bsp/essemi/es32f0334/Kconfig

@@ -8,7 +8,7 @@ config BSP_DIR
 config RTT_DIR
     string
     option env="RTT_ROOT"
-    default "../.."
+    default "../../.."
 
 config PKGS_DIR
     string
@@ -17,9 +17,10 @@ config PKGS_DIR
 
 source "$RTT_DIR/Kconfig"
 source "$PKGS_DIR/Kconfig"
+source "drivers/Kconfig"
 
 config SOC_ES32F0334LT
     bool
+    select RT_USING_COMPONENTS_INIT
+    select RT_USING_USER_MAIN
     default y
-
-source "drivers/Kconfig"

+ 0 - 0
bsp/es32f0334/README.md → bsp/essemi/es32f0334/README.md


+ 0 - 0
bsp/es32f0334/SConscript → bsp/essemi/es32f0334/SConscript


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است