commit 26e73f451e47e6f4e8e3cffaeb3435e500f94789 Author: cbb <2625274797@qq.com> Date: Thu Dec 25 12:07:06 2025 +0800 init diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..dd5c713 --- /dev/null +++ b/.clang-format @@ -0,0 +1,7 @@ +BasedOnStyle: LLVM +UseTab: Always +IndentWidth: 4 +TabWidth: 4 +BreakBeforeBraces: Attach +AllowShortIfStatementsOnASingleLine: false +IndentCaseLabels: false diff --git a/.continue/mcpServers/new-mcp-server.yaml b/.continue/mcpServers/new-mcp-server.yaml new file mode 100644 index 0000000..0e32aa6 --- /dev/null +++ b/.continue/mcpServers/new-mcp-server.yaml @@ -0,0 +1,10 @@ +name: New MCP server +version: 0.0.1 +schema: v1 +mcpServers: + - name: New MCP server + command: npx + args: + - -y + - + env: {} diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..93ef6f1 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x86", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "C:/mingw/bin/gcc.exe", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x86", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..32da4d3 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,84 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "STLink@Arm-Debugger (launch)", + "type": "arm-debugger", + "request": "launch", + "connectionAddress": "${command:device-manager.getSerialNumber}", + "connectionType": "ST-Link", + "programs": "${command:cmsis-csolution.getBinaryFiles}", + "cmsisPack": "${command:cmsis-csolution.getDfpName}", + "deviceName": "${command:cmsis-csolution.getDeviceName}", + "processorName": "${command:cmsis-csolution.getProcessorName}", + "workspaceFolder": "${workspaceFolder}/" + }, + { + "name": "STLink@pyOCD (launch)", + "type": "gdbtarget", + "request": "launch", + "cwd": "${workspaceFolder}/", + "program": "out/Robot_V2/GD32C103CB/Release/Robot_V2.axf", + "gdb": "arm-none-eabi-gdb", + "auxiliaryGdb": true, + "preLaunchTask": "CMSIS Load", + "initCommands": [ + "monitor reset halt", + "tbreak main" + ], + "customResetCommands": [ + "monitor reset halt", + "maintenance flush register-cache", + "maintenance flush dcache", + "tbreak main", + "continue" + ], + "target": { + "server": "pyocd", + "serverParameters": [ + "gdbserver", + "--probe", + "stlink:", + "--connect", + "attach", + "--cbuild-run", + "${command:cmsis-csolution.getCbuildRunFile}", + "--quiet", + "--log", + "*.cbuild_run,*server=info" + ], + "port": "3333" + }, + "cmsis": { + "cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}", + "updateConfiguration": "auto" + } + }, + { + "name": "STLink@pyOCD (attach)", + "type": "gdbtarget", + "request": "attach", + "cwd": "${workspaceFolder}/", + "program": "out/Robot_V2/GD32C103CB/Release/Robot_V2.axf", + "gdb": "arm-none-eabi-gdb", + "auxiliaryGdb": true, + "initCommands": [ + "" + ], + "customResetCommands": [ + "monitor reset halt", + "maintenance flush register-cache", + "maintenance flush dcache", + "tbreak main", + "continue" + ], + "target": { + "port": "3333" + }, + "cmsis": { + "cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}", + "updateConfiguration": "auto" + } + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4208c90 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "clangd.arguments": [ + "--compile-commands-dir=g:\\Robot_v2\\BOOT\\out\\Robot_V2\\GD32C103CB\\Release" + ], + "debug.hideSlowPreLaunchWarning": true, + "debug.showInStatusBar": "never" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..1477a9b --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,112 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "CMSIS Load+Run", + "problemMatcher": [], + "dependsOn": [ + "CMSIS Load", + "CMSIS Run" + ], + "dependsOrder": "sequence" + }, + { + "label": "CMSIS Erase", + "type": "shell", + "command": "pyocd", + "options": { + "cwd": "${workspaceFolder}/", + "shell": { + "executable": "cmd.exe", + "args": [ + "/d", + "/c" + ] + } + }, + "args": [ + "erase", + "--probe", + "stlink:", + "--chip", + "--cbuild-run", + "${command:cmsis-csolution.getCbuildRunFile}" + ], + "problemMatcher": [] + }, + { + "label": "CMSIS Load", + "type": "shell", + "command": "pyocd", + "options": { + "cwd": "${workspaceFolder}/", + "shell": { + "executable": "cmd.exe", + "args": [ + "/d", + "/c" + ] + } + }, + "args": [ + "load", + "--probe", + "stlink:", + "--cbuild-run", + "${command:cmsis-csolution.getCbuildRunFile}" + ], + "problemMatcher": [] + }, + { + "label": "CMSIS Run", + "type": "shell", + "command": "pyocd", + "options": { + "cwd": "${workspaceFolder}/", + "shell": { + "executable": "cmd.exe", + "args": [ + "/d", + "/c" + ] + } + }, + "args": [ + "gdbserver", + "--probe", + "stlink:", + "--connect", + "attach", + "--persist", + "--reset-run", + "--cbuild-run", + "${command:cmsis-csolution.getCbuildRunFile}", + "--quiet", + "--log", + "*.cbuild_run,*server=info" + ], + "problemMatcher": [] + }, + { + "label": "CMSIS TargetInfo", + "type": "shell", + "command": "pyocd", + "options": { + "cwd": "${workspaceFolder}/", + "shell": { + "executable": "cmd.exe", + "args": [ + "/d", + "/c" + ] + } + }, + "args": [ + "list", + "--cbuild-run", + "${command:cmsis-csolution.getCbuildRunFile}" + ], + "problemMatcher": [] + } + ] +} \ No newline at end of file diff --git a/Robot_V2.cbuild-idx.yml b/Robot_V2.cbuild-idx.yml new file mode 100644 index 0000000..28e56bc --- /dev/null +++ b/Robot_V2.cbuild-idx.yml @@ -0,0 +1,17 @@ +build-idx: + generated-by: csolution version 2.12.0+p41-gfeadfc5e + cdefault: ${CMSIS_COMPILER_ROOT}/cdefault.yml + csolution: Robot_V2.csolution.yml + cbuild-run: out/Robot_V2+GD32C103CB.cbuild-run.yml + tmpdir: tmp + cprojects: + - cproject: Robot_V2/Robot_V2.cproject.yml + cbuilds: + - cbuild: out/Robot_V2/GD32C103CB/Release/Robot_V2.Release+GD32C103CB.cbuild.yml + project: Robot_V2 + configuration: .Release+GD32C103CB + messages: + info: + - Robot_V2.cbuild-pack.yml - file is already up-to-date + - Robot_V2+GD32C103CB.cbuild-run.yml - file is already up-to-date + - Robot_V2.Release+GD32C103CB.cbuild.yml - file is already up-to-date diff --git a/Robot_V2.cbuild-pack.yml b/Robot_V2.cbuild-pack.yml new file mode 100644 index 0000000..d3c7b80 --- /dev/null +++ b/Robot_V2.cbuild-pack.yml @@ -0,0 +1,8 @@ +cbuild-pack: + resolved-packs: + - resolved-pack: ARM::CMSIS@4.5.0 + selected-by-pack: + - ARM::CMSIS + - resolved-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by-pack: + - GigaDevice::GD32C10x_DFP diff --git a/Robot_V2.csolution.yml b/Robot_V2.csolution.yml new file mode 100644 index 0000000..54608ea --- /dev/null +++ b/Robot_V2.csolution.yml @@ -0,0 +1,52 @@ +# A solution is a collection of related projects that share same base configuration. +solution: + created-for: CMSIS-Toolbox@2.12.0 + cdefault: # use CMSIS-Toolbox default Compiler options + + # Compilers that can be selected + select-compiler: + - compiler: AC6 + - compiler: GCC + - compiler: IAR + - compiler: CLANG + + # List of miscellaneous tool-specific controls + misc: + - for-compiler: AC6 # GDB requires DWARF 5, remove when using uVision Debugger + C-CPP: + - -gdwarf-5 + ASM: + - -gdwarf-5 + + # List the packs that define the device and/or board. + packs: + - pack: GigaDevice::GD32C10x_DFP + - pack: ARM::CMSIS + + # List different hardware targets that are used to deploy the solution. + target-types: + - type: GD32C103CB + device: GD32C103CB + target-set: + - set: + images: + - project-context: Robot_V2.Release + debugger: + name: ST-Link@pyOCD + clock: 10000000 + protocol: swd + + # List of different build configurations. + build-types: + - type: Debug + debug: on + optimize: none + + - type: Release + debug: off + optimize: balanced + + # List related projects. + projects: + - project: Robot_V2/Robot_V2.cproject.yml + compiler: AC6 diff --git a/Robot_V2/.clangd b/Robot_V2/.clangd new file mode 100644 index 0000000..84e4f63 --- /dev/null +++ b/Robot_V2/.clangd @@ -0,0 +1,424 @@ +CompileFlags: + CompilationDatabase: g:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release + Add: + - '-D_ILP32=1' + - '-D_USE_STATIC_INLINE=1' + - '-D__APCS_32__=1' + - '-D__ARMCC_VERSION=6240002' + - '-D__ARMCOMPILER_VERSION=6240002' + - '-D__ARMEL__=1' + - '-D__ARM_32BIT_STATE=1' + - '-D__ARM_ACLE=200' + - '-D__ARM_ARCH=7' + - '-D__ARM_ARCH_7EM__=1' + - '-D__ARM_ARCH_EXT_IDIV__=1' + - '-D__ARM_ARCH_ISA_THUMB=2' + - '-D__ARM_ARCH_PROFILE=''M''' + - '-D__ARM_EABI__=1' + - '-D__ARM_FEATURE_CLZ=1' + - '-D__ARM_FEATURE_COPROC=0xf' + - '-D__ARM_FEATURE_DSP=1' + - '-D__ARM_FEATURE_FMA=1' + - '-D__ARM_FEATURE_IDIV=1' + - '-D__ARM_FEATURE_LDREX=0x7' + - '-D__ARM_FEATURE_QBIT=1' + - '-D__ARM_FEATURE_SAT=1' + - '-D__ARM_FEATURE_SIMD32=1' + - '-D__ARM_FEATURE_UNALIGNED=1' + - '-D__ARM_FP=0x6' + - '-D__ARM_FP16_ARGS=1' + - '-D__ARM_FP16_FORMAT_IEEE=1' + - '-D__ARM_NO_IMAGINARY_TYPE=1' + - '-D__ARM_PCS=1' + - '-D__ARM_PCS_VFP=1' + - '-D__ARM_PROMISE=__builtin_assume' + - '-D__ARM_SIZEOF_MINIMAL_ENUM=1' + - '-D__ARM_SIZEOF_WCHAR_T=2' + - '-D__ARM_VFPV2__=1' + - '-D__ARM_VFPV3__=1' + - '-D__ARM_VFPV4__=1' + - '-D__ATOMIC_ACQUIRE=2' + - '-D__ATOMIC_ACQ_REL=4' + - '-D__ATOMIC_CONSUME=1' + - '-D__ATOMIC_RELAXED=0' + - '-D__ATOMIC_RELEASE=3' + - '-D__ATOMIC_SEQ_CST=5' + - '-D__BIGGEST_ALIGNMENT__=8' + - '-D__BITINT_MAXWIDTH__=128' + - '-D__BOOL_WIDTH__=8' + - '-D__BYTE_ORDER__=__ORDER_LITTLE_ENDIAN__' + - '-D__CHAR16_TYPE__=unsigned short' + - '-D__CHAR32_TYPE__=unsigned int' + - '-D__CHAR_BIT__=8' + - '-D__CHAR_UNSIGNED__=1' + - '-D__CLANG_ATOMIC_BOOL_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_CHAR16_T_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_CHAR32_T_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_CHAR_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_INT_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_LLONG_LOCK_FREE=1' + - '-D__CLANG_ATOMIC_LONG_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_POINTER_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_SHORT_LOCK_FREE=2' + - '-D__CLANG_ATOMIC_WCHAR_T_LOCK_FREE=2' + - '-D__CONSTANT_CFSTRINGS__=1' + - '-D__DBL_DECIMAL_DIG__=17' + - '-D__DBL_DENORM_MIN__=4.9406564584124654e-324' + - '-D__DBL_DIG__=15' + - '-D__DBL_EPSILON__=2.2204460492503131e-16' + - '-D__DBL_HAS_DENORM__=1' + - '-D__DBL_HAS_INFINITY__=1' + - '-D__DBL_HAS_QUIET_NAN__=1' + - '-D__DBL_MANT_DIG__=53' + - '-D__DBL_MAX_10_EXP__=308' + - '-D__DBL_MAX_EXP__=1024' + - '-D__DBL_MAX__=1.7976931348623157e+308' + - '-D__DBL_MIN_10_EXP__=(-307)' + - '-D__DBL_MIN_EXP__=(-1021)' + - '-D__DBL_MIN__=2.2250738585072014e-308' + - '-D__DBL_NORM_MAX__=1.7976931348623157e+308' + - '-D__DECIMAL_DIG__=__LDBL_DECIMAL_DIG__' + - '-D__ELF__=1' + - '-D__ESCAPE__=' + - '-D__FINITE_MATH_ONLY__=1' + - '-D__FLT16_DECIMAL_DIG__=5' + - '-D__FLT16_DENORM_MIN__=5.9604644775390625e-8F16' + - '-D__FLT16_DIG__=3' + - '-D__FLT16_EPSILON__=9.765625e-4F16' + - '-D__FLT16_HAS_DENORM__=1' + - '-D__FLT16_HAS_INFINITY__=1' + - '-D__FLT16_HAS_QUIET_NAN__=1' + - '-D__FLT16_MANT_DIG__=11' + - '-D__FLT16_MAX_10_EXP__=4' + - '-D__FLT16_MAX_EXP__=16' + - '-D__FLT16_MAX__=6.5504e+4F16' + - '-D__FLT16_MIN_10_EXP__=(-4)' + - '-D__FLT16_MIN_EXP__=(-13)' + - '-D__FLT16_MIN__=6.103515625e-5F16' + - '-D__FLT16_NORM_MAX__=6.5504e+4F16' + - '-D__FLT_DECIMAL_DIG__=9' + - '-D__FLT_DENORM_MIN__=1.40129846e-45F' + - '-D__FLT_DIG__=6' + - '-D__FLT_EPSILON__=1.19209290e-7F' + - '-D__FLT_HAS_DENORM__=1' + - '-D__FLT_HAS_INFINITY__=1' + - '-D__FLT_HAS_QUIET_NAN__=1' + - '-D__FLT_MANT_DIG__=24' + - '-D__FLT_MAX_10_EXP__=38' + - '-D__FLT_MAX_EXP__=128' + - '-D__FLT_MAX__=3.40282347e+38F' + - '-D__FLT_MIN_10_EXP__=(-37)' + - '-D__FLT_MIN_EXP__=(-125)' + - '-D__FLT_MIN__=1.17549435e-38F' + - '-D__FLT_NORM_MAX__=3.40282347e+38F' + - '-D__FLT_RADIX__=2' + - '-D__FPCLASS_NEGINF=0x0004' + - '-D__FPCLASS_NEGNORMAL=0x0008' + - '-D__FPCLASS_NEGSUBNORMAL=0x0010' + - '-D__FPCLASS_NEGZERO=0x0020' + - '-D__FPCLASS_POSINF=0x0200' + - '-D__FPCLASS_POSNORMAL=0x0100' + - '-D__FPCLASS_POSSUBNORMAL=0x0080' + - '-D__FPCLASS_POSZERO=0x0040' + - '-D__FPCLASS_QNAN=0x0002' + - '-D__FPCLASS_SNAN=0x0001' + - '-D__GCC_ATOMIC_BOOL_LOCK_FREE=2' + - '-D__GCC_ATOMIC_CHAR16_T_LOCK_FREE=2' + - '-D__GCC_ATOMIC_CHAR32_T_LOCK_FREE=2' + - '-D__GCC_ATOMIC_CHAR_LOCK_FREE=2' + - '-D__GCC_ATOMIC_INT_LOCK_FREE=2' + - '-D__GCC_ATOMIC_LLONG_LOCK_FREE=1' + - '-D__GCC_ATOMIC_LONG_LOCK_FREE=2' + - '-D__GCC_ATOMIC_POINTER_LOCK_FREE=2' + - '-D__GCC_ATOMIC_SHORT_LOCK_FREE=2' + - '-D__GCC_ATOMIC_TEST_AND_SET_TRUEVAL=1' + - '-D__GCC_ATOMIC_WCHAR_T_LOCK_FREE=2' + - '-D__GCC_CONSTRUCTIVE_SIZE=64' + - '-D__GCC_DESTRUCTIVE_SIZE=64' + - '-D__GCC_HAVE_DWARF2_CFI_ASM=1' + - '-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1' + - '-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1' + - '-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1' + - '-D__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1' + - '-D__GNUC_MINOR__=2' + - '-D__GNUC_PATCHLEVEL__=1' + - '-D__GNUC_STDC_INLINE__=1' + - '-D__GNUC__=4' + - '-D__GXX_ABI_VERSION=1002' + - '-D__ILP32__=1' + - '-D__INT16_C_SUFFIX__=' + - '-D__INT16_FMTd__="hd"' + - '-D__INT16_FMTi__="hi"' + - '-D__INT16_MAX__=32767' + - '-D__INT16_TYPE__=short' + - '-D__INT32_C_SUFFIX__=' + - '-D__INT32_FMTd__="d"' + - '-D__INT32_FMTi__="i"' + - '-D__INT32_MAX__=2147483647' + - '-D__INT32_TYPE__=int' + - '-D__INT64_C_SUFFIX__=LL' + - '-D__INT64_FMTd__="lld"' + - '-D__INT64_FMTi__="lli"' + - '-D__INT64_MAX__=9223372036854775807LL' + - '-D__INT64_TYPE__=long long int' + - '-D__INT8_C_SUFFIX__=' + - '-D__INT8_FMTd__="hhd"' + - '-D__INT8_FMTi__="hhi"' + - '-D__INT8_MAX__=127' + - '-D__INT8_TYPE__=signed char' + - '-D__INTMAX_C_SUFFIX__=LL' + - '-D__INTMAX_FMTd__="lld"' + - '-D__INTMAX_FMTi__="lli"' + - '-D__INTMAX_MAX__=9223372036854775807LL' + - '-D__INTMAX_TYPE__=long long int' + - '-D__INTMAX_WIDTH__=64' + - '-D__INTPTR_FMTd__="d"' + - '-D__INTPTR_FMTi__="i"' + - '-D__INTPTR_MAX__=2147483647' + - '-D__INTPTR_TYPE__=int' + - '-D__INTPTR_WIDTH__=32' + - '-D__INT_FAST16_FMTd__="hd"' + - '-D__INT_FAST16_FMTi__="hi"' + - '-D__INT_FAST16_MAX__=32767' + - '-D__INT_FAST16_TYPE__=short' + - '-D__INT_FAST16_WIDTH__=16' + - '-D__INT_FAST32_FMTd__="d"' + - '-D__INT_FAST32_FMTi__="i"' + - '-D__INT_FAST32_MAX__=2147483647' + - '-D__INT_FAST32_TYPE__=int' + - '-D__INT_FAST32_WIDTH__=32' + - '-D__INT_FAST64_FMTd__="lld"' + - '-D__INT_FAST64_FMTi__="lli"' + - '-D__INT_FAST64_MAX__=9223372036854775807LL' + - '-D__INT_FAST64_TYPE__=long long int' + - '-D__INT_FAST64_WIDTH__=64' + - '-D__INT_FAST8_FMTd__="hhd"' + - '-D__INT_FAST8_FMTi__="hhi"' + - '-D__INT_FAST8_MAX__=127' + - '-D__INT_FAST8_TYPE__=signed char' + - '-D__INT_FAST8_WIDTH__=8' + - '-D__INT_LEAST16_FMTd__="hd"' + - '-D__INT_LEAST16_FMTi__="hi"' + - '-D__INT_LEAST16_MAX__=32767' + - '-D__INT_LEAST16_TYPE__=short' + - '-D__INT_LEAST16_WIDTH__=16' + - '-D__INT_LEAST32_FMTd__="d"' + - '-D__INT_LEAST32_FMTi__="i"' + - '-D__INT_LEAST32_MAX__=2147483647' + - '-D__INT_LEAST32_TYPE__=int' + - '-D__INT_LEAST32_WIDTH__=32' + - '-D__INT_LEAST64_FMTd__="lld"' + - '-D__INT_LEAST64_FMTi__="lli"' + - '-D__INT_LEAST64_MAX__=9223372036854775807LL' + - '-D__INT_LEAST64_TYPE__=long long int' + - '-D__INT_LEAST64_WIDTH__=64' + - '-D__INT_LEAST8_FMTd__="hhd"' + - '-D__INT_LEAST8_FMTi__="hhi"' + - '-D__INT_LEAST8_MAX__=127' + - '-D__INT_LEAST8_TYPE__=signed char' + - '-D__INT_LEAST8_WIDTH__=8' + - '-D__INT_MAX__=2147483647' + - '-D__INT_WIDTH__=32' + - '-D__I__=1.0if' + - '-D__LDBL_DECIMAL_DIG__=17' + - '-D__LDBL_DENORM_MIN__=4.9406564584124654e-324L' + - '-D__LDBL_DIG__=15' + - '-D__LDBL_EPSILON__=2.2204460492503131e-16L' + - '-D__LDBL_HAS_DENORM__=1' + - '-D__LDBL_HAS_INFINITY__=1' + - '-D__LDBL_HAS_QUIET_NAN__=1' + - '-D__LDBL_MANT_DIG__=53' + - '-D__LDBL_MAX_10_EXP__=308' + - '-D__LDBL_MAX_EXP__=1024' + - '-D__LDBL_MAX__=1.7976931348623157e+308L' + - '-D__LDBL_MIN_10_EXP__=(-307)' + - '-D__LDBL_MIN_EXP__=(-1021)' + - '-D__LDBL_MIN__=2.2250738585072014e-308L' + - '-D__LDBL_NORM_MAX__=1.7976931348623157e+308L' + - '-D__LITTLE_ENDIAN__=1' + - '-D__LLONG_WIDTH__=64' + - '-D__LONG_LONG_MAX__=9223372036854775807LL' + - '-D__LONG_MAX__=2147483647L' + - '-D__LONG_WIDTH__=32' + - '-D__MEMORY_SCOPE_DEVICE=1' + - '-D__MEMORY_SCOPE_SINGLE=4' + - '-D__MEMORY_SCOPE_SYSTEM=0' + - '-D__MEMORY_SCOPE_WRKGRP=2' + - '-D__MEMORY_SCOPE_WVFRNT=3' + - '-D__OBJC_BOOL_IS_BOOL=0' + - '-D__OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES=3' + - '-D__OPENCL_MEMORY_SCOPE_DEVICE=2' + - '-D__OPENCL_MEMORY_SCOPE_SUB_GROUP=4' + - '-D__OPENCL_MEMORY_SCOPE_WORK_GROUP=1' + - '-D__OPENCL_MEMORY_SCOPE_WORK_ITEM=0' + - '-D__OPTIMIZE__=1' + - '-D__ORDER_BIG_ENDIAN__=4321' + - '-D__ORDER_LITTLE_ENDIAN__=1234' + - '-D__ORDER_PDP_ENDIAN__=3412' + - '-D__POINTER_WIDTH__=32' + - '-D__PRAGMA_REDEFINE_EXTNAME=1' + - '-D__PTRDIFF_FMTd__="d"' + - '-D__PTRDIFF_FMTi__="i"' + - '-D__PTRDIFF_MAX__=2147483647' + - '-D__PTRDIFF_TYPE__=int' + - '-D__PTRDIFF_WIDTH__=32' + - '-D__REGISTER_PREFIX__=' + - '-D__SCHAR_MAX__=127' + - '-D__SHRT_MAX__=32767' + - '-D__SHRT_WIDTH__=16' + - '-D__SIG_ATOMIC_MAX__=2147483647' + - '-D__SIG_ATOMIC_WIDTH__=32' + - '-D__SIZEOF_DOUBLE__=8' + - '-D__SIZEOF_FLOAT__=4' + - '-D__SIZEOF_INT__=4' + - '-D__SIZEOF_LONG_DOUBLE__=8' + - '-D__SIZEOF_LONG_LONG__=8' + - '-D__SIZEOF_LONG__=4' + - '-D__SIZEOF_POINTER__=4' + - '-D__SIZEOF_PTRDIFF_T__=4' + - '-D__SIZEOF_SHORT__=2' + - '-D__SIZEOF_SIZE_T__=4' + - '-D__SIZEOF_WCHAR_T__=2' + - '-D__SIZEOF_WINT_T__=4' + - '-D__SIZE_FMTX__="X"' + - '-D__SIZE_FMTo__="o"' + - '-D__SIZE_FMTu__="u"' + - '-D__SIZE_FMTx__="x"' + - '-D__SIZE_MAX__=4294967295U' + - '-D__SIZE_TYPE__=unsigned int' + - '-D__SIZE_WIDTH__=32' + - '-D__STDC_EMBED_EMPTY__=2' + - '-D__STDC_EMBED_FOUND__=1' + - '-D__STDC_EMBED_NOT_FOUND__=0' + - '-D__STDC_HOSTED__=1' + - '-D__STDC_UTF_16__=1' + - '-D__STDC_UTF_32__=1' + - '-D__STDC_VERSION__=201710L' + - '-D__STDC__=1' + - '-D__THUMBEL__=1' + - '-D__THUMB_INTERWORK__=1' + - '-D__UINT16_C_SUFFIX__=' + - '-D__UINT16_FMTX__="hX"' + - '-D__UINT16_FMTo__="ho"' + - '-D__UINT16_FMTu__="hu"' + - '-D__UINT16_FMTx__="hx"' + - '-D__UINT16_MAX__=65535' + - '-D__UINT16_TYPE__=unsigned short' + - '-D__UINT32_C_SUFFIX__=U' + - '-D__UINT32_FMTX__="X"' + - '-D__UINT32_FMTo__="o"' + - '-D__UINT32_FMTu__="u"' + - '-D__UINT32_FMTx__="x"' + - '-D__UINT32_MAX__=4294967295U' + - '-D__UINT32_TYPE__=unsigned int' + - '-D__UINT64_C_SUFFIX__=ULL' + - '-D__UINT64_FMTX__="llX"' + - '-D__UINT64_FMTo__="llo"' + - '-D__UINT64_FMTu__="llu"' + - '-D__UINT64_FMTx__="llx"' + - '-D__UINT64_MAX__=18446744073709551615ULL' + - '-D__UINT64_TYPE__=long long unsigned int' + - '-D__UINT8_C_SUFFIX__=' + - '-D__UINT8_FMTX__="hhX"' + - '-D__UINT8_FMTo__="hho"' + - '-D__UINT8_FMTu__="hhu"' + - '-D__UINT8_FMTx__="hhx"' + - '-D__UINT8_MAX__=255' + - '-D__UINT8_TYPE__=unsigned char' + - '-D__UINTMAX_C_SUFFIX__=ULL' + - '-D__UINTMAX_FMTX__="llX"' + - '-D__UINTMAX_FMTo__="llo"' + - '-D__UINTMAX_FMTu__="llu"' + - '-D__UINTMAX_FMTx__="llx"' + - '-D__UINTMAX_MAX__=18446744073709551615ULL' + - '-D__UINTMAX_TYPE__=long long unsigned int' + - '-D__UINTMAX_WIDTH__=64' + - '-D__UINTPTR_FMTX__="X"' + - '-D__UINTPTR_FMTo__="o"' + - '-D__UINTPTR_FMTu__="u"' + - '-D__UINTPTR_FMTx__="x"' + - '-D__UINTPTR_MAX__=4294967295U' + - '-D__UINTPTR_TYPE__=unsigned int' + - '-D__UINTPTR_WIDTH__=32' + - '-D__UINT_FAST16_FMTX__="hX"' + - '-D__UINT_FAST16_FMTo__="ho"' + - '-D__UINT_FAST16_FMTu__="hu"' + - '-D__UINT_FAST16_FMTx__="hx"' + - '-D__UINT_FAST16_MAX__=65535' + - '-D__UINT_FAST16_TYPE__=unsigned short' + - '-D__UINT_FAST32_FMTX__="X"' + - '-D__UINT_FAST32_FMTo__="o"' + - '-D__UINT_FAST32_FMTu__="u"' + - '-D__UINT_FAST32_FMTx__="x"' + - '-D__UINT_FAST32_MAX__=4294967295U' + - '-D__UINT_FAST32_TYPE__=unsigned int' + - '-D__UINT_FAST64_FMTX__="llX"' + - '-D__UINT_FAST64_FMTo__="llo"' + - '-D__UINT_FAST64_FMTu__="llu"' + - '-D__UINT_FAST64_FMTx__="llx"' + - '-D__UINT_FAST64_MAX__=18446744073709551615ULL' + - '-D__UINT_FAST64_TYPE__=long long unsigned int' + - '-D__UINT_FAST8_FMTX__="hhX"' + - '-D__UINT_FAST8_FMTo__="hho"' + - '-D__UINT_FAST8_FMTu__="hhu"' + - '-D__UINT_FAST8_FMTx__="hhx"' + - '-D__UINT_FAST8_MAX__=255' + - '-D__UINT_FAST8_TYPE__=unsigned char' + - '-D__UINT_LEAST16_FMTX__="hX"' + - '-D__UINT_LEAST16_FMTo__="ho"' + - '-D__UINT_LEAST16_FMTu__="hu"' + - '-D__UINT_LEAST16_FMTx__="hx"' + - '-D__UINT_LEAST16_MAX__=65535' + - '-D__UINT_LEAST16_TYPE__=unsigned short' + - '-D__UINT_LEAST32_FMTX__="X"' + - '-D__UINT_LEAST32_FMTo__="o"' + - '-D__UINT_LEAST32_FMTu__="u"' + - '-D__UINT_LEAST32_FMTx__="x"' + - '-D__UINT_LEAST32_MAX__=4294967295U' + - '-D__UINT_LEAST32_TYPE__=unsigned int' + - '-D__UINT_LEAST64_FMTX__="llX"' + - '-D__UINT_LEAST64_FMTo__="llo"' + - '-D__UINT_LEAST64_FMTu__="llu"' + - '-D__UINT_LEAST64_FMTx__="llx"' + - '-D__UINT_LEAST64_MAX__=18446744073709551615ULL' + - '-D__UINT_LEAST64_TYPE__=long long unsigned int' + - '-D__UINT_LEAST8_FMTX__="hhX"' + - '-D__UINT_LEAST8_FMTo__="hho"' + - '-D__UINT_LEAST8_FMTu__="hhu"' + - '-D__UINT_LEAST8_FMTx__="hhx"' + - '-D__UINT_LEAST8_MAX__=255' + - '-D__UINT_LEAST8_TYPE__=unsigned char' + - '-D__USER_LABEL_PREFIX__=' + - '-D__VERSION__="Clang 20.0.0git"' + - '-D__VFP_FP__=1' + - '-D__WCHAR_MAX__=65535' + - '-D__WCHAR_TYPE__=unsigned short' + - '-D__WCHAR_UNSIGNED__=1' + - '-D__WCHAR_WIDTH__=16' + - '-D__WINT_MAX__=2147483647' + - '-D__WINT_TYPE__=int' + - '-D__WINT_WIDTH__=32' + - '-D__arm=1' + - '-D__arm__=1' + - '-D__clang__=1' + - '-D__clang_literal_encoding__="UTF-8"' + - '-D__clang_major__=20' + - '-D__clang_minor__=0' + - '-D__clang_patchlevel__=0' + - '-D__clang_version__="20.0.0git "' + - '-D__clang_wide_literal_encoding__="UTF-16"' + - '-D__llvm__=1' + - '-D__thumb2__=1' + - '-D__thumb__=1' + - '-D__ARMCOMPILER_LIBCXX=1' + - '-IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB' + - '-IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include' + - >- + -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc + - >- + -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include + - >- + -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities + - '-IG:/Robot_v2/BOOT/Robot_V2' + - '-IG:/Robot_v2/BOOT/Robot_V2/sys' + - '-IG:/Robot_v2/BOOT/Robot_V2/device' diff --git a/Robot_V2/Algorithm/DengFOC.cpp b/Robot_V2/Algorithm/DengFOC.cpp new file mode 100644 index 0000000..b824d00 --- /dev/null +++ b/Robot_V2/Algorithm/DengFOC.cpp @@ -0,0 +1,290 @@ +#include "DengFOC.h" +#include "Can.h" +#include "Timer.h" +#include "adc.h" +#include "ang_sensor.h" +#include "initial.h" +#include "pid.h" +#include +#include +#include +#include "motor.h" + +constexpr double PI = 3.1415926535897932384626433832795f; +constexpr float ANGLE_FACTOR = 25.0f / 360.0f * 2.0f * 3.14159265358979323846f; +constexpr float _1_SQRT3 = 0.57735026919f; +constexpr float _2_SQRT3 = 1.15470053838f; +constexpr float _3PI_2 = 4.71238898038f; +constexpr u8 PP = 11; +constexpr float DIR = 1.0; +constexpr float sqrt3 = 1.73205080757f; // sqrt(3)的预计算值 +constexpr float sqrt3dv2 = 0.86602540378f; // sqrt(3)/2的预计算值 +constexpr float zero_electric_angle = 0.0f; +constexpr u16 LUT_SCALE = (LUT_SIZE / (2.0f * PI)); + +FOC_Controlroller FOC; // FOC控制初始化 +extern sampler sampler; +extern angle_sensor KTH7823; +extern CAN_transmiter CAN0_transmiter; + +// 初始变量及函数定义 +#define _constrain(amt, low, high) \ + ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) +#define constrain(value, min, max, target_min, target_max) \ + ((value - min) / (max - min) * (target_max - target_min)) + +/** + * @brief 归一化角度 + * + * @param angle + * @return float + */ +inline float _normalizeAngle(float angle) { + float a = fmod(angle, 2 * PI); + // 取余运算可以用于归一化,列出特殊值例子算便知 + return a >= 0 ? a : (a + 2 * PI); +} + +// 通过Ia,Ib,Ic计算Iq,Id(目前仅输出Iq) +inline float FOC_Controlroller::cal_Iq_Id(float current_a, float current_b, + float current_c) { + // 计算电气角度 + float angle_el = _normalizeAngle(shaft_angle * PP); + + // Clarke变换 (使用三相电流) + float I_alpha = (2.0f / 3.0f) * current_a - (1.0f / 3.0f) * current_b - + (1.0f / 3.0f) * current_c; + float I_beta = _1_SQRT3 * current_b - _1_SQRT3 * current_c; + + // Park变换 + float sin_el, cos_el; + cos_el = cos_lut[(u16)(angle_el * LUT_SCALE) & LUT_MASK]; + sin_el = sin_lut[(u16)(angle_el * LUT_SCALE) & LUT_MASK]; + float I_q = I_beta * cos_el - I_alpha * sin_el; + + return I_q*1000.0f; // 返回Iq值,乘以1000以转换为mA +} + +/** + * @brief 电机控制类构造函数 + * + */ +FOC_Controlroller::FOC_Controlroller() { ; } + +/** + * @brief 设置电机输出,使用优化的SVPWM算法 + * + * @param Uq: q轴电压 + * @param Ud: d轴电压 + * @param angle_el: 电机轴角度 + */ +inline void FOC_Controlroller::setPhaseVoltage(float Uq, float Ud) { + // 计算电气角度 + float angle_el = _normalizeAngle(shaft_angle * PP); + + // 帕克逆变换 (直接计算,避免函数调用开销) + float sin_el, cos_el; + sin_el = sin_lut[(u16)(angle_el * LUT_SCALE) & LUT_MASK]; + cos_el = cos_lut[(u16)(angle_el * LUT_SCALE) & LUT_MASK]; + float Ualpha = Ud * cos_el - Uq * sin_el; + float Ubeta = Ud * sin_el + Uq * cos_el; + + // 克拉克逆变换 (使用预计算常量优化) + Ua = Ualpha + v_half; + Ub = sqrt3dv2 * Ubeta - 0.5f * Ualpha + v_half; + Uc = -0.5f * Ualpha - sqrt3dv2 * Ubeta + v_half; + + // 计算占空比并限制范围 + duty_a = _constrain(Ua / v_safe, 0.0f, 1.0f); + duty_b = _constrain(Ub / v_safe, 0.0f, 1.0f); + duty_c = _constrain(Uc / v_safe, 0.0f, 1.0f); + // 设置PWM输出 + float voltage_exchange = limit_voltage / v_safe; + duty_a = duty_a * voltage_exchange; + duty_b = duty_b * voltage_exchange; + duty_c = duty_c * voltage_exchange; + Set_3Pwm(duty_a, duty_b, duty_c); + // std::printf("PWM:%f,%f,%f\n", dc_a, dc_b, dc_c); +} + +/** + * @brief 电机关机 + * + */ +void FOC_Controlroller::shut_down() { + is_shut_down = 1; + motor_sleep(); +} +/** + * @brief 占空比置0 + * + */ +void FOC_Controlroller::drv_stop() { Set_3Pwm(0.0f, 0.0f, 0.0f); } +/** + * @brief 电机锁止 + */ +void FOC_Controlroller::drv_hold(float duty) { + if (duty > 0.95f) { + duty = 0.95f; + } else if (duty < 0.0f) { + duty = 0.0f; + } + Set_3Pwm(duty, duty, duty); +} +/** + * @brief 电机恢复 + * + */ +void FOC_Controlroller::resume() { + over_current = false; + voltage_error = false; + is_shut_down = false; + motor_resume(); +} +/** + * @brief 更新电源电压 + * + */ +void FOC_Controlroller::update_power(void) { + voltage_power_supply = sampler.get_vbus_voltage(); + if (voltage_power_supply < 36.0f and voltage_power_supply > 8.0f) { + voltage_error = false; + v_half = voltage_power_supply * 0.5f; + v_safe = voltage_power_supply * 0.95f; + } else { + voltage_error = true; + } +} + +/** + * @brief 速度开环控制 + * + * @param target_velocity: 目标速度 + * @return float: q轴电压 + */ +float FOC_Controlroller::velocity_open_loop() { + // 通过时间间隔和目标速度计算需要转动的机械角度,存储在shaft_angle中,在此之前,还需要对轴角度归一化 + // 预计算常量 1e-4 = 100微秒控制周期 + shaft_angle = + _normalizeAngle(shaft_angle + target_velocity * ANGLE_FACTOR * 1e-4f); + + // 因为在开环控制中,Ud始终为0,只控制Uq + const float Uq = voltage_power_supply / 2.0f; + + setPhaseVoltage(Uq, 0.0f); + // CAN0_transmiter.testfloat_union.f = + cal_Iq_Id(sampler.get_current('U'), sampler.get_current('V'), sampler.get_current('W')); + + return limit_voltage; +} + +/** + * @brief 电机初始化 + * + * @param _PP: 电机极队数 + */ +// void FOC_Controlroller::DFOC_alignSensor(int _PP) { +// u8 PP = _PP; +// setPhaseVoltage(3, 0, _3PI_2); +// delay_1ms(3000); +// zero_electric_angle = _electricalAngle(); +// setPhaseVoltage(0, 0, _3PI_2); +// std::printf("0电角度:%f", zero_electric_angle); +// } + +/** + * @brief 角度闭环控制 + * + * @param target_angle: 目标角度 + * @return float: 当前角度 + */ +float FOC_Controlroller::angle_control(float target_angle) { + // PID 控制计算 + float Uq = angle_loop(target_angle - rt_angle); + + // 获取电机轴角度 + shaft_angle = KTH7823.getcurrent_sensorangle() * DEG2RAD; + // 设置相电压 + setPhaseVoltage(Uq, 0.0f); + return shaft_angle; +} + +/** + * @brief 带速度限制的角度闭环控制 + * + * @param target_angle: 目标角度 + * @param max_velocity: 最大速度限制 (单位: rad/s) + * @return float: 当前角度 + */ +float FOC_Controlroller::angle_control_with_velocity_limit(float target_angle) { + // 计算角度误差 + float angle_error = target_angle - rt_angle; + + // 使用角度PID控制器计算目标速度 + float target_velocity = ang_inVelAngloop(angle_error); + + // 对目标速度进行限幅 + target_velocity = _constrain(target_velocity, -limit_velocity, limit_velocity); + + // 使用速度PID控制器计算最终输出电压 + float Uq = vel_inVelAngloop(target_velocity - rt_velocity); + // CAN0_transmiter.testfloat_union.f = target_velocity - rt_velocity; + + // 获取电机轴角度 + shaft_angle = KTH7823.getcurrent_sensorangle() * DEG2RAD; + + // 设置相电压 + setPhaseVoltage(Uq, 0.0f); + + return shaft_angle; +} + +/** + * @brief 角度闭环控制 + * + * @param target_angle: 目标角度 + * @return float: 当前角度 + */ +float FOC_Controlroller::angle_control_NPID(float target_angle) { + static float Kp = 20.0f; + // 控制力矩计算 + float Uq = _constrain(Kp * (target_angle - rt_angle), -voltage_power_supply, + voltage_power_supply); + + // 获取电机轴角度 + shaft_angle = KTH7823.getcurrent_sensorangle() * DEG2RAD; + // 设置相电压 + setPhaseVoltage(Uq, 0.0f); + return shaft_angle; +} + +/** + * @brief 速度闭环控制 + * + * @param target_velocity: 目标速度 + * @return float: 当前速度 + */ +float FOC_Controlroller::velocity_control(float target_velocity) { + // PID 控制计算 + float Uq = vel_loop((target_velocity - rt_velocity)*25); + + // 获取电机轴角度 + shaft_angle = KTH7823.getcurrent_sensorangle() * DEG2RAD; + // 设置相电压 + setPhaseVoltage(Uq, 0.0f); + // CAN0_transmiter.testfloat_union.f = + cal_Iq_Id(sampler.get_current('U'), sampler.get_current('V'), sampler.get_current('W')); + return rt_velocity; +} + +float FOC_Controlroller::current_control(float target_current) { + // PID 控制计算 + float Iq = cal_Iq_Id(sampler.get_current('U'), sampler.get_current('V'), sampler.get_current('W')); + float Uq = current_loop(target_current - Iq); + CAN0_transmiter.testfloat_union.f = Iq; + // 获取电机轴角度 + shaft_angle = KTH7823.getcurrent_sensorangle() * DEG2RAD; + // 设置相电压 + setPhaseVoltage(Uq, 0.0f); + return 1; +} \ No newline at end of file diff --git a/Robot_V2/Algorithm/DengFOC.h b/Robot_V2/Algorithm/DengFOC.h new file mode 100644 index 0000000..3a616aa --- /dev/null +++ b/Robot_V2/Algorithm/DengFOC.h @@ -0,0 +1,411 @@ +// 函数声明 +#ifndef _DENGFOC_H +#define _DENGFOC_H +#include "pid.h" +#include + +class FOC_Controlroller { + + public: + FOC_Controlroller(); + + u8 control_mode = 0; + float limit_voltage = 0.0f; + float limit_velocity = 0.0f; + float target_angle = 0.0f; + float target_velocity = 0.0f; + float rt_angle = 0.0f; + float rt_velocity = 0.0f; + bool over_current = false; + bool voltage_error = false; + bool is_shut_down = false; + float voltage_power_supply = 24.0f; // 电源电压 + float v_safe = voltage_power_supply * 1.05f; + float duty_a = 0, duty_b = 0, duty_c = 0; + float Ua = 0, Ub = 0, Uc = 0; + float velocity_open_loop(); + float angle_control(float target_angle); + float angle_control_with_velocity_limit(float target_angle); + float velocity_control(float target_velocity); + float current_control(float target_current); + float angle_control_NPID(float target_angle); + + void update_power(void); + void DFOC_alignSensor(int _PP); + void shut_down(void); + void resume(void); + void drv_stop(void); + void drv_hold(float duty = 0.5f); + + protected: + float shaft_angle = 0; + float Ualpha, Ubeta = 0; + float zero_electric_angle = 0; + float v_half = voltage_power_supply * 0.5f; // 电源电压的一半 + + PIDController vel_loop = + PIDController{0.028f, 0.2f, 1e-4, 1000000, voltage_power_supply}; // 12V + PIDController angle_loop = PIDController{20.0f, 100.0f, 0.2f, 10000000, + voltage_power_supply}; // 12V + PIDController current_loop = + PIDController{0.006f, 0.02f, 0, 100000, voltage_power_supply}; // 12V + PIDController vel_inVelAngloop = + PIDController{0.35f, 5.0f,1e-3, 1000000, voltage_power_supply}; + PIDController ang_inVelAngloop = + PIDController{30.0f, 0.0f, 1e-3, 1000000, 999}; + + void setPhaseVoltage(float Uq, float Ud); + float cal_Iq_Id(float current_a, float current_b, float current_c); +}; + +float _normalizeAngle(float angle); +inline float _electricalAngle(); + +constexpr u16 LUT_SIZE = 1024; +constexpr u16 LUT_MASK = (LUT_SIZE - 1); + +__attribute__((aligned(4))) const float sin_lut[LUT_SIZE] = { + 0.000000f, 0.006136f, 0.012272f, 0.018407f, 0.024541f, 0.030675f, + 0.036807f, 0.042938f, 0.049068f, 0.055195f, 0.061321f, 0.067444f, + 0.073565f, 0.079682f, 0.085797f, 0.091909f, 0.098017f, 0.104122f, + 0.110222f, 0.116319f, 0.122411f, 0.128498f, 0.134581f, 0.140658f, + 0.146730f, 0.152797f, 0.158858f, 0.164913f, 0.170962f, 0.177004f, + 0.183040f, 0.189069f, 0.195090f, 0.201105f, 0.207111f, 0.213110f, + 0.219101f, 0.225084f, 0.231058f, 0.237024f, 0.242980f, 0.248928f, + 0.254866f, 0.260794f, 0.266713f, 0.272621f, 0.278520f, 0.284408f, + 0.290285f, 0.296151f, 0.302006f, 0.307850f, 0.313682f, 0.319502f, + 0.325310f, 0.331106f, 0.336890f, 0.342661f, 0.348419f, 0.354164f, + 0.359895f, 0.365613f, 0.371317f, 0.377007f, 0.382683f, 0.388345f, + 0.393992f, 0.399624f, 0.405241f, 0.410843f, 0.416430f, 0.422000f, + 0.427555f, 0.433094f, 0.438616f, 0.444122f, 0.449611f, 0.455084f, + 0.460539f, 0.465976f, 0.471397f, 0.476799f, 0.482184f, 0.487550f, + 0.492898f, 0.498228f, 0.503538f, 0.508830f, 0.514103f, 0.519356f, + 0.524590f, 0.529804f, 0.534998f, 0.540171f, 0.545325f, 0.550458f, + 0.555570f, 0.560662f, 0.565732f, 0.570781f, 0.575808f, 0.580814f, + 0.585798f, 0.590760f, 0.595699f, 0.600616f, 0.605511f, 0.610383f, + 0.615232f, 0.620057f, 0.624859f, 0.629638f, 0.634393f, 0.639124f, + 0.643832f, 0.648514f, 0.653173f, 0.657807f, 0.662416f, 0.667000f, + 0.671559f, 0.676093f, 0.680601f, 0.685084f, 0.689541f, 0.693971f, + 0.698376f, 0.702755f, 0.707107f, 0.711432f, 0.715731f, 0.720003f, + 0.724247f, 0.728464f, 0.732654f, 0.736817f, 0.740951f, 0.745058f, + 0.749136f, 0.753187f, 0.757209f, 0.761202f, 0.765167f, 0.769103f, + 0.773010f, 0.776888f, 0.780737f, 0.784557f, 0.788346f, 0.792107f, + 0.795837f, 0.799537f, 0.803208f, 0.806848f, 0.810457f, 0.814036f, + 0.817585f, 0.821103f, 0.824589f, 0.828045f, 0.831470f, 0.834863f, + 0.838225f, 0.841555f, 0.844854f, 0.848120f, 0.851355f, 0.854558f, + 0.857729f, 0.860867f, 0.863973f, 0.867046f, 0.870087f, 0.873095f, + 0.876070f, 0.879012f, 0.881921f, 0.884797f, 0.887640f, 0.890449f, + 0.893224f, 0.895966f, 0.898674f, 0.901349f, 0.903989f, 0.906596f, + 0.909168f, 0.911706f, 0.914210f, 0.916679f, 0.919114f, 0.921514f, + 0.923880f, 0.926210f, 0.928506f, 0.930767f, 0.932993f, 0.935184f, + 0.937339f, 0.939459f, 0.941544f, 0.943593f, 0.945607f, 0.947586f, + 0.949528f, 0.951435f, 0.953306f, 0.955141f, 0.956940f, 0.958703f, + 0.960431f, 0.962121f, 0.963776f, 0.965394f, 0.966976f, 0.968522f, + 0.970031f, 0.971504f, 0.972940f, 0.974339f, 0.975702f, 0.977028f, + 0.978317f, 0.979570f, 0.980785f, 0.981964f, 0.983105f, 0.984210f, + 0.985278f, 0.986308f, 0.987301f, 0.988258f, 0.989177f, 0.990058f, + 0.990903f, 0.991710f, 0.992480f, 0.993212f, 0.993907f, 0.994565f, + 0.995185f, 0.995767f, 0.996313f, 0.996820f, 0.997290f, 0.997723f, + 0.998118f, 0.998476f, 0.998795f, 0.999078f, 0.999322f, 0.999529f, + 0.999699f, 0.999831f, 0.999925f, 0.999981f, 1.000000f, 0.999981f, + 0.999925f, 0.999831f, 0.999699f, 0.999529f, 0.999322f, 0.999078f, + 0.998795f, 0.998476f, 0.998118f, 0.997723f, 0.997290f, 0.996820f, + 0.996313f, 0.995767f, 0.995185f, 0.994565f, 0.993907f, 0.993212f, + 0.992480f, 0.991710f, 0.990903f, 0.990058f, 0.989177f, 0.988258f, + 0.987301f, 0.986308f, 0.985278f, 0.984210f, 0.983105f, 0.981964f, + 0.980785f, 0.979570f, 0.978317f, 0.977028f, 0.975702f, 0.974339f, + 0.972940f, 0.971504f, 0.970031f, 0.968522f, 0.966976f, 0.965394f, + 0.963776f, 0.962121f, 0.960431f, 0.958703f, 0.956940f, 0.955141f, + 0.953306f, 0.951435f, 0.949528f, 0.947586f, 0.945607f, 0.943593f, + 0.941544f, 0.939459f, 0.937339f, 0.935184f, 0.932993f, 0.930767f, + 0.928506f, 0.926210f, 0.923880f, 0.921514f, 0.919114f, 0.916679f, + 0.914210f, 0.911706f, 0.909168f, 0.906596f, 0.903989f, 0.901349f, + 0.898674f, 0.895966f, 0.893224f, 0.890449f, 0.887640f, 0.884797f, + 0.881921f, 0.879012f, 0.876070f, 0.873095f, 0.870087f, 0.867046f, + 0.863973f, 0.860867f, 0.857729f, 0.854558f, 0.851355f, 0.848120f, + 0.844854f, 0.841555f, 0.838225f, 0.834863f, 0.831470f, 0.828045f, + 0.824589f, 0.821103f, 0.817585f, 0.814036f, 0.810457f, 0.806848f, + 0.803208f, 0.799537f, 0.795837f, 0.792107f, 0.788346f, 0.784557f, + 0.780737f, 0.776888f, 0.773010f, 0.769103f, 0.765167f, 0.761202f, + 0.757209f, 0.753187f, 0.749136f, 0.745058f, 0.740951f, 0.736817f, + 0.732654f, 0.728464f, 0.724247f, 0.720003f, 0.715731f, 0.711432f, + 0.707107f, 0.702755f, 0.698376f, 0.693971f, 0.689541f, 0.685084f, + 0.680601f, 0.676093f, 0.671559f, 0.667000f, 0.662416f, 0.657807f, + 0.653173f, 0.648514f, 0.643832f, 0.639124f, 0.634393f, 0.629638f, + 0.624859f, 0.620057f, 0.615232f, 0.610383f, 0.605511f, 0.600616f, + 0.595699f, 0.590760f, 0.585798f, 0.580814f, 0.575808f, 0.570781f, + 0.565732f, 0.560662f, 0.555570f, 0.550458f, 0.545325f, 0.540171f, + 0.534998f, 0.529804f, 0.524590f, 0.519356f, 0.514103f, 0.508830f, + 0.503538f, 0.498228f, 0.492898f, 0.487550f, 0.482184f, 0.476799f, + 0.471397f, 0.465976f, 0.460539f, 0.455084f, 0.449611f, 0.444122f, + 0.438616f, 0.433094f, 0.427555f, 0.422000f, 0.416430f, 0.410843f, + 0.405241f, 0.399624f, 0.393992f, 0.388345f, 0.382683f, 0.377007f, + 0.371317f, 0.365613f, 0.359895f, 0.354164f, 0.348419f, 0.342661f, + 0.336890f, 0.331106f, 0.325310f, 0.319502f, 0.313682f, 0.307850f, + 0.302006f, 0.296151f, 0.290285f, 0.284408f, 0.278520f, 0.272621f, + 0.266713f, 0.260794f, 0.254866f, 0.248928f, 0.242980f, 0.237024f, + 0.231058f, 0.225084f, 0.219101f, 0.213110f, 0.207111f, 0.201105f, + 0.195090f, 0.189069f, 0.183040f, 0.177004f, 0.170962f, 0.164913f, + 0.158858f, 0.152797f, 0.146730f, 0.140658f, 0.134581f, 0.128498f, + 0.122411f, 0.116319f, 0.110222f, 0.104122f, 0.098017f, 0.091909f, + 0.085797f, 0.079682f, 0.073565f, 0.067444f, 0.061321f, 0.055195f, + 0.049068f, 0.042938f, 0.036807f, 0.030675f, 0.024541f, 0.018407f, + 0.012272f, 0.006136f, 0.000000f, -0.006136f, -0.012272f, -0.018407f, + -0.024541f, -0.030675f, -0.036807f, -0.042938f, -0.049068f, -0.055195f, + -0.061321f, -0.067444f, -0.073565f, -0.079682f, -0.085797f, -0.091909f, + -0.098017f, -0.104122f, -0.110222f, -0.116319f, -0.122411f, -0.128498f, + -0.134581f, -0.140658f, -0.146730f, -0.152797f, -0.158858f, -0.164913f, + -0.170962f, -0.177004f, -0.183040f, -0.189069f, -0.195090f, -0.201105f, + -0.207111f, -0.213110f, -0.219101f, -0.225084f, -0.231058f, -0.237024f, + -0.242980f, -0.248928f, -0.254866f, -0.260794f, -0.266713f, -0.272621f, + -0.278520f, -0.284408f, -0.290285f, -0.296151f, -0.302006f, -0.307850f, + -0.313682f, -0.319502f, -0.325310f, -0.331106f, -0.336890f, -0.342661f, + -0.348419f, -0.354164f, -0.359895f, -0.365613f, -0.371317f, -0.377007f, + -0.382683f, -0.388345f, -0.393992f, -0.399624f, -0.405241f, -0.410843f, + -0.416430f, -0.422000f, -0.427555f, -0.433094f, -0.438616f, -0.444122f, + -0.449611f, -0.455084f, -0.460539f, -0.465976f, -0.471397f, -0.476799f, + -0.482184f, -0.487550f, -0.492898f, -0.498228f, -0.503538f, -0.508830f, + -0.514103f, -0.519356f, -0.524590f, -0.529804f, -0.534998f, -0.540171f, + -0.545325f, -0.550458f, -0.555570f, -0.560662f, -0.565732f, -0.570781f, + -0.575808f, -0.580814f, -0.585798f, -0.590760f, -0.595699f, -0.600616f, + -0.605511f, -0.610383f, -0.615232f, -0.620057f, -0.624859f, -0.629638f, + -0.634393f, -0.639124f, -0.643832f, -0.648514f, -0.653173f, -0.657807f, + -0.662416f, -0.667000f, -0.671559f, -0.676093f, -0.680601f, -0.685084f, + -0.689541f, -0.693971f, -0.698376f, -0.702755f, -0.707107f, -0.711432f, + -0.715731f, -0.720003f, -0.724247f, -0.728464f, -0.732654f, -0.736817f, + -0.740951f, -0.745058f, -0.749136f, -0.753187f, -0.757209f, -0.761202f, + -0.765167f, -0.769103f, -0.773010f, -0.776888f, -0.780737f, -0.784557f, + -0.788346f, -0.792107f, -0.795837f, -0.799537f, -0.803208f, -0.806848f, + -0.810457f, -0.814036f, -0.817585f, -0.821103f, -0.824589f, -0.828045f, + -0.831470f, -0.834863f, -0.838225f, -0.841555f, -0.844854f, -0.848120f, + -0.851355f, -0.854558f, -0.857729f, -0.860867f, -0.863973f, -0.867046f, + -0.870087f, -0.873095f, -0.876070f, -0.879012f, -0.881921f, -0.884797f, + -0.887640f, -0.890449f, -0.893224f, -0.895966f, -0.898674f, -0.901349f, + -0.903989f, -0.906596f, -0.909168f, -0.911706f, -0.914210f, -0.916679f, + -0.919114f, -0.921514f, -0.923880f, -0.926210f, -0.928506f, -0.930767f, + -0.932993f, -0.935184f, -0.937339f, -0.939459f, -0.941544f, -0.943593f, + -0.945607f, -0.947586f, -0.949528f, -0.951435f, -0.953306f, -0.955141f, + -0.956940f, -0.958703f, -0.960431f, -0.962121f, -0.963776f, -0.965394f, + -0.966976f, -0.968522f, -0.970031f, -0.971504f, -0.972940f, -0.974339f, + -0.975702f, -0.977028f, -0.978317f, -0.979570f, -0.980785f, -0.981964f, + -0.983105f, -0.984210f, -0.985278f, -0.986308f, -0.987301f, -0.988258f, + -0.989177f, -0.990058f, -0.990903f, -0.991710f, -0.992480f, -0.993212f, + -0.993907f, -0.994565f, -0.995185f, -0.995767f, -0.996313f, -0.996820f, + -0.997290f, -0.997723f, -0.998118f, -0.998476f, -0.998795f, -0.999078f, + -0.999322f, -0.999529f, -0.999699f, -0.999831f, -0.999925f, -0.999981f, + -1.000000f, -0.999981f, -0.999925f, -0.999831f, -0.999699f, -0.999529f, + -0.999322f, -0.999078f, -0.998795f, -0.998476f, -0.998118f, -0.997723f, + -0.997290f, -0.996820f, -0.996313f, -0.995767f, -0.995185f, -0.994565f, + -0.993907f, -0.993212f, -0.992480f, -0.991710f, -0.990903f, -0.990058f, + -0.989177f, -0.988258f, -0.987301f, -0.986308f, -0.985278f, -0.984210f, + -0.983105f, -0.981964f, -0.980785f, -0.979570f, -0.978317f, -0.977028f, + -0.975702f, -0.974339f, -0.972940f, -0.971504f, -0.970031f, -0.968522f, + -0.966976f, -0.965394f, -0.963776f, -0.962121f, -0.960431f, -0.958703f, + -0.956940f, -0.955141f, -0.953306f, -0.951435f, -0.949528f, -0.947586f, + -0.945607f, -0.943593f, -0.941544f, -0.939459f, -0.937339f, -0.935184f, + -0.932993f, -0.930767f, -0.928506f, -0.926210f, -0.923880f, -0.921514f, + -0.919114f, -0.916679f, -0.914210f, -0.911706f, -0.909168f, -0.906596f, + -0.903989f, -0.901349f, -0.898674f, -0.895966f, -0.893224f, -0.890449f, + -0.887640f, -0.884797f, -0.881921f, -0.879012f, -0.876070f, -0.873095f, + -0.870087f, -0.867046f, -0.863973f, -0.860867f, -0.857729f, -0.854558f, + -0.851355f, -0.848120f, -0.844854f, -0.841555f, -0.838225f, -0.834863f, + -0.831470f, -0.828045f, -0.824589f, -0.821103f, -0.817585f, -0.814036f, + -0.810457f, -0.806848f, -0.803208f, -0.799537f, -0.795837f, -0.792107f, + -0.788346f, -0.784557f, -0.780737f, -0.776888f, -0.773010f, -0.769103f, + -0.765167f, -0.761202f, -0.757209f, -0.753187f, -0.749136f, -0.745058f, + -0.740951f, -0.736817f, -0.732654f, -0.728464f, -0.724247f, -0.720003f, + -0.715731f, -0.711432f, -0.707107f, -0.702755f, -0.698376f, -0.693971f, + -0.689541f, -0.685084f, -0.680601f, -0.676093f, -0.671559f, -0.667000f, + -0.662416f, -0.657807f, -0.653173f, -0.648514f, -0.643832f, -0.639124f, + -0.634393f, -0.629638f, -0.624859f, -0.620057f, -0.615232f, -0.610383f, + -0.605511f, -0.600616f, -0.595699f, -0.590760f, -0.585798f, -0.580814f, + -0.575808f, -0.570781f, -0.565732f, -0.560662f, -0.555570f, -0.550458f, + -0.545325f, -0.540171f, -0.534998f, -0.529804f, -0.524590f, -0.519356f, + -0.514103f, -0.508830f, -0.503538f, -0.498228f, -0.492898f, -0.487550f, + -0.482184f, -0.476799f, -0.471397f, -0.465976f, -0.460539f, -0.455084f, + -0.449611f, -0.444122f, -0.438616f, -0.433094f, -0.427555f, -0.422000f, + -0.416430f, -0.410843f, -0.405241f, -0.399624f, -0.393992f, -0.388345f, + -0.382683f, -0.377007f, -0.371317f, -0.365613f, -0.359895f, -0.354164f, + -0.348419f, -0.342661f, -0.336890f, -0.331106f, -0.325310f, -0.319502f, + -0.313682f, -0.307850f, -0.302006f, -0.296151f, -0.290285f, -0.284408f, + -0.278520f, -0.272621f, -0.266713f, -0.260794f, -0.254866f, -0.248928f, + -0.242980f, -0.237024f, -0.231058f, -0.225084f, -0.219101f, -0.213110f, + -0.207111f, -0.201105f, -0.195090f, -0.189069f, -0.183040f, -0.177004f, + -0.170962f, -0.164913f, -0.158858f, -0.152797f, -0.146730f, -0.140658f, + -0.134581f, -0.128498f, -0.122411f, -0.116319f, -0.110222f, -0.104122f, + -0.098017f, -0.091909f, -0.085797f, -0.079682f, -0.073565f, -0.067444f, + -0.061321f, -0.055195f, -0.049068f, -0.042938f, -0.036807f, -0.030675f, + -0.024541f, -0.018407f, -0.012272f, -0.006136f}; +__attribute__((aligned(4))) const float cos_lut[LUT_SIZE] = { + 1.000000f, 0.999981f, 0.999925f, 0.999831f, 0.999699f, 0.999529f, + 0.999322f, 0.999078f, 0.998795f, 0.998476f, 0.998118f, 0.997723f, + 0.997290f, 0.996820f, 0.996313f, 0.995767f, 0.995185f, 0.994565f, + 0.993907f, 0.993212f, 0.992480f, 0.991710f, 0.990903f, 0.990058f, + 0.989177f, 0.988258f, 0.987301f, 0.986308f, 0.985278f, 0.984210f, + 0.983105f, 0.981964f, 0.980785f, 0.979570f, 0.978317f, 0.977028f, + 0.975702f, 0.974339f, 0.972940f, 0.971504f, 0.970031f, 0.968522f, + 0.966976f, 0.965394f, 0.963776f, 0.962121f, 0.960431f, 0.958703f, + 0.956940f, 0.955141f, 0.953306f, 0.951435f, 0.949528f, 0.947586f, + 0.945607f, 0.943593f, 0.941544f, 0.939459f, 0.937339f, 0.935184f, + 0.932993f, 0.930767f, 0.928506f, 0.926210f, 0.923880f, 0.921514f, + 0.919114f, 0.916679f, 0.914210f, 0.911706f, 0.909168f, 0.906596f, + 0.903989f, 0.901349f, 0.898674f, 0.895966f, 0.893224f, 0.890449f, + 0.887640f, 0.884797f, 0.881921f, 0.879012f, 0.876070f, 0.873095f, + 0.870087f, 0.867046f, 0.863973f, 0.860867f, 0.857729f, 0.854558f, + 0.851355f, 0.848120f, 0.844854f, 0.841555f, 0.838225f, 0.834863f, + 0.831470f, 0.828045f, 0.824589f, 0.821103f, 0.817585f, 0.814036f, + 0.810457f, 0.806848f, 0.803208f, 0.799537f, 0.795837f, 0.792107f, + 0.788346f, 0.784557f, 0.780737f, 0.776888f, 0.773010f, 0.769103f, + 0.765167f, 0.761202f, 0.757209f, 0.753187f, 0.749136f, 0.745058f, + 0.740951f, 0.736817f, 0.732654f, 0.728464f, 0.724247f, 0.720003f, + 0.715731f, 0.711432f, 0.707107f, 0.702755f, 0.698376f, 0.693971f, + 0.689541f, 0.685084f, 0.680601f, 0.676093f, 0.671559f, 0.667000f, + 0.662416f, 0.657807f, 0.653173f, 0.648514f, 0.643832f, 0.639124f, + 0.634393f, 0.629638f, 0.624859f, 0.620057f, 0.615232f, 0.610383f, + 0.605511f, 0.600616f, 0.595699f, 0.590760f, 0.585798f, 0.580814f, + 0.575808f, 0.570781f, 0.565732f, 0.560662f, 0.555570f, 0.550458f, + 0.545325f, 0.540171f, 0.534998f, 0.529804f, 0.524590f, 0.519356f, + 0.514103f, 0.508830f, 0.503538f, 0.498228f, 0.492898f, 0.487550f, + 0.482184f, 0.476799f, 0.471397f, 0.465976f, 0.460539f, 0.455084f, + 0.449611f, 0.444122f, 0.438616f, 0.433094f, 0.427555f, 0.422000f, + 0.416430f, 0.410843f, 0.405241f, 0.399624f, 0.393992f, 0.388345f, + 0.382683f, 0.377007f, 0.371317f, 0.365613f, 0.359895f, 0.354164f, + 0.348419f, 0.342661f, 0.336890f, 0.331106f, 0.325310f, 0.319502f, + 0.313682f, 0.307850f, 0.302006f, 0.296151f, 0.290285f, 0.284408f, + 0.278520f, 0.272621f, 0.266713f, 0.260794f, 0.254866f, 0.248928f, + 0.242980f, 0.237024f, 0.231058f, 0.225084f, 0.219101f, 0.213110f, + 0.207111f, 0.201105f, 0.195090f, 0.189069f, 0.183040f, 0.177004f, + 0.170962f, 0.164913f, 0.158858f, 0.152797f, 0.146730f, 0.140658f, + 0.134581f, 0.128498f, 0.122411f, 0.116319f, 0.110222f, 0.104122f, + 0.098017f, 0.091909f, 0.085797f, 0.079682f, 0.073565f, 0.067444f, + 0.061321f, 0.055195f, 0.049068f, 0.042938f, 0.036807f, 0.030675f, + 0.024541f, 0.018407f, 0.012272f, 0.006136f, 0.000000f, -0.006136f, + -0.012272f, -0.018407f, -0.024541f, -0.030675f, -0.036807f, -0.042938f, + -0.049068f, -0.055195f, -0.061321f, -0.067444f, -0.073565f, -0.079682f, + -0.085797f, -0.091909f, -0.098017f, -0.104122f, -0.110222f, -0.116319f, + -0.122411f, -0.128498f, -0.134581f, -0.140658f, -0.146730f, -0.152797f, + -0.158858f, -0.164913f, -0.170962f, -0.177004f, -0.183040f, -0.189069f, + -0.195090f, -0.201105f, -0.207111f, -0.213110f, -0.219101f, -0.225084f, + -0.231058f, -0.237024f, -0.242980f, -0.248928f, -0.254866f, -0.260794f, + -0.266713f, -0.272621f, -0.278520f, -0.284408f, -0.290285f, -0.296151f, + -0.302006f, -0.307850f, -0.313682f, -0.319502f, -0.325310f, -0.331106f, + -0.336890f, -0.342661f, -0.348419f, -0.354164f, -0.359895f, -0.365613f, + -0.371317f, -0.377007f, -0.382683f, -0.388345f, -0.393992f, -0.399624f, + -0.405241f, -0.410843f, -0.416430f, -0.422000f, -0.427555f, -0.433094f, + -0.438616f, -0.444122f, -0.449611f, -0.455084f, -0.460539f, -0.465976f, + -0.471397f, -0.476799f, -0.482184f, -0.487550f, -0.492898f, -0.498228f, + -0.503538f, -0.508830f, -0.514103f, -0.519356f, -0.524590f, -0.529804f, + -0.534998f, -0.540171f, -0.545325f, -0.550458f, -0.555570f, -0.560662f, + -0.565732f, -0.570781f, -0.575808f, -0.580814f, -0.585798f, -0.590760f, + -0.595699f, -0.600616f, -0.605511f, -0.610383f, -0.615232f, -0.620057f, + -0.624859f, -0.629638f, -0.634393f, -0.639124f, -0.643832f, -0.648514f, + -0.653173f, -0.657807f, -0.662416f, -0.667000f, -0.671559f, -0.676093f, + -0.680601f, -0.685084f, -0.689541f, -0.693971f, -0.698376f, -0.702755f, + -0.707107f, -0.711432f, -0.715731f, -0.720003f, -0.724247f, -0.728464f, + -0.732654f, -0.736817f, -0.740951f, -0.745058f, -0.749136f, -0.753187f, + -0.757209f, -0.761202f, -0.765167f, -0.769103f, -0.773010f, -0.776888f, + -0.780737f, -0.784557f, -0.788346f, -0.792107f, -0.795837f, -0.799537f, + -0.803208f, -0.806848f, -0.810457f, -0.814036f, -0.817585f, -0.821103f, + -0.824589f, -0.828045f, -0.831470f, -0.834863f, -0.838225f, -0.841555f, + -0.844854f, -0.848120f, -0.851355f, -0.854558f, -0.857729f, -0.860867f, + -0.863973f, -0.867046f, -0.870087f, -0.873095f, -0.876070f, -0.879012f, + -0.881921f, -0.884797f, -0.887640f, -0.890449f, -0.893224f, -0.895966f, + -0.898674f, -0.901349f, -0.903989f, -0.906596f, -0.909168f, -0.911706f, + -0.914210f, -0.916679f, -0.919114f, -0.921514f, -0.923880f, -0.926210f, + -0.928506f, -0.930767f, -0.932993f, -0.935184f, -0.937339f, -0.939459f, + -0.941544f, -0.943593f, -0.945607f, -0.947586f, -0.949528f, -0.951435f, + -0.953306f, -0.955141f, -0.956940f, -0.958703f, -0.960431f, -0.962121f, + -0.963776f, -0.965394f, -0.966976f, -0.968522f, -0.970031f, -0.971504f, + -0.972940f, -0.974339f, -0.975702f, -0.977028f, -0.978317f, -0.979570f, + -0.980785f, -0.981964f, -0.983105f, -0.984210f, -0.985278f, -0.986308f, + -0.987301f, -0.988258f, -0.989177f, -0.990058f, -0.990903f, -0.991710f, + -0.992480f, -0.993212f, -0.993907f, -0.994565f, -0.995185f, -0.995767f, + -0.996313f, -0.996820f, -0.997290f, -0.997723f, -0.998118f, -0.998476f, + -0.998795f, -0.999078f, -0.999322f, -0.999529f, -0.999699f, -0.999831f, + -0.999925f, -0.999981f, -1.000000f, -0.999981f, -0.999925f, -0.999831f, + -0.999699f, -0.999529f, -0.999322f, -0.999078f, -0.998795f, -0.998476f, + -0.998118f, -0.997723f, -0.997290f, -0.996820f, -0.996313f, -0.995767f, + -0.995185f, -0.994565f, -0.993907f, -0.993212f, -0.992480f, -0.991710f, + -0.990903f, -0.990058f, -0.989177f, -0.988258f, -0.987301f, -0.986308f, + -0.985278f, -0.984210f, -0.983105f, -0.981964f, -0.980785f, -0.979570f, + -0.978317f, -0.977028f, -0.975702f, -0.974339f, -0.972940f, -0.971504f, + -0.970031f, -0.968522f, -0.966976f, -0.965394f, -0.963776f, -0.962121f, + -0.960431f, -0.958703f, -0.956940f, -0.955141f, -0.953306f, -0.951435f, + -0.949528f, -0.947586f, -0.945607f, -0.943593f, -0.941544f, -0.939459f, + -0.937339f, -0.935184f, -0.932993f, -0.930767f, -0.928506f, -0.926210f, + -0.923880f, -0.921514f, -0.919114f, -0.916679f, -0.914210f, -0.911706f, + -0.909168f, -0.906596f, -0.903989f, -0.901349f, -0.898674f, -0.895966f, + -0.893224f, -0.890449f, -0.887640f, -0.884797f, -0.881921f, -0.879012f, + -0.876070f, -0.873095f, -0.870087f, -0.867046f, -0.863973f, -0.860867f, + -0.857729f, -0.854558f, -0.851355f, -0.848120f, -0.844854f, -0.841555f, + -0.838225f, -0.834863f, -0.831470f, -0.828045f, -0.824589f, -0.821103f, + -0.817585f, -0.814036f, -0.810457f, -0.806848f, -0.803208f, -0.799537f, + -0.795837f, -0.792107f, -0.788346f, -0.784557f, -0.780737f, -0.776888f, + -0.773010f, -0.769103f, -0.765167f, -0.761202f, -0.757209f, -0.753187f, + -0.749136f, -0.745058f, -0.740951f, -0.736817f, -0.732654f, -0.728464f, + -0.724247f, -0.720003f, -0.715731f, -0.711432f, -0.707107f, -0.702755f, + -0.698376f, -0.693971f, -0.689541f, -0.685084f, -0.680601f, -0.676093f, + -0.671559f, -0.667000f, -0.662416f, -0.657807f, -0.653173f, -0.648514f, + -0.643832f, -0.639124f, -0.634393f, -0.629638f, -0.624859f, -0.620057f, + -0.615232f, -0.610383f, -0.605511f, -0.600616f, -0.595699f, -0.590760f, + -0.585798f, -0.580814f, -0.575808f, -0.570781f, -0.565732f, -0.560662f, + -0.555570f, -0.550458f, -0.545325f, -0.540171f, -0.534998f, -0.529804f, + -0.524590f, -0.519356f, -0.514103f, -0.508830f, -0.503538f, -0.498228f, + -0.492898f, -0.487550f, -0.482184f, -0.476799f, -0.471397f, -0.465976f, + -0.460539f, -0.455084f, -0.449611f, -0.444122f, -0.438616f, -0.433094f, + -0.427555f, -0.422000f, -0.416430f, -0.410843f, -0.405241f, -0.399624f, + -0.393992f, -0.388345f, -0.382683f, -0.377007f, -0.371317f, -0.365613f, + -0.359895f, -0.354164f, -0.348419f, -0.342661f, -0.336890f, -0.331106f, + -0.325310f, -0.319502f, -0.313682f, -0.307850f, -0.302006f, -0.296151f, + -0.290285f, -0.284408f, -0.278520f, -0.272621f, -0.266713f, -0.260794f, + -0.254866f, -0.248928f, -0.242980f, -0.237024f, -0.231058f, -0.225084f, + -0.219101f, -0.213110f, -0.207111f, -0.201105f, -0.195090f, -0.189069f, + -0.183040f, -0.177004f, -0.170962f, -0.164913f, -0.158858f, -0.152797f, + -0.146730f, -0.140658f, -0.134581f, -0.128498f, -0.122411f, -0.116319f, + -0.110222f, -0.104122f, -0.098017f, -0.091909f, -0.085797f, -0.079682f, + -0.073565f, -0.067444f, -0.061321f, -0.055195f, -0.049068f, -0.042938f, + -0.036807f, -0.030675f, -0.024541f, -0.018407f, -0.012272f, -0.006136f, + -0.000000f, 0.006136f, 0.012272f, 0.018407f, 0.024541f, 0.030675f, + 0.036807f, 0.042938f, 0.049068f, 0.055195f, 0.061321f, 0.067444f, + 0.073565f, 0.079682f, 0.085797f, 0.091909f, 0.098017f, 0.104122f, + 0.110222f, 0.116319f, 0.122411f, 0.128498f, 0.134581f, 0.140658f, + 0.146730f, 0.152797f, 0.158858f, 0.164913f, 0.170962f, 0.177004f, + 0.183040f, 0.189069f, 0.195090f, 0.201105f, 0.207111f, 0.213110f, + 0.219101f, 0.225084f, 0.231058f, 0.237024f, 0.242980f, 0.248928f, + 0.254866f, 0.260794f, 0.266713f, 0.272621f, 0.278520f, 0.284408f, + 0.290285f, 0.296151f, 0.302006f, 0.307850f, 0.313682f, 0.319502f, + 0.325310f, 0.331106f, 0.336890f, 0.342661f, 0.348419f, 0.354164f, + 0.359895f, 0.365613f, 0.371317f, 0.377007f, 0.382683f, 0.388345f, + 0.393992f, 0.399624f, 0.405241f, 0.410843f, 0.416430f, 0.422000f, + 0.427555f, 0.433094f, 0.438616f, 0.444122f, 0.449611f, 0.455084f, + 0.460539f, 0.465976f, 0.471397f, 0.476799f, 0.482184f, 0.487550f, + 0.492898f, 0.498228f, 0.503538f, 0.508830f, 0.514103f, 0.519356f, + 0.524590f, 0.529804f, 0.534998f, 0.540171f, 0.545325f, 0.550458f, + 0.555570f, 0.560662f, 0.565732f, 0.570781f, 0.575808f, 0.580814f, + 0.585798f, 0.590760f, 0.595699f, 0.600616f, 0.605511f, 0.610383f, + 0.615232f, 0.620057f, 0.624859f, 0.629638f, 0.634393f, 0.639124f, + 0.643832f, 0.648514f, 0.653173f, 0.657807f, 0.662416f, 0.667000f, + 0.671559f, 0.676093f, 0.680601f, 0.685084f, 0.689541f, 0.693971f, + 0.698376f, 0.702755f, 0.707107f, 0.711432f, 0.715731f, 0.720003f, + 0.724247f, 0.728464f, 0.732654f, 0.736817f, 0.740951f, 0.745058f, + 0.749136f, 0.753187f, 0.757209f, 0.761202f, 0.765167f, 0.769103f, + 0.773010f, 0.776888f, 0.780737f, 0.784557f, 0.788346f, 0.792107f, + 0.795837f, 0.799537f, 0.803208f, 0.806848f, 0.810457f, 0.814036f, + 0.817585f, 0.821103f, 0.824589f, 0.828045f, 0.831470f, 0.834863f, + 0.838225f, 0.841555f, 0.844854f, 0.848120f, 0.851355f, 0.854558f, + 0.857729f, 0.860867f, 0.863973f, 0.867046f, 0.870087f, 0.873095f, + 0.876070f, 0.879012f, 0.881921f, 0.884797f, 0.887640f, 0.890449f, + 0.893224f, 0.895966f, 0.898674f, 0.901349f, 0.903989f, 0.906596f, + 0.909168f, 0.911706f, 0.914210f, 0.916679f, 0.919114f, 0.921514f, + 0.923880f, 0.926210f, 0.928506f, 0.930767f, 0.932993f, 0.935184f, + 0.937339f, 0.939459f, 0.941544f, 0.943593f, 0.945607f, 0.947586f, + 0.949528f, 0.951435f, 0.953306f, 0.955141f, 0.956940f, 0.958703f, + 0.960431f, 0.962121f, 0.963776f, 0.965394f, 0.966976f, 0.968522f, + 0.970031f, 0.971504f, 0.972940f, 0.974339f, 0.975702f, 0.977028f, + 0.978317f, 0.979570f, 0.980785f, 0.981964f, 0.983105f, 0.984210f, + 0.985278f, 0.986308f, 0.987301f, 0.988258f, 0.989177f, 0.990058f, + 0.990903f, 0.991710f, 0.992480f, 0.993212f, 0.993907f, 0.994565f, + 0.995185f, 0.995767f, 0.996313f, 0.996820f, 0.997290f, 0.997723f, + 0.998118f, 0.998476f, 0.998795f, 0.999078f, 0.999322f, 0.999529f, + 0.999699f, 0.999831f, 0.999925f, 0.999981f}; +#endif \ No newline at end of file diff --git a/Robot_V2/Algorithm/Filter.cpp b/Robot_V2/Algorithm/Filter.cpp new file mode 100644 index 0000000..01021aa --- /dev/null +++ b/Robot_V2/Algorithm/Filter.cpp @@ -0,0 +1,151 @@ +#include "Filter.h" +#include "Can.h" +#include "ang_sensor.h" +#include +#include +#include + +extern angle_sensor KTH7823; +extern CAN_transmiter CAN0_transmiter; +extern u32 system_runtime_us; +EncoderAngleKalman Angle_kalman(0, 1.0f, 1e-4f, 0.25f); +EncoderVelocityKalman Vel_kalman(0, 1e-5f, 1e-6f, 0.02f); + +constexpr u8 SIZE_FLOAT = sizeof(float); + +/*! + \brief 中值滤波器函数 + \param[in] values 待滤波的数据数组 + \param[in] size 数组大小 + \retval 滤波后的中值 + \note 使用部分排序优化算法提高效率 +*/ +float medium_filter(float values[], u8 size) { + // 使用局部数组避免动态内存分配 + float sorted[size]; + memcpy(sorted, values, size * SIZE_FLOAT); + + // 这比完整排序更高效,时间复杂度从O(n log n)降低到O(n) + std::nth_element(sorted, sorted + size / 2, sorted + size); + + return sorted[size / 2]; // 返回中值 +} + +// EncoderVelocityKalman类的实现 +/*! + \brief 构造函数,初始化编码器速度卡尔曼滤波器参数 + \param[in] initial_velocity 初始速度值 (rad/s) + \param[in] T 控制周期(s) + \param[in] Q 过程噪声协方差(典型值: 1e-4 ~ 1e-2) + \param[in] R 测量噪声协方差(典型值: 速度范围的1%~5%) + \retval none +*/ +EncoderVelocityKalman::EncoderVelocityKalman(float initial_velocity, float T, + float Q, float R) + : kalman(initial_velocity, T, Q, R) {} + +/*! + \brief 更新卡尔曼滤波器状态 + \param[in] measured_velocity 测量的速度值 (rad/s) + \retval 估计的速度值 (rad/s) + \note 实现卡尔曼滤波的预测和更新步骤,假设速度变化符合随机游走模型 +*/ +float EncoderVelocityKalman::update(float measured_velocity) { + // 1. 预测步骤 - 假设速度符合随机游走模型(加速度为0) + // 由于速度变化缓慢,我们可以简单预测速度保持不变 + kalman.predict(kalman.getState()); + + // 2. 更新步骤 - 直接使用测量值更新 + return kalman.update(measured_velocity); +} + +/*! + \brief 获取当前速度估计值 + \retval 当前速度估计值 (deg/s) +*/ +float EncoderVelocityKalman::getVelocity() const { return kalman.getState(); } + +/*! + \brief 设置过程噪声协方差 + \param[in] q 过程噪声协方差值 + \retval none +*/ +void EncoderVelocityKalman::setProcessNoise(float q) { + kalman.setProcessNoise(q); +} + +/*! + \brief 设置测量噪声协方差 + \param[in] r 测量噪声协方差值 + \retval none +*/ +void EncoderVelocityKalman::setMeasurementNoise(float r) { + kalman.setMeasurementNoise(r); +} + +// EncoderAngleKalman类的实现 +/*! + \brief 构造函数,初始化编码器角度卡尔曼滤波器参数 + \param[in] initial_angle 初始角度值 (degree) + \param[in] initial_error_covariance 初始误差协方差 + \param[in] process_noise 过程噪声协方差 + \param[in] measurement_noise 测量噪声协方差 + \retval none +*/ +EncoderAngleKalman::EncoderAngleKalman(float initial_angle, + float initial_error_covariance, + float process_noise, + float measurement_noise) + : kalman(initial_angle, initial_error_covariance, process_noise, + measurement_noise), + last_angle(initial_angle), initialized(true) {} + +/*! + \brief 更新卡尔曼滤波器状态 + \param[in] measured_angle 测量的角度值 (degree) + \retval 估计的角度值 (degree) + \note 实现卡尔曼滤波的预测和更新步骤 +*/ +float EncoderAngleKalman::update(float measured_angle) { + // 更新last_angle以支持速度计算 + last_angle = kalman.getState(); + // 1. 预测步骤 - 速度估计 + kalman.predict(last_angle); + + // 2. 更新步骤 - 使用处理后的角度值更新 + float filtered_angle = kalman.update(measured_angle); + return filtered_angle; +} + +/*! + \brief 获取当前角度估计值 + \retval 当前角度估计值 (degree) +*/ +float EncoderAngleKalman::getAngle() const { return kalman.getState(); } +/*! + \brief 获取当前角度估计值 + \retval 当前角度估计值 (degree) +*/ +float EncoderAngleKalman::getVelocity() const { + static u32 last_us100_counter = system_runtime_us; + float vel = (kalman.getState() - last_angle) * 1e4 * + (system_runtime_us - last_us100_counter); + last_us100_counter = system_runtime_us; + return vel; +} + +/*! + \brief 设置过程噪声协方差 + \param[in] q 过程噪声协方差值 + \retval none +*/ +void EncoderAngleKalman::setProcessNoise(float q) { kalman.setProcessNoise(q); } + +/*! + \brief 设置测量噪声协方差 + \param[in] r 测量噪声协方差值 + \retval none +*/ +void EncoderAngleKalman::setMeasurementNoise(float r) { + kalman.setMeasurementNoise(r); +} \ No newline at end of file diff --git a/Robot_V2/Algorithm/Filter.h b/Robot_V2/Algorithm/Filter.h new file mode 100644 index 0000000..26096bb --- /dev/null +++ b/Robot_V2/Algorithm/Filter.h @@ -0,0 +1,164 @@ +#ifndef _FILTER_H +#define _FILTER_H + +#ifdef __cplusplus +extern "C" { +#endif + +// C风格函数声明可以放在这里 +// 例如: void some_c_function(float* data, int size); + +#ifdef __cplusplus +} // extern "C" +#endif + +#ifdef __cplusplus +#include +#include + +float medium_filter(float values[], u8 size); + +/*! + \brief 通用卡尔曼滤波器模板类 + \note 可用于各种基于线性系统的状态估计 +*/ +template class KalmanFilter { + private: + T P; // 估计误差协方差 + T Q; // 过程噪声协方差 + T R; // 测量噪声协方差 + + public: + T x; // 状态估计 + /*! + \brief 构造函数 + \param[in] initial_state 初始状态值 + \param[in] initial_error_covariance 初始误差协方差 + \param[in] process_noise 过程噪声协方差 + \param[in] measurement_noise 测量噪声协方差 + */ + KalmanFilter(T initial_state, T initial_error_covariance, T process_noise, + T measurement_noise) + : x(initial_state), P(initial_error_covariance), Q(process_noise), + R(measurement_noise) {} + + /*! + \brief 预测步骤 + \param[in] state_prediction 状态预测值 + \retval none + */ + void predict(T state_prediction) { + x = state_prediction; + P += Q; + } + + /*! + \brief 更新步骤 + \param[in] measurement 测量值 + \param[in] measurement_prediction 测量预测值 + \retval 估计的状态值 + */ + T update(T measurement, T measurement_prediction) { + T y = measurement - measurement_prediction; // 测量残差 + T S = P + R; // 残差协方差 + T K = P / S; // 卡尔曼增益 + + x += K * y; // 更新状态估计 + P = (1 - K) * P; // 更新误差协方差 + + return x; + } + + /*! + \brief 直接更新步骤(适用于状态直接可测的情况) + \param[in] measurement 测量值 + \retval 估计的状态值 + */ + T update(T measurement) { + T K = P / (P + R); // 卡尔曼增益 + + x += K * (measurement - x); // 更新状态估计 + P = (1 - K) * P; // 更新误差协方差 + return x; + } + + /*! + \brief 获取当前状态估计值 + \retval 当前状态估计值 + */ + T getState() const { return x; } + + /*! + \brief 设置过程噪声协方差 + \param[in] process_noise 过程噪声协方差值 + \retval none + */ + void setProcessNoise(T process_noise) { Q = process_noise; } + + /*! + \brief 设置测量噪声协方差 + \param[in] measurement_noise 测量噪声协方差值 + \retval none + */ + void setMeasurementNoise(T measurement_noise) { R = measurement_noise; } +}; + +/*! + \brief 编码器速度卡尔曼滤波器类 + \note 用于滤除编码器速度测量噪声的卡尔曼滤波器实现 +*/ +class EncoderVelocityKalman { + private: + KalmanFilter kalman; + + public: + EncoderVelocityKalman(float initial_velocity, + float initial_error_covariance, float process_noise, + float measurement_noise); + + float update(float measured_velocity); + + float getVelocity() const; + + void setProcessNoise(float q); + + void setMeasurementNoise(float r); + + u8 init(float init_velocity) { + kalman.x = init_velocity; + return 0; + } +}; + +/*! + \brief 编码器角度卡尔曼滤波器类 + \note 用于滤除编码器角度测量噪声的卡尔曼滤波器实现 +*/ +class EncoderAngleKalman { + private: + KalmanFilter kalman; + bool initialized; + float last_angle; + + public: + EncoderAngleKalman(float initial_angle, float initial_error_covariance, + float process_noise, float measurement_noise); + + float update(float measured_angle); + + float getAngle() const; + float getVelocity() const; + + void setProcessNoise(float q); + float getstate() const { return kalman.getState(); }; + + void setMeasurementNoise(float r); + u8 init(float init_angle) { + kalman.x = init_angle; + return 0; + } +}; + +#endif // __cplusplus + +#endif // _FILTER_H \ No newline at end of file diff --git a/Robot_V2/Algorithm/pid.cpp b/Robot_V2/Algorithm/pid.cpp new file mode 100644 index 0000000..61595c1 --- /dev/null +++ b/Robot_V2/Algorithm/pid.cpp @@ -0,0 +1,60 @@ +#include "pid.h" +#define _constrain(amt, low, high) \ + ((amt) < (low) ? (low) : ((amt) > (high) ? (high) : (amt))) +#include "Can.h" +#include "math.h" + +extern CAN_transmiter CAN0_transmiter; +constexpr float TIME_SLICE = 1e-4; + +PIDController::PIDController(float P, float I, float D, float ramp, float limit) + : P(P), I(I), D(D), output_ramp(ramp) // PID控制器加速度限幅 + , + limit(limit) // PID控制器输出限幅 + , + error_prev(0.0f), output_prev(0.0f), integral_prev(0.0f) {} + +// PID 控制器函数 +float PIDController::operator()(float error) { + // P环 + float proportional = P * error; + + // Tustin 散点积分(I环) + // 添加积分限幅,防止积分饱和 + float integral = integral_prev + I * TIME_SLICE * 0.5f * (error + error_prev); + integral = _constrain(integral, -limit, limit); + + // D环(微分环节) + float derivative = D * (error - error_prev) / TIME_SLICE; + + // 将P,I,D三环的计算值加起来 + float output = proportional + integral + derivative; + output = _constrain(output, -limit, limit); + + // 输出斜坡限制 + // 简化的斜坡限制(单行逻辑) + if (output_ramp > 0) { + float max_delta = output_ramp * TIME_SLICE; + output = output_prev + fmaxf(-max_delta, fminf(max_delta, output - output_prev)); + } + // 保存值(为了下一次循环) + integral_prev = integral; + output_prev = output; + error_prev = error; + + return output; +} + +/** + * @brief 设置PID参数 + * + * @param P: P参数 + * @param I: I参数 + * @param D: D参数 + * @return void + */ +void PIDController::set_PID(float P, float I, float D) { + this->P = P; + this->I = I; + this->D = D; +} \ No newline at end of file diff --git a/Robot_V2/Algorithm/pid.h b/Robot_V2/Algorithm/pid.h new file mode 100644 index 0000000..695b51d --- /dev/null +++ b/Robot_V2/Algorithm/pid.h @@ -0,0 +1,25 @@ +#ifndef PID_H +#define PID_H + +class PIDController +{ +public: + PIDController(float P, float I, float D, float ramp, float limit); + ~PIDController() = default; + + float operator() (float error); + void set_PID(float P, float I, float D); + + float P; //!< 比例增益(P环增益) + float I; //!< 积分增益(I环增益) + float D; //!< 微分增益(D环增益) + float output_ramp; + float limit; +protected: + float error_prev; //!< 最后的跟踪误差值 + float output_prev; //!< 最后一个 pid 输出值 + float integral_prev; //!< 最后一个积分分量值 + unsigned long timestamp_prev; //!< 上次执行时间戳 +}; + +#endif \ No newline at end of file diff --git a/Robot_V2/Algorithm/thermal.cpp b/Robot_V2/Algorithm/thermal.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Robot_V2/Algorithm/thermal.h b/Robot_V2/Algorithm/thermal.h new file mode 100644 index 0000000..ed7041f --- /dev/null +++ b/Robot_V2/Algorithm/thermal.h @@ -0,0 +1,7 @@ +#ifndef THERMAL_H +#define THERMAL_H + + + + +#endif \ No newline at end of file diff --git a/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src b/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src new file mode 100644 index 0000000..7820e1f --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2023 Arm Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* ---------------------------------------------------------------------------- + Stack seal size definition + *----------------------------------------------------------------------------*/ +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) +#define __STACKSEAL_SIZE 8 +#else +#define __STACKSEAL_SIZE 0 +#endif + +/*---------------------------------------------------------------------------- + Scatter File Definitions definition + *----------------------------------------------------------------------------*/ + +LR_ROM0 __ROM0_BASE __ROM0_SIZE { + + ER_ROM0 __ROM0_BASE __ROM0_SIZE { + *.o (RESET, +First) + *(InRoot$$Sections) + *(+RO +XO) + } + +#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U) + ER_CMSE_VENEER AlignExpr(+0, 32) (__ROM0_SIZE - AlignExpr(ImageLength(ER_ROM0), 32)) { + *(Veneer$$CMSE) + } +#endif + + RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { + *.o(.bss.noinit) + *.o(.bss.noinit.*) + } + + RW_RAM0 AlignExpr(+0, 8) (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE - AlignExpr(ImageLength(RW_NOINIT), 8)) { + *(+RW +ZI) + } + +#if __HEAP_SIZE > 0 + ARM_LIB_HEAP (AlignExpr(+0, 8)) EMPTY __HEAP_SIZE { ; Reserve empty region for heap + } +#endif + + ARM_LIB_STACK (__RAM0_BASE + __RAM0_SIZE - __STACKSEAL_SIZE) EMPTY -__STACK_SIZE { ; Reserve empty region for stack + } + +#if __STACKSEAL_SIZE > 0 + STACKSEAL +0 EMPTY __STACKSEAL_SIZE { ; Reserve empty region for stack seal immediately after stack + } +#endif + +#if __RAM1_SIZE > 0 + RW_RAM1 __RAM1_BASE __RAM1_SIZE { + .ANY (+RW +ZI) + } +#endif + +#if __RAM2_SIZE > 0 + RW_RAM2 __RAM2_BASE __RAM2_SIZE { + .ANY (+RW +ZI) + } +#endif + +#if __RAM3_SIZE > 0 + RW_RAM3 __RAM3_BASE __RAM3_SIZE { + .ANY (+RW +ZI) + } +#endif +} + +#if __ROM1_SIZE > 0 +LR_ROM1 __ROM1_BASE __ROM1_SIZE { + ER_ROM1 +0 __ROM1_SIZE { + .ANY (+RO +XO) + } +} +#endif + +#if __ROM2_SIZE > 0 +LR_ROM2 __ROM2_BASE __ROM2_SIZE { + ER_ROM2 +0 __ROM2_SIZE { + .ANY (+RO +XO) + } +} +#endif + +#if __ROM3_SIZE > 0 +LR_ROM3 __ROM3_BASE __ROM3_SIZE { + ER_ROM3 +0 __ROM3_SIZE { + .ANY (+RO +XO) + } +} +#endif diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_adc.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_adc.c new file mode 100644 index 0000000..638fd3a --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_adc.c @@ -0,0 +1,992 @@ +/*! + \file gd32c10x_adc.c + \brief ADC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_adc.h" + +/* discontinuous mode macro*/ +#define ADC_CHANNEL_LENGTH_SUBTRACT_ONE ((uint8_t)1U) + +/* ADC regular channel macro */ +#define ADC_REGULAR_CHANNEL_RANK_SIX ((uint8_t)6U) +#define ADC_REGULAR_CHANNEL_RANK_TWELVE ((uint8_t)12U) +#define ADC_REGULAR_CHANNEL_RANK_SIXTEEN ((uint8_t)16U) +#define ADC_REGULAR_CHANNEL_RANK_LENGTH ((uint8_t)5U) + +/* ADC sampling time macro */ +#define ADC_CHANNEL_SAMPLE_TEN ((uint8_t)10U) +#define ADC_CHANNEL_SAMPLE_EIGHTEEN ((uint8_t)18U) +#define ADC_CHANNEL_SAMPLE_LENGTH ((uint8_t)3U) + +/* ADC inserted channel macro */ +#define ADC_INSERTED_CHANNEL_RANK_LENGTH ((uint8_t)5U) +#define ADC_INSERTED_CHANNEL_SHIFT_LENGTH ((uint8_t)15U) + +/* ADC inserted channel offset macro */ +#define ADC_OFFSET_LENGTH ((uint8_t)3U) +#define ADC_OFFSET_SHIFT_LENGTH ((uint8_t)4U) + +/*! + \brief reset ADC + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_deinit(uint32_t adc_periph) +{ + switch(adc_periph){ + case ADC0: + /* reset ADC0 */ + rcu_periph_reset_enable(RCU_ADC0RST); + rcu_periph_reset_disable(RCU_ADC0RST); + break; + case ADC1: + /* reset ADC1 */ + rcu_periph_reset_enable(RCU_ADC1RST); + rcu_periph_reset_disable(RCU_ADC1RST); + break; + default: + break; + } +} + +/*! + \brief configure the ADC sync mode + \param[in] mode: ADC mode + only one parameter can be selected which is shown as below: + \arg ADC_MODE_FREE: all the ADCs work independently + \arg ADC_DAUL_REGULAL_PARALLEL_INSERTED_PARALLEL: ADC0 and ADC1 work in combined regular parallel + inserted parallel mode + \arg ADC_DAUL_REGULAL_PARALLEL_INSERTED_ROTATION: ADC0 and ADC1 work in combined regular parallel + trigger rotation mode + \arg ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_FAST: ADC0 and ADC1 work in combined inserted parallel + follow-up fast mode + \arg ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_SLOW: ADC0 and ADC1 work in combined inserted parallel + follow-up slow mode + \arg ADC_DAUL_INSERTED_PARALLEL: ADC0 and ADC1 work in inserted parallel mode only + \arg ADC_DAUL_REGULAL_PARALLEL: ADC0 and ADC1 work in regular parallel mode only + \arg ADC_DAUL_REGULAL_FOLLOWUP_FAST: ADC0 and ADC1 work in follow-up fast mode only + \arg ADC_DAUL_REGULAL_FOLLOWUP_SLOW: ADC0 and ADC1 work in follow-up slow mode only + \arg ADC_DAUL_INSERTED_TRIGGER_ROTATION: ADC0 and ADC1 work in trigger rotation mode only + \param[out] none + \retval none +*/ +void adc_mode_config(uint32_t mode) +{ + ADC_CTL0(ADC0) &= ~(ADC_CTL0_SYNCM); + ADC_CTL0(ADC0) |= mode; +} + +/*! + \brief enable or disable ADC special function + \param[in] adc_periph: ADCx,x=0,1 + \param[in] function: the function to config + only one parameter can be selected which is shown as below: + \arg ADC_SCAN_MODE: scan mode select + \arg ADC_INSERTED_CHANNEL_AUTO: inserted channel group convert automatically + \arg ADC_CONTINUOUS_MODE: continuous mode select + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void adc_special_function_config(uint32_t adc_periph , uint32_t function , ControlStatus newvalue) +{ + if(newvalue){ + if(0U != (function & ADC_SCAN_MODE)){ + /* enable scan mode */ + ADC_CTL0(adc_periph) |= ADC_SCAN_MODE; + } + if(0U != (function & ADC_INSERTED_CHANNEL_AUTO)){ + /* enable inserted channel group convert automatically */ + ADC_CTL0(adc_periph) |= ADC_INSERTED_CHANNEL_AUTO; + } + if(0U != (function & ADC_CONTINUOUS_MODE)){ + /* enable continuous mode */ + ADC_CTL1(adc_periph) |= ADC_CONTINUOUS_MODE; + } + }else{ + if(0U != (function & ADC_SCAN_MODE)){ + /* disable scan mode */ + ADC_CTL0(adc_periph) &= ~ADC_SCAN_MODE; + } + if(0U != (function & ADC_INSERTED_CHANNEL_AUTO)){ + /* disable inserted channel group convert automatically */ + ADC_CTL0(adc_periph) &= ~ADC_INSERTED_CHANNEL_AUTO; + } + if(0U != (function & ADC_CONTINUOUS_MODE)){ + /* disable continuous mode */ + ADC_CTL1(adc_periph) &= ~ADC_CONTINUOUS_MODE; + } + } +} + +/*! + \brief configure ADC data alignment + \param[in] adc_periph: ADCx,x=0,1 + \param[in] data_alignment: data alignment select + only one parameter can be selected which is shown as below: + \arg ADC_DATAALIGN_RIGHT: LSB alignment + \arg ADC_DATAALIGN_LEFT: MSB alignment + \param[out] none + \retval none +*/ +void adc_data_alignment_config(uint32_t adc_periph , uint32_t data_alignment) +{ + if(ADC_DATAALIGN_RIGHT != data_alignment){ + /* MSB alignment */ + ADC_CTL1(adc_periph) |= ADC_CTL1_DAL; + }else{ + /* LSB alignment */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_DAL); + } +} + +/*! + \brief enable ADC interface + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_enable(uint32_t adc_periph) +{ + if(RESET == (ADC_CTL1(adc_periph) & ADC_CTL1_ADCON)){ + /* enable ADC */ + ADC_CTL1(adc_periph) |= (uint32_t)ADC_CTL1_ADCON; + } +} + +/*! + \brief disable ADC interface + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_disable(uint32_t adc_periph) +{ + /* disable ADC */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ADCON); +} + +/*! + \brief ADC calibration and reset calibration + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_calibration_enable(uint32_t adc_periph) +{ + /* reset the selected ADC calibration registers */ + ADC_CTL1(adc_periph) |= (uint32_t) ADC_CTL1_RSTCLB; + /* check the RSTCLB bit state */ + while(RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_RSTCLB)){ + } + /* enable ADC calibration process */ + ADC_CTL1(adc_periph) |= ADC_CTL1_CLB; + /* check the CLB bit state */ + while(RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_CLB)){ + } +} + +/*! + \brief enable the temperature sensor and Vrefint channel + \param[in] none + \param[out] none + \retval none +*/ +void adc_tempsensor_vrefint_enable(void) +{ + /* enable the temperature sensor and Vrefint channel */ + ADC_CTL1(ADC0) |= ADC_CTL1_TSVREN; +} + +/*! + \brief disable the temperature sensor and Vrefint channel + \param[in] none + \param[out] none + \retval none +*/ +void adc_tempsensor_vrefint_disable(void) +{ + /* disable the temperature sensor and Vrefint channel */ + ADC_CTL1(ADC0) &= ~ADC_CTL1_TSVREN; +} + +/*! + \brief configure ADC resolution + \param[in] adc_periph: ADCx,x=0,1 + \param[in] resolution: ADC resolution + only one parameter can be selected which is shown as below: + \arg ADC_RESOLUTION_12B: 12-bit ADC resolution + \arg ADC_RESOLUTION_10B: 10-bit ADC resolution + \arg ADC_RESOLUTION_8B: 8-bit ADC resolution + \arg ADC_RESOLUTION_6B: 6-bit ADC resolution + \param[out] none + \retval none +*/ +void adc_resolution_config(uint32_t adc_periph , uint32_t resolution) +{ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)ADC_OVSAMPCTL_DRES); + ADC_OVSAMPCTL(adc_periph) |= (uint32_t)resolution; +} + +/*! + \brief configure ADC oversample mode + \param[in] adc_periph: ADCx,x=0,1 + \param[in] mode: ADC oversampling mode + only one parameter can be selected which is shown as below: + \arg ADC_OVERSAMPLING_ALL_CONVERT: all oversampled conversions for a channel are done consecutively after a trigger + \arg ADC_OVERSAMPLING_ONE_CONVERT: each oversampled conversion for a channel needs a trigger + \param[in] shift: ADC oversampling shift + only one parameter can be selected which is shown as below: + \arg ADC_OVERSAMPLING_SHIFT_NONE: no oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_1B: 1-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_2B: 2-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_3B: 3-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_4B: 3-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_5B: 5-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_6B: 6-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_7B: 7-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_8B: 8-bit oversampling shift + \param[in] ratio: ADC oversampling ratio + only one parameter can be selected which is shown as below: + \arg ADC_OVERSAMPLING_RATIO_MUL2: oversampling ratio multiple 2 + \arg ADC_OVERSAMPLING_RATIO_MUL4: oversampling ratio multiple 4 + \arg ADC_OVERSAMPLING_RATIO_MUL8: oversampling ratio multiple 8 + \arg ADC_OVERSAMPLING_RATIO_MUL16: oversampling ratio multiple 16 + \arg ADC_OVERSAMPLING_RATIO_MUL32: oversampling ratio multiple 32 + \arg ADC_OVERSAMPLING_RATIO_MUL64: oversampling ratio multiple 64 + \arg ADC_OVERSAMPLING_RATIO_MUL128: oversampling ratio multiple 128 + \arg ADC_OVERSAMPLING_RATIO_MUL256: oversampling ratio multiple 256 + \param[out] none + \retval none +*/ +void adc_oversample_mode_config(uint32_t adc_periph, uint32_t mode, uint16_t shift, uint8_t ratio) +{ + if(ADC_OVERSAMPLING_ONE_CONVERT == mode){ + ADC_OVSAMPCTL(adc_periph) |= (uint32_t)ADC_OVSAMPCTL_TOVS; + }else{ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)ADC_OVSAMPCTL_TOVS); + } + /* config the shift and ratio */ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)(ADC_OVSAMPCTL_OVSR | ADC_OVSAMPCTL_OVSS)); + ADC_OVSAMPCTL(adc_periph) |= ((uint32_t)shift | (uint32_t)ratio); +} + +/*! + \brief enable ADC oversample mode + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_oversample_mode_enable(uint32_t adc_periph) +{ + ADC_OVSAMPCTL(adc_periph) |= ADC_OVSAMPCTL_OVSEN; +} + +/*! + \brief disable ADC oversample mode + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_oversample_mode_disable(uint32_t adc_periph) +{ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)ADC_OVSAMPCTL_OVSEN); +} + +/*! + \brief enable DMA request + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_dma_mode_enable(uint32_t adc_periph) +{ + /* enable DMA request */ + ADC_CTL1(adc_periph) |= (uint32_t)(ADC_CTL1_DMA); +} + +/*! + \brief disable DMA request + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_dma_mode_disable(uint32_t adc_periph) +{ + /* disable DMA request */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_DMA); +} + +/*! + \brief configure ADC discontinuous mode + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \arg ADC_CHANNEL_DISCON_DISABLE: disable discontinuous mode of regular & inserted channel + \param[in] length: number of conversions in discontinuous mode,the number can be 1..8 + for regular channel ,the number has no effect for inserted channel + \param[out] none + \retval none +*/ +void adc_discontinuous_mode_config(uint32_t adc_periph, uint8_t adc_channel_group, uint8_t length) +{ + /* disable discontinuous mode of regular & inserted channel */ + ADC_CTL0(adc_periph) &= ~((uint32_t)(ADC_CTL0_DISRC | ADC_CTL0_DISIC)); + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* config the number of conversions in discontinuous mode */ + ADC_CTL0(adc_periph) &= ~((uint32_t)ADC_CTL0_DISNUM); + ADC_CTL0(adc_periph) |= CTL0_DISNUM(((uint32_t)length - ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + /* enable regular channel group discontinuous mode */ + ADC_CTL0(adc_periph) |= (uint32_t)ADC_CTL0_DISRC; + break; + case ADC_INSERTED_CHANNEL: + /* enable inserted channel group discontinuous mode */ + ADC_CTL0(adc_periph) |= (uint32_t)ADC_CTL0_DISIC; + break; + case ADC_CHANNEL_DISCON_DISABLE: + /* disable discontinuous mode of regular & inserted channel */ + default: + break; + } +} + +/*! + \brief configure the length of regular channel group or inserted channel group + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] length: the length of the channel + regular channel 1-16 + inserted channel 1-4 + \param[out] none + \retval none +*/ +void adc_channel_length_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t length) +{ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* configure the length of regular channel group */ + ADC_RSQ0(adc_periph) &= ~((uint32_t)ADC_RSQ0_RL); + ADC_RSQ0(adc_periph) |= RSQ0_RL((uint32_t)(length-ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + break; + case ADC_INSERTED_CHANNEL: + /* configure the length of inserted channel group */ + ADC_ISQ(adc_periph) &= ~((uint32_t)ADC_ISQ_IL); + ADC_ISQ(adc_periph) |= ISQ_IL((uint32_t)(length-ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + break; + default: + break; + } +} + +/*! + \brief configure ADC regular channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] rank: the regular group sequence rank,this parameter must be between 0 to 15 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x(x=0..17)(x=16 and x=17 are only for ADC0): ADC Channelx + \param[in] sample_time: the sample time value + only one parameter can be selected which is shown as below: + \arg ADC_SAMPLETIME_1POINT5: 1.5 cycles + \arg ADC_SAMPLETIME_7POINT5: 7.5 cycles + \arg ADC_SAMPLETIME_13POINT5: 13.5 cycles + \arg ADC_SAMPLETIME_28POINT5: 28.5 cycles + \arg ADC_SAMPLETIME_41POINT5: 41.5 cycles + \arg ADC_SAMPLETIME_55POINT5: 55.5 cycles + \arg ADC_SAMPLETIME_71POINT5: 71.5 cycles + \arg ADC_SAMPLETIME_239POINT5: 239.5 cycles + \param[out] none + \retval none +*/ +void adc_regular_channel_config(uint32_t adc_periph , uint8_t rank , uint8_t adc_channel , uint32_t sample_time) +{ + uint32_t rsq,sampt; + + /* ADC regular sequence config */ + if(rank < ADC_REGULAR_CHANNEL_RANK_SIX){ + /* the regular group sequence rank is smaller than six */ + rsq = ADC_RSQ2(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*rank))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*rank)); + ADC_RSQ2(adc_periph) = rsq; + }else if(rank < ADC_REGULAR_CHANNEL_RANK_TWELVE){ + /* the regular group sequence rank is smaller than twelve */ + rsq = ADC_RSQ1(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_SIX)))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_SIX))); + ADC_RSQ1(adc_periph) = rsq; + }else if(rank < ADC_REGULAR_CHANNEL_RANK_SIXTEEN){ + /* the regular group sequence rank is smaller than sixteen */ + rsq = ADC_RSQ0(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_TWELVE)))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_TWELVE))); + ADC_RSQ0(adc_periph) = rsq; + }else{ + } + + /* ADC sampling time config */ + if(adc_channel < ADC_CHANNEL_SAMPLE_TEN){ + /* the regular group sequence rank is smaller than ten */ + sampt = ADC_SAMPT1(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel))); + /* channel sample time set*/ + sampt |= (uint32_t)(sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel)); + ADC_SAMPT1(adc_periph) = sampt; + }else if(adc_channel < ADC_CHANNEL_SAMPLE_EIGHTEEN){ + /* the regular group sequence rank is smaller than eighteen */ + sampt = ADC_SAMPT0(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN)))); + /* channel sample time set*/ + sampt |= (uint32_t)(sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN))); + ADC_SAMPT0(adc_periph) = sampt; + }else{ + } +} + +/*! + \brief configure ADC inserted channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] rank: the inserted group sequencer rank,this parameter must be between 0 to 3 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x(x=0..17)(x=16 and x=17 are only for ADC0): ADC Channelx + \param[in] sample_time: The sample time value + only one parameter can be selected which is shown as below: + \arg ADC_SAMPLETIME_1POINT5: 1.5 cycles + \arg ADC_SAMPLETIME_7POINT5: 7.5 cycles + \arg ADC_SAMPLETIME_13POINT5: 13.5 cycles + \arg ADC_SAMPLETIME_28POINT5: 28.5 cycles + \arg ADC_SAMPLETIME_41POINT5: 41.5 cycles + \arg ADC_SAMPLETIME_55POINT5: 55.5 cycles + \arg ADC_SAMPLETIME_71POINT5: 71.5 cycles + \arg ADC_SAMPLETIME_239POINT5: 239.5 cycles + \param[out] none + \retval none +*/ +void adc_inserted_channel_config(uint32_t adc_periph , uint8_t rank , uint8_t adc_channel , uint32_t sample_time) +{ + uint8_t inserted_length; + uint32_t isq,sampt; + + /* get inserted channel group length */ + inserted_length = (uint8_t)GET_BITS(ADC_ISQ(adc_periph) , 20U , 21U); + /* the channel number is written to these bits to select a channel as the nth conversion in the inserted channel group */ + isq = ADC_ISQ(adc_periph); + isq &= ~((uint32_t)(ADC_ISQ_ISQN << (5U * ((3 + rank) - inserted_length)))); + isq |= ((uint32_t)adc_channel << (5U * ((3 + rank) - inserted_length))); + ADC_ISQ(adc_periph) = isq; + + /* ADC sampling time config */ + if(adc_channel < ADC_CHANNEL_SAMPLE_TEN){ + /* the inserted group sequence rank is smaller than ten */ + sampt = ADC_SAMPT1(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel))); + /* channel sample time set*/ + sampt |= (uint32_t) sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel); + ADC_SAMPT1(adc_periph) = sampt; + }else if(adc_channel < ADC_CHANNEL_SAMPLE_EIGHTEEN){ + /* the inserted group sequence rank is smaller than eighteen */ + sampt = ADC_SAMPT0(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN)))); + /* channel sample time set*/ + sampt |= ((uint32_t)sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN))); + ADC_SAMPT0(adc_periph) = sampt; + }else{ + } +} + +/*! + \brief configure ADC inserted channel offset + \param[in] adc_periph: ADCx,x=0,1 + \param[in] inserted_channel : insert channel select + only one parameter can be selected which is shown as below: + \arg ADC_INSERTED_CHANNEL_0: inserted channel0 + \arg ADC_INSERTED_CHANNEL_1: inserted channel1 + \arg ADC_INSERTED_CHANNEL_2: inserted channel2 + \arg ADC_INSERTED_CHANNEL_3: inserted channel3 + \param[in] offset : the offset data + \param[out] none + \retval none +*/ +void adc_inserted_channel_offset_config(uint32_t adc_periph , uint8_t inserted_channel , uint16_t offset) +{ + uint8_t inserted_length; + uint32_t num = 0U; + + inserted_length = (uint8_t)GET_BITS(ADC_ISQ(adc_periph) , 20U , 21U); + num = ((uint32_t)ADC_OFFSET_LENGTH - ((uint32_t)inserted_length - (uint32_t)inserted_channel)); + + if(num <= ADC_OFFSET_LENGTH){ + /* calculate the offset of the register */ + num = num * ADC_OFFSET_SHIFT_LENGTH; + /* config the offset of the selected channels */ + REG32((adc_periph) + 0x14U + num) = IOFFX_IOFF((uint32_t)offset); + } +} + +/*! + \brief configure ADC external trigger source + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] external_trigger_source: regular or inserted group trigger source + only one parameter can be selected which is shown as below: + for regular channel: + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH0: timer 0 CC0 event select + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH1: timer 0 CC1 event select + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH2: timer 0 CC2 event select + \arg ADC0_1_EXTTRIG_REGULAR_T1_CH1: timer 1 CC1 event select + \arg ADC0_1_EXTTRIG_REGULAR_T2_TRGO: timer 2 TRGO event select + \arg ADC0_1_EXTTRIG_REGULAR_T3_CH3: timer 3 CC3 event select + \arg ADC0_1_EXTTRIG_REGULAR_T7_TRGO: timer 7 TRGO event select + \arg ADC0_1_EXTTRIG_REGULAR_EXTI_11 : external interrupt line 11 + \arg ADC0_1_EXTTRIG_REGULAR_NONE: software trigger + for inserted channel: + \arg ADC0_1_EXTTRIG_INSERTED_T0_TRGO: timer 0 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_T0_CH3: timer 0 CC3 event select + \arg ADC0_1_EXTTRIG_INSERTED_T1_TRGO: timer 1 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_T1_CH0: timer 1 CC0 event select + \arg ADC0_1_EXTTRIG_INSERTED_T2_CH3: timer 2 CC3 event select + \arg ADC0_1_EXTTRIG_INSERTED_T3_TRGO: timer 3 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_EXTI_15: external interrupt line 15 + \arg ADC0_1_EXTTRIG_INSERTED_T7_CH3: timer 7 CC3 event select + \arg ADC0_1_EXTTRIG_INSERTED_NONE: software trigger + \param[out] none + \retval none +*/ +void adc_external_trigger_source_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t external_trigger_source) +{ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* configure ADC regular group external trigger source */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ETSRC); + ADC_CTL1(adc_periph) |= (uint32_t)external_trigger_source; + break; + case ADC_INSERTED_CHANNEL: + /* configure ADC inserted group external trigger source */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ETSIC); + ADC_CTL1(adc_periph) |= (uint32_t)external_trigger_source; + break; + default: + break; + } +} + +/*! + \brief enable ADC external trigger + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + one or more parameters can be selected which are shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void adc_external_trigger_config(uint32_t adc_periph, uint8_t adc_channel_group, ControlStatus newvalue) +{ + if(newvalue){ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* enable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_ETERC; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* enable ADC inserted channel group external trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_ETEIC; + } + }else{ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* disable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) &= ~ADC_CTL1_ETERC; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* disable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) &= ~ADC_CTL1_ETEIC; + } + } +} + +/*! + \brief enable ADC software trigger + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + one or more parameters can be selected which are shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[out] none + \retval none +*/ +void adc_software_trigger_enable(uint32_t adc_periph , uint8_t adc_channel_group) +{ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* enable ADC regular channel group software trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_SWRCST; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* enable ADC inserted channel group software trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_SWICST; + } +} + +/*! + \brief read ADC regular group data register + \param[in] adc_periph: ADCx,x=0,1 + \param[in] none + \param[out] none + \retval the conversion value +*/ +uint16_t adc_regular_data_read(uint32_t adc_periph) +{ + return (uint16_t)(ADC_RDATA(adc_periph)); +} + +/*! + \brief read ADC inserted group data register + \param[in] adc_periph: ADCx,x=0,1 + \param[in] inserted_channel : insert channel select + only one parameter can be selected which is shown as below: + \arg ADC_INSERTED_CHANNEL_0: inserted Channel0 + \arg ADC_INSERTED_CHANNEL_1: inserted channel1 + \arg ADC_INSERTED_CHANNEL_2: inserted Channel2 + \arg ADC_INSERTED_CHANNEL_3: inserted Channel3 + \param[out] none + \retval the conversion value +*/ +uint16_t adc_inserted_data_read(uint32_t adc_periph , uint8_t inserted_channel) +{ + uint32_t idata; + /* read the data of the selected channel */ + switch(inserted_channel){ + case ADC_INSERTED_CHANNEL_0: + /* read the data of channel 0 */ + idata = ADC_IDATA0(adc_periph); + break; + case ADC_INSERTED_CHANNEL_1: + /* read the data of channel 1 */ + idata = ADC_IDATA1(adc_periph); + break; + case ADC_INSERTED_CHANNEL_2: + /* read the data of channel 2 */ + idata = ADC_IDATA2(adc_periph); + break; + case ADC_INSERTED_CHANNEL_3: + /* read the data of channel 3 */ + idata = ADC_IDATA3(adc_periph); + break; + default: + idata = 0U; + break; + } + return (uint16_t)idata; +} + +/*! + \brief read the last ADC0 and ADC1 conversion result data in sync mode + \param[in] none + \param[out] none + \retval the conversion value +*/ +uint32_t adc_sync_mode_convert_value_read(void) +{ + /* return conversion value */ + return ADC_RDATA(ADC0); +} + +/*! + \brief configure ADC analog watchdog single channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x: ADC Channelx(x=0..17)(x=16 and x=17 are only for ADC0) + \param[out] none + \retval none +*/ +void adc_watchdog_single_channel_enable(uint32_t adc_periph, uint8_t adc_channel) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); + /* analog watchdog channel select */ + ADC_CTL0(adc_periph) |= (uint32_t)adc_channel; + ADC_CTL0(adc_periph) |= (uint32_t)(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC); +} + +/*! + \brief configure ADC analog watchdog group channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: the channel group use analog watchdog + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \arg ADC_REGULAR_INSERTED_CHANNEL: both regular and inserted group + \param[out] none + \retval none +*/ +void adc_watchdog_group_channel_enable(uint32_t adc_periph, uint8_t adc_channel_group) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC); + /* select the group */ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* regular channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_RWDEN; + break; + case ADC_INSERTED_CHANNEL: + /* inserted channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_IWDEN; + break; + case ADC_REGULAR_INSERTED_CHANNEL: + /* regular and inserted channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t)(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN); + break; + default: + break; + } +} + +/*! + \brief disable ADC analog watchdog + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_watchdog_disable(uint32_t adc_periph) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); +} + +/*! + \brief configure ADC analog watchdog threshold + \param[in] adc_periph: ADCx,x=0,1 + \param[in] low_threshold: analog watchdog low threshold,0..4095 + \param[in] high_threshold: analog watchdog high threshold,0..4095 + \param[out] none + \retval none +*/ +void adc_watchdog_threshold_config(uint32_t adc_periph , uint16_t low_threshold , uint16_t high_threshold) +{ + ADC_WDLT(adc_periph) = (uint32_t)WDLT_WDLT(low_threshold); + ADC_WDHT(adc_periph) = (uint32_t)WDHT_WDHT(high_threshold); +} + +/*! + \brief get the ADC flag bits + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_flag: the adc flag bits + only one parameter can be selected which is shown as below: + \arg ADC_FLAG_WDE: analog watchdog event flag + \arg ADC_FLAG_EOC: end of group conversion flag + \arg ADC_FLAG_EOIC: end of inserted group conversion flag + \arg ADC_FLAG_STIC: start flag of inserted channel group + \arg ADC_FLAG_STRC: start flag of regular channel group + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_flag_get(uint32_t adc_periph , uint32_t adc_flag) +{ + FlagStatus reval = RESET; + if(ADC_STAT(adc_periph) & adc_flag){ + reval = SET; + } + return reval; +} + +/*! + \brief clear the ADC flag bits + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_flag: the adc flag bits + one or more parameters can be selected which are shown as below: + \arg ADC_FLAG_WDE: analog watchdog event flag + \arg ADC_FLAG_EOC: end of group conversion flag + \arg ADC_FLAG_EOIC: end of inserted group conversion flag + \arg ADC_FLAG_STIC: start flag of inserted channel group + \arg ADC_FLAG_STRC: start flag of regular channel group + \param[out] none + \retval none +*/ +void adc_flag_clear(uint32_t adc_periph , uint32_t adc_flag) +{ + ADC_STAT(adc_periph) &= ~((uint32_t)adc_flag); +} + +/*! + \brief get the bit state of ADCx software start conversion + \param[in] adc_periph: ADCx, x=0,1, only one among these parameters can be selected + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_regular_software_startconv_flag_get(uint32_t adc_periph) +{ + FlagStatus reval = RESET; + if((uint32_t)RESET != (ADC_STAT(adc_periph) & ADC_STAT_STRC)){ + reval = SET; + } + return reval; +} + +/*! + \brief get the bit state of ADCx software inserted channel start conversion + \param[in] adc_periph: ADCx, x=0,1 only one among these parameters can be selected + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_inserted_software_startconv_flag_get(uint32_t adc_periph) +{ + FlagStatus reval = RESET; + if((uint32_t)RESET != (ADC_STAT(adc_periph) & ADC_STAT_STIC)){ + reval = SET; + } + return reval; +} + +/*! + \brief get the ADC interrupt bits + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc interrupt bits + only one parameter can be selected which is shown as below: + \arg ADC_INT_FLAG_WDE: analog watchdog interrupt + \arg ADC_INT_FLAG_EOC: end of group conversion interrupt + \arg ADC_INT_FLAG_EOIC: end of inserted group conversion interrupt + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_interrupt_flag_get(uint32_t adc_periph , uint32_t adc_interrupt) +{ + FlagStatus interrupt_flag = RESET; + uint32_t state; + /* check the interrupt bits */ + switch(adc_interrupt){ + case ADC_INT_FLAG_WDE: + /* get the ADC analog watchdog interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_WDE; + if((ADC_CTL0(adc_periph) & ADC_CTL0_WDEIE) && state){ + interrupt_flag = SET; + } + break; + case ADC_INT_FLAG_EOC: + /* get the ADC end of group conversion interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_EOC; + if((ADC_CTL0(adc_periph) & ADC_CTL0_EOCIE) && state){ + interrupt_flag = SET; + } + break; + case ADC_INT_FLAG_EOIC: + /* get the ADC end of inserted group conversion interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_EOIC; + if((ADC_CTL0(adc_periph) & ADC_CTL0_EOICIE) && state){ + interrupt_flag = SET; + } + break; + default: + break; + } + return interrupt_flag; +} + +/*! + \brief clear the ADC flag + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc status flag + one or more parameters can be selected which are shown as below: + \arg ADC_INT_FLAG_WDE: analog watchdog interrupt + \arg ADC_INT_FLAG_EOC: end of group conversion interrupt + \arg ADC_INT_FLAG_EOIC: end of inserted group conversion interrupt + \param[out] none + \retval none +*/ +void adc_interrupt_flag_clear(uint32_t adc_periph , uint32_t adc_interrupt) +{ + ADC_STAT(adc_periph) &= ~((uint32_t)adc_interrupt); +} + +/*! + \brief enable ADC interrupt + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc interrupt + one or more parameters can be selected which are shown as below: + \arg ADC_INT_WDE: analog watchdog interrupt flag + \arg ADC_INT_EOC: end of group conversion interrupt flag + \arg ADC_INT_EOIC: end of inserted group conversion interrupt flag + \param[out] none + \retval none +*/ +void adc_interrupt_enable(uint32_t adc_periph , uint32_t adc_interrupt) +{ + /* enable ADC analog watchdog interrupt */ + if(0U != (adc_interrupt & ADC_INT_WDE)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_WDEIE; + } + /* enable ADC end of group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOC)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_EOCIE; + } + /* enable ADC end of inserted group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOIC)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_EOICIE; + } +} + +/*! + \brief disable ADC interrupt + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc interrupt flag + one or more parameters can be selected which are shown as below: + \arg ADC_INT_WDE: analog watchdog interrupt flag + \arg ADC_INT_EOC: end of group conversion interrupt flag + \arg ADC_INT_EOIC: end of inserted group conversion interrupt flag + \param[out] none + \retval none +*/ +void adc_interrupt_disable(uint32_t adc_periph, uint32_t adc_interrupt) +{ + /* disable ADC analog watchdog interrupt */ + if(0U != (adc_interrupt & ADC_INT_WDE)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_WDEIE; + } + /* disable ADC end of group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOC)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_EOCIE; + } + /* disable ADC end of inserted group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOIC)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_EOICIE; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_adc.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_adc.c.base@1.0.0 new file mode 100644 index 0000000..638fd3a --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_adc.c.base@1.0.0 @@ -0,0 +1,992 @@ +/*! + \file gd32c10x_adc.c + \brief ADC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_adc.h" + +/* discontinuous mode macro*/ +#define ADC_CHANNEL_LENGTH_SUBTRACT_ONE ((uint8_t)1U) + +/* ADC regular channel macro */ +#define ADC_REGULAR_CHANNEL_RANK_SIX ((uint8_t)6U) +#define ADC_REGULAR_CHANNEL_RANK_TWELVE ((uint8_t)12U) +#define ADC_REGULAR_CHANNEL_RANK_SIXTEEN ((uint8_t)16U) +#define ADC_REGULAR_CHANNEL_RANK_LENGTH ((uint8_t)5U) + +/* ADC sampling time macro */ +#define ADC_CHANNEL_SAMPLE_TEN ((uint8_t)10U) +#define ADC_CHANNEL_SAMPLE_EIGHTEEN ((uint8_t)18U) +#define ADC_CHANNEL_SAMPLE_LENGTH ((uint8_t)3U) + +/* ADC inserted channel macro */ +#define ADC_INSERTED_CHANNEL_RANK_LENGTH ((uint8_t)5U) +#define ADC_INSERTED_CHANNEL_SHIFT_LENGTH ((uint8_t)15U) + +/* ADC inserted channel offset macro */ +#define ADC_OFFSET_LENGTH ((uint8_t)3U) +#define ADC_OFFSET_SHIFT_LENGTH ((uint8_t)4U) + +/*! + \brief reset ADC + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_deinit(uint32_t adc_periph) +{ + switch(adc_periph){ + case ADC0: + /* reset ADC0 */ + rcu_periph_reset_enable(RCU_ADC0RST); + rcu_periph_reset_disable(RCU_ADC0RST); + break; + case ADC1: + /* reset ADC1 */ + rcu_periph_reset_enable(RCU_ADC1RST); + rcu_periph_reset_disable(RCU_ADC1RST); + break; + default: + break; + } +} + +/*! + \brief configure the ADC sync mode + \param[in] mode: ADC mode + only one parameter can be selected which is shown as below: + \arg ADC_MODE_FREE: all the ADCs work independently + \arg ADC_DAUL_REGULAL_PARALLEL_INSERTED_PARALLEL: ADC0 and ADC1 work in combined regular parallel + inserted parallel mode + \arg ADC_DAUL_REGULAL_PARALLEL_INSERTED_ROTATION: ADC0 and ADC1 work in combined regular parallel + trigger rotation mode + \arg ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_FAST: ADC0 and ADC1 work in combined inserted parallel + follow-up fast mode + \arg ADC_DAUL_INSERTED_PARALLEL_REGULAL_FOLLOWUP_SLOW: ADC0 and ADC1 work in combined inserted parallel + follow-up slow mode + \arg ADC_DAUL_INSERTED_PARALLEL: ADC0 and ADC1 work in inserted parallel mode only + \arg ADC_DAUL_REGULAL_PARALLEL: ADC0 and ADC1 work in regular parallel mode only + \arg ADC_DAUL_REGULAL_FOLLOWUP_FAST: ADC0 and ADC1 work in follow-up fast mode only + \arg ADC_DAUL_REGULAL_FOLLOWUP_SLOW: ADC0 and ADC1 work in follow-up slow mode only + \arg ADC_DAUL_INSERTED_TRIGGER_ROTATION: ADC0 and ADC1 work in trigger rotation mode only + \param[out] none + \retval none +*/ +void adc_mode_config(uint32_t mode) +{ + ADC_CTL0(ADC0) &= ~(ADC_CTL0_SYNCM); + ADC_CTL0(ADC0) |= mode; +} + +/*! + \brief enable or disable ADC special function + \param[in] adc_periph: ADCx,x=0,1 + \param[in] function: the function to config + only one parameter can be selected which is shown as below: + \arg ADC_SCAN_MODE: scan mode select + \arg ADC_INSERTED_CHANNEL_AUTO: inserted channel group convert automatically + \arg ADC_CONTINUOUS_MODE: continuous mode select + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void adc_special_function_config(uint32_t adc_periph , uint32_t function , ControlStatus newvalue) +{ + if(newvalue){ + if(0U != (function & ADC_SCAN_MODE)){ + /* enable scan mode */ + ADC_CTL0(adc_periph) |= ADC_SCAN_MODE; + } + if(0U != (function & ADC_INSERTED_CHANNEL_AUTO)){ + /* enable inserted channel group convert automatically */ + ADC_CTL0(adc_periph) |= ADC_INSERTED_CHANNEL_AUTO; + } + if(0U != (function & ADC_CONTINUOUS_MODE)){ + /* enable continuous mode */ + ADC_CTL1(adc_periph) |= ADC_CONTINUOUS_MODE; + } + }else{ + if(0U != (function & ADC_SCAN_MODE)){ + /* disable scan mode */ + ADC_CTL0(adc_periph) &= ~ADC_SCAN_MODE; + } + if(0U != (function & ADC_INSERTED_CHANNEL_AUTO)){ + /* disable inserted channel group convert automatically */ + ADC_CTL0(adc_periph) &= ~ADC_INSERTED_CHANNEL_AUTO; + } + if(0U != (function & ADC_CONTINUOUS_MODE)){ + /* disable continuous mode */ + ADC_CTL1(adc_periph) &= ~ADC_CONTINUOUS_MODE; + } + } +} + +/*! + \brief configure ADC data alignment + \param[in] adc_periph: ADCx,x=0,1 + \param[in] data_alignment: data alignment select + only one parameter can be selected which is shown as below: + \arg ADC_DATAALIGN_RIGHT: LSB alignment + \arg ADC_DATAALIGN_LEFT: MSB alignment + \param[out] none + \retval none +*/ +void adc_data_alignment_config(uint32_t adc_periph , uint32_t data_alignment) +{ + if(ADC_DATAALIGN_RIGHT != data_alignment){ + /* MSB alignment */ + ADC_CTL1(adc_periph) |= ADC_CTL1_DAL; + }else{ + /* LSB alignment */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_DAL); + } +} + +/*! + \brief enable ADC interface + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_enable(uint32_t adc_periph) +{ + if(RESET == (ADC_CTL1(adc_periph) & ADC_CTL1_ADCON)){ + /* enable ADC */ + ADC_CTL1(adc_periph) |= (uint32_t)ADC_CTL1_ADCON; + } +} + +/*! + \brief disable ADC interface + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_disable(uint32_t adc_periph) +{ + /* disable ADC */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ADCON); +} + +/*! + \brief ADC calibration and reset calibration + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_calibration_enable(uint32_t adc_periph) +{ + /* reset the selected ADC calibration registers */ + ADC_CTL1(adc_periph) |= (uint32_t) ADC_CTL1_RSTCLB; + /* check the RSTCLB bit state */ + while(RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_RSTCLB)){ + } + /* enable ADC calibration process */ + ADC_CTL1(adc_periph) |= ADC_CTL1_CLB; + /* check the CLB bit state */ + while(RESET != (ADC_CTL1(adc_periph) & ADC_CTL1_CLB)){ + } +} + +/*! + \brief enable the temperature sensor and Vrefint channel + \param[in] none + \param[out] none + \retval none +*/ +void adc_tempsensor_vrefint_enable(void) +{ + /* enable the temperature sensor and Vrefint channel */ + ADC_CTL1(ADC0) |= ADC_CTL1_TSVREN; +} + +/*! + \brief disable the temperature sensor and Vrefint channel + \param[in] none + \param[out] none + \retval none +*/ +void adc_tempsensor_vrefint_disable(void) +{ + /* disable the temperature sensor and Vrefint channel */ + ADC_CTL1(ADC0) &= ~ADC_CTL1_TSVREN; +} + +/*! + \brief configure ADC resolution + \param[in] adc_periph: ADCx,x=0,1 + \param[in] resolution: ADC resolution + only one parameter can be selected which is shown as below: + \arg ADC_RESOLUTION_12B: 12-bit ADC resolution + \arg ADC_RESOLUTION_10B: 10-bit ADC resolution + \arg ADC_RESOLUTION_8B: 8-bit ADC resolution + \arg ADC_RESOLUTION_6B: 6-bit ADC resolution + \param[out] none + \retval none +*/ +void adc_resolution_config(uint32_t adc_periph , uint32_t resolution) +{ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)ADC_OVSAMPCTL_DRES); + ADC_OVSAMPCTL(adc_periph) |= (uint32_t)resolution; +} + +/*! + \brief configure ADC oversample mode + \param[in] adc_periph: ADCx,x=0,1 + \param[in] mode: ADC oversampling mode + only one parameter can be selected which is shown as below: + \arg ADC_OVERSAMPLING_ALL_CONVERT: all oversampled conversions for a channel are done consecutively after a trigger + \arg ADC_OVERSAMPLING_ONE_CONVERT: each oversampled conversion for a channel needs a trigger + \param[in] shift: ADC oversampling shift + only one parameter can be selected which is shown as below: + \arg ADC_OVERSAMPLING_SHIFT_NONE: no oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_1B: 1-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_2B: 2-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_3B: 3-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_4B: 3-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_5B: 5-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_6B: 6-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_7B: 7-bit oversampling shift + \arg ADC_OVERSAMPLING_SHIFT_8B: 8-bit oversampling shift + \param[in] ratio: ADC oversampling ratio + only one parameter can be selected which is shown as below: + \arg ADC_OVERSAMPLING_RATIO_MUL2: oversampling ratio multiple 2 + \arg ADC_OVERSAMPLING_RATIO_MUL4: oversampling ratio multiple 4 + \arg ADC_OVERSAMPLING_RATIO_MUL8: oversampling ratio multiple 8 + \arg ADC_OVERSAMPLING_RATIO_MUL16: oversampling ratio multiple 16 + \arg ADC_OVERSAMPLING_RATIO_MUL32: oversampling ratio multiple 32 + \arg ADC_OVERSAMPLING_RATIO_MUL64: oversampling ratio multiple 64 + \arg ADC_OVERSAMPLING_RATIO_MUL128: oversampling ratio multiple 128 + \arg ADC_OVERSAMPLING_RATIO_MUL256: oversampling ratio multiple 256 + \param[out] none + \retval none +*/ +void adc_oversample_mode_config(uint32_t adc_periph, uint32_t mode, uint16_t shift, uint8_t ratio) +{ + if(ADC_OVERSAMPLING_ONE_CONVERT == mode){ + ADC_OVSAMPCTL(adc_periph) |= (uint32_t)ADC_OVSAMPCTL_TOVS; + }else{ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)ADC_OVSAMPCTL_TOVS); + } + /* config the shift and ratio */ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)(ADC_OVSAMPCTL_OVSR | ADC_OVSAMPCTL_OVSS)); + ADC_OVSAMPCTL(adc_periph) |= ((uint32_t)shift | (uint32_t)ratio); +} + +/*! + \brief enable ADC oversample mode + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_oversample_mode_enable(uint32_t adc_periph) +{ + ADC_OVSAMPCTL(adc_periph) |= ADC_OVSAMPCTL_OVSEN; +} + +/*! + \brief disable ADC oversample mode + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_oversample_mode_disable(uint32_t adc_periph) +{ + ADC_OVSAMPCTL(adc_periph) &= ~((uint32_t)ADC_OVSAMPCTL_OVSEN); +} + +/*! + \brief enable DMA request + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_dma_mode_enable(uint32_t adc_periph) +{ + /* enable DMA request */ + ADC_CTL1(adc_periph) |= (uint32_t)(ADC_CTL1_DMA); +} + +/*! + \brief disable DMA request + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_dma_mode_disable(uint32_t adc_periph) +{ + /* disable DMA request */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_DMA); +} + +/*! + \brief configure ADC discontinuous mode + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \arg ADC_CHANNEL_DISCON_DISABLE: disable discontinuous mode of regular & inserted channel + \param[in] length: number of conversions in discontinuous mode,the number can be 1..8 + for regular channel ,the number has no effect for inserted channel + \param[out] none + \retval none +*/ +void adc_discontinuous_mode_config(uint32_t adc_periph, uint8_t adc_channel_group, uint8_t length) +{ + /* disable discontinuous mode of regular & inserted channel */ + ADC_CTL0(adc_periph) &= ~((uint32_t)(ADC_CTL0_DISRC | ADC_CTL0_DISIC)); + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* config the number of conversions in discontinuous mode */ + ADC_CTL0(adc_periph) &= ~((uint32_t)ADC_CTL0_DISNUM); + ADC_CTL0(adc_periph) |= CTL0_DISNUM(((uint32_t)length - ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + /* enable regular channel group discontinuous mode */ + ADC_CTL0(adc_periph) |= (uint32_t)ADC_CTL0_DISRC; + break; + case ADC_INSERTED_CHANNEL: + /* enable inserted channel group discontinuous mode */ + ADC_CTL0(adc_periph) |= (uint32_t)ADC_CTL0_DISIC; + break; + case ADC_CHANNEL_DISCON_DISABLE: + /* disable discontinuous mode of regular & inserted channel */ + default: + break; + } +} + +/*! + \brief configure the length of regular channel group or inserted channel group + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] length: the length of the channel + regular channel 1-16 + inserted channel 1-4 + \param[out] none + \retval none +*/ +void adc_channel_length_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t length) +{ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* configure the length of regular channel group */ + ADC_RSQ0(adc_periph) &= ~((uint32_t)ADC_RSQ0_RL); + ADC_RSQ0(adc_periph) |= RSQ0_RL((uint32_t)(length-ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + break; + case ADC_INSERTED_CHANNEL: + /* configure the length of inserted channel group */ + ADC_ISQ(adc_periph) &= ~((uint32_t)ADC_ISQ_IL); + ADC_ISQ(adc_periph) |= ISQ_IL((uint32_t)(length-ADC_CHANNEL_LENGTH_SUBTRACT_ONE)); + break; + default: + break; + } +} + +/*! + \brief configure ADC regular channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] rank: the regular group sequence rank,this parameter must be between 0 to 15 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x(x=0..17)(x=16 and x=17 are only for ADC0): ADC Channelx + \param[in] sample_time: the sample time value + only one parameter can be selected which is shown as below: + \arg ADC_SAMPLETIME_1POINT5: 1.5 cycles + \arg ADC_SAMPLETIME_7POINT5: 7.5 cycles + \arg ADC_SAMPLETIME_13POINT5: 13.5 cycles + \arg ADC_SAMPLETIME_28POINT5: 28.5 cycles + \arg ADC_SAMPLETIME_41POINT5: 41.5 cycles + \arg ADC_SAMPLETIME_55POINT5: 55.5 cycles + \arg ADC_SAMPLETIME_71POINT5: 71.5 cycles + \arg ADC_SAMPLETIME_239POINT5: 239.5 cycles + \param[out] none + \retval none +*/ +void adc_regular_channel_config(uint32_t adc_periph , uint8_t rank , uint8_t adc_channel , uint32_t sample_time) +{ + uint32_t rsq,sampt; + + /* ADC regular sequence config */ + if(rank < ADC_REGULAR_CHANNEL_RANK_SIX){ + /* the regular group sequence rank is smaller than six */ + rsq = ADC_RSQ2(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*rank))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*rank)); + ADC_RSQ2(adc_periph) = rsq; + }else if(rank < ADC_REGULAR_CHANNEL_RANK_TWELVE){ + /* the regular group sequence rank is smaller than twelve */ + rsq = ADC_RSQ1(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_SIX)))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_SIX))); + ADC_RSQ1(adc_periph) = rsq; + }else if(rank < ADC_REGULAR_CHANNEL_RANK_SIXTEEN){ + /* the regular group sequence rank is smaller than sixteen */ + rsq = ADC_RSQ0(adc_periph); + rsq &= ~((uint32_t)(ADC_RSQX_RSQN << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_TWELVE)))); + /* the channel number is written to these bits to select a channel as the nth conversion in the regular channel group */ + rsq |= ((uint32_t)adc_channel << (ADC_REGULAR_CHANNEL_RANK_LENGTH*(rank-ADC_REGULAR_CHANNEL_RANK_TWELVE))); + ADC_RSQ0(adc_periph) = rsq; + }else{ + } + + /* ADC sampling time config */ + if(adc_channel < ADC_CHANNEL_SAMPLE_TEN){ + /* the regular group sequence rank is smaller than ten */ + sampt = ADC_SAMPT1(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel))); + /* channel sample time set*/ + sampt |= (uint32_t)(sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel)); + ADC_SAMPT1(adc_periph) = sampt; + }else if(adc_channel < ADC_CHANNEL_SAMPLE_EIGHTEEN){ + /* the regular group sequence rank is smaller than eighteen */ + sampt = ADC_SAMPT0(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN)))); + /* channel sample time set*/ + sampt |= (uint32_t)(sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN))); + ADC_SAMPT0(adc_periph) = sampt; + }else{ + } +} + +/*! + \brief configure ADC inserted channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] rank: the inserted group sequencer rank,this parameter must be between 0 to 3 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x(x=0..17)(x=16 and x=17 are only for ADC0): ADC Channelx + \param[in] sample_time: The sample time value + only one parameter can be selected which is shown as below: + \arg ADC_SAMPLETIME_1POINT5: 1.5 cycles + \arg ADC_SAMPLETIME_7POINT5: 7.5 cycles + \arg ADC_SAMPLETIME_13POINT5: 13.5 cycles + \arg ADC_SAMPLETIME_28POINT5: 28.5 cycles + \arg ADC_SAMPLETIME_41POINT5: 41.5 cycles + \arg ADC_SAMPLETIME_55POINT5: 55.5 cycles + \arg ADC_SAMPLETIME_71POINT5: 71.5 cycles + \arg ADC_SAMPLETIME_239POINT5: 239.5 cycles + \param[out] none + \retval none +*/ +void adc_inserted_channel_config(uint32_t adc_periph , uint8_t rank , uint8_t adc_channel , uint32_t sample_time) +{ + uint8_t inserted_length; + uint32_t isq,sampt; + + /* get inserted channel group length */ + inserted_length = (uint8_t)GET_BITS(ADC_ISQ(adc_periph) , 20U , 21U); + /* the channel number is written to these bits to select a channel as the nth conversion in the inserted channel group */ + isq = ADC_ISQ(adc_periph); + isq &= ~((uint32_t)(ADC_ISQ_ISQN << (5U * ((3 + rank) - inserted_length)))); + isq |= ((uint32_t)adc_channel << (5U * ((3 + rank) - inserted_length))); + ADC_ISQ(adc_periph) = isq; + + /* ADC sampling time config */ + if(adc_channel < ADC_CHANNEL_SAMPLE_TEN){ + /* the inserted group sequence rank is smaller than ten */ + sampt = ADC_SAMPT1(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel))); + /* channel sample time set*/ + sampt |= (uint32_t) sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*adc_channel); + ADC_SAMPT1(adc_periph) = sampt; + }else if(adc_channel < ADC_CHANNEL_SAMPLE_EIGHTEEN){ + /* the inserted group sequence rank is smaller than eighteen */ + sampt = ADC_SAMPT0(adc_periph); + sampt &= ~((uint32_t)(ADC_SAMPTX_SPTN << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN)))); + /* channel sample time set*/ + sampt |= ((uint32_t)sample_time << (ADC_CHANNEL_SAMPLE_LENGTH*(adc_channel-ADC_CHANNEL_SAMPLE_TEN))); + ADC_SAMPT0(adc_periph) = sampt; + }else{ + } +} + +/*! + \brief configure ADC inserted channel offset + \param[in] adc_periph: ADCx,x=0,1 + \param[in] inserted_channel : insert channel select + only one parameter can be selected which is shown as below: + \arg ADC_INSERTED_CHANNEL_0: inserted channel0 + \arg ADC_INSERTED_CHANNEL_1: inserted channel1 + \arg ADC_INSERTED_CHANNEL_2: inserted channel2 + \arg ADC_INSERTED_CHANNEL_3: inserted channel3 + \param[in] offset : the offset data + \param[out] none + \retval none +*/ +void adc_inserted_channel_offset_config(uint32_t adc_periph , uint8_t inserted_channel , uint16_t offset) +{ + uint8_t inserted_length; + uint32_t num = 0U; + + inserted_length = (uint8_t)GET_BITS(ADC_ISQ(adc_periph) , 20U , 21U); + num = ((uint32_t)ADC_OFFSET_LENGTH - ((uint32_t)inserted_length - (uint32_t)inserted_channel)); + + if(num <= ADC_OFFSET_LENGTH){ + /* calculate the offset of the register */ + num = num * ADC_OFFSET_SHIFT_LENGTH; + /* config the offset of the selected channels */ + REG32((adc_periph) + 0x14U + num) = IOFFX_IOFF((uint32_t)offset); + } +} + +/*! + \brief configure ADC external trigger source + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] external_trigger_source: regular or inserted group trigger source + only one parameter can be selected which is shown as below: + for regular channel: + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH0: timer 0 CC0 event select + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH1: timer 0 CC1 event select + \arg ADC0_1_EXTTRIG_REGULAR_T0_CH2: timer 0 CC2 event select + \arg ADC0_1_EXTTRIG_REGULAR_T1_CH1: timer 1 CC1 event select + \arg ADC0_1_EXTTRIG_REGULAR_T2_TRGO: timer 2 TRGO event select + \arg ADC0_1_EXTTRIG_REGULAR_T3_CH3: timer 3 CC3 event select + \arg ADC0_1_EXTTRIG_REGULAR_T7_TRGO: timer 7 TRGO event select + \arg ADC0_1_EXTTRIG_REGULAR_EXTI_11 : external interrupt line 11 + \arg ADC0_1_EXTTRIG_REGULAR_NONE: software trigger + for inserted channel: + \arg ADC0_1_EXTTRIG_INSERTED_T0_TRGO: timer 0 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_T0_CH3: timer 0 CC3 event select + \arg ADC0_1_EXTTRIG_INSERTED_T1_TRGO: timer 1 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_T1_CH0: timer 1 CC0 event select + \arg ADC0_1_EXTTRIG_INSERTED_T2_CH3: timer 2 CC3 event select + \arg ADC0_1_EXTTRIG_INSERTED_T3_TRGO: timer 3 TRGO event select + \arg ADC0_1_EXTTRIG_INSERTED_EXTI_15: external interrupt line 15 + \arg ADC0_1_EXTTRIG_INSERTED_T7_CH3: timer 7 CC3 event select + \arg ADC0_1_EXTTRIG_INSERTED_NONE: software trigger + \param[out] none + \retval none +*/ +void adc_external_trigger_source_config(uint32_t adc_periph, uint8_t adc_channel_group, uint32_t external_trigger_source) +{ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* configure ADC regular group external trigger source */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ETSRC); + ADC_CTL1(adc_periph) |= (uint32_t)external_trigger_source; + break; + case ADC_INSERTED_CHANNEL: + /* configure ADC inserted group external trigger source */ + ADC_CTL1(adc_periph) &= ~((uint32_t)ADC_CTL1_ETSIC); + ADC_CTL1(adc_periph) |= (uint32_t)external_trigger_source; + break; + default: + break; + } +} + +/*! + \brief enable ADC external trigger + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + one or more parameters can be selected which are shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void adc_external_trigger_config(uint32_t adc_periph, uint8_t adc_channel_group, ControlStatus newvalue) +{ + if(newvalue){ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* enable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_ETERC; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* enable ADC inserted channel group external trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_ETEIC; + } + }else{ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* disable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) &= ~ADC_CTL1_ETERC; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* disable ADC regular channel group external trigger */ + ADC_CTL1(adc_periph) &= ~ADC_CTL1_ETEIC; + } + } +} + +/*! + \brief enable ADC software trigger + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: select the channel group + one or more parameters can be selected which are shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \param[out] none + \retval none +*/ +void adc_software_trigger_enable(uint32_t adc_periph , uint8_t adc_channel_group) +{ + if(0U != (adc_channel_group & ADC_REGULAR_CHANNEL)){ + /* enable ADC regular channel group software trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_SWRCST; + } + if(0U != (adc_channel_group & ADC_INSERTED_CHANNEL)){ + /* enable ADC inserted channel group software trigger */ + ADC_CTL1(adc_periph) |= ADC_CTL1_SWICST; + } +} + +/*! + \brief read ADC regular group data register + \param[in] adc_periph: ADCx,x=0,1 + \param[in] none + \param[out] none + \retval the conversion value +*/ +uint16_t adc_regular_data_read(uint32_t adc_periph) +{ + return (uint16_t)(ADC_RDATA(adc_periph)); +} + +/*! + \brief read ADC inserted group data register + \param[in] adc_periph: ADCx,x=0,1 + \param[in] inserted_channel : insert channel select + only one parameter can be selected which is shown as below: + \arg ADC_INSERTED_CHANNEL_0: inserted Channel0 + \arg ADC_INSERTED_CHANNEL_1: inserted channel1 + \arg ADC_INSERTED_CHANNEL_2: inserted Channel2 + \arg ADC_INSERTED_CHANNEL_3: inserted Channel3 + \param[out] none + \retval the conversion value +*/ +uint16_t adc_inserted_data_read(uint32_t adc_periph , uint8_t inserted_channel) +{ + uint32_t idata; + /* read the data of the selected channel */ + switch(inserted_channel){ + case ADC_INSERTED_CHANNEL_0: + /* read the data of channel 0 */ + idata = ADC_IDATA0(adc_periph); + break; + case ADC_INSERTED_CHANNEL_1: + /* read the data of channel 1 */ + idata = ADC_IDATA1(adc_periph); + break; + case ADC_INSERTED_CHANNEL_2: + /* read the data of channel 2 */ + idata = ADC_IDATA2(adc_periph); + break; + case ADC_INSERTED_CHANNEL_3: + /* read the data of channel 3 */ + idata = ADC_IDATA3(adc_periph); + break; + default: + idata = 0U; + break; + } + return (uint16_t)idata; +} + +/*! + \brief read the last ADC0 and ADC1 conversion result data in sync mode + \param[in] none + \param[out] none + \retval the conversion value +*/ +uint32_t adc_sync_mode_convert_value_read(void) +{ + /* return conversion value */ + return ADC_RDATA(ADC0); +} + +/*! + \brief configure ADC analog watchdog single channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel: the selected ADC channel + only one parameter can be selected which is shown as below: + \arg ADC_CHANNEL_x: ADC Channelx(x=0..17)(x=16 and x=17 are only for ADC0) + \param[out] none + \retval none +*/ +void adc_watchdog_single_channel_enable(uint32_t adc_periph, uint8_t adc_channel) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); + /* analog watchdog channel select */ + ADC_CTL0(adc_periph) |= (uint32_t)adc_channel; + ADC_CTL0(adc_periph) |= (uint32_t)(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC); +} + +/*! + \brief configure ADC analog watchdog group channel + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_channel_group: the channel group use analog watchdog + only one parameter can be selected which is shown as below: + \arg ADC_REGULAR_CHANNEL: regular channel group + \arg ADC_INSERTED_CHANNEL: inserted channel group + \arg ADC_REGULAR_INSERTED_CHANNEL: both regular and inserted group + \param[out] none + \retval none +*/ +void adc_watchdog_group_channel_enable(uint32_t adc_periph, uint8_t adc_channel_group) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC); + /* select the group */ + switch(adc_channel_group){ + case ADC_REGULAR_CHANNEL: + /* regular channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_RWDEN; + break; + case ADC_INSERTED_CHANNEL: + /* inserted channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_IWDEN; + break; + case ADC_REGULAR_INSERTED_CHANNEL: + /* regular and inserted channel analog watchdog enable */ + ADC_CTL0(adc_periph) |= (uint32_t)(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN); + break; + default: + break; + } +} + +/*! + \brief disable ADC analog watchdog + \param[in] adc_periph: ADCx,x=0,1 + \param[out] none + \retval none +*/ +void adc_watchdog_disable(uint32_t adc_periph) +{ + ADC_CTL0(adc_periph) &= (uint32_t)~(ADC_CTL0_RWDEN | ADC_CTL0_IWDEN | ADC_CTL0_WDSC | ADC_CTL0_WDCHSEL); +} + +/*! + \brief configure ADC analog watchdog threshold + \param[in] adc_periph: ADCx,x=0,1 + \param[in] low_threshold: analog watchdog low threshold,0..4095 + \param[in] high_threshold: analog watchdog high threshold,0..4095 + \param[out] none + \retval none +*/ +void adc_watchdog_threshold_config(uint32_t adc_periph , uint16_t low_threshold , uint16_t high_threshold) +{ + ADC_WDLT(adc_periph) = (uint32_t)WDLT_WDLT(low_threshold); + ADC_WDHT(adc_periph) = (uint32_t)WDHT_WDHT(high_threshold); +} + +/*! + \brief get the ADC flag bits + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_flag: the adc flag bits + only one parameter can be selected which is shown as below: + \arg ADC_FLAG_WDE: analog watchdog event flag + \arg ADC_FLAG_EOC: end of group conversion flag + \arg ADC_FLAG_EOIC: end of inserted group conversion flag + \arg ADC_FLAG_STIC: start flag of inserted channel group + \arg ADC_FLAG_STRC: start flag of regular channel group + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_flag_get(uint32_t adc_periph , uint32_t adc_flag) +{ + FlagStatus reval = RESET; + if(ADC_STAT(adc_periph) & adc_flag){ + reval = SET; + } + return reval; +} + +/*! + \brief clear the ADC flag bits + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_flag: the adc flag bits + one or more parameters can be selected which are shown as below: + \arg ADC_FLAG_WDE: analog watchdog event flag + \arg ADC_FLAG_EOC: end of group conversion flag + \arg ADC_FLAG_EOIC: end of inserted group conversion flag + \arg ADC_FLAG_STIC: start flag of inserted channel group + \arg ADC_FLAG_STRC: start flag of regular channel group + \param[out] none + \retval none +*/ +void adc_flag_clear(uint32_t adc_periph , uint32_t adc_flag) +{ + ADC_STAT(adc_periph) &= ~((uint32_t)adc_flag); +} + +/*! + \brief get the bit state of ADCx software start conversion + \param[in] adc_periph: ADCx, x=0,1, only one among these parameters can be selected + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_regular_software_startconv_flag_get(uint32_t adc_periph) +{ + FlagStatus reval = RESET; + if((uint32_t)RESET != (ADC_STAT(adc_periph) & ADC_STAT_STRC)){ + reval = SET; + } + return reval; +} + +/*! + \brief get the bit state of ADCx software inserted channel start conversion + \param[in] adc_periph: ADCx, x=0,1 only one among these parameters can be selected + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_inserted_software_startconv_flag_get(uint32_t adc_periph) +{ + FlagStatus reval = RESET; + if((uint32_t)RESET != (ADC_STAT(adc_periph) & ADC_STAT_STIC)){ + reval = SET; + } + return reval; +} + +/*! + \brief get the ADC interrupt bits + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc interrupt bits + only one parameter can be selected which is shown as below: + \arg ADC_INT_FLAG_WDE: analog watchdog interrupt + \arg ADC_INT_FLAG_EOC: end of group conversion interrupt + \arg ADC_INT_FLAG_EOIC: end of inserted group conversion interrupt + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus adc_interrupt_flag_get(uint32_t adc_periph , uint32_t adc_interrupt) +{ + FlagStatus interrupt_flag = RESET; + uint32_t state; + /* check the interrupt bits */ + switch(adc_interrupt){ + case ADC_INT_FLAG_WDE: + /* get the ADC analog watchdog interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_WDE; + if((ADC_CTL0(adc_periph) & ADC_CTL0_WDEIE) && state){ + interrupt_flag = SET; + } + break; + case ADC_INT_FLAG_EOC: + /* get the ADC end of group conversion interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_EOC; + if((ADC_CTL0(adc_periph) & ADC_CTL0_EOCIE) && state){ + interrupt_flag = SET; + } + break; + case ADC_INT_FLAG_EOIC: + /* get the ADC end of inserted group conversion interrupt bits */ + state = ADC_STAT(adc_periph) & ADC_STAT_EOIC; + if((ADC_CTL0(adc_periph) & ADC_CTL0_EOICIE) && state){ + interrupt_flag = SET; + } + break; + default: + break; + } + return interrupt_flag; +} + +/*! + \brief clear the ADC flag + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc status flag + one or more parameters can be selected which are shown as below: + \arg ADC_INT_FLAG_WDE: analog watchdog interrupt + \arg ADC_INT_FLAG_EOC: end of group conversion interrupt + \arg ADC_INT_FLAG_EOIC: end of inserted group conversion interrupt + \param[out] none + \retval none +*/ +void adc_interrupt_flag_clear(uint32_t adc_periph , uint32_t adc_interrupt) +{ + ADC_STAT(adc_periph) &= ~((uint32_t)adc_interrupt); +} + +/*! + \brief enable ADC interrupt + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc interrupt + one or more parameters can be selected which are shown as below: + \arg ADC_INT_WDE: analog watchdog interrupt flag + \arg ADC_INT_EOC: end of group conversion interrupt flag + \arg ADC_INT_EOIC: end of inserted group conversion interrupt flag + \param[out] none + \retval none +*/ +void adc_interrupt_enable(uint32_t adc_periph , uint32_t adc_interrupt) +{ + /* enable ADC analog watchdog interrupt */ + if(0U != (adc_interrupt & ADC_INT_WDE)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_WDEIE; + } + /* enable ADC end of group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOC)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_EOCIE; + } + /* enable ADC end of inserted group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOIC)){ + ADC_CTL0(adc_periph) |= (uint32_t) ADC_CTL0_EOICIE; + } +} + +/*! + \brief disable ADC interrupt + \param[in] adc_periph: ADCx,x=0,1 + \param[in] adc_interrupt: the adc interrupt flag + one or more parameters can be selected which are shown as below: + \arg ADC_INT_WDE: analog watchdog interrupt flag + \arg ADC_INT_EOC: end of group conversion interrupt flag + \arg ADC_INT_EOIC: end of inserted group conversion interrupt flag + \param[out] none + \retval none +*/ +void adc_interrupt_disable(uint32_t adc_periph, uint32_t adc_interrupt) +{ + /* disable ADC analog watchdog interrupt */ + if(0U != (adc_interrupt & ADC_INT_WDE)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_WDEIE; + } + /* disable ADC end of group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOC)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_EOCIE; + } + /* disable ADC end of inserted group conversion interrupt */ + if(0U != (adc_interrupt & ADC_INT_EOIC)){ + ADC_CTL0(adc_periph) &= ~(uint32_t) ADC_CTL0_EOICIE; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c new file mode 100644 index 0000000..3832c3d --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c @@ -0,0 +1,332 @@ +/*! + \file gd32c10x_bkp.c + \brief BKP driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_bkp.h" + +/* BKP register bits offset */ +#define BKP_TAMPER_BITS_OFFSET ((uint32_t)8U) + +/*! + \brief reset BKP registers + \param[in] none + \param[out] none + \retval none +*/ +void bkp_deinit(void) +{ + /* reset BKP domain register*/ + rcu_bkp_reset_enable(); + rcu_bkp_reset_disable(); +} + +/*! + \brief write BKP data register + \param[in] register_number: refer to bkp_data_register_enum + only one parameter can be selected which is shown as below: + \arg BKP_DATA_x(x = 0..41): bkp data register number x + \param[in] data: the data to be write in BKP data register + \param[out] none + \retval none +*/ +void bkp_data_write(bkp_data_register_enum register_number, uint16_t data) +{ + if((register_number >= BKP_DATA_10) && (register_number <= BKP_DATA_41)){ + BKP_DATA10_41(register_number-1U) = data; + }else if((register_number >= BKP_DATA_0) && (register_number <= BKP_DATA_9)){ + BKP_DATA0_9(register_number-1U) = data; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief read BKP data register + \param[in] register_number: refer to bkp_data_register_enum + only one parameter can be selected which is shown as below: + \arg BKP_DATA_x(x = 0..41): bkp data register number x + \param[out] none + \retval data of BKP data register +*/ +uint16_t bkp_data_read(bkp_data_register_enum register_number) +{ + uint16_t data = 0U; + + /* get the data from the BKP data register */ + if((register_number >= BKP_DATA_10) && (register_number <= BKP_DATA_41)){ + data = BKP_DATA10_41(register_number-1U); + }else if((register_number >= BKP_DATA_0) && (register_number <= BKP_DATA_9)){ + data = BKP_DATA0_9(register_number-1U); + }else{ + /* illegal parameters */ + } + return data; +} + +/*! + \brief enable RTC clock calibration output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_output_enable(void) +{ + BKP_OCTL |= (uint16_t)BKP_OCTL_COEN; +} + +/*! + \brief disable RTC clock calibration output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_output_disable(void) +{ + BKP_OCTL &= (uint16_t)~BKP_OCTL_COEN; +} + +/*! + \brief enable RTC alarm or second signal output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_signal_output_enable(void) +{ + BKP_OCTL |= (uint16_t)BKP_OCTL_ASOEN; +} + +/*! + \brief disable RTC alarm or second signal output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_signal_output_disable(void) +{ + BKP_OCTL &= (uint16_t)~BKP_OCTL_ASOEN; +} + +/*! + \brief select RTC output + \param[in] outputsel: RTC output selection + only one parameter can be selected which is shown as below: + \arg RTC_OUTPUT_ALARM_PULSE: RTC alarm pulse is selected as the RTC output + \arg RTC_OUTPUT_SECOND_PULSE: RTC second pulse is selected as the RTC output + \param[out] none + \retval none +*/ +void bkp_rtc_output_select(uint16_t outputsel) +{ + uint16_t ctl = 0U; + + /* configure BKP_OCTL_ROSEL with outputsel */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_ROSEL; + ctl |= outputsel; + BKP_OCTL = ctl; +} + +/*! + \brief select RTC clock output + \param[in] clocksel: RTC clock output selection + only one parameter can be selected which is shown as below: + \arg RTC_CLOCK_DIV_64: RTC clock div 64 + \arg RTC_CLOCK_DIV_1: RTC clock + \param[out] none + \retval none +*/ +void bkp_rtc_clock_output_select(uint16_t clocksel) +{ + uint16_t ctl = 0U; + + /* configure BKP_OCTL_CCOSEL with clocksel */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_CCOSEL; + ctl |= clocksel; + BKP_OCTL = ctl; +} + +/*! + \brief select RTC clock calibration direction + \param[in] direction: RTC clock calibration direction + only one parameter can be selected which is shown as below: + \arg RTC_CLOCK_SLOW_DOWN: RTC clock slow down + \arg RTC_CLOCK_SPEED_UP: RTC clock speed up + \param[out] none + \retval none +*/ +void bkp_rtc_clock_calibration_direction_select(uint16_t direction) +{ + uint16_t ctl = 0U; + + /* configure BKP_OCTL_CALDIR with direction */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_CALDIR; + ctl |= direction; + BKP_OCTL = ctl; +} + +/*! + \brief set RTC clock calibration value + \param[in] value: RTC clock calibration value + \arg 0x00 - 0x7F + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_value_set(uint8_t value) +{ + uint16_t ctl; + + /* configure BKP_OCTL_RCCV with value */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_RCCV; + ctl |= (uint16_t)OCTL_RCCV(value); + BKP_OCTL = ctl; +} + +/*! + \brief enable tamper detection + \param[in] none + \param[out] none + \retval none +*/ +void bkp_tamper_detection_enable(void) +{ + BKP_TPCTL |= (uint16_t)BKP_TPCTL_TPEN; +} + +/*! + \brief disable tamper detection + \param[in] none + \param[out] none + \retval none +*/ +void bkp_tamper_detection_disable(void) +{ + BKP_TPCTL &= (uint16_t)~BKP_TPCTL_TPEN; +} + +/*! + \brief set tamper pin active level + \param[in] level: tamper active level + only one parameter can be selected which is shown as below: + \arg TAMPER_PIN_ACTIVE_HIGH: the tamper pin is active high + \arg TAMPER_PIN_ACTIVE_LOW: the tamper pin is active low + \param[out] none + \retval none +*/ +void bkp_tamper_active_level_set(uint16_t level) +{ + uint16_t ctl = 0U; + + /* configure BKP_TPCTL_TPAL with level */ + ctl = BKP_TPCTL; + ctl &= (uint16_t)~BKP_TPCTL_TPAL; + ctl |= level; + BKP_TPCTL = ctl; +} + +/*! + \brief enable tamper interrupt + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_enable(void) +{ + BKP_TPCS |= (uint16_t)BKP_TPCS_TPIE; +} + +/*! + \brief disable tamper interrupt + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_disable(void) +{ + BKP_TPCS &= (uint16_t)~BKP_TPCS_TPIE; +} + +/*! + \brief get tamper flag state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus bkp_flag_get(void) +{ + if(RESET != (BKP_TPCS & BKP_FLAG_TAMPER)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear tamper flag state + \param[in] none + \param[out] none + \retval none +*/ +void bkp_flag_clear(void) +{ + BKP_TPCS |= (uint16_t)(BKP_FLAG_TAMPER >> BKP_TAMPER_BITS_OFFSET); +} + +/*! + \brief get tamper interrupt flag state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus bkp_interrupt_flag_get(void) +{ + if(RESET != (BKP_TPCS & BKP_INT_FLAG_TAMPER)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear tamper interrupt flag state + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_flag_clear(void) +{ + BKP_TPCS |= (uint16_t)(BKP_INT_FLAG_TAMPER >> BKP_TAMPER_BITS_OFFSET); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c.base@1.0.0 new file mode 100644 index 0000000..3832c3d --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c.base@1.0.0 @@ -0,0 +1,332 @@ +/*! + \file gd32c10x_bkp.c + \brief BKP driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_bkp.h" + +/* BKP register bits offset */ +#define BKP_TAMPER_BITS_OFFSET ((uint32_t)8U) + +/*! + \brief reset BKP registers + \param[in] none + \param[out] none + \retval none +*/ +void bkp_deinit(void) +{ + /* reset BKP domain register*/ + rcu_bkp_reset_enable(); + rcu_bkp_reset_disable(); +} + +/*! + \brief write BKP data register + \param[in] register_number: refer to bkp_data_register_enum + only one parameter can be selected which is shown as below: + \arg BKP_DATA_x(x = 0..41): bkp data register number x + \param[in] data: the data to be write in BKP data register + \param[out] none + \retval none +*/ +void bkp_data_write(bkp_data_register_enum register_number, uint16_t data) +{ + if((register_number >= BKP_DATA_10) && (register_number <= BKP_DATA_41)){ + BKP_DATA10_41(register_number-1U) = data; + }else if((register_number >= BKP_DATA_0) && (register_number <= BKP_DATA_9)){ + BKP_DATA0_9(register_number-1U) = data; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief read BKP data register + \param[in] register_number: refer to bkp_data_register_enum + only one parameter can be selected which is shown as below: + \arg BKP_DATA_x(x = 0..41): bkp data register number x + \param[out] none + \retval data of BKP data register +*/ +uint16_t bkp_data_read(bkp_data_register_enum register_number) +{ + uint16_t data = 0U; + + /* get the data from the BKP data register */ + if((register_number >= BKP_DATA_10) && (register_number <= BKP_DATA_41)){ + data = BKP_DATA10_41(register_number-1U); + }else if((register_number >= BKP_DATA_0) && (register_number <= BKP_DATA_9)){ + data = BKP_DATA0_9(register_number-1U); + }else{ + /* illegal parameters */ + } + return data; +} + +/*! + \brief enable RTC clock calibration output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_output_enable(void) +{ + BKP_OCTL |= (uint16_t)BKP_OCTL_COEN; +} + +/*! + \brief disable RTC clock calibration output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_output_disable(void) +{ + BKP_OCTL &= (uint16_t)~BKP_OCTL_COEN; +} + +/*! + \brief enable RTC alarm or second signal output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_signal_output_enable(void) +{ + BKP_OCTL |= (uint16_t)BKP_OCTL_ASOEN; +} + +/*! + \brief disable RTC alarm or second signal output + \param[in] none + \param[out] none + \retval none +*/ +void bkp_rtc_signal_output_disable(void) +{ + BKP_OCTL &= (uint16_t)~BKP_OCTL_ASOEN; +} + +/*! + \brief select RTC output + \param[in] outputsel: RTC output selection + only one parameter can be selected which is shown as below: + \arg RTC_OUTPUT_ALARM_PULSE: RTC alarm pulse is selected as the RTC output + \arg RTC_OUTPUT_SECOND_PULSE: RTC second pulse is selected as the RTC output + \param[out] none + \retval none +*/ +void bkp_rtc_output_select(uint16_t outputsel) +{ + uint16_t ctl = 0U; + + /* configure BKP_OCTL_ROSEL with outputsel */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_ROSEL; + ctl |= outputsel; + BKP_OCTL = ctl; +} + +/*! + \brief select RTC clock output + \param[in] clocksel: RTC clock output selection + only one parameter can be selected which is shown as below: + \arg RTC_CLOCK_DIV_64: RTC clock div 64 + \arg RTC_CLOCK_DIV_1: RTC clock + \param[out] none + \retval none +*/ +void bkp_rtc_clock_output_select(uint16_t clocksel) +{ + uint16_t ctl = 0U; + + /* configure BKP_OCTL_CCOSEL with clocksel */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_CCOSEL; + ctl |= clocksel; + BKP_OCTL = ctl; +} + +/*! + \brief select RTC clock calibration direction + \param[in] direction: RTC clock calibration direction + only one parameter can be selected which is shown as below: + \arg RTC_CLOCK_SLOW_DOWN: RTC clock slow down + \arg RTC_CLOCK_SPEED_UP: RTC clock speed up + \param[out] none + \retval none +*/ +void bkp_rtc_clock_calibration_direction_select(uint16_t direction) +{ + uint16_t ctl = 0U; + + /* configure BKP_OCTL_CALDIR with direction */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_CALDIR; + ctl |= direction; + BKP_OCTL = ctl; +} + +/*! + \brief set RTC clock calibration value + \param[in] value: RTC clock calibration value + \arg 0x00 - 0x7F + \param[out] none + \retval none +*/ +void bkp_rtc_calibration_value_set(uint8_t value) +{ + uint16_t ctl; + + /* configure BKP_OCTL_RCCV with value */ + ctl = BKP_OCTL; + ctl &= (uint16_t)~BKP_OCTL_RCCV; + ctl |= (uint16_t)OCTL_RCCV(value); + BKP_OCTL = ctl; +} + +/*! + \brief enable tamper detection + \param[in] none + \param[out] none + \retval none +*/ +void bkp_tamper_detection_enable(void) +{ + BKP_TPCTL |= (uint16_t)BKP_TPCTL_TPEN; +} + +/*! + \brief disable tamper detection + \param[in] none + \param[out] none + \retval none +*/ +void bkp_tamper_detection_disable(void) +{ + BKP_TPCTL &= (uint16_t)~BKP_TPCTL_TPEN; +} + +/*! + \brief set tamper pin active level + \param[in] level: tamper active level + only one parameter can be selected which is shown as below: + \arg TAMPER_PIN_ACTIVE_HIGH: the tamper pin is active high + \arg TAMPER_PIN_ACTIVE_LOW: the tamper pin is active low + \param[out] none + \retval none +*/ +void bkp_tamper_active_level_set(uint16_t level) +{ + uint16_t ctl = 0U; + + /* configure BKP_TPCTL_TPAL with level */ + ctl = BKP_TPCTL; + ctl &= (uint16_t)~BKP_TPCTL_TPAL; + ctl |= level; + BKP_TPCTL = ctl; +} + +/*! + \brief enable tamper interrupt + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_enable(void) +{ + BKP_TPCS |= (uint16_t)BKP_TPCS_TPIE; +} + +/*! + \brief disable tamper interrupt + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_disable(void) +{ + BKP_TPCS &= (uint16_t)~BKP_TPCS_TPIE; +} + +/*! + \brief get tamper flag state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus bkp_flag_get(void) +{ + if(RESET != (BKP_TPCS & BKP_FLAG_TAMPER)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear tamper flag state + \param[in] none + \param[out] none + \retval none +*/ +void bkp_flag_clear(void) +{ + BKP_TPCS |= (uint16_t)(BKP_FLAG_TAMPER >> BKP_TAMPER_BITS_OFFSET); +} + +/*! + \brief get tamper interrupt flag state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus bkp_interrupt_flag_get(void) +{ + if(RESET != (BKP_TPCS & BKP_INT_FLAG_TAMPER)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear tamper interrupt flag state + \param[in] none + \param[out] none + \retval none +*/ +void bkp_interrupt_flag_clear(void) +{ + BKP_TPCS |= (uint16_t)(BKP_INT_FLAG_TAMPER >> BKP_TAMPER_BITS_OFFSET); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c new file mode 100644 index 0000000..ca75355 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c @@ -0,0 +1,1473 @@ +/*! + \file gd32c10x_can.c + \brief CAN driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_can.h" +#include "stdio.h" +#include + +#define CAN_ERROR_HANDLE(s) do{}while(1) + +/* This table can be used to calculate data length in FD mode */ +const uint8_t g_can_fdlength_table[] = {12, 16, 20, 24, 32, 48, 64}; + +/*! + \brief deinitialize CAN + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_deinit(uint32_t can_periph) +{ + if(CAN0 == can_periph) { + rcu_periph_reset_enable(RCU_CAN0RST); + rcu_periph_reset_disable(RCU_CAN0RST); + } else { + rcu_periph_reset_enable(RCU_CAN1RST); + rcu_periph_reset_disable(RCU_CAN1RST); + } +} + +/*! + \brief initialize CAN parameter struct with a default value + \param[in] type: the type of CAN parameter struct + only one parameter can be selected which is shown as below: + \arg CAN_INIT_STRUCT: the CAN initial struct + \arg CAN_FILTER_STRUCT: the CAN filter struct + \arg CAN_FD_FRAME_STRUCT: the CAN FD initial struct + \arg CAN_TX_MESSAGE_STRUCT: the CAN TX message struct + \arg CAN_RX_MESSAGE_STRUCT: the CAN RX message struct + \param[in] p_struct: the pointer of the specific struct + \param[out] none + \retval none +*/ +void can_struct_para_init(can_struct_type_enum type, void *p_struct) +{ + uint8_t i; + + if(NULL == p_struct) { + CAN_ERROR_HANDLE("struct parameter can not be NULL \r\n"); + } + + /* get type of the struct */ + switch(type) { + /* used for can_init() */ + case CAN_INIT_STRUCT: + ((can_parameter_struct *)p_struct)->auto_bus_off_recovery = DISABLE; + ((can_parameter_struct *)p_struct)->auto_retrans = DISABLE; + ((can_parameter_struct *)p_struct)->auto_wake_up = DISABLE; + ((can_parameter_struct *)p_struct)->prescaler = 0x0400U; + ((can_parameter_struct *)p_struct)->rec_fifo_overwrite = DISABLE; + ((can_parameter_struct *)p_struct)->resync_jump_width = CAN_BT_SJW_1TQ; + ((can_parameter_struct *)p_struct)->time_segment_1 = CAN_BT_BS1_3TQ; + ((can_parameter_struct *)p_struct)->time_segment_2 = CAN_BT_BS2_1TQ; + ((can_parameter_struct *)p_struct)->time_triggered = DISABLE; + ((can_parameter_struct *)p_struct)->trans_fifo_order = DISABLE; + ((can_parameter_struct *)p_struct)->working_mode = CAN_NORMAL_MODE; + + break; + /* used for can_filter_init() */ + case CAN_FILTER_STRUCT: + ((can_filter_parameter_struct *)p_struct)->filter_bits = CAN_FILTERBITS_32BIT; + ((can_filter_parameter_struct *)p_struct)->filter_enable = DISABLE; + ((can_filter_parameter_struct *)p_struct)->filter_fifo_number = CAN_FIFO0; + ((can_filter_parameter_struct *)p_struct)->filter_list_high = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_list_low = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_mask_high = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_mask_low = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_mode = CAN_FILTERMODE_MASK; + ((can_filter_parameter_struct *)p_struct)->filter_number = 0U; + + break; + /* used for can_fd_init() */ + case CAN_FD_FRAME_STRUCT: + ((can_fdframe_struct *)p_struct)->data_prescaler = 0x0400U; + ((can_fdframe_struct *)p_struct)->data_resync_jump_width = 1U - 1U; + ((can_fdframe_struct *)p_struct)->data_time_segment_1 = 3U - 1U; + ((can_fdframe_struct *)p_struct)->data_time_segment_2 = 2U - 1U; + ((can_fdframe_struct *)p_struct)->delay_compensation = DISABLE; + ((can_fdframe_struct *)p_struct)->esi_mode = CAN_ESIMOD_HARDWARE; + ((can_fdframe_struct *)p_struct)->excp_event_detect = ENABLE; + ((can_fdframe_struct *)p_struct)->fd_frame = DISABLE; + ((can_fdframe_struct *)p_struct)->iso_bosch = CAN_FDMOD_ISO; + ((can_fdframe_struct *)p_struct)->p_delay_compensation = 0U; + + break; + /* used for can_message_transmit() */ + case CAN_TX_MESSAGE_STRUCT: + ((can_trasnmit_message_struct *)p_struct)->fd_brs = CAN_BRS_DISABLE; + ((can_trasnmit_message_struct *)p_struct)->fd_esi = CAN_ESI_DOMINANT; + ((can_trasnmit_message_struct *)p_struct)->fd_flag = CAN_FDF_CLASSIC; + + for(i = 0U; i < 64U; i++) { + ((can_trasnmit_message_struct *)p_struct)->tx_data[i] = 0U; + } + + ((can_trasnmit_message_struct *)p_struct)->tx_dlen = 0u; + ((can_trasnmit_message_struct *)p_struct)->tx_efid = 0U; + ((can_trasnmit_message_struct *)p_struct)->tx_ff = (uint8_t)CAN_FF_STANDARD; + ((can_trasnmit_message_struct *)p_struct)->tx_ft = (uint8_t)CAN_FT_DATA; + ((can_trasnmit_message_struct *)p_struct)->tx_sfid = 0U; + + break; + /* used for can_message_receive() */ + case CAN_RX_MESSAGE_STRUCT: + ((can_receive_message_struct *)p_struct)->fd_brs = CAN_BRS_DISABLE; + ((can_receive_message_struct *)p_struct)->fd_esi = CAN_ESI_DOMINANT; + ((can_receive_message_struct *)p_struct)->fd_flag = CAN_FDF_CLASSIC; + + for(i = 0U; i < 64U; i++) { + ((can_receive_message_struct *)p_struct)->rx_data[i] = 0U; + } + + ((can_receive_message_struct *)p_struct)->rx_dlen = 0U; + ((can_receive_message_struct *)p_struct)->rx_efid = 0U; + ((can_receive_message_struct *)p_struct)->rx_ff = (uint8_t)CAN_FF_STANDARD; + ((can_receive_message_struct *)p_struct)->rx_fi = 0U; + ((can_receive_message_struct *)p_struct)->rx_ft = (uint8_t)CAN_FT_DATA; + ((can_receive_message_struct *)p_struct)->rx_sfid = 0U; + + break; + + default: + CAN_ERROR_HANDLE("parameter is invalid \r\n"); + } +} + +/*! + \brief initialize CAN + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] can_parameter_init: parameters for CAN initialization + \arg working_mode: CAN_NORMAL_MODE, CAN_LOOPBACK_MODE, CAN_SILENT_MODE, CAN_SILENT_LOOPBACK_MODE + \arg resync_jump_width: 0x00 - 0x07 + \arg time_segment_1: 0x00 - 0x7F + \arg time_segment_2: 0x00 - 0x1F + \arg time_triggered: ENABLE or DISABLE + \arg auto_bus_off_recovery: ENABLE or DISABLE + \arg auto_wake_up: ENABLE or DISABLE + \arg auto_retrans: ENABLE or DISABLE + \arg rec_fifo_overwrite: ENABLE or DISABLE + \arg trans_fifo_order: ENABLE or DISABLE + \arg prescaler: 0x0001 - 0x0400 + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_init(uint32_t can_periph, can_parameter_struct *can_parameter_init) +{ + uint32_t timeout = CAN_TIMEOUT; + ErrStatus flag = ERROR; + uint32_t fdctl_status; + + /* disable sleep mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + /* enable initialize mode */ + CAN_CTL(can_periph) |= CAN_CTL_IWMOD; + /* wait ACK */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check initialize working success */ + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + flag = ERROR; + } else { + /* set the bit timing register */ + fdctl_status = CAN_FDCTL(can_periph); + if(CAN_FDCTL_FDEN != (fdctl_status & CAN_FDCTL_FDEN)) { + /* CAN FD disable, should first enable, then write */ + fdctl_status = fdctl_status | CAN_FDCTL_FDEN; + CAN_FDCTL(can_periph) = fdctl_status; + CAN_BT(can_periph) = (BT_MODE((uint32_t)can_parameter_init->working_mode) | \ + BT_SJW((uint32_t)can_parameter_init->resync_jump_width) | \ + BT_BS1((uint32_t)can_parameter_init->time_segment_1) | \ + BT_BS2((uint32_t)can_parameter_init->time_segment_2) | \ + BT_BAUDPSC(((uint32_t)(can_parameter_init->prescaler) - 1U))); + fdctl_status = fdctl_status & (~CAN_FDCTL_FDEN); + CAN_FDCTL(can_periph) = fdctl_status; + } else { + /* CAN FD enable */ + CAN_BT(can_periph) = (BT_MODE((uint32_t)can_parameter_init->working_mode) | \ + BT_SJW((uint32_t)can_parameter_init->resync_jump_width) | \ + BT_BS1((uint32_t)can_parameter_init->time_segment_1) | \ + BT_BS2((uint32_t)can_parameter_init->time_segment_2) | \ + BT_BAUDPSC(((uint32_t)(can_parameter_init->prescaler) - 1U))); + } + + /* time trigger communication mode */ + if(ENABLE == can_parameter_init->time_triggered) { + CAN_CTL(can_periph) |= CAN_CTL_TTC; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_TTC; + } + /* automatic bus-off management */ + if(ENABLE == can_parameter_init->auto_bus_off_recovery) { + CAN_CTL(can_periph) |= CAN_CTL_ABOR; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_ABOR; + } + /* automatic wakeup mode */ + if(ENABLE == can_parameter_init->auto_wake_up) { + CAN_CTL(can_periph) |= CAN_CTL_AWU; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_AWU; + } + /* automatic retransmission mode */ + if(ENABLE == can_parameter_init->auto_retrans) { + CAN_CTL(can_periph) &= ~CAN_CTL_ARD; + } else { + CAN_CTL(can_periph) |= CAN_CTL_ARD; + } + /* receive fifo overwrite mode */ + if(ENABLE == can_parameter_init->rec_fifo_overwrite) { + CAN_CTL(can_periph) &= ~CAN_CTL_RFOD; + } else { + CAN_CTL(can_periph) |= CAN_CTL_RFOD; + } + /* transmit fifo order */ + if(ENABLE == can_parameter_init->trans_fifo_order) { + CAN_CTL(can_periph) |= CAN_CTL_TFO; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_TFO; + } + /* disable initialize mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_IWMOD; + timeout = CAN_TIMEOUT; + /* wait the ACK */ + while((CAN_STAT_IWS == (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check exit initialize mode */ + if(0U != timeout) { + flag = SUCCESS; + } + } + return flag; +} + +/*! + \brief initialize CAN FD function + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] can_fdframe_init: parameters for CAN FD initialization + \arg fd_frame: ENABLE or DISABLE + \arg excp_event_detect: ENABLE or DISABLE + \arg delay_compensation: ENABLE or DISABLE + \arg p_delay_compensation: the pointer of tdc struct + can_fd_tdc_struct: + tdc_mode: CAN_TDCMOD_CALC_AND_OFFSET or CAN_TDCMOD_OFFSET + tdc_filter: 0x00 - 0x07 + tdc_offset: 0x00 - 0x07 + \arg iso_bosch: CAN_FDMOD_ISO or CAN_FDMOD_BOSCH + \arg esi_mode: CAN_ESIMOD_HARDWARE or CAN_ESIMOD_SOFTWARE + \arg data_resync_jump_width: 0x00 - 0x07 + \arg data_time_segment_1: 0x00 - 0x0F + \arg data_time_segment_2: 0x00 - 0x07 + \arg data_prescaler: 0x0001 - 0x0400 + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_fd_init(uint32_t can_periph, can_fdframe_struct *can_fdframe_init) +{ + uint32_t timeout = CAN_TIMEOUT; + uint32_t tempreg = 0U; + + /* check null pointer */ + if(0 == can_fdframe_init) { + return ERROR; + } + /* disable sleep mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + /* enable initialize mode */ + CAN_CTL(can_periph) |= CAN_CTL_IWMOD; + /* wait ACK */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check initialize working success */ + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + return ERROR; + } else { + /* set the data bit timing register */ + CAN_DBT(can_periph) = (BT_DSJW((uint32_t)can_fdframe_init->data_resync_jump_width) | \ + BT_DBS1((uint32_t)can_fdframe_init->data_time_segment_1) | \ + BT_DBS2((uint32_t)can_fdframe_init->data_time_segment_2) | \ + BT_BAUDPSC(((uint32_t)can_fdframe_init->data_prescaler) - 1U)); + + tempreg = can_fdframe_init->esi_mode | can_fdframe_init->iso_bosch; + + /* Protocol exception event detection */ + if(ENABLE == can_fdframe_init->excp_event_detect) { + tempreg &= ~CAN_FDCTL_PRED; + } else { + tempreg |= CAN_FDCTL_PRED; + } + + /* Transmitter delay compensation mode */ + if(ENABLE == can_fdframe_init->delay_compensation) { + tempreg |= CAN_FDCTL_TDCEN; + /* p_delay_compensation pointer should be config when TDC mode is enabled */ + if(0 != can_fdframe_init->p_delay_compensation) { + tempreg |= (can_fdframe_init->p_delay_compensation->tdc_mode & CAN_FDCTL_TDCMOD); + CAN_FDTDC(can_periph) = (FDTDC_TDCF(can_fdframe_init->p_delay_compensation->tdc_filter) | FDTDC_TDCO( + can_fdframe_init->p_delay_compensation->tdc_offset)); + } else { + return ERROR; + } + } else { + /* Transmitter delay compensation mode is disabled */ + tempreg &= ~CAN_FDCTL_TDCEN; + } + + /* FD operation mode */ + if(ENABLE == can_fdframe_init->fd_frame) { + tempreg |= CAN_FDCTL_FDEN; + } else { + tempreg &= ~CAN_FDCTL_FDEN; + } + CAN_FDCTL(can_periph) = tempreg; + + /* disable initialize mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_IWMOD; + timeout = CAN_TIMEOUT; + /* wait the ACK */ + while((CAN_STAT_IWS == (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check exit initialize mode */ + if(0U == timeout) { + return ERROR; + } + } + + return SUCCESS; +} + +/*! + \brief initialize CAN filter + \param[in] can_filter_parameter_init: struct for CAN filter initialization + \arg filter_list_high: 0x0000 - 0xFFFF + \arg filter_list_low: 0x0000 - 0xFFFF + \arg filter_mask_high: 0x0000 - 0xFFFF + \arg filter_mask_low: 0x0000 - 0xFFFF + \arg filter_fifo_number: CAN_FIFO0, CAN_FIFO1 + \arg filter_number: 0 - 27 + \arg filter_mode: CAN_FILTERMODE_MASK, CAN_FILTERMODE_LIST + \arg filter_bits: CAN_FILTERBITS_32BIT, CAN_FILTERBITS_16BIT + \arg filter_enable: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void can_filter_init(can_filter_parameter_struct *can_filter_parameter_init) +{ + uint32_t val = 0U; + + val = ((uint32_t)1) << (can_filter_parameter_init->filter_number); + /* filter lock disable */ + CAN_FCTL(CAN0) |= CAN_FCTL_FLD; + /* disable filter */ + CAN_FW(CAN0) &= ~(uint32_t)val; + + /* filter 16 bits */ + if(CAN_FILTERBITS_16BIT == can_filter_parameter_init->filter_bits) { + /* set filter 16 bits */ + CAN_FSCFG(CAN0) &= ~(uint32_t)val; + /* first 16 bits list and first 16 bits mask or first 16 bits list and second 16 bits list */ + CAN_FDATA0(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_low) & CAN_FILTER_MASK_16BITS) | \ + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_low) & CAN_FILTER_MASK_16BITS); + /* second 16 bits list and second 16 bits mask or third 16 bits list and fourth 16 bits list */ + CAN_FDATA1(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_high) & CAN_FILTER_MASK_16BITS) | \ + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_high) & CAN_FILTER_MASK_16BITS); + } + /* filter 32 bits */ + if(CAN_FILTERBITS_32BIT == can_filter_parameter_init->filter_bits) { + /* set filter 32 bits */ + CAN_FSCFG(CAN0) |= (uint32_t)val; + /* 32 bits list or first 32 bits list */ + CAN_FDATA0(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_list_high) & CAN_FILTER_MASK_16BITS) | + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_low) & CAN_FILTER_MASK_16BITS); + /* 32 bits mask or second 32 bits list */ + CAN_FDATA1(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_high) & CAN_FILTER_MASK_16BITS) | + FDATA_MASK_LOW((can_filter_parameter_init->filter_mask_low) & CAN_FILTER_MASK_16BITS); + } + + /* filter mode */ + if(CAN_FILTERMODE_MASK == can_filter_parameter_init->filter_mode) { + /* mask mode */ + CAN_FMCFG(CAN0) &= ~(uint32_t)val; + } else { + /* list mode */ + CAN_FMCFG(CAN0) |= (uint32_t)val; + } + + /* filter FIFO */ + if(CAN_FIFO0 == (can_filter_parameter_init->filter_fifo_number)) { + /* FIFO0 */ + CAN_FAFIFO(CAN0) &= ~(uint32_t)val; + } else { + /* FIFO1 */ + CAN_FAFIFO(CAN0) |= (uint32_t)val; + } + + /* filter working */ + if(ENABLE == can_filter_parameter_init->filter_enable) { + + CAN_FW(CAN0) |= (uint32_t)val; + } + + /* filter lock enable */ + CAN_FCTL(CAN0) &= ~CAN_FCTL_FLD; +} + +/*! + \brief CAN filter mask mode initialization + \param[in] id: extended(11-bits) or standard(29-bits) identifier + \arg 0x00000000 - 0x1FFFFFFF + \param[in] mask: extended(11-bits) or standard(29-bits) identifier mask + \arg 0x00000000 - 0x1FFFFFFF + \param[in] format_fifo: format and FIFO states + only one parameter can be selected which is shown as below: + \arg CAN_STANDARD_FIFO0 + \arg CAN_STANDARD_FIFO1 + \arg CAN_EXTENDED_FIFO0 + \arg CAN_EXTENDED_FIFO1 + \param[in] filter_number: filter sequence number + \arg 0x00 - 0x1C + \param[out] none + \retval none +*/ +void can_filter_mask_mode_init(uint32_t id, uint32_t mask, can_format_fifo_enum format_fifo, uint16_t filter_number) +{ + can_filter_parameter_struct can_filter; + + /* Initialize the filter structure */ + can_struct_para_init(CAN_FILTER_STRUCT, &can_filter); + + /* filter config */ + can_filter.filter_number = filter_number; + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + can_filter.filter_enable = ENABLE; + + switch(format_fifo) { + /* standard FIFO 0 */ + case CAN_STANDARD_FIFO0: + can_filter.filter_fifo_number = CAN_FIFO0; + /* configure SFID[10:0] */ + can_filter.filter_list_high = (uint16_t)id << 5; + can_filter.filter_list_low = 0x0000U; + /* configure SFID[10:0] mask */ + can_filter.filter_mask_high = (uint16_t)mask << 5; + /* both data and remote frames can be received */ + can_filter.filter_mask_low = (uint16_t)(1U << 2U); + + break; + /* standard FIFO 1 */ + case CAN_STANDARD_FIFO1: + can_filter.filter_fifo_number = CAN_FIFO1; + /* configure SFID[10:0] */ + can_filter.filter_list_high = (uint16_t)id << 5; + can_filter.filter_list_low = 0x0000U; + /* configure SFID[10:0] mask */ + can_filter.filter_mask_high = (uint16_t)mask << 5; + /* both data and remote frames can be received */ + can_filter.filter_mask_low = (uint16_t)(1U << 2U); + + break; + /* extended FIFO 0 */ + case CAN_EXTENDED_FIFO0: + can_filter.filter_fifo_number = CAN_FIFO0; + /* configure EFID[28:13] */ + can_filter.filter_list_high = (uint16_t)(id >> 13); + /* configure EFID[12:0] and frame format bit set */ + can_filter.filter_list_low = ((uint16_t)(id << 3)) | (1U << 2); + /* configure EFID[28:13] mask */ + can_filter.filter_mask_high = (uint16_t)(mask >> 13); + /* configure EFID[12:0] and frame format bit mask */ + /* both data and remote frames can be received */ + can_filter.filter_mask_low = ((uint16_t)(mask << 3)) | (1U << 2); + + break; + /* extended FIFO 1 */ + case CAN_EXTENDED_FIFO1: + can_filter.filter_fifo_number = CAN_FIFO1; + /* configure EFID[28:13] */ + can_filter.filter_list_high = (uint16_t)(id >> 13); + /* configure EFID[12:0] and frame format bit set */ + can_filter.filter_list_low = ((uint16_t)(id << 3)) | (1U << 2); + /* configure EFID[28:13] mask */ + can_filter.filter_mask_high = (uint16_t)(mask >> 13); + /* configure EFID[12:0] and frame format bit mask */ + /* both data and remote frames can be received */ + can_filter.filter_mask_low = ((uint16_t)(mask << 3)) | (1U << 2); + + break; + default: + CAN_ERROR_HANDLE("parameter is invalid \r\n"); + } + + can_filter_init(&can_filter); +} + +/*! + \brief CAN communication mode configure + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] mode: communication mode + only one parameter can be selected which is shown as below: + \arg CAN_NORMAL_MODE + \arg CAN_LOOPBACK_MODE + \arg CAN_SILENT_MODE + \arg CAN_SILENT_LOOPBACK_MODE + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_monitor_mode_set(uint32_t can_periph, uint8_t mode) +{ + ErrStatus reval = SUCCESS; + uint32_t timeout = CAN_TIMEOUT; + + if(mode == (mode & CAN_SILENT_LOOPBACK_MODE)) { + /* disable sleep mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_SLPWMOD); + /* set initialize mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_IWMOD; + /* wait the acknowledge */ + timeout = CAN_TIMEOUT; + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + reval = ERROR; + } else { + CAN_BT(can_periph) &= ~BT_MODE(3); + CAN_BT(can_periph) |= BT_MODE(mode); + + timeout = CAN_TIMEOUT; + /* enter normal mode */ + CAN_CTL(can_periph) &= ~(uint32_t)(CAN_CTL_SLPWMOD | CAN_CTL_IWMOD); + /* wait the acknowledge */ + while((0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) && (0U != timeout)) { + timeout--; + } + if(0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) { + reval = ERROR; + } + } + } else { + reval = ERROR; + } + + return reval; +} + +/*! + \brief CAN FD frame function enable + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_fd_function_enable(uint32_t can_periph) +{ + CAN_FDCTL(can_periph) |= CAN_FDCTL_FDEN; +} + +/*! + \brief CAN FD frame function disable + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_fd_function_disable(uint32_t can_periph) +{ + CAN_FDCTL(can_periph) &= ~CAN_FDCTL_FDEN; +} + +/*! + \brief set CAN1 filter start bank number + \param[in] start_bank: CAN1 start bank number + only one parameter can be selected which is shown as below: + \arg (1..27) + \param[out] none + \retval none +*/ +void can1_filter_start_bank(uint8_t start_bank) +{ + /* filter lock disable */ + CAN_FCTL(CAN0) |= CAN_FCTL_FLD; + /* set CAN1 filter start number */ + CAN_FCTL(CAN0) &= ~(uint32_t)CAN_FCTL_HBC1F; + CAN_FCTL(CAN0) |= FCTL_HBC1F(start_bank); + /* filter lock enable */ + CAN_FCTL(CAN0) &= ~CAN_FCTL_FLD; +} + +/*! + \brief enable CAN debug freeze + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_debug_freeze_enable(uint32_t can_periph) +{ + /* set DFZ bit */ + CAN_CTL(can_periph) |= CAN_CTL_DFZ; + if(CAN0 == can_periph) { + dbg_periph_enable(DBG_CAN0_HOLD); + } else { + dbg_periph_enable(DBG_CAN1_HOLD); + } +} + +/*! + \brief disable CAN debug freeze + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_debug_freeze_disable(uint32_t can_periph) +{ + /* set DFZ bit */ + CAN_CTL(can_periph) &= ~CAN_CTL_DFZ; + + if(CAN0 == can_periph) { + dbg_periph_disable(DBG_CAN0_HOLD); + } else { + dbg_periph_disable(DBG_CAN1_HOLD); + } +} + +/*! + \brief enable CAN time trigger mode + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_time_trigger_mode_enable(uint32_t can_periph) +{ + uint8_t mailbox_number; + + /* enable the tcc mode */ + CAN_CTL(can_periph) |= CAN_CTL_TTC; + /* enable time stamp */ + for(mailbox_number = 0U; mailbox_number < 3U; mailbox_number++) { + CAN_TMP(can_periph, mailbox_number) |= CAN_TMP_TSEN; + } +} + +/*! + \brief disable CAN time trigger mode + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_time_trigger_mode_disable(uint32_t can_periph) +{ + uint8_t mailbox_number; + + /* disable the TCC mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_TTC; + /* reset TSEN bits */ + for(mailbox_number = 0U; mailbox_number < 3U; mailbox_number++) { + CAN_TMP(can_periph, mailbox_number) &= ~CAN_TMP_TSEN; + } +} + +/*! + \brief transmit CAN message + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] transmit_message: struct for CAN transmit message + \arg tx_sfid: 0x00000000 - 0x000007FF + \arg tx_efid: 0x00000000 - 0x1FFFFFFF + \arg tx_ff: CAN_FF_STANDARD, CAN_FF_EXTENDED + \arg tx_ft: CAN_FT_DATA, CAN_FT_REMOTE + \arg tx_dlen: 0 - 8 (FD mode: 0 - 8, or 12, 16, 20, 24, 32, 48, 64) + \arg tx_data[]: 0x00 - 0xFF + \param[out] none + \retval mailbox_number +*/ +uint8_t can_message_transmit(uint32_t can_periph, can_trasnmit_message_struct *transmit_message) +{ + uint8_t mailbox_number = CAN_MAILBOX0; + uint8_t i = 0U; + uint8_t hit = 0U; + uint32_t canfd_en = 0U; + volatile uint32_t p_temp; + uint32_t reg_temp = 0U; + + /* select one empty mailbox */ + if(CAN_TSTAT_TME0 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME0)) { + mailbox_number = CAN_MAILBOX0; + } else if(CAN_TSTAT_TME1 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME1)) { + mailbox_number = CAN_MAILBOX1; + } else if(CAN_TSTAT_TME2 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME2)) { + mailbox_number = CAN_MAILBOX2; + } else { + mailbox_number = CAN_NOMAILBOX; + } + /* return no mailbox empty */ + if(CAN_NOMAILBOX == mailbox_number) { + return CAN_NOMAILBOX; + } + + CAN_TMI(can_periph, mailbox_number) &= CAN_TMI_TEN; + if(CAN_FF_STANDARD == transmit_message->tx_ff) { + /* set transmit mailbox standard identifier */ + CAN_TMI(can_periph, mailbox_number) |= (uint32_t)(TMI_SFID(transmit_message->tx_sfid) | \ + transmit_message->tx_ft); + } else { + /* set transmit mailbox extended identifier */ + CAN_TMI(can_periph, mailbox_number) |= (uint32_t)(TMI_EFID(transmit_message->tx_efid) | \ + transmit_message->tx_ff | \ + transmit_message->tx_ft); + } + + if(CAN_FDF_CLASSIC == transmit_message->fd_flag) { + /* set the data length */ + CAN_TMP(can_periph, mailbox_number) &= ~(CAN_TMP_DLENC | CAN_TMP_ESI | CAN_TMP_BRS | CAN_TMP_FDF); + /* Classic CAN frame data length does not exceed 8 */ + if (transmit_message->tx_dlen > 8U) { + transmit_message->tx_dlen = 8U; + } + CAN_TMP(can_periph, mailbox_number) |= transmit_message->tx_dlen; + /* set the data */ + CAN_TMDATA0(can_periph, mailbox_number) = TMDATA0_DB3(transmit_message->tx_data[3]) | \ + TMDATA0_DB2(transmit_message->tx_data[2]) | \ + TMDATA0_DB1(transmit_message->tx_data[1]) | \ + TMDATA0_DB0(transmit_message->tx_data[0]); + CAN_TMDATA1(can_periph, mailbox_number) = TMDATA1_DB7(transmit_message->tx_data[7]) | \ + TMDATA1_DB6(transmit_message->tx_data[6]) | \ + TMDATA1_DB5(transmit_message->tx_data[5]) | \ + TMDATA1_DB4(transmit_message->tx_data[4]); + } else { + canfd_en = CAN_FDCTL(can_periph) & CAN_FDCTL_FDEN; + /* check FD function has been enabled */ + if(canfd_en) { + if(transmit_message->tx_dlen <= 8U) { + /* set the data length */ + reg_temp |= transmit_message->tx_dlen; + } else { + /* data length greater than 8 */ + for(i = 0U; i < 7U; i++) { + if(transmit_message->tx_dlen == g_can_fdlength_table[i]) { + hit = 1U; + break; + } + } + /* data length is valid */ + if(1U == hit) { + reg_temp |= 9U + i; + } else { + CAN_ERROR_HANDLE("dlen is invalid \r\n"); + } + } + reg_temp |= (((uint32_t)transmit_message->fd_brs << 5U) | ((uint32_t)transmit_message->fd_esi << 4U) | ((uint32_t)transmit_message->fd_flag << 7U)); + CAN_TMP(can_periph, mailbox_number) = reg_temp; + + /* set the data */ + i = transmit_message->tx_dlen / 4U; + + /* data length is 5-7 need send 2 word */ + if((1U == i) && (4U != transmit_message->tx_dlen)) { + i++; + } + p_temp = (uint32_t)transmit_message->tx_data; + if((0U == i)) { + CAN_TMDATA0(can_periph, mailbox_number) = *(uint32_t *)p_temp; + } else { + for(; i > 0U; i--) { + CAN_TMDATA0(can_periph, mailbox_number) = *(uint32_t *)p_temp; + p_temp = ((uint32_t)((uint32_t)p_temp + 4U)); + } + } + + } else { + CAN_ERROR_HANDLE("CAN FD function disabled \r\n"); + } + } + + /* enable transmission */ + CAN_TMI(can_periph, mailbox_number) |= CAN_TMI_TEN; + + return mailbox_number; +} + +/*! + \brief get CAN transmit state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] mailbox_number + only one parameter can be selected which is shown as below: + \arg CAN_MAILBOX(x=0,1,2) + \param[out] none + \retval can_transmit_state_enum +*/ +can_transmit_state_enum can_transmit_states(uint32_t can_periph, uint8_t mailbox_number) +{ + can_transmit_state_enum state = CAN_TRANSMIT_FAILED; + uint32_t val = 0U; + + /* check selected mailbox state */ + switch(mailbox_number) { + /* mailbox0 */ + case CAN_MAILBOX0: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF0 | CAN_TSTAT_MTFNERR0 | CAN_TSTAT_TME0); + break; + /* mailbox1 */ + case CAN_MAILBOX1: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF1 | CAN_TSTAT_MTFNERR1 | CAN_TSTAT_TME1); + break; + /* mailbox2 */ + case CAN_MAILBOX2: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF2 | CAN_TSTAT_MTFNERR2 | CAN_TSTAT_TME2); + break; + default: + val = CAN_TRANSMIT_FAILED; + break; + } + + switch(val) { + /* transmit pending */ + case(CAN_STATE_PENDING): + state = CAN_TRANSMIT_PENDING; + break; + /* mailbox0 transmit succeeded */ + case(CAN_TSTAT_MTF0 | CAN_TSTAT_MTFNERR0 | CAN_TSTAT_TME0): + state = CAN_TRANSMIT_OK; + break; + /* mailbox1 transmit succeeded */ + case(CAN_TSTAT_MTF1 | CAN_TSTAT_MTFNERR1 | CAN_TSTAT_TME1): + state = CAN_TRANSMIT_OK; + break; + /* mailbox2 transmit succeeded */ + case(CAN_TSTAT_MTF2 | CAN_TSTAT_MTFNERR2 | CAN_TSTAT_TME2): + state = CAN_TRANSMIT_OK; + break; + /* transmit failed */ + default: + state = CAN_TRANSMIT_FAILED; + break; + } + return state; +} + +/*! + \brief stop CAN transmission + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] mailbox_number + only one parameter can be selected which is shown as below: + \arg CAN_MAILBOXx(x=0,1,2) + \param[out] none + \retval none +*/ +void can_transmission_stop(uint32_t can_periph, uint8_t mailbox_number) +{ + if(CAN_MAILBOX0 == mailbox_number) { + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST0; + while(CAN_TSTAT_MST0 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST0)) { + } + } else if(CAN_MAILBOX1 == mailbox_number) { + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST1; + while(CAN_TSTAT_MST1 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST1)) { + } + } else if(CAN_MAILBOX2 == mailbox_number) { + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST2; + while(CAN_TSTAT_MST2 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST2)) { + } + } else { + /* illegal parameters */ + } +} + +/*! + \brief CAN receive message + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + \arg CAN_FIFOx(x=0,1) + \param[out] receive_message: struct for CAN receive message + \arg rx_sfid: 0x00000000 - 0x000007FF + \arg rx_efid: 0x00000000 - 0x1FFFFFFF + \arg rx_ff: CAN_FF_STANDARD, CAN_FF_EXTENDED + \arg rx_ft: CAN_FT_DATA, CAN_FT_REMOTE + \arg rx_dlen: 0 - 8 (FD mode: 0 - 8, or 12, 16, 20, 24, 32, 48, 64) + \arg rx_data[]: 0x00 - 0xFF + \arg rx_fi: 0 - 27 + \retval none +*/ +void can_message_receive(uint32_t can_periph, uint8_t fifo_number, can_receive_message_struct *receive_message) +{ + uint32_t canfd_en = 0U; + volatile uint32_t p_temp; + uint32_t data_temp; + uint8_t canfd_recv_cnt = 0U; + uint8_t i; + + /* get the frame format */ + receive_message->rx_ff = (uint8_t)(CAN_RFIFOMI_FF & CAN_RFIFOMI(can_periph, fifo_number)); + if(CAN_FF_STANDARD == receive_message->rx_ff) { + /* get standard identifier */ + receive_message->rx_sfid = (uint32_t)(GET_RFIFOMI_SFID(CAN_RFIFOMI(can_periph, fifo_number))); + } else { + /* get extended identifier */ + receive_message->rx_efid = (uint32_t)(GET_RFIFOMI_EFID(CAN_RFIFOMI(can_periph, fifo_number))); + } + + /* get frame type */ + receive_message->rx_ft = (uint8_t)(CAN_RFIFOMI_FT & CAN_RFIFOMI(can_periph, fifo_number)); + /* filtering index */ + receive_message->rx_fi = (uint8_t)(GET_RFIFOMP_FI(CAN_RFIFOMP(can_periph, fifo_number))); + receive_message->fd_flag = (uint8_t)((CAN_RFIFOMP_FDF & CAN_RFIFOMP(can_periph, fifo_number)) >> 7); + + canfd_en = CAN_FDCTL(can_periph) & CAN_FDCTL_FDEN; + if(!canfd_en) { + if(CAN_FDF_CLASSIC == receive_message->fd_flag) { + /* get receive data length */ + receive_message->rx_dlen = (uint8_t)(GET_RFIFOMP_DLENC(CAN_RFIFOMP(can_periph, fifo_number))); + /* receive data */ + receive_message->rx_data[0] = (uint8_t)(GET_RFIFOMDATA0_DB0(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[1] = (uint8_t)(GET_RFIFOMDATA0_DB1(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[2] = (uint8_t)(GET_RFIFOMDATA0_DB2(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[3] = (uint8_t)(GET_RFIFOMDATA0_DB3(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[4] = (uint8_t)(GET_RFIFOMDATA1_DB4(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message->rx_data[5] = (uint8_t)(GET_RFIFOMDATA1_DB5(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message->rx_data[6] = (uint8_t)(GET_RFIFOMDATA1_DB6(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message->rx_data[7] = (uint8_t)(GET_RFIFOMDATA1_DB7(CAN_RFIFOMDATA1(can_periph, fifo_number))); + + } else { + printf("CAN FD function disabled but FD frame received\r\n"); + // CAN_ERROR_HANDLE("CAN FD function disabled \r\n"); + } + } else { + + /* check FD function has been enabled */ + /* get receive data length */ + canfd_recv_cnt = (uint8_t)(GET_RFIFOMP_DLENC(CAN_RFIFOMP(can_periph, fifo_number))); + + if(canfd_recv_cnt <= 8U) { + /* set the data length */ + receive_message->rx_dlen = canfd_recv_cnt; + } else { + receive_message->rx_dlen = g_can_fdlength_table[canfd_recv_cnt - 9U]; + } + + receive_message->fd_brs = (uint8_t)((CAN_RFIFOMP(can_periph, fifo_number) & CAN_RFIFOMP_BRS) >> 5); + receive_message->fd_esi = (uint8_t)((CAN_RFIFOMP(can_periph, fifo_number) & CAN_RFIFOMP_ESI) >> 4); + + /* get the data */ + i = receive_message->rx_dlen / 4U; + + /* data length is 5-7 need receive 2 word */ + if((1U == i) && (4U != receive_message->rx_dlen)) { + i++; + } + p_temp = (uint32_t)(uint32_t)receive_message->rx_data; + if(0U == i) { + data_temp = CAN_RFIFOMDATA0(can_periph, fifo_number); + *(uint32_t *)p_temp = data_temp; + } else { + /* get the data by reading from CAN_RFIFOMDATA0 register*/ + for(; i > 0U; i--) { + data_temp = CAN_RFIFOMDATA0(can_periph, fifo_number); + *(uint32_t *)p_temp = data_temp; + p_temp = ((uint32_t)((uint32_t)p_temp + 4U)); + } + } + } + + /* release FIFO */ + if(CAN_FIFO0 == fifo_number) { + CAN_RFIFO0(can_periph) |= CAN_RFIFO0_RFD0; + } else { + CAN_RFIFO1(can_periph) |= CAN_RFIFO1_RFD1; + } +} + +/*! + \brief release FIFO0 + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval none +*/ +void can_fifo_release(uint32_t can_periph, uint8_t fifo_number) +{ + if(CAN_FIFO0 == fifo_number) { + CAN_RFIFO0(can_periph) |= CAN_RFIFO0_RFD0; + } else if(CAN_FIFO1 == fifo_number) { + CAN_RFIFO1(can_periph) |= CAN_RFIFO1_RFD1; + } else { + /* illegal parameters */ + CAN_ERROR_HANDLE("CAN FIFO NUM is invalid \r\n"); + } +} + +/*! + \brief CAN receive message length + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval message length +*/ +uint8_t can_receive_message_length_get(uint32_t can_periph, uint8_t fifo_number) +{ + uint8_t val = 0U; + + if(CAN_FIFO0 == fifo_number) { + /* FIFO0 */ + val = (uint8_t)(CAN_RFIFO0(can_periph) & CAN_RFIF_RFL_MASK); + } else if(CAN_FIFO1 == fifo_number) { + /* FIFO1 */ + val = (uint8_t)(CAN_RFIFO1(can_periph) & CAN_RFIF_RFL_MASK); + } else { + /* illegal parameters */ + } + return val; +} + +/*! + \brief set CAN working mode + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] can_working_mode + only one parameter can be selected which is shown as below: + \arg CAN_MODE_INITIALIZE + \arg CAN_MODE_NORMAL + \arg CAN_MODE_SLEEP + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_working_mode_set(uint32_t can_periph, uint8_t working_mode) +{ + ErrStatus flag = ERROR; + /* timeout for IWS or also for SLPWS bits */ + uint32_t timeout = CAN_TIMEOUT; + + if(CAN_MODE_INITIALIZE == working_mode) { + /* disable sleep mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_SLPWMOD); + /* set initialize mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_IWMOD; + /* wait the acknowledge */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + flag = ERROR; + } else { + flag = SUCCESS; + } + } else if(CAN_MODE_NORMAL == working_mode) { + /* enter normal mode */ + CAN_CTL(can_periph) &= ~(uint32_t)(CAN_CTL_SLPWMOD | CAN_CTL_IWMOD); + /* wait the acknowledge */ + while((0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) && (0U != timeout)) { + timeout--; + } + if(0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) { + flag = ERROR; + } else { + flag = SUCCESS; + } + } else if(CAN_MODE_SLEEP == working_mode) { + /* disable initialize mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_IWMOD); + /* set sleep mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_SLPWMOD; + /* wait the acknowledge */ + while((CAN_STAT_SLPWS != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) && (0U != timeout)) { + timeout--; + } + if(CAN_STAT_SLPWS != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) { + flag = ERROR; + } else { + flag = SUCCESS; + } + } else { + flag = ERROR; + } + return flag; +} + +/*! + \brief wake up CAN + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_wakeup(uint32_t can_periph) +{ + ErrStatus flag = ERROR; + uint32_t timeout = CAN_TIMEOUT; + + /* wakeup */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + + while((0U != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) && (0x00U != timeout)) { + timeout--; + } + /* check state */ + if(0U != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) { + flag = ERROR; + } else { + flag = SUCCESS; + } + return flag; +} + +/*! + \brief get CAN error type + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval can_error_enum + \arg CAN_ERROR_NONE: no error + \arg CAN_ERROR_FILL: fill error + \arg CAN_ERROR_FORMATE: format error + \arg CAN_ERROR_ACK: ACK error + \arg CAN_ERROR_BITRECESSIVE: bit recessive + \arg CAN_ERROR_BITDOMINANTER: bit dominant error + \arg CAN_ERROR_CRC: CRC error + \arg CAN_ERROR_SOFTWARECFG: software configure +*/ +can_error_enum can_error_get(uint32_t can_periph) +{ + can_error_enum error; + error = CAN_ERROR_NONE; + + /* get error type */ + error = (can_error_enum)(GET_ERR_ERRN(CAN_ERR(can_periph))); + return error; +} + +/*! + \brief get CAN receive error number + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval error number +*/ +uint8_t can_receive_error_number_get(uint32_t can_periph) +{ + uint8_t val; + + /* get error count */ + val = (uint8_t)(GET_ERR_RECNT(CAN_ERR(can_periph))); + return val; +} + +/*! + \brief get CAN transmit error number + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval error number +*/ +uint8_t can_transmit_error_number_get(uint32_t can_periph) +{ + uint8_t val; + + val = (uint8_t)(GET_ERR_TECNT(CAN_ERR(can_periph))); + return val; +} + +/*! + \brief enable CAN interrupt + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] interrupt + one or more parameters can be selected which are shown as below: + \arg CAN_INT_TME: transmit mailbox empty interrupt enable + \arg CAN_INT_RFNE0: receive FIFO0 not empty interrupt enable + \arg CAN_INT_RFF0: receive FIFO0 full interrupt enable + \arg CAN_INT_RFO0: receive FIFO0 overfull interrupt enable + \arg CAN_INT_RFNE1: receive FIFO1 not empty interrupt enable + \arg CAN_INT_RFF1: receive FIFO1 full interrupt enable + \arg CAN_INT_RFO1: receive FIFO1 overfull interrupt enable + \arg CAN_INT_WERR: warning error interrupt enable + \arg CAN_INT_PERR: passive error interrupt enable + \arg CAN_INT_BO: bus-off interrupt enable + \arg CAN_INT_ERRN: error number interrupt enable + \arg CAN_INT_ERR: error interrupt enable + \arg CAN_INT_WU: wakeup interrupt enable + \arg CAN_INT_SLPW: sleep working interrupt enable + \param[out] none + \retval none +*/ +void can_interrupt_enable(uint32_t can_periph, uint32_t interrupt) +{ + CAN_INTEN(can_periph) |= interrupt; +} + +/*! + \brief disable CAN interrupt + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] interrupt + one or more parameters can be selected which are shown as below: + \arg CAN_INT_TME: transmit mailbox empty interrupt enable + \arg CAN_INT_RFNE0: receive FIFO0 not empty interrupt enable + \arg CAN_INT_RFF0: receive FIFO0 full interrupt enable + \arg CAN_INT_RFO0: receive FIFO0 overfull interrupt enable + \arg CAN_INT_RFNE1: receive FIFO1 not empty interrupt enable + \arg CAN_INT_RFF1: receive FIFO1 full interrupt enable + \arg CAN_INT_RFO1: receive FIFO1 overfull interrupt enable + \arg CAN_INT_WERR: warning error interrupt enable + \arg CAN_INT_PERR: passive error interrupt enable + \arg CAN_INT_BO: bus-off interrupt enable + \arg CAN_INT_ERRN: error number interrupt enable + \arg CAN_INT_ERR: error interrupt enable + \arg CAN_INT_WU: wakeup interrupt enable + \arg CAN_INT_SLPW: sleep working interrupt enable + \param[out] none + \retval none +*/ +void can_interrupt_disable(uint32_t can_periph, uint32_t interrupt) +{ + CAN_INTEN(can_periph) &= ~interrupt; +} + +/*! + \brief get CAN flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN flags, refer to can_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_FLAG_RXL: RX level + \arg CAN_FLAG_LASTRX: last sample value of RX pin + \arg CAN_FLAG_RS: receiving state + \arg CAN_FLAG_TS: transmitting state + \arg CAN_FLAG_SLPIF: status change flag of entering sleep working mode + \arg CAN_FLAG_WUIF: status change flag of wakeup from sleep working mode + \arg CAN_FLAG_ERRIF: error flag + \arg CAN_FLAG_SLPWS: sleep working state + \arg CAN_FLAG_IWS: initial working state + \arg CAN_FLAG_TMLS2: transmit mailbox 2 last sending in Tx FIFO + \arg CAN_FLAG_TMLS1: transmit mailbox 1 last sending in Tx FIFO + \arg CAN_FLAG_TMLS0: transmit mailbox 0 last sending in Tx FIFO + \arg CAN_FLAG_TME2: transmit mailbox 2 empty + \arg CAN_FLAG_TME1: transmit mailbox 1 empty + \arg CAN_FLAG_TME0: transmit mailbox 0 empty + \arg CAN_FLAG_MTE2: mailbox 2 transmit error + \arg CAN_FLAG_MTE1: mailbox 1 transmit error + \arg CAN_FLAG_MTE0: mailbox 0 transmit error + \arg CAN_FLAG_MAL2: mailbox 2 arbitration lost + \arg CAN_FLAG_MAL1: mailbox 1 arbitration lost + \arg CAN_FLAG_MAL0: mailbox 0 arbitration lost + \arg CAN_FLAG_MTFNERR2: mailbox 2 transmit finished with no error + \arg CAN_FLAG_MTFNERR1: mailbox 1 transmit finished with no error + \arg CAN_FLAG_MTFNERR0: mailbox 0 transmit finished with no error + \arg CAN_FLAG_MTF2: mailbox 2 transmit finished + \arg CAN_FLAG_MTF1: mailbox 1 transmit finished + \arg CAN_FLAG_MTF0: mailbox 0 transmit finished + \arg CAN_FLAG_RFO0: receive FIFO0 overfull + \arg CAN_FLAG_RFF0: receive FIFO0 full + \arg CAN_FLAG_RFO1: receive FIFO1 overfull + \arg CAN_FLAG_RFF1: receive FIFO1 full + \arg CAN_FLAG_BOERR: bus-off error + \arg CAN_FLAG_PERR: passive error + \arg CAN_FLAG_WERR: warning error + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_flag_get(uint32_t can_periph, can_flag_enum flag) +{ + /* get flag and interrupt enable state */ + if(RESET != (CAN_REG_VAL(can_periph, flag) & BIT(CAN_BIT_POS(flag)))) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear CAN flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN flags, refer to can_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_FLAG_SLPIF: status change flag of entering sleep working mode + \arg CAN_FLAG_WUIF: status change flag of wakeup from sleep working mode + \arg CAN_FLAG_ERRIF: error flag + \arg CAN_FLAG_MTE2: mailbox 2 transmit error + \arg CAN_FLAG_MTE1: mailbox 1 transmit error + \arg CAN_FLAG_MTE0: mailbox 0 transmit error + \arg CAN_FLAG_MAL2: mailbox 2 arbitration lost + \arg CAN_FLAG_MAL1: mailbox 1 arbitration lost + \arg CAN_FLAG_MAL0: mailbox 0 arbitration lost + \arg CAN_FLAG_MTFNERR2: mailbox 2 transmit finished with no error + \arg CAN_FLAG_MTFNERR1: mailbox 1 transmit finished with no error + \arg CAN_FLAG_MTFNERR0: mailbox 0 transmit finished with no error + \arg CAN_FLAG_MTF2: mailbox 2 transmit finished + \arg CAN_FLAG_MTF1: mailbox 1 transmit finished + \arg CAN_FLAG_MTF0: mailbox 0 transmit finished + \arg CAN_FLAG_RFO0: receive FIFO0 overfull + \arg CAN_FLAG_RFF0: receive FIFO0 full + \arg CAN_FLAG_RFO1: receive FIFO1 overfull + \arg CAN_FLAG_RFF1: receive FIFO1 full + \param[out] none + \retval none +*/ +void can_flag_clear(uint32_t can_periph, can_flag_enum flag) +{ + CAN_REG_VAL(can_periph, flag) |= BIT(CAN_BIT_POS(flag)); +} + +/*! + \brief get CAN interrupt flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_INT_FLAG_SLPIF: status change interrupt flag of sleep working mode entering + \arg CAN_INT_FLAG_WUIF: status change interrupt flag of wakeup from sleep working mode + \arg CAN_INT_FLAG_ERRIF: error interrupt flag + \arg CAN_INT_FLAG_MTF2: mailbox 2 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF1: mailbox 1 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF0: mailbox 0 transmit finished interrupt flag + \arg CAN_INT_FLAG_RFO0: receive FIFO0 overfull interrupt flag + \arg CAN_INT_FLAG_RFF0: receive FIFO0 full interrupt flag + \arg CAN_INT_FLAG_RFL0: receive FIFO0 not empty interrupt flag + \arg CAN_INT_FLAG_RFO1: receive FIFO1 overfull interrupt flag + \arg CAN_INT_FLAG_RFF1: receive FIFO1 full interrupt flag + \arg CAN_INT_FLAG_RFL1: receive FIFO1 not empty interrupt flag + \arg CAN_INT_FLAG_ERRN: error number interrupt flag + \arg CAN_INT_FLAG_BOERR: bus-off error interrupt flag + \arg CAN_INT_FLAG_PERR: passive error interrupt flag + \arg CAN_INT_FLAG_WERR: warning error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_interrupt_flag_get(uint32_t can_periph, can_interrupt_flag_enum flag) +{ + uint32_t ret1 = RESET; + uint32_t ret2 = RESET; + + /* get the status of interrupt flag */ + if(flag == CAN_INT_FLAG_RFL0) { + ret1 = can_receive_message_length_get(can_periph, CAN_FIFO0); + } else if(flag == CAN_INT_FLAG_RFL1) { + ret1 = can_receive_message_length_get(can_periph, CAN_FIFO1); + } else if(flag == CAN_INT_FLAG_ERRN) { + ret1 = can_error_get(can_periph); + } else { + ret1 = CAN_REG_VALS(can_periph, flag) & BIT(CAN_BIT_POS0(flag)); + } + /* get the status of interrupt enable bit */ + ret2 = CAN_INTEN(can_periph) & BIT(CAN_BIT_POS1(flag)); + if(ret1 && ret2) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear CAN interrupt flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_INT_FLAG_SLPIF: status change interrupt flag of sleep working mode entering + \arg CAN_INT_FLAG_WUIF: status change interrupt flag of wakeup from sleep working mode + \arg CAN_INT_FLAG_ERRIF: error interrupt flag + \arg CAN_INT_FLAG_MTF2: mailbox 2 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF1: mailbox 1 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF0: mailbox 0 transmit finished interrupt flag + \arg CAN_INT_FLAG_RFO0: receive FIFO0 overfull interrupt flag + \arg CAN_INT_FLAG_RFF0: receive FIFO0 full interrupt flag + \arg CAN_INT_FLAG_RFO1: receive FIFO1 overfull interrupt flag + \arg CAN_INT_FLAG_RFF1: receive FIFO1 full interrupt flag + \param[out] none + \retval none +*/ +void can_interrupt_flag_clear(uint32_t can_periph, can_interrupt_flag_enum flag) +{ + CAN_REG_VALS(can_periph, flag) |= BIT(CAN_BIT_POS0(flag)); +} + +#ifdef GD32C103XXA +/*! + \brief get FIFO overrun flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_fifo_overrun_flag_get(uint32_t can_periph, uint8_t fifo_number) +{ + FlagStatus ret = RESET; + if(CAN_FIFO0 == fifo_number) { + /* get flag state */ + if(RESET != (CAN_RFIFO0(can_periph) & CAN_RFIFO0_RFOVRN0)) { + ret = SET; + } else { + ret = RESET; + } + } else if(CAN_FIFO1 == fifo_number) { + /* get flag state */ + if(RESET != (CAN_RFIFO1(can_periph) & CAN_RFIFO1_RFOVRN1)) { + ret = SET; + } else { + ret = RESET; + } + } else { + /* illegal parameters */ + CAN_ERROR_HANDLE("CAN FIFO NUM is invalid \r\n"); + } + return ret; +} +#endif /* GD32C103XXA */ diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c.base@1.0.0 new file mode 100644 index 0000000..6b70808 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c.base@1.0.0 @@ -0,0 +1,1469 @@ +/*! + \file gd32c10x_can.c + \brief CAN driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_can.h" +#include + +#define CAN_ERROR_HANDLE(s) do{}while(1) + +/* This table can be used to calculate data length in FD mode */ +const uint8_t g_can_fdlength_table[] = {12, 16, 20, 24, 32, 48, 64}; + +/*! + \brief deinitialize CAN + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_deinit(uint32_t can_periph) +{ + if(CAN0 == can_periph) { + rcu_periph_reset_enable(RCU_CAN0RST); + rcu_periph_reset_disable(RCU_CAN0RST); + } else { + rcu_periph_reset_enable(RCU_CAN1RST); + rcu_periph_reset_disable(RCU_CAN1RST); + } +} + +/*! + \brief initialize CAN parameter struct with a default value + \param[in] type: the type of CAN parameter struct + only one parameter can be selected which is shown as below: + \arg CAN_INIT_STRUCT: the CAN initial struct + \arg CAN_FILTER_STRUCT: the CAN filter struct + \arg CAN_FD_FRAME_STRUCT: the CAN FD initial struct + \arg CAN_TX_MESSAGE_STRUCT: the CAN TX message struct + \arg CAN_RX_MESSAGE_STRUCT: the CAN RX message struct + \param[in] p_struct: the pointer of the specific struct + \param[out] none + \retval none +*/ +void can_struct_para_init(can_struct_type_enum type, void *p_struct) +{ + uint8_t i; + + if(NULL == p_struct) { + CAN_ERROR_HANDLE("struct parameter can not be NULL \r\n"); + } + + /* get type of the struct */ + switch(type) { + /* used for can_init() */ + case CAN_INIT_STRUCT: + ((can_parameter_struct *)p_struct)->auto_bus_off_recovery = DISABLE; + ((can_parameter_struct *)p_struct)->auto_retrans = DISABLE; + ((can_parameter_struct *)p_struct)->auto_wake_up = DISABLE; + ((can_parameter_struct *)p_struct)->prescaler = 0x0400U; + ((can_parameter_struct *)p_struct)->rec_fifo_overwrite = DISABLE; + ((can_parameter_struct *)p_struct)->resync_jump_width = CAN_BT_SJW_1TQ; + ((can_parameter_struct *)p_struct)->time_segment_1 = CAN_BT_BS1_3TQ; + ((can_parameter_struct *)p_struct)->time_segment_2 = CAN_BT_BS2_1TQ; + ((can_parameter_struct *)p_struct)->time_triggered = DISABLE; + ((can_parameter_struct *)p_struct)->trans_fifo_order = DISABLE; + ((can_parameter_struct *)p_struct)->working_mode = CAN_NORMAL_MODE; + + break; + /* used for can_filter_init() */ + case CAN_FILTER_STRUCT: + ((can_filter_parameter_struct *)p_struct)->filter_bits = CAN_FILTERBITS_32BIT; + ((can_filter_parameter_struct *)p_struct)->filter_enable = DISABLE; + ((can_filter_parameter_struct *)p_struct)->filter_fifo_number = CAN_FIFO0; + ((can_filter_parameter_struct *)p_struct)->filter_list_high = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_list_low = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_mask_high = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_mask_low = 0x0000U; + ((can_filter_parameter_struct *)p_struct)->filter_mode = CAN_FILTERMODE_MASK; + ((can_filter_parameter_struct *)p_struct)->filter_number = 0U; + + break; + /* used for can_fd_init() */ + case CAN_FD_FRAME_STRUCT: + ((can_fdframe_struct *)p_struct)->data_prescaler = 0x0400U; + ((can_fdframe_struct *)p_struct)->data_resync_jump_width = 1U - 1U; + ((can_fdframe_struct *)p_struct)->data_time_segment_1 = 3U - 1U; + ((can_fdframe_struct *)p_struct)->data_time_segment_2 = 2U - 1U; + ((can_fdframe_struct *)p_struct)->delay_compensation = DISABLE; + ((can_fdframe_struct *)p_struct)->esi_mode = CAN_ESIMOD_HARDWARE; + ((can_fdframe_struct *)p_struct)->excp_event_detect = ENABLE; + ((can_fdframe_struct *)p_struct)->fd_frame = DISABLE; + ((can_fdframe_struct *)p_struct)->iso_bosch = CAN_FDMOD_ISO; + ((can_fdframe_struct *)p_struct)->p_delay_compensation = 0U; + + break; + /* used for can_message_transmit() */ + case CAN_TX_MESSAGE_STRUCT: + ((can_trasnmit_message_struct *)p_struct)->fd_brs = CAN_BRS_DISABLE; + ((can_trasnmit_message_struct *)p_struct)->fd_esi = CAN_ESI_DOMINANT; + ((can_trasnmit_message_struct *)p_struct)->fd_flag = CAN_FDF_CLASSIC; + + for(i = 0U; i < 64U; i++) { + ((can_trasnmit_message_struct *)p_struct)->tx_data[i] = 0U; + } + + ((can_trasnmit_message_struct *)p_struct)->tx_dlen = 0u; + ((can_trasnmit_message_struct *)p_struct)->tx_efid = 0U; + ((can_trasnmit_message_struct *)p_struct)->tx_ff = (uint8_t)CAN_FF_STANDARD; + ((can_trasnmit_message_struct *)p_struct)->tx_ft = (uint8_t)CAN_FT_DATA; + ((can_trasnmit_message_struct *)p_struct)->tx_sfid = 0U; + + break; + /* used for can_message_receive() */ + case CAN_RX_MESSAGE_STRUCT: + ((can_receive_message_struct *)p_struct)->fd_brs = CAN_BRS_DISABLE; + ((can_receive_message_struct *)p_struct)->fd_esi = CAN_ESI_DOMINANT; + ((can_receive_message_struct *)p_struct)->fd_flag = CAN_FDF_CLASSIC; + + for(i = 0U; i < 64U; i++) { + ((can_receive_message_struct *)p_struct)->rx_data[i] = 0U; + } + + ((can_receive_message_struct *)p_struct)->rx_dlen = 0U; + ((can_receive_message_struct *)p_struct)->rx_efid = 0U; + ((can_receive_message_struct *)p_struct)->rx_ff = (uint8_t)CAN_FF_STANDARD; + ((can_receive_message_struct *)p_struct)->rx_fi = 0U; + ((can_receive_message_struct *)p_struct)->rx_ft = (uint8_t)CAN_FT_DATA; + ((can_receive_message_struct *)p_struct)->rx_sfid = 0U; + + break; + + default: + CAN_ERROR_HANDLE("parameter is invalid \r\n"); + } +} + +/*! + \brief initialize CAN + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] can_parameter_init: parameters for CAN initialization + \arg working_mode: CAN_NORMAL_MODE, CAN_LOOPBACK_MODE, CAN_SILENT_MODE, CAN_SILENT_LOOPBACK_MODE + \arg resync_jump_width: 0x00 - 0x07 + \arg time_segment_1: 0x00 - 0x7F + \arg time_segment_2: 0x00 - 0x1F + \arg time_triggered: ENABLE or DISABLE + \arg auto_bus_off_recovery: ENABLE or DISABLE + \arg auto_wake_up: ENABLE or DISABLE + \arg auto_retrans: ENABLE or DISABLE + \arg rec_fifo_overwrite: ENABLE or DISABLE + \arg trans_fifo_order: ENABLE or DISABLE + \arg prescaler: 0x0001 - 0x0400 + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_init(uint32_t can_periph, can_parameter_struct *can_parameter_init) +{ + uint32_t timeout = CAN_TIMEOUT; + ErrStatus flag = ERROR; + uint32_t fdctl_status; + + /* disable sleep mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + /* enable initialize mode */ + CAN_CTL(can_periph) |= CAN_CTL_IWMOD; + /* wait ACK */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check initialize working success */ + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + flag = ERROR; + } else { + /* set the bit timing register */ + fdctl_status = CAN_FDCTL(can_periph); + if(CAN_FDCTL_FDEN != (fdctl_status & CAN_FDCTL_FDEN)) { + /* CAN FD disable, should first enable, then write */ + fdctl_status = fdctl_status | CAN_FDCTL_FDEN; + CAN_FDCTL(can_periph) = fdctl_status; + CAN_BT(can_periph) = (BT_MODE((uint32_t)can_parameter_init->working_mode) | \ + BT_SJW((uint32_t)can_parameter_init->resync_jump_width) | \ + BT_BS1((uint32_t)can_parameter_init->time_segment_1) | \ + BT_BS2((uint32_t)can_parameter_init->time_segment_2) | \ + BT_BAUDPSC(((uint32_t)(can_parameter_init->prescaler) - 1U))); + fdctl_status = fdctl_status & (~CAN_FDCTL_FDEN); + CAN_FDCTL(can_periph) = fdctl_status; + } else { + /* CAN FD enable */ + CAN_BT(can_periph) = (BT_MODE((uint32_t)can_parameter_init->working_mode) | \ + BT_SJW((uint32_t)can_parameter_init->resync_jump_width) | \ + BT_BS1((uint32_t)can_parameter_init->time_segment_1) | \ + BT_BS2((uint32_t)can_parameter_init->time_segment_2) | \ + BT_BAUDPSC(((uint32_t)(can_parameter_init->prescaler) - 1U))); + } + + /* time trigger communication mode */ + if(ENABLE == can_parameter_init->time_triggered) { + CAN_CTL(can_periph) |= CAN_CTL_TTC; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_TTC; + } + /* automatic bus-off management */ + if(ENABLE == can_parameter_init->auto_bus_off_recovery) { + CAN_CTL(can_periph) |= CAN_CTL_ABOR; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_ABOR; + } + /* automatic wakeup mode */ + if(ENABLE == can_parameter_init->auto_wake_up) { + CAN_CTL(can_periph) |= CAN_CTL_AWU; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_AWU; + } + /* automatic retransmission mode */ + if(ENABLE == can_parameter_init->auto_retrans) { + CAN_CTL(can_periph) &= ~CAN_CTL_ARD; + } else { + CAN_CTL(can_periph) |= CAN_CTL_ARD; + } + /* receive fifo overwrite mode */ + if(ENABLE == can_parameter_init->rec_fifo_overwrite) { + CAN_CTL(can_periph) &= ~CAN_CTL_RFOD; + } else { + CAN_CTL(can_periph) |= CAN_CTL_RFOD; + } + /* transmit fifo order */ + if(ENABLE == can_parameter_init->trans_fifo_order) { + CAN_CTL(can_periph) |= CAN_CTL_TFO; + } else { + CAN_CTL(can_periph) &= ~CAN_CTL_TFO; + } + /* disable initialize mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_IWMOD; + timeout = CAN_TIMEOUT; + /* wait the ACK */ + while((CAN_STAT_IWS == (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check exit initialize mode */ + if(0U != timeout) { + flag = SUCCESS; + } + } + return flag; +} + +/*! + \brief initialize CAN FD function + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] can_fdframe_init: parameters for CAN FD initialization + \arg fd_frame: ENABLE or DISABLE + \arg excp_event_detect: ENABLE or DISABLE + \arg delay_compensation: ENABLE or DISABLE + \arg p_delay_compensation: the pointer of tdc struct + can_fd_tdc_struct: + tdc_mode: CAN_TDCMOD_CALC_AND_OFFSET or CAN_TDCMOD_OFFSET + tdc_filter: 0x00 - 0x07 + tdc_offset: 0x00 - 0x07 + \arg iso_bosch: CAN_FDMOD_ISO or CAN_FDMOD_BOSCH + \arg esi_mode: CAN_ESIMOD_HARDWARE or CAN_ESIMOD_SOFTWARE + \arg data_resync_jump_width: 0x00 - 0x07 + \arg data_time_segment_1: 0x00 - 0x0F + \arg data_time_segment_2: 0x00 - 0x07 + \arg data_prescaler: 0x0001 - 0x0400 + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_fd_init(uint32_t can_periph, can_fdframe_struct *can_fdframe_init) +{ + uint32_t timeout = CAN_TIMEOUT; + uint32_t tempreg = 0U; + + /* check null pointer */ + if(0 == can_fdframe_init) { + return ERROR; + } + /* disable sleep mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + /* enable initialize mode */ + CAN_CTL(can_periph) |= CAN_CTL_IWMOD; + /* wait ACK */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check initialize working success */ + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + return ERROR; + } else { + /* set the data bit timing register */ + CAN_DBT(can_periph) = (BT_DSJW((uint32_t)can_fdframe_init->data_resync_jump_width) | \ + BT_DBS1((uint32_t)can_fdframe_init->data_time_segment_1) | \ + BT_DBS2((uint32_t)can_fdframe_init->data_time_segment_2) | \ + BT_BAUDPSC(((uint32_t)can_fdframe_init->data_prescaler) - 1U)); + + tempreg = can_fdframe_init->esi_mode | can_fdframe_init->iso_bosch; + + /* Protocol exception event detection */ + if(ENABLE == can_fdframe_init->excp_event_detect) { + tempreg &= ~CAN_FDCTL_PRED; + } else { + tempreg |= CAN_FDCTL_PRED; + } + + /* Transmitter delay compensation mode */ + if(ENABLE == can_fdframe_init->delay_compensation) { + tempreg |= CAN_FDCTL_TDCEN; + /* p_delay_compensation pointer should be config when TDC mode is enabled */ + if(0 != can_fdframe_init->p_delay_compensation) { + tempreg |= (can_fdframe_init->p_delay_compensation->tdc_mode & CAN_FDCTL_TDCMOD); + CAN_FDTDC(can_periph) = (FDTDC_TDCF(can_fdframe_init->p_delay_compensation->tdc_filter) | FDTDC_TDCO( + can_fdframe_init->p_delay_compensation->tdc_offset)); + } else { + return ERROR; + } + } else { + /* Transmitter delay compensation mode is disabled */ + tempreg &= ~CAN_FDCTL_TDCEN; + } + + /* FD operation mode */ + if(ENABLE == can_fdframe_init->fd_frame) { + tempreg |= CAN_FDCTL_FDEN; + } else { + tempreg &= ~CAN_FDCTL_FDEN; + } + CAN_FDCTL(can_periph) = tempreg; + + /* disable initialize mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_IWMOD; + timeout = CAN_TIMEOUT; + /* wait the ACK */ + while((CAN_STAT_IWS == (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + /* check exit initialize mode */ + if(0U == timeout) { + return ERROR; + } + } + + return SUCCESS; +} + +/*! + \brief initialize CAN filter + \param[in] can_filter_parameter_init: struct for CAN filter initialization + \arg filter_list_high: 0x0000 - 0xFFFF + \arg filter_list_low: 0x0000 - 0xFFFF + \arg filter_mask_high: 0x0000 - 0xFFFF + \arg filter_mask_low: 0x0000 - 0xFFFF + \arg filter_fifo_number: CAN_FIFO0, CAN_FIFO1 + \arg filter_number: 0 - 27 + \arg filter_mode: CAN_FILTERMODE_MASK, CAN_FILTERMODE_LIST + \arg filter_bits: CAN_FILTERBITS_32BIT, CAN_FILTERBITS_16BIT + \arg filter_enable: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void can_filter_init(can_filter_parameter_struct *can_filter_parameter_init) +{ + uint32_t val = 0U; + + val = ((uint32_t)1) << (can_filter_parameter_init->filter_number); + /* filter lock disable */ + CAN_FCTL(CAN0) |= CAN_FCTL_FLD; + /* disable filter */ + CAN_FW(CAN0) &= ~(uint32_t)val; + + /* filter 16 bits */ + if(CAN_FILTERBITS_16BIT == can_filter_parameter_init->filter_bits) { + /* set filter 16 bits */ + CAN_FSCFG(CAN0) &= ~(uint32_t)val; + /* first 16 bits list and first 16 bits mask or first 16 bits list and second 16 bits list */ + CAN_FDATA0(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_low) & CAN_FILTER_MASK_16BITS) | \ + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_low) & CAN_FILTER_MASK_16BITS); + /* second 16 bits list and second 16 bits mask or third 16 bits list and fourth 16 bits list */ + CAN_FDATA1(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_high) & CAN_FILTER_MASK_16BITS) | \ + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_high) & CAN_FILTER_MASK_16BITS); + } + /* filter 32 bits */ + if(CAN_FILTERBITS_32BIT == can_filter_parameter_init->filter_bits) { + /* set filter 32 bits */ + CAN_FSCFG(CAN0) |= (uint32_t)val; + /* 32 bits list or first 32 bits list */ + CAN_FDATA0(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_list_high) & CAN_FILTER_MASK_16BITS) | + FDATA_MASK_LOW((can_filter_parameter_init->filter_list_low) & CAN_FILTER_MASK_16BITS); + /* 32 bits mask or second 32 bits list */ + CAN_FDATA1(CAN0, can_filter_parameter_init->filter_number) = \ + FDATA_MASK_HIGH((can_filter_parameter_init->filter_mask_high) & CAN_FILTER_MASK_16BITS) | + FDATA_MASK_LOW((can_filter_parameter_init->filter_mask_low) & CAN_FILTER_MASK_16BITS); + } + + /* filter mode */ + if(CAN_FILTERMODE_MASK == can_filter_parameter_init->filter_mode) { + /* mask mode */ + CAN_FMCFG(CAN0) &= ~(uint32_t)val; + } else { + /* list mode */ + CAN_FMCFG(CAN0) |= (uint32_t)val; + } + + /* filter FIFO */ + if(CAN_FIFO0 == (can_filter_parameter_init->filter_fifo_number)) { + /* FIFO0 */ + CAN_FAFIFO(CAN0) &= ~(uint32_t)val; + } else { + /* FIFO1 */ + CAN_FAFIFO(CAN0) |= (uint32_t)val; + } + + /* filter working */ + if(ENABLE == can_filter_parameter_init->filter_enable) { + + CAN_FW(CAN0) |= (uint32_t)val; + } + + /* filter lock enable */ + CAN_FCTL(CAN0) &= ~CAN_FCTL_FLD; +} + +/*! + \brief CAN filter mask mode initialization + \param[in] id: extended(11-bits) or standard(29-bits) identifier + \arg 0x00000000 - 0x1FFFFFFF + \param[in] mask: extended(11-bits) or standard(29-bits) identifier mask + \arg 0x00000000 - 0x1FFFFFFF + \param[in] format_fifo: format and FIFO states + only one parameter can be selected which is shown as below: + \arg CAN_STANDARD_FIFO0 + \arg CAN_STANDARD_FIFO1 + \arg CAN_EXTENDED_FIFO0 + \arg CAN_EXTENDED_FIFO1 + \param[in] filter_number: filter sequence number + \arg 0x00 - 0x1C + \param[out] none + \retval none +*/ +void can_filter_mask_mode_init(uint32_t id, uint32_t mask, can_format_fifo_enum format_fifo, uint16_t filter_number) +{ + can_filter_parameter_struct can_filter; + + /* Initialize the filter structure */ + can_struct_para_init(CAN_FILTER_STRUCT, &can_filter); + + /* filter config */ + can_filter.filter_number = filter_number; + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + can_filter.filter_enable = ENABLE; + + switch(format_fifo) { + /* standard FIFO 0 */ + case CAN_STANDARD_FIFO0: + can_filter.filter_fifo_number = CAN_FIFO0; + /* configure SFID[10:0] */ + can_filter.filter_list_high = (uint16_t)id << 5; + can_filter.filter_list_low = 0x0000U; + /* configure SFID[10:0] mask */ + can_filter.filter_mask_high = (uint16_t)mask << 5; + /* both data and remote frames can be received */ + can_filter.filter_mask_low = (uint16_t)(1U << 2U); + + break; + /* standard FIFO 1 */ + case CAN_STANDARD_FIFO1: + can_filter.filter_fifo_number = CAN_FIFO1; + /* configure SFID[10:0] */ + can_filter.filter_list_high = (uint16_t)id << 5; + can_filter.filter_list_low = 0x0000U; + /* configure SFID[10:0] mask */ + can_filter.filter_mask_high = (uint16_t)mask << 5; + /* both data and remote frames can be received */ + can_filter.filter_mask_low = (uint16_t)(1U << 2U); + + break; + /* extended FIFO 0 */ + case CAN_EXTENDED_FIFO0: + can_filter.filter_fifo_number = CAN_FIFO0; + /* configure EFID[28:13] */ + can_filter.filter_list_high = (uint16_t)(id >> 13); + /* configure EFID[12:0] and frame format bit set */ + can_filter.filter_list_low = ((uint16_t)(id << 3)) | (1U << 2); + /* configure EFID[28:13] mask */ + can_filter.filter_mask_high = (uint16_t)(mask >> 13); + /* configure EFID[12:0] and frame format bit mask */ + /* both data and remote frames can be received */ + can_filter.filter_mask_low = ((uint16_t)(mask << 3)) | (1U << 2); + + break; + /* extended FIFO 1 */ + case CAN_EXTENDED_FIFO1: + can_filter.filter_fifo_number = CAN_FIFO1; + /* configure EFID[28:13] */ + can_filter.filter_list_high = (uint16_t)(id >> 13); + /* configure EFID[12:0] and frame format bit set */ + can_filter.filter_list_low = ((uint16_t)(id << 3)) | (1U << 2); + /* configure EFID[28:13] mask */ + can_filter.filter_mask_high = (uint16_t)(mask >> 13); + /* configure EFID[12:0] and frame format bit mask */ + /* both data and remote frames can be received */ + can_filter.filter_mask_low = ((uint16_t)(mask << 3)) | (1U << 2); + + break; + default: + CAN_ERROR_HANDLE("parameter is invalid \r\n"); + } + + can_filter_init(&can_filter); +} + +/*! + \brief CAN communication mode configure + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] mode: communication mode + only one parameter can be selected which is shown as below: + \arg CAN_NORMAL_MODE + \arg CAN_LOOPBACK_MODE + \arg CAN_SILENT_MODE + \arg CAN_SILENT_LOOPBACK_MODE + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_monitor_mode_set(uint32_t can_periph, uint8_t mode) +{ + ErrStatus reval = SUCCESS; + uint32_t timeout = CAN_TIMEOUT; + + if(mode == (mode & CAN_SILENT_LOOPBACK_MODE)) { + /* disable sleep mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_SLPWMOD); + /* set initialize mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_IWMOD; + /* wait the acknowledge */ + timeout = CAN_TIMEOUT; + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + reval = ERROR; + } else { + CAN_BT(can_periph) &= ~BT_MODE(3); + CAN_BT(can_periph) |= BT_MODE(mode); + + timeout = CAN_TIMEOUT; + /* enter normal mode */ + CAN_CTL(can_periph) &= ~(uint32_t)(CAN_CTL_SLPWMOD | CAN_CTL_IWMOD); + /* wait the acknowledge */ + while((0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) && (0U != timeout)) { + timeout--; + } + if(0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) { + reval = ERROR; + } + } + } else { + reval = ERROR; + } + + return reval; +} + +/*! + \brief CAN FD frame function enable + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_fd_function_enable(uint32_t can_periph) +{ + CAN_FDCTL(can_periph) |= CAN_FDCTL_FDEN; +} + +/*! + \brief CAN FD frame function disable + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_fd_function_disable(uint32_t can_periph) +{ + CAN_FDCTL(can_periph) &= ~CAN_FDCTL_FDEN; +} + +/*! + \brief set CAN1 filter start bank number + \param[in] start_bank: CAN1 start bank number + only one parameter can be selected which is shown as below: + \arg (1..27) + \param[out] none + \retval none +*/ +void can1_filter_start_bank(uint8_t start_bank) +{ + /* filter lock disable */ + CAN_FCTL(CAN0) |= CAN_FCTL_FLD; + /* set CAN1 filter start number */ + CAN_FCTL(CAN0) &= ~(uint32_t)CAN_FCTL_HBC1F; + CAN_FCTL(CAN0) |= FCTL_HBC1F(start_bank); + /* filter lock enable */ + CAN_FCTL(CAN0) &= ~CAN_FCTL_FLD; +} + +/*! + \brief enable CAN debug freeze + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_debug_freeze_enable(uint32_t can_periph) +{ + /* set DFZ bit */ + CAN_CTL(can_periph) |= CAN_CTL_DFZ; + if(CAN0 == can_periph) { + dbg_periph_enable(DBG_CAN0_HOLD); + } else { + dbg_periph_enable(DBG_CAN1_HOLD); + } +} + +/*! + \brief disable CAN debug freeze + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_debug_freeze_disable(uint32_t can_periph) +{ + /* set DFZ bit */ + CAN_CTL(can_periph) &= ~CAN_CTL_DFZ; + + if(CAN0 == can_periph) { + dbg_periph_disable(DBG_CAN0_HOLD); + } else { + dbg_periph_disable(DBG_CAN1_HOLD); + } +} + +/*! + \brief enable CAN time trigger mode + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_time_trigger_mode_enable(uint32_t can_periph) +{ + uint8_t mailbox_number; + + /* enable the tcc mode */ + CAN_CTL(can_periph) |= CAN_CTL_TTC; + /* enable time stamp */ + for(mailbox_number = 0U; mailbox_number < 3U; mailbox_number++) { + CAN_TMP(can_periph, mailbox_number) |= CAN_TMP_TSEN; + } +} + +/*! + \brief disable CAN time trigger mode + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval none +*/ +void can_time_trigger_mode_disable(uint32_t can_periph) +{ + uint8_t mailbox_number; + + /* disable the TCC mode */ + CAN_CTL(can_periph) &= ~CAN_CTL_TTC; + /* reset TSEN bits */ + for(mailbox_number = 0U; mailbox_number < 3U; mailbox_number++) { + CAN_TMP(can_periph, mailbox_number) &= ~CAN_TMP_TSEN; + } +} + +/*! + \brief transmit CAN message + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] transmit_message: struct for CAN transmit message + \arg tx_sfid: 0x00000000 - 0x000007FF + \arg tx_efid: 0x00000000 - 0x1FFFFFFF + \arg tx_ff: CAN_FF_STANDARD, CAN_FF_EXTENDED + \arg tx_ft: CAN_FT_DATA, CAN_FT_REMOTE + \arg tx_dlen: 0 - 8 (FD mode: 0 - 8, or 12, 16, 20, 24, 32, 48, 64) + \arg tx_data[]: 0x00 - 0xFF + \param[out] none + \retval mailbox_number +*/ +uint8_t can_message_transmit(uint32_t can_periph, can_trasnmit_message_struct *transmit_message) +{ + uint8_t mailbox_number = CAN_MAILBOX0; + uint8_t i = 0U; + uint8_t hit = 0U; + uint32_t canfd_en = 0U; + volatile uint32_t p_temp; + uint32_t reg_temp = 0U; + + /* select one empty mailbox */ + if(CAN_TSTAT_TME0 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME0)) { + mailbox_number = CAN_MAILBOX0; + } else if(CAN_TSTAT_TME1 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME1)) { + mailbox_number = CAN_MAILBOX1; + } else if(CAN_TSTAT_TME2 == (CAN_TSTAT(can_periph)&CAN_TSTAT_TME2)) { + mailbox_number = CAN_MAILBOX2; + } else { + mailbox_number = CAN_NOMAILBOX; + } + /* return no mailbox empty */ + if(CAN_NOMAILBOX == mailbox_number) { + return CAN_NOMAILBOX; + } + + CAN_TMI(can_periph, mailbox_number) &= CAN_TMI_TEN; + if(CAN_FF_STANDARD == transmit_message->tx_ff) { + /* set transmit mailbox standard identifier */ + CAN_TMI(can_periph, mailbox_number) |= (uint32_t)(TMI_SFID(transmit_message->tx_sfid) | \ + transmit_message->tx_ft); + } else { + /* set transmit mailbox extended identifier */ + CAN_TMI(can_periph, mailbox_number) |= (uint32_t)(TMI_EFID(transmit_message->tx_efid) | \ + transmit_message->tx_ff | \ + transmit_message->tx_ft); + } + + if(CAN_FDF_CLASSIC == transmit_message->fd_flag) { + /* set the data length */ + CAN_TMP(can_periph, mailbox_number) &= ~(CAN_TMP_DLENC | CAN_TMP_ESI | CAN_TMP_BRS | CAN_TMP_FDF); + /* Classic CAN frame data length does not exceed 8 */ + if (transmit_message->tx_dlen > 8U) { + transmit_message->tx_dlen = 8U; + } + CAN_TMP(can_periph, mailbox_number) |= transmit_message->tx_dlen; + /* set the data */ + CAN_TMDATA0(can_periph, mailbox_number) = TMDATA0_DB3(transmit_message->tx_data[3]) | \ + TMDATA0_DB2(transmit_message->tx_data[2]) | \ + TMDATA0_DB1(transmit_message->tx_data[1]) | \ + TMDATA0_DB0(transmit_message->tx_data[0]); + CAN_TMDATA1(can_periph, mailbox_number) = TMDATA1_DB7(transmit_message->tx_data[7]) | \ + TMDATA1_DB6(transmit_message->tx_data[6]) | \ + TMDATA1_DB5(transmit_message->tx_data[5]) | \ + TMDATA1_DB4(transmit_message->tx_data[4]); + } else { + canfd_en = CAN_FDCTL(can_periph) & CAN_FDCTL_FDEN; + /* check FD function has been enabled */ + if(canfd_en) { + if(transmit_message->tx_dlen <= 8U) { + /* set the data length */ + reg_temp |= transmit_message->tx_dlen; + } else { + /* data length greater than 8 */ + for(i = 0U; i < 7U; i++) { + if(transmit_message->tx_dlen == g_can_fdlength_table[i]) { + hit = 1U; + break; + } + } + /* data length is valid */ + if(1U == hit) { + reg_temp |= 9U + i; + } else { + CAN_ERROR_HANDLE("dlen is invalid \r\n"); + } + } + reg_temp |= (((uint32_t)transmit_message->fd_brs << 5U) | ((uint32_t)transmit_message->fd_esi << 4U) | ((uint32_t)transmit_message->fd_flag << 7U)); + CAN_TMP(can_periph, mailbox_number) = reg_temp; + + /* set the data */ + i = transmit_message->tx_dlen / 4U; + + /* data length is 5-7 need send 2 word */ + if((1U == i) && (4U != transmit_message->tx_dlen)) { + i++; + } + p_temp = (uint32_t)transmit_message->tx_data; + if((0U == i)) { + CAN_TMDATA0(can_periph, mailbox_number) = *(uint32_t *)p_temp; + } else { + for(; i > 0U; i--) { + CAN_TMDATA0(can_periph, mailbox_number) = *(uint32_t *)p_temp; + p_temp = ((uint32_t)((uint32_t)p_temp + 4U)); + } + } + + } else { + CAN_ERROR_HANDLE("CAN FD function disabled \r\n"); + } + } + + /* enable transmission */ + CAN_TMI(can_periph, mailbox_number) |= CAN_TMI_TEN; + + return mailbox_number; +} + +/*! + \brief get CAN transmit state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] mailbox_number + only one parameter can be selected which is shown as below: + \arg CAN_MAILBOX(x=0,1,2) + \param[out] none + \retval can_transmit_state_enum +*/ +can_transmit_state_enum can_transmit_states(uint32_t can_periph, uint8_t mailbox_number) +{ + can_transmit_state_enum state = CAN_TRANSMIT_FAILED; + uint32_t val = 0U; + + /* check selected mailbox state */ + switch(mailbox_number) { + /* mailbox0 */ + case CAN_MAILBOX0: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF0 | CAN_TSTAT_MTFNERR0 | CAN_TSTAT_TME0); + break; + /* mailbox1 */ + case CAN_MAILBOX1: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF1 | CAN_TSTAT_MTFNERR1 | CAN_TSTAT_TME1); + break; + /* mailbox2 */ + case CAN_MAILBOX2: + val = CAN_TSTAT(can_periph) & (CAN_TSTAT_MTF2 | CAN_TSTAT_MTFNERR2 | CAN_TSTAT_TME2); + break; + default: + val = CAN_TRANSMIT_FAILED; + break; + } + + switch(val) { + /* transmit pending */ + case(CAN_STATE_PENDING): + state = CAN_TRANSMIT_PENDING; + break; + /* mailbox0 transmit succeeded */ + case(CAN_TSTAT_MTF0 | CAN_TSTAT_MTFNERR0 | CAN_TSTAT_TME0): + state = CAN_TRANSMIT_OK; + break; + /* mailbox1 transmit succeeded */ + case(CAN_TSTAT_MTF1 | CAN_TSTAT_MTFNERR1 | CAN_TSTAT_TME1): + state = CAN_TRANSMIT_OK; + break; + /* mailbox2 transmit succeeded */ + case(CAN_TSTAT_MTF2 | CAN_TSTAT_MTFNERR2 | CAN_TSTAT_TME2): + state = CAN_TRANSMIT_OK; + break; + /* transmit failed */ + default: + state = CAN_TRANSMIT_FAILED; + break; + } + return state; +} + +/*! + \brief stop CAN transmission + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] mailbox_number + only one parameter can be selected which is shown as below: + \arg CAN_MAILBOXx(x=0,1,2) + \param[out] none + \retval none +*/ +void can_transmission_stop(uint32_t can_periph, uint8_t mailbox_number) +{ + if(CAN_MAILBOX0 == mailbox_number) { + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST0; + while(CAN_TSTAT_MST0 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST0)) { + } + } else if(CAN_MAILBOX1 == mailbox_number) { + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST1; + while(CAN_TSTAT_MST1 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST1)) { + } + } else if(CAN_MAILBOX2 == mailbox_number) { + CAN_TSTAT(can_periph) |= CAN_TSTAT_MST2; + while(CAN_TSTAT_MST2 == (CAN_TSTAT(can_periph) & CAN_TSTAT_MST2)) { + } + } else { + /* illegal parameters */ + } +} + +/*! + \brief CAN receive message + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + \arg CAN_FIFOx(x=0,1) + \param[out] receive_message: struct for CAN receive message + \arg rx_sfid: 0x00000000 - 0x000007FF + \arg rx_efid: 0x00000000 - 0x1FFFFFFF + \arg rx_ff: CAN_FF_STANDARD, CAN_FF_EXTENDED + \arg rx_ft: CAN_FT_DATA, CAN_FT_REMOTE + \arg rx_dlen: 0 - 8 (FD mode: 0 - 8, or 12, 16, 20, 24, 32, 48, 64) + \arg rx_data[]: 0x00 - 0xFF + \arg rx_fi: 0 - 27 + \retval none +*/ +void can_message_receive(uint32_t can_periph, uint8_t fifo_number, can_receive_message_struct *receive_message) +{ + uint32_t canfd_en = 0U; + volatile uint32_t p_temp; + uint32_t data_temp; + uint8_t canfd_recv_cnt = 0U; + uint8_t i; + + /* get the frame format */ + receive_message->rx_ff = (uint8_t)(CAN_RFIFOMI_FF & CAN_RFIFOMI(can_periph, fifo_number)); + if(CAN_FF_STANDARD == receive_message->rx_ff) { + /* get standard identifier */ + receive_message->rx_sfid = (uint32_t)(GET_RFIFOMI_SFID(CAN_RFIFOMI(can_periph, fifo_number))); + } else { + /* get extended identifier */ + receive_message->rx_efid = (uint32_t)(GET_RFIFOMI_EFID(CAN_RFIFOMI(can_periph, fifo_number))); + } + + /* get frame type */ + receive_message->rx_ft = (uint8_t)(CAN_RFIFOMI_FT & CAN_RFIFOMI(can_periph, fifo_number)); + /* filtering index */ + receive_message->rx_fi = (uint8_t)(GET_RFIFOMP_FI(CAN_RFIFOMP(can_periph, fifo_number))); + receive_message->fd_flag = (uint8_t)((CAN_RFIFOMP_FDF & CAN_RFIFOMP(can_periph, fifo_number)) >> 7); + + canfd_en = CAN_FDCTL(can_periph) & CAN_FDCTL_FDEN; + if(!canfd_en) { + if(CAN_FDF_CLASSIC == receive_message->fd_flag) { + /* get receive data length */ + receive_message->rx_dlen = (uint8_t)(GET_RFIFOMP_DLENC(CAN_RFIFOMP(can_periph, fifo_number))); + /* receive data */ + receive_message->rx_data[0] = (uint8_t)(GET_RFIFOMDATA0_DB0(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[1] = (uint8_t)(GET_RFIFOMDATA0_DB1(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[2] = (uint8_t)(GET_RFIFOMDATA0_DB2(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[3] = (uint8_t)(GET_RFIFOMDATA0_DB3(CAN_RFIFOMDATA0(can_periph, fifo_number))); + receive_message->rx_data[4] = (uint8_t)(GET_RFIFOMDATA1_DB4(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message->rx_data[5] = (uint8_t)(GET_RFIFOMDATA1_DB5(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message->rx_data[6] = (uint8_t)(GET_RFIFOMDATA1_DB6(CAN_RFIFOMDATA1(can_periph, fifo_number))); + receive_message->rx_data[7] = (uint8_t)(GET_RFIFOMDATA1_DB7(CAN_RFIFOMDATA1(can_periph, fifo_number))); + } else { + CAN_ERROR_HANDLE("CAN FD function disabled \r\n"); + } + } else { + /* check FD function has been enabled */ + /* get receive data length */ + canfd_recv_cnt = (uint8_t)(GET_RFIFOMP_DLENC(CAN_RFIFOMP(can_periph, fifo_number))); + + if(canfd_recv_cnt <= 8U) { + /* set the data length */ + receive_message->rx_dlen = canfd_recv_cnt; + } else { + receive_message->rx_dlen = g_can_fdlength_table[canfd_recv_cnt - 9U]; + } + + receive_message->fd_brs = (uint8_t)((CAN_RFIFOMP(can_periph, fifo_number) & CAN_RFIFOMP_BRS) >> 5); + receive_message->fd_esi = (uint8_t)((CAN_RFIFOMP(can_periph, fifo_number) & CAN_RFIFOMP_ESI) >> 4); + + /* get the data */ + i = receive_message->rx_dlen / 4U; + + /* data length is 5-7 need receive 2 word */ + if((1U == i) && (4U != receive_message->rx_dlen)) { + i++; + } + p_temp = (uint32_t)(uint32_t)receive_message->rx_data; + if(0U == i) { + data_temp = CAN_RFIFOMDATA0(can_periph, fifo_number); + *(uint32_t *)p_temp = data_temp; + } else { + /* get the data by reading from CAN_RFIFOMDATA0 register*/ + for(; i > 0U; i--) { + data_temp = CAN_RFIFOMDATA0(can_periph, fifo_number); + *(uint32_t *)p_temp = data_temp; + p_temp = ((uint32_t)((uint32_t)p_temp + 4U)); + } + } + } + + /* release FIFO */ + if(CAN_FIFO0 == fifo_number) { + CAN_RFIFO0(can_periph) |= CAN_RFIFO0_RFD0; + } else { + CAN_RFIFO1(can_periph) |= CAN_RFIFO1_RFD1; + } +} + +/*! + \brief release FIFO0 + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval none +*/ +void can_fifo_release(uint32_t can_periph, uint8_t fifo_number) +{ + if(CAN_FIFO0 == fifo_number) { + CAN_RFIFO0(can_periph) |= CAN_RFIFO0_RFD0; + } else if(CAN_FIFO1 == fifo_number) { + CAN_RFIFO1(can_periph) |= CAN_RFIFO1_RFD1; + } else { + /* illegal parameters */ + CAN_ERROR_HANDLE("CAN FIFO NUM is invalid \r\n"); + } +} + +/*! + \brief CAN receive message length + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval message length +*/ +uint8_t can_receive_message_length_get(uint32_t can_periph, uint8_t fifo_number) +{ + uint8_t val = 0U; + + if(CAN_FIFO0 == fifo_number) { + /* FIFO0 */ + val = (uint8_t)(CAN_RFIFO0(can_periph) & CAN_RFIF_RFL_MASK); + } else if(CAN_FIFO1 == fifo_number) { + /* FIFO1 */ + val = (uint8_t)(CAN_RFIFO1(can_periph) & CAN_RFIF_RFL_MASK); + } else { + /* illegal parameters */ + } + return val; +} + +/*! + \brief set CAN working mode + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] can_working_mode + only one parameter can be selected which is shown as below: + \arg CAN_MODE_INITIALIZE + \arg CAN_MODE_NORMAL + \arg CAN_MODE_SLEEP + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_working_mode_set(uint32_t can_periph, uint8_t working_mode) +{ + ErrStatus flag = ERROR; + /* timeout for IWS or also for SLPWS bits */ + uint32_t timeout = CAN_TIMEOUT; + + if(CAN_MODE_INITIALIZE == working_mode) { + /* disable sleep mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_SLPWMOD); + /* set initialize mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_IWMOD; + /* wait the acknowledge */ + while((CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) && (0U != timeout)) { + timeout--; + } + if(CAN_STAT_IWS != (CAN_STAT(can_periph) & CAN_STAT_IWS)) { + flag = ERROR; + } else { + flag = SUCCESS; + } + } else if(CAN_MODE_NORMAL == working_mode) { + /* enter normal mode */ + CAN_CTL(can_periph) &= ~(uint32_t)(CAN_CTL_SLPWMOD | CAN_CTL_IWMOD); + /* wait the acknowledge */ + while((0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) && (0U != timeout)) { + timeout--; + } + if(0U != (CAN_STAT(can_periph) & (CAN_STAT_IWS | CAN_STAT_SLPWS))) { + flag = ERROR; + } else { + flag = SUCCESS; + } + } else if(CAN_MODE_SLEEP == working_mode) { + /* disable initialize mode */ + CAN_CTL(can_periph) &= (~(uint32_t)CAN_CTL_IWMOD); + /* set sleep mode */ + CAN_CTL(can_periph) |= (uint8_t)CAN_CTL_SLPWMOD; + /* wait the acknowledge */ + while((CAN_STAT_SLPWS != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) && (0U != timeout)) { + timeout--; + } + if(CAN_STAT_SLPWS != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) { + flag = ERROR; + } else { + flag = SUCCESS; + } + } else { + flag = ERROR; + } + return flag; +} + +/*! + \brief wake up CAN + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus can_wakeup(uint32_t can_periph) +{ + ErrStatus flag = ERROR; + uint32_t timeout = CAN_TIMEOUT; + + /* wakeup */ + CAN_CTL(can_periph) &= ~CAN_CTL_SLPWMOD; + + while((0U != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) && (0x00U != timeout)) { + timeout--; + } + /* check state */ + if(0U != (CAN_STAT(can_periph) & CAN_STAT_SLPWS)) { + flag = ERROR; + } else { + flag = SUCCESS; + } + return flag; +} + +/*! + \brief get CAN error type + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval can_error_enum + \arg CAN_ERROR_NONE: no error + \arg CAN_ERROR_FILL: fill error + \arg CAN_ERROR_FORMATE: format error + \arg CAN_ERROR_ACK: ACK error + \arg CAN_ERROR_BITRECESSIVE: bit recessive + \arg CAN_ERROR_BITDOMINANTER: bit dominant error + \arg CAN_ERROR_CRC: CRC error + \arg CAN_ERROR_SOFTWARECFG: software configure +*/ +can_error_enum can_error_get(uint32_t can_periph) +{ + can_error_enum error; + error = CAN_ERROR_NONE; + + /* get error type */ + error = (can_error_enum)(GET_ERR_ERRN(CAN_ERR(can_periph))); + return error; +} + +/*! + \brief get CAN receive error number + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval error number +*/ +uint8_t can_receive_error_number_get(uint32_t can_periph) +{ + uint8_t val; + + /* get error count */ + val = (uint8_t)(GET_ERR_RECNT(CAN_ERR(can_periph))); + return val; +} + +/*! + \brief get CAN transmit error number + \param[in] can_periph + \arg CANx(x=0,1) + \param[out] none + \retval error number +*/ +uint8_t can_transmit_error_number_get(uint32_t can_periph) +{ + uint8_t val; + + val = (uint8_t)(GET_ERR_TECNT(CAN_ERR(can_periph))); + return val; +} + +/*! + \brief enable CAN interrupt + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] interrupt + one or more parameters can be selected which are shown as below: + \arg CAN_INT_TME: transmit mailbox empty interrupt enable + \arg CAN_INT_RFNE0: receive FIFO0 not empty interrupt enable + \arg CAN_INT_RFF0: receive FIFO0 full interrupt enable + \arg CAN_INT_RFO0: receive FIFO0 overfull interrupt enable + \arg CAN_INT_RFNE1: receive FIFO1 not empty interrupt enable + \arg CAN_INT_RFF1: receive FIFO1 full interrupt enable + \arg CAN_INT_RFO1: receive FIFO1 overfull interrupt enable + \arg CAN_INT_WERR: warning error interrupt enable + \arg CAN_INT_PERR: passive error interrupt enable + \arg CAN_INT_BO: bus-off interrupt enable + \arg CAN_INT_ERRN: error number interrupt enable + \arg CAN_INT_ERR: error interrupt enable + \arg CAN_INT_WU: wakeup interrupt enable + \arg CAN_INT_SLPW: sleep working interrupt enable + \param[out] none + \retval none +*/ +void can_interrupt_enable(uint32_t can_periph, uint32_t interrupt) +{ + CAN_INTEN(can_periph) |= interrupt; +} + +/*! + \brief disable CAN interrupt + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] interrupt + one or more parameters can be selected which are shown as below: + \arg CAN_INT_TME: transmit mailbox empty interrupt enable + \arg CAN_INT_RFNE0: receive FIFO0 not empty interrupt enable + \arg CAN_INT_RFF0: receive FIFO0 full interrupt enable + \arg CAN_INT_RFO0: receive FIFO0 overfull interrupt enable + \arg CAN_INT_RFNE1: receive FIFO1 not empty interrupt enable + \arg CAN_INT_RFF1: receive FIFO1 full interrupt enable + \arg CAN_INT_RFO1: receive FIFO1 overfull interrupt enable + \arg CAN_INT_WERR: warning error interrupt enable + \arg CAN_INT_PERR: passive error interrupt enable + \arg CAN_INT_BO: bus-off interrupt enable + \arg CAN_INT_ERRN: error number interrupt enable + \arg CAN_INT_ERR: error interrupt enable + \arg CAN_INT_WU: wakeup interrupt enable + \arg CAN_INT_SLPW: sleep working interrupt enable + \param[out] none + \retval none +*/ +void can_interrupt_disable(uint32_t can_periph, uint32_t interrupt) +{ + CAN_INTEN(can_periph) &= ~interrupt; +} + +/*! + \brief get CAN flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN flags, refer to can_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_FLAG_RXL: RX level + \arg CAN_FLAG_LASTRX: last sample value of RX pin + \arg CAN_FLAG_RS: receiving state + \arg CAN_FLAG_TS: transmitting state + \arg CAN_FLAG_SLPIF: status change flag of entering sleep working mode + \arg CAN_FLAG_WUIF: status change flag of wakeup from sleep working mode + \arg CAN_FLAG_ERRIF: error flag + \arg CAN_FLAG_SLPWS: sleep working state + \arg CAN_FLAG_IWS: initial working state + \arg CAN_FLAG_TMLS2: transmit mailbox 2 last sending in Tx FIFO + \arg CAN_FLAG_TMLS1: transmit mailbox 1 last sending in Tx FIFO + \arg CAN_FLAG_TMLS0: transmit mailbox 0 last sending in Tx FIFO + \arg CAN_FLAG_TME2: transmit mailbox 2 empty + \arg CAN_FLAG_TME1: transmit mailbox 1 empty + \arg CAN_FLAG_TME0: transmit mailbox 0 empty + \arg CAN_FLAG_MTE2: mailbox 2 transmit error + \arg CAN_FLAG_MTE1: mailbox 1 transmit error + \arg CAN_FLAG_MTE0: mailbox 0 transmit error + \arg CAN_FLAG_MAL2: mailbox 2 arbitration lost + \arg CAN_FLAG_MAL1: mailbox 1 arbitration lost + \arg CAN_FLAG_MAL0: mailbox 0 arbitration lost + \arg CAN_FLAG_MTFNERR2: mailbox 2 transmit finished with no error + \arg CAN_FLAG_MTFNERR1: mailbox 1 transmit finished with no error + \arg CAN_FLAG_MTFNERR0: mailbox 0 transmit finished with no error + \arg CAN_FLAG_MTF2: mailbox 2 transmit finished + \arg CAN_FLAG_MTF1: mailbox 1 transmit finished + \arg CAN_FLAG_MTF0: mailbox 0 transmit finished + \arg CAN_FLAG_RFO0: receive FIFO0 overfull + \arg CAN_FLAG_RFF0: receive FIFO0 full + \arg CAN_FLAG_RFO1: receive FIFO1 overfull + \arg CAN_FLAG_RFF1: receive FIFO1 full + \arg CAN_FLAG_BOERR: bus-off error + \arg CAN_FLAG_PERR: passive error + \arg CAN_FLAG_WERR: warning error + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_flag_get(uint32_t can_periph, can_flag_enum flag) +{ + /* get flag and interrupt enable state */ + if(RESET != (CAN_REG_VAL(can_periph, flag) & BIT(CAN_BIT_POS(flag)))) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear CAN flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN flags, refer to can_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_FLAG_SLPIF: status change flag of entering sleep working mode + \arg CAN_FLAG_WUIF: status change flag of wakeup from sleep working mode + \arg CAN_FLAG_ERRIF: error flag + \arg CAN_FLAG_MTE2: mailbox 2 transmit error + \arg CAN_FLAG_MTE1: mailbox 1 transmit error + \arg CAN_FLAG_MTE0: mailbox 0 transmit error + \arg CAN_FLAG_MAL2: mailbox 2 arbitration lost + \arg CAN_FLAG_MAL1: mailbox 1 arbitration lost + \arg CAN_FLAG_MAL0: mailbox 0 arbitration lost + \arg CAN_FLAG_MTFNERR2: mailbox 2 transmit finished with no error + \arg CAN_FLAG_MTFNERR1: mailbox 1 transmit finished with no error + \arg CAN_FLAG_MTFNERR0: mailbox 0 transmit finished with no error + \arg CAN_FLAG_MTF2: mailbox 2 transmit finished + \arg CAN_FLAG_MTF1: mailbox 1 transmit finished + \arg CAN_FLAG_MTF0: mailbox 0 transmit finished + \arg CAN_FLAG_RFO0: receive FIFO0 overfull + \arg CAN_FLAG_RFF0: receive FIFO0 full + \arg CAN_FLAG_RFO1: receive FIFO1 overfull + \arg CAN_FLAG_RFF1: receive FIFO1 full + \param[out] none + \retval none +*/ +void can_flag_clear(uint32_t can_periph, can_flag_enum flag) +{ + CAN_REG_VAL(can_periph, flag) |= BIT(CAN_BIT_POS(flag)); +} + +/*! + \brief get CAN interrupt flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_INT_FLAG_SLPIF: status change interrupt flag of sleep working mode entering + \arg CAN_INT_FLAG_WUIF: status change interrupt flag of wakeup from sleep working mode + \arg CAN_INT_FLAG_ERRIF: error interrupt flag + \arg CAN_INT_FLAG_MTF2: mailbox 2 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF1: mailbox 1 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF0: mailbox 0 transmit finished interrupt flag + \arg CAN_INT_FLAG_RFO0: receive FIFO0 overfull interrupt flag + \arg CAN_INT_FLAG_RFF0: receive FIFO0 full interrupt flag + \arg CAN_INT_FLAG_RFL0: receive FIFO0 not empty interrupt flag + \arg CAN_INT_FLAG_RFO1: receive FIFO1 overfull interrupt flag + \arg CAN_INT_FLAG_RFF1: receive FIFO1 full interrupt flag + \arg CAN_INT_FLAG_RFL1: receive FIFO1 not empty interrupt flag + \arg CAN_INT_FLAG_ERRN: error number interrupt flag + \arg CAN_INT_FLAG_BOERR: bus-off error interrupt flag + \arg CAN_INT_FLAG_PERR: passive error interrupt flag + \arg CAN_INT_FLAG_WERR: warning error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_interrupt_flag_get(uint32_t can_periph, can_interrupt_flag_enum flag) +{ + uint32_t ret1 = RESET; + uint32_t ret2 = RESET; + + /* get the status of interrupt flag */ + if(flag == CAN_INT_FLAG_RFL0) { + ret1 = can_receive_message_length_get(can_periph, CAN_FIFO0); + } else if(flag == CAN_INT_FLAG_RFL1) { + ret1 = can_receive_message_length_get(can_periph, CAN_FIFO1); + } else if(flag == CAN_INT_FLAG_ERRN) { + ret1 = can_error_get(can_periph); + } else { + ret1 = CAN_REG_VALS(can_periph, flag) & BIT(CAN_BIT_POS0(flag)); + } + /* get the status of interrupt enable bit */ + ret2 = CAN_INTEN(can_periph) & BIT(CAN_BIT_POS1(flag)); + if(ret1 && ret2) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear CAN interrupt flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] flag: CAN interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg CAN_INT_FLAG_SLPIF: status change interrupt flag of sleep working mode entering + \arg CAN_INT_FLAG_WUIF: status change interrupt flag of wakeup from sleep working mode + \arg CAN_INT_FLAG_ERRIF: error interrupt flag + \arg CAN_INT_FLAG_MTF2: mailbox 2 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF1: mailbox 1 transmit finished interrupt flag + \arg CAN_INT_FLAG_MTF0: mailbox 0 transmit finished interrupt flag + \arg CAN_INT_FLAG_RFO0: receive FIFO0 overfull interrupt flag + \arg CAN_INT_FLAG_RFF0: receive FIFO0 full interrupt flag + \arg CAN_INT_FLAG_RFO1: receive FIFO1 overfull interrupt flag + \arg CAN_INT_FLAG_RFF1: receive FIFO1 full interrupt flag + \param[out] none + \retval none +*/ +void can_interrupt_flag_clear(uint32_t can_periph, can_interrupt_flag_enum flag) +{ + CAN_REG_VALS(can_periph, flag) |= BIT(CAN_BIT_POS0(flag)); +} + +#ifdef GD32C103XXA +/*! + \brief get FIFO overrun flag state + \param[in] can_periph + \arg CANx(x=0,1) + \param[in] fifo_number + only one parameter can be selected which is shown as below: + \arg CAN_FIFOx(x=0,1) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus can_fifo_overrun_flag_get(uint32_t can_periph, uint8_t fifo_number) +{ + FlagStatus ret = RESET; + if(CAN_FIFO0 == fifo_number) { + /* get flag state */ + if(RESET != (CAN_RFIFO0(can_periph) & CAN_RFIFO0_RFOVRN0)) { + ret = SET; + } else { + ret = RESET; + } + } else if(CAN_FIFO1 == fifo_number) { + /* get flag state */ + if(RESET != (CAN_RFIFO1(can_periph) & CAN_RFIFO1_RFOVRN1)) { + ret = SET; + } else { + ret = RESET; + } + } else { + /* illegal parameters */ + CAN_ERROR_HANDLE("CAN FIFO NUM is invalid \r\n"); + } + return ret; +} +#endif /* GD32C103XXA */ diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c new file mode 100644 index 0000000..9525060 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c @@ -0,0 +1,127 @@ +/*! + \file gd32c10x_crc.c + \brief CRC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_crc.h" + +#define CRC_DATA_RESET_VALUE ((uint32_t)0xFFFFFFFFU) +#define CRC_FDATA_RESET_VALUE ((uint32_t)0x00000000U) + +/*! + \brief deinit CRC calculation unit + \param[in] none + \param[out] none + \retval none +*/ +void crc_deinit(void) +{ + CRC_DATA = CRC_DATA_RESET_VALUE; + CRC_FDATA = CRC_FDATA_RESET_VALUE; + CRC_CTL = (uint32_t)CRC_CTL_RST; +} + +/*! + \brief reset data register(CRC_DATA) to the value of 0xFFFFFFFF + \param[in] none + \param[out] none + \retval none +*/ +void crc_data_register_reset(void) +{ + CRC_CTL |= (uint32_t)CRC_CTL_RST; +} + +/*! + \brief read the value of the data register + \param[in] none + \param[out] none + \retval 32-bit value of the data register +*/ +uint32_t crc_data_register_read(void) +{ + uint32_t data; + data = CRC_DATA; + return (data); +} + +/*! + \brief read the value of the free data register + \param[in] none + \param[out] none + \retval 8-bit value of the free data register +*/ +uint8_t crc_free_data_register_read(void) +{ + uint8_t fdata; + fdata = (uint8_t)CRC_FDATA; + return (fdata); +} + +/*! + \brief write data to the free data register + \param[in] free_data: specified 8-bit data + \param[out] none + \retval none +*/ +void crc_free_data_register_write(uint8_t free_data) +{ + CRC_FDATA = (uint32_t)free_data; +} + +/*! + \brief calculate the CRC value of a 32-bit data + \param[in] sdata: specified 32-bit data + \param[out] none + \retval 32-bit value calculated by CRC +*/ +uint32_t crc_single_data_calculate(uint32_t sdata) +{ + CRC_DATA = sdata; + return (CRC_DATA); +} + +/*! + \brief calculate the CRC value of an array of 32-bit values + \param[in] array: pointer to an array of 32-bit values + \param[in] size: size of the array + \param[out] none + \retval 32-bit value calculated by CRC +*/ +uint32_t crc_block_data_calculate(const uint32_t *array, uint32_t size) +{ + uint32_t index; + for(index = 0U; index < size; index++){ + CRC_DATA = *(array+index); + } + return (CRC_DATA); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c.base@1.0.0 new file mode 100644 index 0000000..9525060 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c.base@1.0.0 @@ -0,0 +1,127 @@ +/*! + \file gd32c10x_crc.c + \brief CRC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_crc.h" + +#define CRC_DATA_RESET_VALUE ((uint32_t)0xFFFFFFFFU) +#define CRC_FDATA_RESET_VALUE ((uint32_t)0x00000000U) + +/*! + \brief deinit CRC calculation unit + \param[in] none + \param[out] none + \retval none +*/ +void crc_deinit(void) +{ + CRC_DATA = CRC_DATA_RESET_VALUE; + CRC_FDATA = CRC_FDATA_RESET_VALUE; + CRC_CTL = (uint32_t)CRC_CTL_RST; +} + +/*! + \brief reset data register(CRC_DATA) to the value of 0xFFFFFFFF + \param[in] none + \param[out] none + \retval none +*/ +void crc_data_register_reset(void) +{ + CRC_CTL |= (uint32_t)CRC_CTL_RST; +} + +/*! + \brief read the value of the data register + \param[in] none + \param[out] none + \retval 32-bit value of the data register +*/ +uint32_t crc_data_register_read(void) +{ + uint32_t data; + data = CRC_DATA; + return (data); +} + +/*! + \brief read the value of the free data register + \param[in] none + \param[out] none + \retval 8-bit value of the free data register +*/ +uint8_t crc_free_data_register_read(void) +{ + uint8_t fdata; + fdata = (uint8_t)CRC_FDATA; + return (fdata); +} + +/*! + \brief write data to the free data register + \param[in] free_data: specified 8-bit data + \param[out] none + \retval none +*/ +void crc_free_data_register_write(uint8_t free_data) +{ + CRC_FDATA = (uint32_t)free_data; +} + +/*! + \brief calculate the CRC value of a 32-bit data + \param[in] sdata: specified 32-bit data + \param[out] none + \retval 32-bit value calculated by CRC +*/ +uint32_t crc_single_data_calculate(uint32_t sdata) +{ + CRC_DATA = sdata; + return (CRC_DATA); +} + +/*! + \brief calculate the CRC value of an array of 32-bit values + \param[in] array: pointer to an array of 32-bit values + \param[in] size: size of the array + \param[out] none + \retval 32-bit value calculated by CRC +*/ +uint32_t crc_block_data_calculate(const uint32_t *array, uint32_t size) +{ + uint32_t index; + for(index = 0U; index < size; index++){ + CRC_DATA = *(array+index); + } + return (CRC_DATA); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_ctc.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_ctc.c new file mode 100644 index 0000000..44d1fcf --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_ctc.c @@ -0,0 +1,388 @@ +/*! + \file gd32c10x_ctc.c + \brief CTC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_ctc.h" + +#define CTC_FLAG_MASK ((uint32_t)0x00000700U) + +/* CTC register bit offset */ +#define CTC_TRIMVALUE_OFFSET ((uint32_t)8U) +#define CTC_TRIM_VALUE_OFFSET ((uint32_t)8U) +#define CTC_REFCAP_OFFSET ((uint32_t)16U) +#define CTC_LIMIT_VALUE_OFFSET ((uint32_t)16U) + +/*! + \brief reset CTC clock trim controller + \param[in] none + \param[out] none + \retval none +*/ +void ctc_deinit(void) +{ + /* reset CTC */ + rcu_periph_reset_enable(RCU_CTCRST); + rcu_periph_reset_disable(RCU_CTCRST); +} + +/*! + \brief enable CTC trim counter + \param[in] none + \param[out] none + \retval none +*/ +void ctc_counter_enable(void) +{ + CTC_CTL0 |= (uint32_t)CTC_CTL0_CNTEN; +} + +/*! + \brief disable CTC trim counter + \param[in] none + \param[out] none + \retval none +*/ +void ctc_counter_disable(void) +{ + CTC_CTL0 &= (uint32_t)(~CTC_CTL0_CNTEN); +} + +/*! + \brief configure the IRC48M trim value + \param[in] ctc_trim_value: 8-bit IRC48M trim value + \arg 0x00 - 0x3F + \param[out] none + \retval none +*/ +void ctc_irc48m_trim_value_config(uint8_t trim_value) +{ + /* clear TRIMVALUE bits */ + CTC_CTL0 &= (~(uint32_t)CTC_CTL0_TRIMVALUE); + /* set TRIMVALUE bits */ + CTC_CTL0 |= ((uint32_t)trim_value << CTC_TRIM_VALUE_OFFSET); +} + +/*! + \brief generate software reference source sync pulse + \param[in] none + \param[out] none + \retval none +*/ +void ctc_software_refsource_pulse_generate(void) +{ + CTC_CTL0 |= (uint32_t)CTC_CTL0_SWREFPUL; +} + +/*! + \brief configure hardware automatically trim mode + \param[in] hardmode: + only one parameter can be selected which is shown as below: + \arg CTC_HARDWARE_TRIM_MODE_ENABLE: hardware automatically trim mode enable + \arg CTC_HARDWARE_TRIM_MODE_DISABLE: hardware automatically trim mode disable + \param[out] none + \retval none +*/ +void ctc_hardware_trim_mode_config(uint32_t hardmode) +{ + CTC_CTL0 &= (uint32_t)(~CTC_CTL0_AUTOTRIM); + CTC_CTL0 |= (uint32_t)hardmode; +} + +/*! + \brief configure reference signal source polarity + \param[in] polarity: + only one parameter can be selected which is shown as below: + \arg CTC_REFSOURCE_POLARITY_FALLING: reference signal source polarity is falling edge + \arg CTC_REFSOURCE_POLARITY_RISING: reference signal source polarity is rising edge + \param[out] none + \retval none +*/ +void ctc_refsource_polarity_config(uint32_t polarity) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_REFPOL); + CTC_CTL1 |= (uint32_t)polarity; +} + +/*! + \brief select reference signal source + \param[in] refs: + only one parameter can be selected which is shown as below: + \arg CTC_REFSOURCE_GPIO: GPIO is selected + \arg CTC_REFSOURCE_LXTAL: LXTAL is selected + \param[out] none + \retval none +*/ +void ctc_refsource_signal_select(uint32_t refs) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_REFSEL); + CTC_CTL1 |= (uint32_t)refs; +} + +/*! + \brief configure reference signal source prescaler + \param[in] prescaler: + only one parameter can be selected which is shown as below: + \arg CTC_REFSOURCE_PSC_OFF: reference signal not divided + \arg CTC_REFSOURCE_PSC_DIV2: reference signal divided by 2 + \arg CTC_REFSOURCE_PSC_DIV4: reference signal divided by 4 + \arg CTC_REFSOURCE_PSC_DIV8: reference signal divided by 8 + \arg CTC_REFSOURCE_PSC_DIV16: reference signal divided by 16 + \arg CTC_REFSOURCE_PSC_DIV32: reference signal divided by 32 + \arg CTC_REFSOURCE_PSC_DIV64: reference signal divided by 64 + \arg CTC_REFSOURCE_PSC_DIV128: reference signal divided by 128 + \param[out] none + \retval none +*/ +void ctc_refsource_prescaler_config(uint32_t prescaler) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_REFPSC); + CTC_CTL1 |= (uint32_t)prescaler; +} + +/*! + \brief configure clock trim base limit value + \param[in] limit_value: 8-bit clock trim base limit value + \arg 0x00 - 0xFF + \param[out] none + \retval none +*/ +void ctc_clock_limit_value_config(uint8_t limit_value) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_CKLIM); + CTC_CTL1 |= (uint32_t)((uint32_t)limit_value << CTC_LIMIT_VALUE_OFFSET); +} + +/*! + \brief configure CTC counter reload value + \param[in] reload_value: 16-bit CTC counter reload value + \arg 0x0000 - 0xFFFF + \param[out] none + \retval none +*/ +void ctc_counter_reload_value_config(uint16_t reload_value) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_RLVALUE); + CTC_CTL1 |= (uint32_t)reload_value; +} + +/*! + \brief read CTC counter capture value when reference sync pulse occurred + \param[in] none + \param[out] none + \retval the 16-bit CTC counter capture value +*/ +uint16_t ctc_counter_capture_value_read(void) +{ + uint16_t capture_value = 0U; + capture_value = (uint16_t)((CTC_STAT & CTC_STAT_REFCAP)>> CTC_REFCAP_OFFSET); + return (capture_value); +} + +/*! + \brief read CTC trim counter direction when reference sync pulse occurred + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET + \arg SET: CTC trim counter direction is down-counting + \arg RESET: CTC trim counter direction is up-counting +*/ +FlagStatus ctc_counter_direction_read(void) +{ + if(RESET != (CTC_STAT & CTC_STAT_REFDIR)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief read CTC counter reload value + \param[in] none + \param[out] none + \retval the 16-bit CTC counter reload value +*/ +uint16_t ctc_counter_reload_value_read(void) +{ + uint16_t reload_value = 0U; + reload_value = (uint16_t)(CTC_CTL1 & CTC_CTL1_RLVALUE); + return (reload_value); +} + +/*! + \brief read the IRC48M trim value + \param[in] none + \param[out] none + \retval the 8-bit IRC48M trim value +*/ +uint8_t ctc_irc48m_trim_value_read(void) +{ + uint8_t trim_value = 0U; + trim_value = (uint8_t)((CTC_CTL0 & CTC_CTL0_TRIMVALUE) >> CTC_TRIMVALUE_OFFSET); + return (trim_value); +} + +/*! + \brief enable the CTC interrupt + \param[in] interrupt: CTC interrupt enable + one or more parameters can be selected which are shown as below: + \arg CTC_INT_CKOK: clock trim OK interrupt enable + \arg CTC_INT_CKWARN: clock trim warning interrupt enable + \arg CTC_INT_ERR: error interrupt enable + \arg CTC_INT_EREF: expect reference interrupt enable + \param[out] none + \retval none +*/ +void ctc_interrupt_enable(uint32_t interrupt) +{ + CTC_CTL0 |= (uint32_t)interrupt; +} + +/*! + \brief disable the CTC interrupt + \param[in] interrupt: CTC interrupt enable source + one or more parameters can be selected which are shown as below: + \arg CTC_INT_CKOK: clock trim OK interrupt enable + \arg CTC_INT_CKWARN: clock trim warning interrupt enable + \arg CTC_INT_ERR: error interrupt enable + \arg CTC_INT_EREF: expect reference interrupt enable + \param[out] none + \retval none +*/ +void ctc_interrupt_disable(uint32_t interrupt) +{ + CTC_CTL0 &= (uint32_t)(~interrupt); +} + +/*! + \brief get CTC interrupt flag + \param[in] interrupt: the CTC interrupt flag + only one parameter can be selected which is shown as below: + \arg CTC_INT_FLAG_CKOK: clock trim OK interrupt + \arg CTC_INT_FLAG_CKWARN: clock trim warning interrupt + \arg CTC_INT_FLAG_ERR: error interrupt + \arg CTC_INT_FLAG_EREF: expect reference interrupt + \arg CTC_INT_FLAG_CKERR: clock trim error bit interrupt + \arg CTC_INT_FLAG_REFMISS: reference sync pulse miss interrupt + \arg CTC_INT_FLAG_TRIMERR: trim value error interrupt + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus ctc_interrupt_flag_get(uint32_t interrupt) +{ + uint32_t intflag = 0U, intenable = 0U; + + /* check whether the interrupt is enabled */ + if(RESET != (interrupt & CTC_FLAG_MASK)){ + intenable = CTC_CTL0 & CTC_CTL0_ERRIE; + }else{ + intenable = CTC_CTL0 & interrupt; + } + + /* get interrupt flag status */ + intflag = CTC_STAT & interrupt; + + if(intflag && intenable){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear CTC interrupt flag + \param[in] interrupt: the CTC interrupt flag + only one parameter can be selected which is shown as below: + \arg CTC_INT_FLAG_CKOK: clock trim OK interrupt + \arg CTC_INT_FLAG_CKWARN: clock trim warning interrupt + \arg CTC_INT_FLAG_ERR: error interrupt + \arg CTC_INT_FLAG_EREF: expect reference interrupt + \arg CTC_INT_FLAG_CKERR: clock trim error bit interrupt + \arg CTC_INT_FLAG_REFMISS: reference sync pulse miss interrupt + \arg CTC_INT_FLAG_TRIMERR: trim value error interrupt + \param[out] none + \retval none +*/ +void ctc_interrupt_flag_clear(uint32_t interrupt) +{ + if(RESET != (interrupt & CTC_FLAG_MASK)){ + CTC_INTC |= CTC_INTC_ERRIC; + }else{ + CTC_INTC |= interrupt; + } +} + +/*! + \brief get CTC flag + \param[in] flag: the CTC flag + only one parameter can be selected which is shown as below: + \arg CTC_FLAG_CKOK: clock trim OK flag + \arg CTC_FLAG_CKWARN: clock trim warning flag + \arg CTC_FLAG_ERR: error flag + \arg CTC_FLAG_EREF: expect reference flag + \arg CTC_FLAG_CKERR: clock trim error bit + \arg CTC_FLAG_REFMISS: reference sync pulse miss + \arg CTC_FLAG_TRIMERR: trim value error bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus ctc_flag_get(uint32_t flag) +{ + if(RESET != (CTC_STAT & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear CTC flag + \param[in] flag: the CTC flag + only one parameter can be selected which is shown as below: + \arg CTC_FLAG_CKOK: clock trim OK flag + \arg CTC_FLAG_CKWARN: clock trim warning flag + \arg CTC_FLAG_ERR: error flag + \arg CTC_FLAG_EREF: expect reference flag + \arg CTC_FLAG_CKERR: clock trim error bit + \arg CTC_FLAG_REFMISS: reference sync pulse miss + \arg CTC_FLAG_TRIMERR: trim value error bit + \param[out] none + \retval none +*/ +void ctc_flag_clear(uint32_t flag) +{ + if(RESET != (flag & CTC_FLAG_MASK)){ + CTC_INTC |= CTC_INTC_ERRIC; + }else{ + CTC_INTC |= flag; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_ctc.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_ctc.c.base@1.0.0 new file mode 100644 index 0000000..44d1fcf --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_ctc.c.base@1.0.0 @@ -0,0 +1,388 @@ +/*! + \file gd32c10x_ctc.c + \brief CTC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_ctc.h" + +#define CTC_FLAG_MASK ((uint32_t)0x00000700U) + +/* CTC register bit offset */ +#define CTC_TRIMVALUE_OFFSET ((uint32_t)8U) +#define CTC_TRIM_VALUE_OFFSET ((uint32_t)8U) +#define CTC_REFCAP_OFFSET ((uint32_t)16U) +#define CTC_LIMIT_VALUE_OFFSET ((uint32_t)16U) + +/*! + \brief reset CTC clock trim controller + \param[in] none + \param[out] none + \retval none +*/ +void ctc_deinit(void) +{ + /* reset CTC */ + rcu_periph_reset_enable(RCU_CTCRST); + rcu_periph_reset_disable(RCU_CTCRST); +} + +/*! + \brief enable CTC trim counter + \param[in] none + \param[out] none + \retval none +*/ +void ctc_counter_enable(void) +{ + CTC_CTL0 |= (uint32_t)CTC_CTL0_CNTEN; +} + +/*! + \brief disable CTC trim counter + \param[in] none + \param[out] none + \retval none +*/ +void ctc_counter_disable(void) +{ + CTC_CTL0 &= (uint32_t)(~CTC_CTL0_CNTEN); +} + +/*! + \brief configure the IRC48M trim value + \param[in] ctc_trim_value: 8-bit IRC48M trim value + \arg 0x00 - 0x3F + \param[out] none + \retval none +*/ +void ctc_irc48m_trim_value_config(uint8_t trim_value) +{ + /* clear TRIMVALUE bits */ + CTC_CTL0 &= (~(uint32_t)CTC_CTL0_TRIMVALUE); + /* set TRIMVALUE bits */ + CTC_CTL0 |= ((uint32_t)trim_value << CTC_TRIM_VALUE_OFFSET); +} + +/*! + \brief generate software reference source sync pulse + \param[in] none + \param[out] none + \retval none +*/ +void ctc_software_refsource_pulse_generate(void) +{ + CTC_CTL0 |= (uint32_t)CTC_CTL0_SWREFPUL; +} + +/*! + \brief configure hardware automatically trim mode + \param[in] hardmode: + only one parameter can be selected which is shown as below: + \arg CTC_HARDWARE_TRIM_MODE_ENABLE: hardware automatically trim mode enable + \arg CTC_HARDWARE_TRIM_MODE_DISABLE: hardware automatically trim mode disable + \param[out] none + \retval none +*/ +void ctc_hardware_trim_mode_config(uint32_t hardmode) +{ + CTC_CTL0 &= (uint32_t)(~CTC_CTL0_AUTOTRIM); + CTC_CTL0 |= (uint32_t)hardmode; +} + +/*! + \brief configure reference signal source polarity + \param[in] polarity: + only one parameter can be selected which is shown as below: + \arg CTC_REFSOURCE_POLARITY_FALLING: reference signal source polarity is falling edge + \arg CTC_REFSOURCE_POLARITY_RISING: reference signal source polarity is rising edge + \param[out] none + \retval none +*/ +void ctc_refsource_polarity_config(uint32_t polarity) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_REFPOL); + CTC_CTL1 |= (uint32_t)polarity; +} + +/*! + \brief select reference signal source + \param[in] refs: + only one parameter can be selected which is shown as below: + \arg CTC_REFSOURCE_GPIO: GPIO is selected + \arg CTC_REFSOURCE_LXTAL: LXTAL is selected + \param[out] none + \retval none +*/ +void ctc_refsource_signal_select(uint32_t refs) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_REFSEL); + CTC_CTL1 |= (uint32_t)refs; +} + +/*! + \brief configure reference signal source prescaler + \param[in] prescaler: + only one parameter can be selected which is shown as below: + \arg CTC_REFSOURCE_PSC_OFF: reference signal not divided + \arg CTC_REFSOURCE_PSC_DIV2: reference signal divided by 2 + \arg CTC_REFSOURCE_PSC_DIV4: reference signal divided by 4 + \arg CTC_REFSOURCE_PSC_DIV8: reference signal divided by 8 + \arg CTC_REFSOURCE_PSC_DIV16: reference signal divided by 16 + \arg CTC_REFSOURCE_PSC_DIV32: reference signal divided by 32 + \arg CTC_REFSOURCE_PSC_DIV64: reference signal divided by 64 + \arg CTC_REFSOURCE_PSC_DIV128: reference signal divided by 128 + \param[out] none + \retval none +*/ +void ctc_refsource_prescaler_config(uint32_t prescaler) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_REFPSC); + CTC_CTL1 |= (uint32_t)prescaler; +} + +/*! + \brief configure clock trim base limit value + \param[in] limit_value: 8-bit clock trim base limit value + \arg 0x00 - 0xFF + \param[out] none + \retval none +*/ +void ctc_clock_limit_value_config(uint8_t limit_value) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_CKLIM); + CTC_CTL1 |= (uint32_t)((uint32_t)limit_value << CTC_LIMIT_VALUE_OFFSET); +} + +/*! + \brief configure CTC counter reload value + \param[in] reload_value: 16-bit CTC counter reload value + \arg 0x0000 - 0xFFFF + \param[out] none + \retval none +*/ +void ctc_counter_reload_value_config(uint16_t reload_value) +{ + CTC_CTL1 &= (uint32_t)(~CTC_CTL1_RLVALUE); + CTC_CTL1 |= (uint32_t)reload_value; +} + +/*! + \brief read CTC counter capture value when reference sync pulse occurred + \param[in] none + \param[out] none + \retval the 16-bit CTC counter capture value +*/ +uint16_t ctc_counter_capture_value_read(void) +{ + uint16_t capture_value = 0U; + capture_value = (uint16_t)((CTC_STAT & CTC_STAT_REFCAP)>> CTC_REFCAP_OFFSET); + return (capture_value); +} + +/*! + \brief read CTC trim counter direction when reference sync pulse occurred + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET + \arg SET: CTC trim counter direction is down-counting + \arg RESET: CTC trim counter direction is up-counting +*/ +FlagStatus ctc_counter_direction_read(void) +{ + if(RESET != (CTC_STAT & CTC_STAT_REFDIR)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief read CTC counter reload value + \param[in] none + \param[out] none + \retval the 16-bit CTC counter reload value +*/ +uint16_t ctc_counter_reload_value_read(void) +{ + uint16_t reload_value = 0U; + reload_value = (uint16_t)(CTC_CTL1 & CTC_CTL1_RLVALUE); + return (reload_value); +} + +/*! + \brief read the IRC48M trim value + \param[in] none + \param[out] none + \retval the 8-bit IRC48M trim value +*/ +uint8_t ctc_irc48m_trim_value_read(void) +{ + uint8_t trim_value = 0U; + trim_value = (uint8_t)((CTC_CTL0 & CTC_CTL0_TRIMVALUE) >> CTC_TRIMVALUE_OFFSET); + return (trim_value); +} + +/*! + \brief enable the CTC interrupt + \param[in] interrupt: CTC interrupt enable + one or more parameters can be selected which are shown as below: + \arg CTC_INT_CKOK: clock trim OK interrupt enable + \arg CTC_INT_CKWARN: clock trim warning interrupt enable + \arg CTC_INT_ERR: error interrupt enable + \arg CTC_INT_EREF: expect reference interrupt enable + \param[out] none + \retval none +*/ +void ctc_interrupt_enable(uint32_t interrupt) +{ + CTC_CTL0 |= (uint32_t)interrupt; +} + +/*! + \brief disable the CTC interrupt + \param[in] interrupt: CTC interrupt enable source + one or more parameters can be selected which are shown as below: + \arg CTC_INT_CKOK: clock trim OK interrupt enable + \arg CTC_INT_CKWARN: clock trim warning interrupt enable + \arg CTC_INT_ERR: error interrupt enable + \arg CTC_INT_EREF: expect reference interrupt enable + \param[out] none + \retval none +*/ +void ctc_interrupt_disable(uint32_t interrupt) +{ + CTC_CTL0 &= (uint32_t)(~interrupt); +} + +/*! + \brief get CTC interrupt flag + \param[in] interrupt: the CTC interrupt flag + only one parameter can be selected which is shown as below: + \arg CTC_INT_FLAG_CKOK: clock trim OK interrupt + \arg CTC_INT_FLAG_CKWARN: clock trim warning interrupt + \arg CTC_INT_FLAG_ERR: error interrupt + \arg CTC_INT_FLAG_EREF: expect reference interrupt + \arg CTC_INT_FLAG_CKERR: clock trim error bit interrupt + \arg CTC_INT_FLAG_REFMISS: reference sync pulse miss interrupt + \arg CTC_INT_FLAG_TRIMERR: trim value error interrupt + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus ctc_interrupt_flag_get(uint32_t interrupt) +{ + uint32_t intflag = 0U, intenable = 0U; + + /* check whether the interrupt is enabled */ + if(RESET != (interrupt & CTC_FLAG_MASK)){ + intenable = CTC_CTL0 & CTC_CTL0_ERRIE; + }else{ + intenable = CTC_CTL0 & interrupt; + } + + /* get interrupt flag status */ + intflag = CTC_STAT & interrupt; + + if(intflag && intenable){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear CTC interrupt flag + \param[in] interrupt: the CTC interrupt flag + only one parameter can be selected which is shown as below: + \arg CTC_INT_FLAG_CKOK: clock trim OK interrupt + \arg CTC_INT_FLAG_CKWARN: clock trim warning interrupt + \arg CTC_INT_FLAG_ERR: error interrupt + \arg CTC_INT_FLAG_EREF: expect reference interrupt + \arg CTC_INT_FLAG_CKERR: clock trim error bit interrupt + \arg CTC_INT_FLAG_REFMISS: reference sync pulse miss interrupt + \arg CTC_INT_FLAG_TRIMERR: trim value error interrupt + \param[out] none + \retval none +*/ +void ctc_interrupt_flag_clear(uint32_t interrupt) +{ + if(RESET != (interrupt & CTC_FLAG_MASK)){ + CTC_INTC |= CTC_INTC_ERRIC; + }else{ + CTC_INTC |= interrupt; + } +} + +/*! + \brief get CTC flag + \param[in] flag: the CTC flag + only one parameter can be selected which is shown as below: + \arg CTC_FLAG_CKOK: clock trim OK flag + \arg CTC_FLAG_CKWARN: clock trim warning flag + \arg CTC_FLAG_ERR: error flag + \arg CTC_FLAG_EREF: expect reference flag + \arg CTC_FLAG_CKERR: clock trim error bit + \arg CTC_FLAG_REFMISS: reference sync pulse miss + \arg CTC_FLAG_TRIMERR: trim value error bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus ctc_flag_get(uint32_t flag) +{ + if(RESET != (CTC_STAT & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear CTC flag + \param[in] flag: the CTC flag + only one parameter can be selected which is shown as below: + \arg CTC_FLAG_CKOK: clock trim OK flag + \arg CTC_FLAG_CKWARN: clock trim warning flag + \arg CTC_FLAG_ERR: error flag + \arg CTC_FLAG_EREF: expect reference flag + \arg CTC_FLAG_CKERR: clock trim error bit + \arg CTC_FLAG_REFMISS: reference sync pulse miss + \arg CTC_FLAG_TRIMERR: trim value error bit + \param[out] none + \retval none +*/ +void ctc_flag_clear(uint32_t flag) +{ + if(RESET != (flag & CTC_FLAG_MASK)){ + CTC_INTC |= CTC_INTC_ERRIC; + }else{ + CTC_INTC |= flag; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dac.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dac.c new file mode 100644 index 0000000..06b662c --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dac.c @@ -0,0 +1,539 @@ +/*! + \file gd32c10x_dac.c + \brief DAC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_dac.h" + +/* DAC register bit offset */ +#define OUT1_REG_OFFSET ((uint32_t)0x00000010U) +#define DH_12BIT_OFFSET ((uint32_t)0x00000010U) +#define DH_8BIT_OFFSET ((uint32_t)0x00000008U) + +/*! + \brief deinitialize DAC + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_deinit(uint32_t dac_periph) +{ + switch(dac_periph){ + case DAC0: + /* reset DAC0 */ + rcu_periph_reset_enable(RCU_DACRST); + rcu_periph_reset_disable(RCU_DACRST); + break; + default: + break; + } +} + +/*! + \brief enable DAC + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC DMA function + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_dma_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DDMAEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DDMAEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC DMA function + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_dma_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DDMAEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DDMAEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC output buffer + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_output_buffer_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DBOFF0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DBOFF1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC output buffer + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_output_buffer_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DBOFF0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DBOFF1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief get DAC output value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval DAC output data: 0~4095 +*/ +uint16_t dac_output_value_get(uint32_t dac_periph, uint8_t dac_out) +{ + uint16_t data = 0U; + + if(DAC_OUT0 == dac_out){ + /* store the DACx_OUT0 output value */ + data = (uint16_t)DAC_OUT0_DO(dac_periph); + }else if(DAC_OUT1 == dac_out){ + /* store the DACx_OUT1 output value */ + data = (uint16_t)DAC_OUT1_DO(dac_periph); + }else{ + /* illegal parameters */ + } + + return data; +} + +/*! + \brief set DAC data holding register value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] dac_align: DAC data alignment mode + only one parameter can be selected which is shown as below: + \arg DAC_ALIGN_12B_R: 12-bit right-aligned data + \arg DAC_ALIGN_12B_L: 12-bit left-aligned data + \arg DAC_ALIGN_8B_R: 8-bit right-aligned data + \param[in] data: data to be loaded(0~4095) + \param[out] none + \retval none +*/ +void dac_data_set(uint32_t dac_periph, uint8_t dac_out, uint32_t dac_align, uint16_t data) +{ + /* DAC_OUT0 data alignment */ + if(DAC_OUT0 == dac_out){ + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + DAC_OUT0_R12DH(dac_periph) = data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + DAC_OUT0_L12DH(dac_periph) = data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + DAC_OUT0_R8DH(dac_periph) = data; + break; + default: + break; + } + }else if(DAC_OUT1 == dac_out){ + /* DAC_OUT1 data alignment */ + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + DAC_OUT1_R12DH(dac_periph) = data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + DAC_OUT1_L12DH(dac_periph) = data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + DAC_OUT1_R8DH(dac_periph) = data; + break; + default: + break; + } + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_trigger_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DTEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DTEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_trigger_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC trigger source + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] triggersource: external trigger of DAC + only one parameter can be selected which is shown as below: + \arg DAC_TRIGGER_T5_TRGO: TIMER5 TRGO + \arg DAC_TRIGGER_T2_TRGO: TIMER2 TRGO + \arg DAC_TRIGGER_T6_TRGO: TIMER6 TRGO + \arg DAC_TRIGGER_T4_TRGO: TIMER4 TRGO + \arg DAC_TRIGGER_T1_TRGO: TIMER1 TRGO + \arg DAC_TRIGGER_T3_TRGO: TIMER3 TRGO + \arg DAC_TRIGGER_EXTI_9: EXTI interrupt line9 event + \arg DAC_TRIGGER_SOFTWARE: software trigger + \param[out] none + \retval none +*/ +void dac_trigger_source_config(uint32_t dac_periph, uint8_t dac_out, uint32_t triggersource) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 trigger source */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTSEL0); + DAC_CTL0(dac_periph) |= triggersource; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 trigger source */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTSEL1); + DAC_CTL0(dac_periph) |= (triggersource << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC software trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \retval none +*/ +void dac_software_trigger_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_SWT(dac_periph) |= (uint32_t)DAC_SWT_SWTR0; + }else if(DAC_OUT1 == dac_out){ + DAC_SWT(dac_periph) |= (uint32_t)DAC_SWT_SWTR1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC wave mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] wave_mode: DAC wave mode + only one parameter can be selected which is shown as below: + \arg DAC_WAVE_DISABLE: wave mode disable + \arg DAC_WAVE_MODE_LFSR: LFSR noise mode + \arg DAC_WAVE_MODE_TRIANGLE: triangle noise mode + \param[out] none + \retval none +*/ +void dac_wave_mode_config(uint32_t dac_periph, uint8_t dac_out, uint32_t wave_mode) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 wave mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWM0); + DAC_CTL0(dac_periph) |= wave_mode; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 wave mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWM1); + DAC_CTL0(dac_periph) |= (wave_mode << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC LFSR noise mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] unmask_bits: LFSR noise unmask bits + only one parameter can be selected which is shown as below: + \arg DAC_LFSR_BIT0: unmask the LFSR bit0 + \arg DAC_LFSR_BITS1_0: unmask the LFSR bits[1:0] + \arg DAC_LFSR_BITS2_0: unmask the LFSR bits[2:0] + \arg DAC_LFSR_BITS3_0: unmask the LFSR bits[3:0] + \arg DAC_LFSR_BITS4_0: unmask the LFSR bits[4:0] + \arg DAC_LFSR_BITS5_0: unmask the LFSR bits[5:0] + \arg DAC_LFSR_BITS6_0: unmask the LFSR bits[6:0] + \arg DAC_LFSR_BITS7_0: unmask the LFSR bits[7:0] + \arg DAC_LFSR_BITS8_0: unmask the LFSR bits[8:0] + \arg DAC_LFSR_BITS9_0: unmask the LFSR bits[9:0] + \arg DAC_LFSR_BITS10_0: unmask the LFSR bits[10:0] + \arg DAC_LFSR_BITS11_0: unmask the LFSR bits[11:0] + \param[out] none + \retval none +*/ +void dac_lfsr_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t unmask_bits) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 LFSR noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW0); + DAC_CTL0(dac_periph) |= unmask_bits; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 LFSR noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW1); + DAC_CTL0(dac_periph) |= (unmask_bits << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC triangle noise mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] amplitude: the amplitude of the triangle + only one parameter can be selected which is shown as below: + \arg DAC_TRIANGLE_AMPLITUDE_1: triangle amplitude is 1 + \arg DAC_TRIANGLE_AMPLITUDE_3: triangle amplitude is 3 + \arg DAC_TRIANGLE_AMPLITUDE_7: triangle amplitude is 7 + \arg DAC_TRIANGLE_AMPLITUDE_15: triangle amplitude is 15 + \arg DAC_TRIANGLE_AMPLITUDE_31: triangle amplitude is 31 + \arg DAC_TRIANGLE_AMPLITUDE_63: triangle amplitude is 63 + \arg DAC_TRIANGLE_AMPLITUDE_127: triangle amplitude is 127 + \arg DAC_TRIANGLE_AMPLITUDE_255: triangle amplitude is 255 + \arg DAC_TRIANGLE_AMPLITUDE_511: triangle amplitude is 511 + \arg DAC_TRIANGLE_AMPLITUDE_1023: triangle amplitude is 1023 + \arg DAC_TRIANGLE_AMPLITUDE_2047: triangle amplitude is 2047 + \arg DAC_TRIANGLE_AMPLITUDE_4095: triangle amplitude is 4095 + \param[out] none + \retval none +*/ +void dac_triangle_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t amplitude) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 triangle noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW0); + DAC_CTL0(dac_periph) |= amplitude; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 triangle noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW1); + DAC_CTL0(dac_periph) |= (amplitude << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC concurrent mode + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_enable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DEN0 | DAC_CTL0_DEN1); + DAC_CTL0(dac_periph) |= (uint32_t)ctl; +} + +/*! + \brief disable DAC concurrent mode + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_disable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DEN0 | DAC_CTL0_DEN1); + DAC_CTL0(dac_periph) &= (uint32_t)(~ctl); +} + +/*! + \brief enable DAC concurrent software trigger + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_software_trigger_enable(uint32_t dac_periph) +{ + uint32_t swt = 0U; + + swt = (uint32_t)(DAC_SWT_SWTR0 | DAC_SWT_SWTR1); + DAC_SWT(dac_periph) |= (uint32_t)swt; +} + +/*! + \brief enable DAC concurrent buffer function + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_output_buffer_enable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DBOFF0 | DAC_CTL0_DBOFF1); + DAC_CTL0(dac_periph) &= (uint32_t)(~ctl); +} + +/*! + \brief disable DAC concurrent buffer function + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_output_buffer_disable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DBOFF0 | DAC_CTL0_DBOFF1); + DAC_CTL0(dac_periph) |= (uint32_t)ctl; +} + +/*! + \brief set DAC concurrent mode data holding register value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_align: DAC data alignment mode + only one parameter can be selected which is shown as below: + \arg DAC_ALIGN_12B_R: 12-bit right-aligned data + \arg DAC_ALIGN_12B_L: 12-bit left-aligned data + \arg DAC_ALIGN_8B_R: 8-bit right-aligned data + \param[in] data0: data to be loaded (0~4095) + \param[in] data1: data to be loaded (0~4095) + \param[out] none + \retval none +*/ +void dac_concurrent_data_set(uint32_t dac_periph, uint32_t dac_align, uint16_t data0, uint16_t data1) +{ + uint32_t data = 0U; + + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + data = (uint32_t)(((uint32_t)data1 << DH_12BIT_OFFSET) | data0); + DACC_R12DH(dac_periph) = (uint32_t)data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + data = (uint32_t)(((uint32_t)data1 << DH_12BIT_OFFSET) | data0); + DACC_L12DH(dac_periph) = (uint32_t)data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + data = (uint32_t)(((uint32_t)data1 << DH_8BIT_OFFSET) | data0); + DACC_R8DH(dac_periph) = (uint32_t)data; + break; + default: + break; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dac.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dac.c.base@1.0.0 new file mode 100644 index 0000000..06b662c --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dac.c.base@1.0.0 @@ -0,0 +1,539 @@ +/*! + \file gd32c10x_dac.c + \brief DAC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_dac.h" + +/* DAC register bit offset */ +#define OUT1_REG_OFFSET ((uint32_t)0x00000010U) +#define DH_12BIT_OFFSET ((uint32_t)0x00000010U) +#define DH_8BIT_OFFSET ((uint32_t)0x00000008U) + +/*! + \brief deinitialize DAC + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_deinit(uint32_t dac_periph) +{ + switch(dac_periph){ + case DAC0: + /* reset DAC0 */ + rcu_periph_reset_enable(RCU_DACRST); + rcu_periph_reset_disable(RCU_DACRST); + break; + default: + break; + } +} + +/*! + \brief enable DAC + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC DMA function + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_dma_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DDMAEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DDMAEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC DMA function + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_dma_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DDMAEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DDMAEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC output buffer + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_output_buffer_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DBOFF0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DBOFF1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC output buffer + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_output_buffer_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DBOFF0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DBOFF1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief get DAC output value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval DAC output data: 0~4095 +*/ +uint16_t dac_output_value_get(uint32_t dac_periph, uint8_t dac_out) +{ + uint16_t data = 0U; + + if(DAC_OUT0 == dac_out){ + /* store the DACx_OUT0 output value */ + data = (uint16_t)DAC_OUT0_DO(dac_periph); + }else if(DAC_OUT1 == dac_out){ + /* store the DACx_OUT1 output value */ + data = (uint16_t)DAC_OUT1_DO(dac_periph); + }else{ + /* illegal parameters */ + } + + return data; +} + +/*! + \brief set DAC data holding register value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] dac_align: DAC data alignment mode + only one parameter can be selected which is shown as below: + \arg DAC_ALIGN_12B_R: 12-bit right-aligned data + \arg DAC_ALIGN_12B_L: 12-bit left-aligned data + \arg DAC_ALIGN_8B_R: 8-bit right-aligned data + \param[in] data: data to be loaded(0~4095) + \param[out] none + \retval none +*/ +void dac_data_set(uint32_t dac_periph, uint8_t dac_out, uint32_t dac_align, uint16_t data) +{ + /* DAC_OUT0 data alignment */ + if(DAC_OUT0 == dac_out){ + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + DAC_OUT0_R12DH(dac_periph) = data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + DAC_OUT0_L12DH(dac_periph) = data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + DAC_OUT0_R8DH(dac_periph) = data; + break; + default: + break; + } + }else if(DAC_OUT1 == dac_out){ + /* DAC_OUT1 data alignment */ + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + DAC_OUT1_R12DH(dac_periph) = data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + DAC_OUT1_L12DH(dac_periph) = data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + DAC_OUT1_R8DH(dac_periph) = data; + break; + default: + break; + } + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_trigger_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DTEN0; + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) |= (uint32_t)DAC_CTL0_DTEN1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief disable DAC trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[out] none + \retval none +*/ +void dac_trigger_disable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTEN0); + }else if(DAC_OUT1 == dac_out){ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTEN1); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC trigger source + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] triggersource: external trigger of DAC + only one parameter can be selected which is shown as below: + \arg DAC_TRIGGER_T5_TRGO: TIMER5 TRGO + \arg DAC_TRIGGER_T2_TRGO: TIMER2 TRGO + \arg DAC_TRIGGER_T6_TRGO: TIMER6 TRGO + \arg DAC_TRIGGER_T4_TRGO: TIMER4 TRGO + \arg DAC_TRIGGER_T1_TRGO: TIMER1 TRGO + \arg DAC_TRIGGER_T3_TRGO: TIMER3 TRGO + \arg DAC_TRIGGER_EXTI_9: EXTI interrupt line9 event + \arg DAC_TRIGGER_SOFTWARE: software trigger + \param[out] none + \retval none +*/ +void dac_trigger_source_config(uint32_t dac_periph, uint8_t dac_out, uint32_t triggersource) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 trigger source */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTSEL0); + DAC_CTL0(dac_periph) |= triggersource; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 trigger source */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DTSEL1); + DAC_CTL0(dac_periph) |= (triggersource << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC software trigger + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \retval none +*/ +void dac_software_trigger_enable(uint32_t dac_periph, uint8_t dac_out) +{ + if(DAC_OUT0 == dac_out){ + DAC_SWT(dac_periph) |= (uint32_t)DAC_SWT_SWTR0; + }else if(DAC_OUT1 == dac_out){ + DAC_SWT(dac_periph) |= (uint32_t)DAC_SWT_SWTR1; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC wave mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] wave_mode: DAC wave mode + only one parameter can be selected which is shown as below: + \arg DAC_WAVE_DISABLE: wave mode disable + \arg DAC_WAVE_MODE_LFSR: LFSR noise mode + \arg DAC_WAVE_MODE_TRIANGLE: triangle noise mode + \param[out] none + \retval none +*/ +void dac_wave_mode_config(uint32_t dac_periph, uint8_t dac_out, uint32_t wave_mode) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 wave mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWM0); + DAC_CTL0(dac_periph) |= wave_mode; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 wave mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWM1); + DAC_CTL0(dac_periph) |= (wave_mode << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC LFSR noise mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] unmask_bits: LFSR noise unmask bits + only one parameter can be selected which is shown as below: + \arg DAC_LFSR_BIT0: unmask the LFSR bit0 + \arg DAC_LFSR_BITS1_0: unmask the LFSR bits[1:0] + \arg DAC_LFSR_BITS2_0: unmask the LFSR bits[2:0] + \arg DAC_LFSR_BITS3_0: unmask the LFSR bits[3:0] + \arg DAC_LFSR_BITS4_0: unmask the LFSR bits[4:0] + \arg DAC_LFSR_BITS5_0: unmask the LFSR bits[5:0] + \arg DAC_LFSR_BITS6_0: unmask the LFSR bits[6:0] + \arg DAC_LFSR_BITS7_0: unmask the LFSR bits[7:0] + \arg DAC_LFSR_BITS8_0: unmask the LFSR bits[8:0] + \arg DAC_LFSR_BITS9_0: unmask the LFSR bits[9:0] + \arg DAC_LFSR_BITS10_0: unmask the LFSR bits[10:0] + \arg DAC_LFSR_BITS11_0: unmask the LFSR bits[11:0] + \param[out] none + \retval none +*/ +void dac_lfsr_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t unmask_bits) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 LFSR noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW0); + DAC_CTL0(dac_periph) |= unmask_bits; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 LFSR noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW1); + DAC_CTL0(dac_periph) |= (unmask_bits << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure DAC triangle noise mode + \param[in] dac_periph: DACx(x=0) + \param[in] dac_out: DAC_OUTx(x=0,1) + \param[in] amplitude: the amplitude of the triangle + only one parameter can be selected which is shown as below: + \arg DAC_TRIANGLE_AMPLITUDE_1: triangle amplitude is 1 + \arg DAC_TRIANGLE_AMPLITUDE_3: triangle amplitude is 3 + \arg DAC_TRIANGLE_AMPLITUDE_7: triangle amplitude is 7 + \arg DAC_TRIANGLE_AMPLITUDE_15: triangle amplitude is 15 + \arg DAC_TRIANGLE_AMPLITUDE_31: triangle amplitude is 31 + \arg DAC_TRIANGLE_AMPLITUDE_63: triangle amplitude is 63 + \arg DAC_TRIANGLE_AMPLITUDE_127: triangle amplitude is 127 + \arg DAC_TRIANGLE_AMPLITUDE_255: triangle amplitude is 255 + \arg DAC_TRIANGLE_AMPLITUDE_511: triangle amplitude is 511 + \arg DAC_TRIANGLE_AMPLITUDE_1023: triangle amplitude is 1023 + \arg DAC_TRIANGLE_AMPLITUDE_2047: triangle amplitude is 2047 + \arg DAC_TRIANGLE_AMPLITUDE_4095: triangle amplitude is 4095 + \param[out] none + \retval none +*/ +void dac_triangle_noise_config(uint32_t dac_periph, uint8_t dac_out, uint32_t amplitude) +{ + if(DAC_OUT0 == dac_out){ + /* configure DACx_OUT0 triangle noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW0); + DAC_CTL0(dac_periph) |= amplitude; + }else if(DAC_OUT1 == dac_out){ + /* configure DACx_OUT1 triangle noise mode */ + DAC_CTL0(dac_periph) &= (uint32_t)(~DAC_CTL0_DWBW1); + DAC_CTL0(dac_periph) |= (amplitude << OUT1_REG_OFFSET); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable DAC concurrent mode + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_enable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DEN0 | DAC_CTL0_DEN1); + DAC_CTL0(dac_periph) |= (uint32_t)ctl; +} + +/*! + \brief disable DAC concurrent mode + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_disable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DEN0 | DAC_CTL0_DEN1); + DAC_CTL0(dac_periph) &= (uint32_t)(~ctl); +} + +/*! + \brief enable DAC concurrent software trigger + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_software_trigger_enable(uint32_t dac_periph) +{ + uint32_t swt = 0U; + + swt = (uint32_t)(DAC_SWT_SWTR0 | DAC_SWT_SWTR1); + DAC_SWT(dac_periph) |= (uint32_t)swt; +} + +/*! + \brief enable DAC concurrent buffer function + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_output_buffer_enable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DBOFF0 | DAC_CTL0_DBOFF1); + DAC_CTL0(dac_periph) &= (uint32_t)(~ctl); +} + +/*! + \brief disable DAC concurrent buffer function + \param[in] dac_periph: DACx(x=0) + \param[out] none + \retval none +*/ +void dac_concurrent_output_buffer_disable(uint32_t dac_periph) +{ + uint32_t ctl = 0U; + + ctl = (uint32_t)(DAC_CTL0_DBOFF0 | DAC_CTL0_DBOFF1); + DAC_CTL0(dac_periph) |= (uint32_t)ctl; +} + +/*! + \brief set DAC concurrent mode data holding register value + \param[in] dac_periph: DACx(x=0) + \param[in] dac_align: DAC data alignment mode + only one parameter can be selected which is shown as below: + \arg DAC_ALIGN_12B_R: 12-bit right-aligned data + \arg DAC_ALIGN_12B_L: 12-bit left-aligned data + \arg DAC_ALIGN_8B_R: 8-bit right-aligned data + \param[in] data0: data to be loaded (0~4095) + \param[in] data1: data to be loaded (0~4095) + \param[out] none + \retval none +*/ +void dac_concurrent_data_set(uint32_t dac_periph, uint32_t dac_align, uint16_t data0, uint16_t data1) +{ + uint32_t data = 0U; + + switch(dac_align){ + /* 12-bit right-aligned data */ + case DAC_ALIGN_12B_R: + data = (uint32_t)(((uint32_t)data1 << DH_12BIT_OFFSET) | data0); + DACC_R12DH(dac_periph) = (uint32_t)data; + break; + /* 12-bit left-aligned data */ + case DAC_ALIGN_12B_L: + data = (uint32_t)(((uint32_t)data1 << DH_12BIT_OFFSET) | data0); + DACC_L12DH(dac_periph) = (uint32_t)data; + break; + /* 8-bit right-aligned data */ + case DAC_ALIGN_8B_R: + data = (uint32_t)(((uint32_t)data1 << DH_8BIT_OFFSET) | data0); + DACC_R8DH(dac_periph) = (uint32_t)data; + break; + default: + break; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c new file mode 100644 index 0000000..d241f64 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c @@ -0,0 +1,133 @@ +/*! + \file gd32c10x_dbg.c + \brief DBG driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_dbg.h" + +/*! + \brief read DBG_ID code register + \param[in] none + \param[out] none + \retval DBG_ID code +*/ +uint32_t dbg_id_get(void) +{ + return DBG_ID; +} + +/*! + \brief enable low power behavior when the mcu is in debug mode + \param[in] dbg_low_power: + one or more parameters can be selected which are shown as below: + \arg DBG_LOW_POWER_SLEEP: keep debugger connection during sleep mode + \arg DBG_LOW_POWER_DEEPSLEEP: keep debugger connection during deepsleep mode + \arg DBG_LOW_POWER_STANDBY: keep debugger connection during standby mode + \param[out] none + \retval none +*/ +void dbg_low_power_enable(uint32_t dbg_low_power) +{ + DBG_CTL |= dbg_low_power; +} + +/*! + \brief disable low power behavior when the mcu is in debug mode + \param[in] dbg_low_power: + one or more parameters can be selected which are shown as below: + \arg DBG_LOW_POWER_SLEEP: donot keep debugger connection during sleep mode + \arg DBG_LOW_POWER_DEEPSLEEP: donot keep debugger connection during deepsleep mode + \arg DBG_LOW_POWER_STANDBY: donot keep debugger connection during standby mode + \param[out] none + \retval none +*/ +void dbg_low_power_disable(uint32_t dbg_low_power) +{ + DBG_CTL &= ~dbg_low_power; +} + +/*! + \brief enable peripheral behavior when the mcu is in debug mode + \param[in] dbg_periph: refer to dbg_periph_enum + one or more parameters can be selected which are shown as below: + \arg DBG_FWDGT_HOLD : debug FWDGT kept when core is halted + \arg DBG_WWDGT_HOLD : debug WWDGT kept when core is halted + \arg DBG_CANx_HOLD (x=0,1,CAN1 is only available for CL series): hold CANx counter when core is halted + \arg DBG_I2Cx_HOLD (x=0,1): hold I2Cx smbus when core is halted + \arg DBG_TIMERx_HOLD (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are not available for HD series): hold TIMERx counter when core is halted + \param[out] none + \retval none +*/ +void dbg_periph_enable(dbg_periph_enum dbg_periph) +{ + DBG_CTL |= (uint32_t)dbg_periph; +} + +/*! + \brief disable peripheral behavior when the mcu is in debug mode + \param[in] dbg_periph: refer to dbg_periph_enum + one or more parameters can be selected which are shown as below: + \arg DBG_FWDGT_HOLD : debug FWDGT kept when core is halted + \arg DBG_WWDGT_HOLD : debug WWDGT kept when core is halted + \arg DBG_CANx_HOLD (x=0,1,CAN1 is only available for CL series): hold CAN0 counter when core is halted + \arg DBG_I2Cx_HOLD (x=0,1): hold I2Cx smbus when core is halted + \arg DBG_TIMERx_HOLD (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): hold TIMERx counter when core is halted + \param[out] none + \retval none +*/ +void dbg_periph_disable(dbg_periph_enum dbg_periph) +{ + DBG_CTL &= ~(uint32_t)dbg_periph; +} + +/*! + \brief enable trace pin assignment + \param[in] none + \param[out] none + \retval none +*/ +void dbg_trace_pin_enable(void) +{ + DBG_CTL |= DBG_CTL_TRACE_IOEN; +} + +/*! + \brief disable trace pin assignment + \param[in] none + \param[out] none + \retval none +*/ +void dbg_trace_pin_disable(void) +{ + DBG_CTL &= ~DBG_CTL_TRACE_IOEN; +} + diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c.base@1.0.0 new file mode 100644 index 0000000..d241f64 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c.base@1.0.0 @@ -0,0 +1,133 @@ +/*! + \file gd32c10x_dbg.c + \brief DBG driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_dbg.h" + +/*! + \brief read DBG_ID code register + \param[in] none + \param[out] none + \retval DBG_ID code +*/ +uint32_t dbg_id_get(void) +{ + return DBG_ID; +} + +/*! + \brief enable low power behavior when the mcu is in debug mode + \param[in] dbg_low_power: + one or more parameters can be selected which are shown as below: + \arg DBG_LOW_POWER_SLEEP: keep debugger connection during sleep mode + \arg DBG_LOW_POWER_DEEPSLEEP: keep debugger connection during deepsleep mode + \arg DBG_LOW_POWER_STANDBY: keep debugger connection during standby mode + \param[out] none + \retval none +*/ +void dbg_low_power_enable(uint32_t dbg_low_power) +{ + DBG_CTL |= dbg_low_power; +} + +/*! + \brief disable low power behavior when the mcu is in debug mode + \param[in] dbg_low_power: + one or more parameters can be selected which are shown as below: + \arg DBG_LOW_POWER_SLEEP: donot keep debugger connection during sleep mode + \arg DBG_LOW_POWER_DEEPSLEEP: donot keep debugger connection during deepsleep mode + \arg DBG_LOW_POWER_STANDBY: donot keep debugger connection during standby mode + \param[out] none + \retval none +*/ +void dbg_low_power_disable(uint32_t dbg_low_power) +{ + DBG_CTL &= ~dbg_low_power; +} + +/*! + \brief enable peripheral behavior when the mcu is in debug mode + \param[in] dbg_periph: refer to dbg_periph_enum + one or more parameters can be selected which are shown as below: + \arg DBG_FWDGT_HOLD : debug FWDGT kept when core is halted + \arg DBG_WWDGT_HOLD : debug WWDGT kept when core is halted + \arg DBG_CANx_HOLD (x=0,1,CAN1 is only available for CL series): hold CANx counter when core is halted + \arg DBG_I2Cx_HOLD (x=0,1): hold I2Cx smbus when core is halted + \arg DBG_TIMERx_HOLD (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13,TIMER8..13 are not available for HD series): hold TIMERx counter when core is halted + \param[out] none + \retval none +*/ +void dbg_periph_enable(dbg_periph_enum dbg_periph) +{ + DBG_CTL |= (uint32_t)dbg_periph; +} + +/*! + \brief disable peripheral behavior when the mcu is in debug mode + \param[in] dbg_periph: refer to dbg_periph_enum + one or more parameters can be selected which are shown as below: + \arg DBG_FWDGT_HOLD : debug FWDGT kept when core is halted + \arg DBG_WWDGT_HOLD : debug WWDGT kept when core is halted + \arg DBG_CANx_HOLD (x=0,1,CAN1 is only available for CL series): hold CAN0 counter when core is halted + \arg DBG_I2Cx_HOLD (x=0,1): hold I2Cx smbus when core is halted + \arg DBG_TIMERx_HOLD (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): hold TIMERx counter when core is halted + \param[out] none + \retval none +*/ +void dbg_periph_disable(dbg_periph_enum dbg_periph) +{ + DBG_CTL &= ~(uint32_t)dbg_periph; +} + +/*! + \brief enable trace pin assignment + \param[in] none + \param[out] none + \retval none +*/ +void dbg_trace_pin_enable(void) +{ + DBG_CTL |= DBG_CTL_TRACE_IOEN; +} + +/*! + \brief disable trace pin assignment + \param[in] none + \param[out] none + \retval none +*/ +void dbg_trace_pin_disable(void) +{ + DBG_CTL &= ~DBG_CTL_TRACE_IOEN; +} + diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c new file mode 100644 index 0000000..1b083d6 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c @@ -0,0 +1,737 @@ +/*! + \file gd32c10x_dma.c + \brief DMA driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_dma.h" +#include + +#define DMA_WRONG_HANDLE while(1){} + +/* check whether peripheral matches channels or not */ +static ErrStatus dma_periph_and_channel_check(uint32_t dma_periph, dma_channel_enum channelx); + +/*! + \brief deinitialize DMA a channel registers + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel is deinitialized + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_deinit(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* disable the DMA channel */ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CHEN; + /* reset DMA channel registers */ + DMA_CHCTL(dma_periph, channelx) = DMA_CHCTL_RESET_VALUE; + DMA_CHCNT(dma_periph, channelx) = DMA_CHCNT_RESET_VALUE; + DMA_CHPADDR(dma_periph, channelx) = DMA_CHPADDR_RESET_VALUE; + DMA_CHMADDR(dma_periph, channelx) = DMA_CHMADDR_RESET_VALUE; + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(DMA_CHINTF_RESET_VALUE, channelx); +} + +/*! + \brief initialize the parameters of DMA struct with the default values + \param[in] init_struct: the initialization data needed to initialize DMA channel + \param[out] none + \retval none +*/ +void dma_struct_para_init(dma_parameter_struct* init_struct) +{ + if(NULL == init_struct){ + DMA_WRONG_HANDLE + } + + /* set the DMA struct with the default values */ + init_struct->periph_addr = 0U; + init_struct->periph_width = 0U; + init_struct->periph_inc = DMA_PERIPH_INCREASE_DISABLE; + init_struct->memory_addr = 0U; + init_struct->memory_width = 0U; + init_struct->memory_inc = DMA_MEMORY_INCREASE_DISABLE; + init_struct->number = 0U; + init_struct->direction = DMA_PERIPHERAL_TO_MEMORY; + init_struct->priority = DMA_PRIORITY_LOW; +} + +/*! + \brief initialize DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel is initialized + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] init_struct: the data needed to initialize DMA channel + periph_addr: peripheral base address + periph_width: DMA_PERIPHERAL_WIDTH_8BIT, DMA_PERIPHERAL_WIDTH_16BIT, DMA_PERIPHERAL_WIDTH_32BIT + periph_inc: DMA_PERIPH_INCREASE_ENABLE, DMA_PERIPH_INCREASE_DISABLE + memory_addr: memory base address + memory_width: DMA_MEMORY_WIDTH_8BIT, DMA_MEMORY_WIDTH_16BIT, DMA_MEMORY_WIDTH_32BIT + memory_inc: DMA_MEMORY_INCREASE_ENABLE, DMA_MEMORY_INCREASE_DISABLE + direction: DMA_PERIPHERAL_TO_MEMORY, DMA_MEMORY_TO_PERIPHERAL + number: the number of remaining data to be transferred by the DMA + priority: DMA_PRIORITY_LOW, DMA_PRIORITY_MEDIUM, DMA_PRIORITY_HIGH, DMA_PRIORITY_ULTRA_HIGH + \param[out] none + \retval none +*/ +void dma_init(uint32_t dma_periph, dma_channel_enum channelx, dma_parameter_struct* init_struct) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* configure peripheral base address */ + DMA_CHPADDR(dma_periph, channelx) = init_struct->periph_addr; + + /* configure memory base address */ + DMA_CHMADDR(dma_periph, channelx) = init_struct->memory_addr; + + /* configure the number of remaining data to be transferred */ + DMA_CHCNT(dma_periph, channelx) = (init_struct->number & DMA_CHANNEL_CNT_MASK); + + /* configure peripheral transfer width,memory transfer width and priority */ + ctl = DMA_CHCTL(dma_periph, channelx); + ctl &= ~(DMA_CHXCTL_PWIDTH | DMA_CHXCTL_MWIDTH | DMA_CHXCTL_PRIO); + ctl |= (init_struct->periph_width | init_struct->memory_width | init_struct->priority); + DMA_CHCTL(dma_periph, channelx) = ctl; + + /* configure peripheral increasing mode */ + if(DMA_PERIPH_INCREASE_ENABLE == init_struct->periph_inc){ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_PNAGA; + }else{ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_PNAGA; + } + + /* configure memory increasing mode */ + if(DMA_MEMORY_INCREASE_ENABLE == init_struct->memory_inc){ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_MNAGA; + }else{ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_MNAGA; + } + + /* configure the direction of data transfer */ + if(DMA_PERIPHERAL_TO_MEMORY == init_struct->direction){ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_DIR; + }else{ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_DIR; + } +} + +/*! + \brief enable DMA circulation mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_circulation_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_CMEN; +} + +/*! + \brief disable DMA circulation mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_circulation_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CMEN; +} + +/*! + \brief enable memory to memory mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_to_memory_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_M2M; +} + +/*! + \brief disable memory to memory mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_to_memory_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_M2M; +} + +/*! + \brief enable DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_channel_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_CHEN; +} + +/*! + \brief disable DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_channel_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CHEN; +} + +/*! + \brief set DMA peripheral base address + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] address: peripheral base address + \param[out] none + \retval none +*/ +void dma_periph_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHPADDR(dma_periph, channelx) = address; +} + +/*! + \brief set DMA memory base address + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] address: memory base address + \param[out] none + \retval none +*/ +void dma_memory_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHMADDR(dma_periph, channelx) = address; +} + +/*! + \brief set the number of remaining data to be transferred by the DMA + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] number: the number of remaining data to be transferred by the DMA + \arg 0x0000-0xFFFF + \param[out] none + \retval none +*/ +void dma_transfer_number_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t number) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCNT(dma_periph, channelx) = (number & DMA_CHANNEL_CNT_MASK); +} + +/*! + \brief get the number of remaining data to be transferred by the DMA + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval uint32_t: the number of remaining data to be transferred by the DMA +*/ +uint32_t dma_transfer_number_get(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + return (uint32_t)DMA_CHCNT(dma_periph, channelx); +} + +/*! + \brief configure priority level of DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] priority: priority level of this channel + only one parameter can be selected which is shown as below: + \arg DMA_PRIORITY_LOW: low priority + \arg DMA_PRIORITY_MEDIUM: medium priority + \arg DMA_PRIORITY_HIGH: high priority + \arg DMA_PRIORITY_ULTRA_HIGH: ultra high priority + \param[out] none + \retval none +*/ +void dma_priority_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t priority) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign register */ + ctl &= ~DMA_CHXCTL_PRIO; + ctl |= priority; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief configure transfer data size of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] mwidth: transfer data width of memory + only one parameter can be selected which is shown as below: + \arg DMA_MEMORY_WIDTH_8BIT: transfer data width of memory is 8-bit + \arg DMA_MEMORY_WIDTH_16BIT: transfer data width of memory is 16-bit + \arg DMA_MEMORY_WIDTH_32BIT: transfer data width of memory is 32-bit + \param[out] none + \retval none +*/ +void dma_memory_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t mwidth) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign register */ + ctl &= ~DMA_CHXCTL_MWIDTH; + ctl |= mwidth; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief configure transfer data size of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] pwidth: transfer data width of peripheral + only one parameter can be selected which is shown as below: + \arg DMA_PERIPHERAL_WIDTH_8BIT: transfer data width of peripheral is 8-bit + \arg DMA_PERIPHERAL_WIDTH_16BIT: transfer data width of peripheral is 16-bit + \arg DMA_PERIPHERAL_WIDTH_32BIT: transfer data width of peripheral is 32-bit + \param[out] none + \retval none +*/ +void dma_periph_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t pwidth) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign register */ + ctl &= ~DMA_CHXCTL_PWIDTH; + ctl |= pwidth; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief enable next address increment algorithm of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_increase_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_MNAGA; +} + +/*! + \brief disable next address increment algorithm of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_increase_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_MNAGA; +} + +/*! + \brief enable next address increment algorithm of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_periph_increase_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_PNAGA; +} + +/*! + \brief disable next address increment algorithm of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_periph_increase_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_PNAGA; +} + +/*! + \brief configure the direction of data transfer on the channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] direction: specify the direction of data transfer + only one parameter can be selected which is shown as below: + \arg DMA_PERIPHERAL_TO_MEMORY: read from peripheral and write to memory + \arg DMA_MEMORY_TO_PERIPHERAL: read from memory and write to peripheral + \param[out] none + \retval none +*/ +void dma_transfer_direction_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t direction) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + if(DMA_PERIPHERAL_TO_MEMORY == direction){ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_DIR; + } else { + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_DIR; + } +} + +/*! + \brief check DMA flag is set or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel to get flag + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_FLAG_G: global interrupt flag of channel + \arg DMA_FLAG_FTF: full transfer finish flag of channel + \arg DMA_FLAG_HTF: half transfer finish flag of channel + \arg DMA_FLAG_ERR: error flag of channel + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus dma_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + FlagStatus reval; + + /* check whether the flag is set or not */ + if(RESET != (DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx))){ + reval = SET; + }else{ + reval = RESET; + } + + return reval; +} + +/*! + \brief clear the flag of a DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel to clear flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_FLAG_G: global interrupt flag of channel + \arg DMA_FLAG_FTF: full transfer finish flag of channel + \arg DMA_FLAG_HTF: half transfer finish flag of channel + \arg DMA_FLAG_ERR: error flag of channel + \param[out] none + \retval none +*/ +void dma_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(flag, channelx); +} + +/*! + \brief check DMA flag and interrupt enable bit is set or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel to get flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_INT_FLAG_FTF: full transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_HTF: half transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_ERR: error interrupt flag of channel + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus dma_interrupt_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + uint32_t interrupt_enable = 0U, interrupt_flag = 0U; + + switch(flag){ + case DMA_INT_FLAG_FTF: + /* check whether the full transfer finish interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_FTFIE; + break; + case DMA_INT_FLAG_HTF: + /* check whether the half transfer finish interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_HTFIE; + break; + case DMA_INT_FLAG_ERR: + /* check whether the error interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_ERRIE; + break; + default: + DMA_WRONG_HANDLE + } + + /* when the interrupt flag is set and enabled, return SET */ + if((0U != interrupt_flag) && (0U != interrupt_enable)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear the interrupt flag of a DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_INT_FLAG_G: global interrupt flag of channel + \arg DMA_INT_FLAG_FTF: full transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_HTF: half transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_ERR: error interrupt flag of channel + \param[out] none + \retval none +*/ +void dma_interrupt_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(flag, channelx); +} + +/*! + \brief enable DMA interrupt + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] source: specify which interrupt to enable + one or more parameters can be selected which are shown as below + \arg DMA_INT_FTF: channel full transfer finish interrupt + \arg DMA_INT_HTF: channel half transfer finish interrupt + \arg DMA_INT_ERR: channel error interrupt + \param[out] none + \retval none +*/ +void dma_interrupt_enable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= source; +} + +/*! + \brief disable DMA interrupt + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] source: specify which interrupt to disable + one or more parameters can be selected which are shown as below + \arg DMA_INT_FTF: channel full transfer finish interrupt + \arg DMA_INT_HTF: channel half transfer finish interrupt + \arg DMA_INT_ERR: channel error interrupt + \param[out] none + \retval none +*/ +void dma_interrupt_disable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~source; +} + +/*! + \brief check whether peripheral matches channels or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA_CHx(x=0..6) + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +static ErrStatus dma_periph_and_channel_check(uint32_t dma_periph, dma_channel_enum channelx) +{ + ErrStatus val = SUCCESS; + + if(DMA1 == dma_periph){ + /* for DMA1, the channel is from DMA_CH0 to DMA_CH4 */ + if(channelx > DMA_CH4){ + val = ERROR; + } + } + + return val; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c.base@1.0.0 new file mode 100644 index 0000000..1b083d6 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c.base@1.0.0 @@ -0,0 +1,737 @@ +/*! + \file gd32c10x_dma.c + \brief DMA driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_dma.h" +#include + +#define DMA_WRONG_HANDLE while(1){} + +/* check whether peripheral matches channels or not */ +static ErrStatus dma_periph_and_channel_check(uint32_t dma_periph, dma_channel_enum channelx); + +/*! + \brief deinitialize DMA a channel registers + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel is deinitialized + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_deinit(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* disable the DMA channel */ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CHEN; + /* reset DMA channel registers */ + DMA_CHCTL(dma_periph, channelx) = DMA_CHCTL_RESET_VALUE; + DMA_CHCNT(dma_periph, channelx) = DMA_CHCNT_RESET_VALUE; + DMA_CHPADDR(dma_periph, channelx) = DMA_CHPADDR_RESET_VALUE; + DMA_CHMADDR(dma_periph, channelx) = DMA_CHMADDR_RESET_VALUE; + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(DMA_CHINTF_RESET_VALUE, channelx); +} + +/*! + \brief initialize the parameters of DMA struct with the default values + \param[in] init_struct: the initialization data needed to initialize DMA channel + \param[out] none + \retval none +*/ +void dma_struct_para_init(dma_parameter_struct* init_struct) +{ + if(NULL == init_struct){ + DMA_WRONG_HANDLE + } + + /* set the DMA struct with the default values */ + init_struct->periph_addr = 0U; + init_struct->periph_width = 0U; + init_struct->periph_inc = DMA_PERIPH_INCREASE_DISABLE; + init_struct->memory_addr = 0U; + init_struct->memory_width = 0U; + init_struct->memory_inc = DMA_MEMORY_INCREASE_DISABLE; + init_struct->number = 0U; + init_struct->direction = DMA_PERIPHERAL_TO_MEMORY; + init_struct->priority = DMA_PRIORITY_LOW; +} + +/*! + \brief initialize DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel is initialized + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] init_struct: the data needed to initialize DMA channel + periph_addr: peripheral base address + periph_width: DMA_PERIPHERAL_WIDTH_8BIT, DMA_PERIPHERAL_WIDTH_16BIT, DMA_PERIPHERAL_WIDTH_32BIT + periph_inc: DMA_PERIPH_INCREASE_ENABLE, DMA_PERIPH_INCREASE_DISABLE + memory_addr: memory base address + memory_width: DMA_MEMORY_WIDTH_8BIT, DMA_MEMORY_WIDTH_16BIT, DMA_MEMORY_WIDTH_32BIT + memory_inc: DMA_MEMORY_INCREASE_ENABLE, DMA_MEMORY_INCREASE_DISABLE + direction: DMA_PERIPHERAL_TO_MEMORY, DMA_MEMORY_TO_PERIPHERAL + number: the number of remaining data to be transferred by the DMA + priority: DMA_PRIORITY_LOW, DMA_PRIORITY_MEDIUM, DMA_PRIORITY_HIGH, DMA_PRIORITY_ULTRA_HIGH + \param[out] none + \retval none +*/ +void dma_init(uint32_t dma_periph, dma_channel_enum channelx, dma_parameter_struct* init_struct) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* configure peripheral base address */ + DMA_CHPADDR(dma_periph, channelx) = init_struct->periph_addr; + + /* configure memory base address */ + DMA_CHMADDR(dma_periph, channelx) = init_struct->memory_addr; + + /* configure the number of remaining data to be transferred */ + DMA_CHCNT(dma_periph, channelx) = (init_struct->number & DMA_CHANNEL_CNT_MASK); + + /* configure peripheral transfer width,memory transfer width and priority */ + ctl = DMA_CHCTL(dma_periph, channelx); + ctl &= ~(DMA_CHXCTL_PWIDTH | DMA_CHXCTL_MWIDTH | DMA_CHXCTL_PRIO); + ctl |= (init_struct->periph_width | init_struct->memory_width | init_struct->priority); + DMA_CHCTL(dma_periph, channelx) = ctl; + + /* configure peripheral increasing mode */ + if(DMA_PERIPH_INCREASE_ENABLE == init_struct->periph_inc){ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_PNAGA; + }else{ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_PNAGA; + } + + /* configure memory increasing mode */ + if(DMA_MEMORY_INCREASE_ENABLE == init_struct->memory_inc){ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_MNAGA; + }else{ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_MNAGA; + } + + /* configure the direction of data transfer */ + if(DMA_PERIPHERAL_TO_MEMORY == init_struct->direction){ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_DIR; + }else{ + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_DIR; + } +} + +/*! + \brief enable DMA circulation mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_circulation_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_CMEN; +} + +/*! + \brief disable DMA circulation mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_circulation_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CMEN; +} + +/*! + \brief enable memory to memory mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_to_memory_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_M2M; +} + +/*! + \brief disable memory to memory mode + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_to_memory_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_M2M; +} + +/*! + \brief enable DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_channel_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_CHEN; +} + +/*! + \brief disable DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_channel_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_CHEN; +} + +/*! + \brief set DMA peripheral base address + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] address: peripheral base address + \param[out] none + \retval none +*/ +void dma_periph_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHPADDR(dma_periph, channelx) = address; +} + +/*! + \brief set DMA memory base address + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] address: memory base address + \param[out] none + \retval none +*/ +void dma_memory_address_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t address) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHMADDR(dma_periph, channelx) = address; +} + +/*! + \brief set the number of remaining data to be transferred by the DMA + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] number: the number of remaining data to be transferred by the DMA + \arg 0x0000-0xFFFF + \param[out] none + \retval none +*/ +void dma_transfer_number_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t number) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCNT(dma_periph, channelx) = (number & DMA_CHANNEL_CNT_MASK); +} + +/*! + \brief get the number of remaining data to be transferred by the DMA + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval uint32_t: the number of remaining data to be transferred by the DMA +*/ +uint32_t dma_transfer_number_get(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + return (uint32_t)DMA_CHCNT(dma_periph, channelx); +} + +/*! + \brief configure priority level of DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] priority: priority level of this channel + only one parameter can be selected which is shown as below: + \arg DMA_PRIORITY_LOW: low priority + \arg DMA_PRIORITY_MEDIUM: medium priority + \arg DMA_PRIORITY_HIGH: high priority + \arg DMA_PRIORITY_ULTRA_HIGH: ultra high priority + \param[out] none + \retval none +*/ +void dma_priority_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t priority) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign register */ + ctl &= ~DMA_CHXCTL_PRIO; + ctl |= priority; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief configure transfer data size of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] mwidth: transfer data width of memory + only one parameter can be selected which is shown as below: + \arg DMA_MEMORY_WIDTH_8BIT: transfer data width of memory is 8-bit + \arg DMA_MEMORY_WIDTH_16BIT: transfer data width of memory is 16-bit + \arg DMA_MEMORY_WIDTH_32BIT: transfer data width of memory is 32-bit + \param[out] none + \retval none +*/ +void dma_memory_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t mwidth) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign register */ + ctl &= ~DMA_CHXCTL_MWIDTH; + ctl |= mwidth; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief configure transfer data size of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] pwidth: transfer data width of peripheral + only one parameter can be selected which is shown as below: + \arg DMA_PERIPHERAL_WIDTH_8BIT: transfer data width of peripheral is 8-bit + \arg DMA_PERIPHERAL_WIDTH_16BIT: transfer data width of peripheral is 16-bit + \arg DMA_PERIPHERAL_WIDTH_32BIT: transfer data width of peripheral is 32-bit + \param[out] none + \retval none +*/ +void dma_periph_width_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t pwidth) +{ + uint32_t ctl; + + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + /* acquire DMA_CHxCTL register */ + ctl = DMA_CHCTL(dma_periph, channelx); + /* assign register */ + ctl &= ~DMA_CHXCTL_PWIDTH; + ctl |= pwidth; + DMA_CHCTL(dma_periph, channelx) = ctl; +} + +/*! + \brief enable next address increment algorithm of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_increase_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_MNAGA; +} + +/*! + \brief disable next address increment algorithm of memory + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_memory_increase_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_MNAGA; +} + +/*! + \brief enable next address increment algorithm of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_periph_increase_enable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_PNAGA; +} + +/*! + \brief disable next address increment algorithm of peripheral + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[out] none + \retval none +*/ +void dma_periph_increase_disable(uint32_t dma_periph, dma_channel_enum channelx) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_PNAGA; +} + +/*! + \brief configure the direction of data transfer on the channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] direction: specify the direction of data transfer + only one parameter can be selected which is shown as below: + \arg DMA_PERIPHERAL_TO_MEMORY: read from peripheral and write to memory + \arg DMA_MEMORY_TO_PERIPHERAL: read from memory and write to peripheral + \param[out] none + \retval none +*/ +void dma_transfer_direction_config(uint32_t dma_periph, dma_channel_enum channelx, uint32_t direction) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + if(DMA_PERIPHERAL_TO_MEMORY == direction){ + DMA_CHCTL(dma_periph, channelx) &= ~DMA_CHXCTL_DIR; + } else { + DMA_CHCTL(dma_periph, channelx) |= DMA_CHXCTL_DIR; + } +} + +/*! + \brief check DMA flag is set or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel to get flag + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_FLAG_G: global interrupt flag of channel + \arg DMA_FLAG_FTF: full transfer finish flag of channel + \arg DMA_FLAG_HTF: half transfer finish flag of channel + \arg DMA_FLAG_ERR: error flag of channel + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus dma_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + FlagStatus reval; + + /* check whether the flag is set or not */ + if(RESET != (DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx))){ + reval = SET; + }else{ + reval = RESET; + } + + return reval; +} + +/*! + \brief clear the flag of a DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel to clear flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_FLAG_G: global interrupt flag of channel + \arg DMA_FLAG_FTF: full transfer finish flag of channel + \arg DMA_FLAG_HTF: half transfer finish flag of channel + \arg DMA_FLAG_ERR: error flag of channel + \param[out] none + \retval none +*/ +void dma_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(flag, channelx); +} + +/*! + \brief check DMA flag and interrupt enable bit is set or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel to get flag + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_INT_FLAG_FTF: full transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_HTF: half transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_ERR: error interrupt flag of channel + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus dma_interrupt_flag_get(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + uint32_t interrupt_enable = 0U, interrupt_flag = 0U; + + switch(flag){ + case DMA_INT_FLAG_FTF: + /* check whether the full transfer finish interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_FTFIE; + break; + case DMA_INT_FLAG_HTF: + /* check whether the half transfer finish interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_HTFIE; + break; + case DMA_INT_FLAG_ERR: + /* check whether the error interrupt flag is set and enabled */ + interrupt_flag = DMA_INTF(dma_periph) & DMA_FLAG_ADD(flag, channelx); + interrupt_enable = DMA_CHCTL(dma_periph, channelx) & DMA_CHXCTL_ERRIE; + break; + default: + DMA_WRONG_HANDLE + } + + /* when the interrupt flag is set and enabled, return SET */ + if((0U != interrupt_flag) && (0U != interrupt_enable)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear the interrupt flag of a DMA channel + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] flag: specify get which flag + only one parameter can be selected which is shown as below: + \arg DMA_INT_FLAG_G: global interrupt flag of channel + \arg DMA_INT_FLAG_FTF: full transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_HTF: half transfer finish interrupt flag of channel + \arg DMA_INT_FLAG_ERR: error interrupt flag of channel + \param[out] none + \retval none +*/ +void dma_interrupt_flag_clear(uint32_t dma_periph, dma_channel_enum channelx, uint32_t flag) +{ + DMA_INTC(dma_periph) |= DMA_FLAG_ADD(flag, channelx); +} + +/*! + \brief enable DMA interrupt + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] source: specify which interrupt to enable + one or more parameters can be selected which are shown as below + \arg DMA_INT_FTF: channel full transfer finish interrupt + \arg DMA_INT_HTF: channel half transfer finish interrupt + \arg DMA_INT_ERR: channel error interrupt + \param[out] none + \retval none +*/ +void dma_interrupt_enable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) |= source; +} + +/*! + \brief disable DMA interrupt + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA0: DMA_CHx(x=0..6), DMA1: DMA_CHx(x=0..4) + \param[in] source: specify which interrupt to disable + one or more parameters can be selected which are shown as below + \arg DMA_INT_FTF: channel full transfer finish interrupt + \arg DMA_INT_HTF: channel half transfer finish interrupt + \arg DMA_INT_ERR: channel error interrupt + \param[out] none + \retval none +*/ +void dma_interrupt_disable(uint32_t dma_periph, dma_channel_enum channelx, uint32_t source) +{ + if(ERROR == dma_periph_and_channel_check(dma_periph, channelx)){ + DMA_WRONG_HANDLE + } + + DMA_CHCTL(dma_periph, channelx) &= ~source; +} + +/*! + \brief check whether peripheral matches channels or not + \param[in] dma_periph: DMAx(x=0,1) + \arg DMAx(x=0,1) + \param[in] channelx: specified DMA channel + only one parameter can be selected which is shown as below: + \arg DMA_CHx(x=0..6) + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +static ErrStatus dma_periph_and_channel_check(uint32_t dma_periph, dma_channel_enum channelx) +{ + ErrStatus val = SUCCESS; + + if(DMA1 == dma_periph){ + /* for DMA1, the channel is from DMA_CH0 to DMA_CH4 */ + if(channelx > DMA_CH4){ + val = ERROR; + } + } + + return val; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c new file mode 100644 index 0000000..0bc0f94 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c @@ -0,0 +1,222 @@ +/*! + \file gd32c10x_eval.c + \brief firmware functions to manage leds, keys, COM ports + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_eval.h" + +/* private variables */ +static uint32_t GPIO_PORT[LED_MAX] = {LED1_GPIO_PORT, LED2_GPIO_PORT, + LED3_GPIO_PORT, LED4_GPIO_PORT}; +static uint32_t GPIO_PIN[LED_MAX] = {LED1_PIN, LED2_PIN, LED3_PIN, LED4_PIN}; + +static rcu_periph_enum COM_CLK[COMn] = {EVAL_COM0_CLK, EVAL_COM1_CLK}; +static uint32_t COM_TX_PIN[COMn] = {EVAL_COM0_TX_PIN, EVAL_COM1_TX_PIN}; +static uint32_t COM_RX_PIN[COMn] = {EVAL_COM0_RX_PIN, EVAL_COM1_RX_PIN}; +static uint32_t COM_GPIO_PORT[COMn] = {EVAL_COM0_GPIO_PORT, EVAL_COM1_GPIO_PORT}; +static rcu_periph_enum COM_GPIO_CLK[COMn] = {EVAL_COM0_GPIO_CLK, EVAL_COM1_GPIO_CLK}; + +static rcu_periph_enum GPIO_CLK[LED_MAX] = {LED1_GPIO_CLK, LED2_GPIO_CLK, + LED3_GPIO_CLK, LED4_GPIO_CLK}; + +static uint32_t KEY_PORT[KEY_MAX] = {WAKEUP_KEY_GPIO_PORT, + TAMPER_KEY_GPIO_PORT, + USER_KEY_GPIO_PORT}; +static uint32_t KEY_PIN[KEY_MAX] = {WAKEUP_KEY_PIN, TAMPER_KEY_PIN,USER_KEY_PIN,}; +static rcu_periph_enum KEY_CLK[KEY_MAX] = {WAKEUP_KEY_GPIO_CLK, + TAMPER_KEY_GPIO_CLK, + USER_KEY_GPIO_CLK}; +static exti_line_enum KEY_EXTI_LINE[KEY_MAX] = {WAKEUP_KEY_EXTI_LINE, + TAMPER_KEY_EXTI_LINE, + USER_KEY_EXTI_LINE}; +static uint8_t KEY_PORT_SOURCE[KEY_MAX] = {WAKEUP_KEY_EXTI_PORT_SOURCE, + TAMPER_KEY_EXTI_PORT_SOURCE, + USER_KEY_EXTI_PORT_SOURCE}; +static uint8_t KEY_PIN_SOURCE[KEY_MAX] = {WAKEUP_KEY_EXTI_PIN_SOURCE, + TAMPER_KEY_EXTI_PIN_SOURCE, + USER_KEY_EXTI_PIN_SOURCE}; +static IRQn_Type KEY_IRQn[KEY_MAX] = {WAKEUP_KEY_EXTI_IRQn, + TAMPER_KEY_EXTI_IRQn, + USER_KEY_EXTI_IRQn}; + +/*! + \brief configure led GPIO + \param[in] lednum: specify the led to be configured + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_init (led_typedef_enum lednum) +{ + /* enable the led clock */ + rcu_periph_clock_enable(GPIO_CLK[lednum]); + /* configure led GPIO port */ + gpio_init(GPIO_PORT[lednum], GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN[lednum]); + + GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief turn on selected led + \param[in] lednum: specify the led to be turned on + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_on(led_typedef_enum lednum) +{ + GPIO_BOP(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief turn off selected led + \param[in] lednum: specify the led to be turned off + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_off(led_typedef_enum lednum) +{ + GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief toggle selected led + \param[in] lednum: specify the led to be toggled + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_toggle(led_typedef_enum lednum) +{ + gpio_bit_write(GPIO_PORT[lednum], GPIO_PIN[lednum], + (bit_status)(1-gpio_input_bit_get(GPIO_PORT[lednum], GPIO_PIN[lednum]))); +} + +/*! + \brief configure key + \param[in] key_num: specify the key to be configured + \arg KEY_TAMPER: tamper key + \arg KEY_WAKEUP: wakeup key + \arg KEY_USER: user key + \param[in] key_mode: specify button mode + \arg KEY_MODE_GPIO: key will be used as simple IO + \arg KEY_MODE_EXTI: key will be connected to EXTI line with interrupt + \param[out] none + \retval none +*/ +void gd_eval_key_init(key_typedef_enum key_num, keymode_typedef_enum key_mode) +{ + /* enable the key clock */ + rcu_periph_clock_enable(KEY_CLK[key_num]); + rcu_periph_clock_enable(RCU_AF); + + /* configure button pin as input */ + gpio_init(KEY_PORT[key_num], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, KEY_PIN[key_num]); + + if (key_mode == KEY_MODE_EXTI) { + /* enable and set key EXTI interrupt to the lowest priority */ + nvic_irq_enable(KEY_IRQn[key_num], 2U, 0U); + + /* connect key EXTI line to key GPIO pin */ + gpio_exti_source_select(KEY_PORT_SOURCE[key_num], KEY_PIN_SOURCE[key_num]); + + /* configure key EXTI line */ + exti_init(KEY_EXTI_LINE[key_num], EXTI_INTERRUPT, EXTI_TRIG_FALLING); + exti_interrupt_flag_clear(KEY_EXTI_LINE[key_num]); + } +} + +/*! + \brief return the selected key state + \param[in] key: specify the key to be checked + \arg KEY_TAMPER: tamper key + \arg KEY_WAKEUP: wakeup key + \arg KEY_USER: user key + \param[out] none + \retval the key's GPIO pin value +*/ +uint8_t gd_eval_key_state_get(key_typedef_enum key) +{ + return gpio_input_bit_get(KEY_PORT[key], KEY_PIN[key]); +} + +/*! + \brief configure COM port + \param[in] com: COM on the board + \arg EVAL_COM0: COM0 on the board + \arg EVAL_COM1: COM1 on the board + \param[out] none + \retval none +*/ +void gd_eval_com_init(uint32_t com) +{ + uint32_t com_id = 0U; + if(EVAL_COM0 == com){ + com_id = 0U; + }else if(EVAL_COM1 == com){ + com_id = 1U; + }else{ + com_id = 2U; + } + + /* enable GPIO clock */ + rcu_periph_clock_enable(COM_GPIO_CLK[com_id]); + + /* enable USART clock */ + rcu_periph_clock_enable(COM_CLK[com_id]); + + /* connect port to USARTx_Tx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, COM_TX_PIN[com_id]); + + /* connect port to USARTx_Rx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, COM_RX_PIN[com_id]); + + /* USART configure */ + usart_deinit(com); + usart_baudrate_set(com, 3000000U); + usart_receive_config(com, USART_RECEIVE_ENABLE); + usart_transmit_config(com, USART_TRANSMIT_ENABLE); + usart_enable(com); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c.base@1.0.0 new file mode 100644 index 0000000..079f63e --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c.base@1.0.0 @@ -0,0 +1,222 @@ +/*! + \file gd32c10x_eval.c + \brief firmware functions to manage leds, keys, COM ports + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_eval.h" + +/* private variables */ +static uint32_t GPIO_PORT[LED_MAX] = {LED1_GPIO_PORT, LED2_GPIO_PORT, + LED3_GPIO_PORT, LED4_GPIO_PORT}; +static uint32_t GPIO_PIN[LED_MAX] = {LED1_PIN, LED2_PIN, LED3_PIN, LED4_PIN}; + +static rcu_periph_enum COM_CLK[COMn] = {EVAL_COM0_CLK, EVAL_COM1_CLK}; +static uint32_t COM_TX_PIN[COMn] = {EVAL_COM0_TX_PIN, EVAL_COM1_TX_PIN}; +static uint32_t COM_RX_PIN[COMn] = {EVAL_COM0_RX_PIN, EVAL_COM1_RX_PIN}; +static uint32_t COM_GPIO_PORT[COMn] = {EVAL_COM0_GPIO_PORT, EVAL_COM1_GPIO_PORT}; +static rcu_periph_enum COM_GPIO_CLK[COMn] = {EVAL_COM0_GPIO_CLK, EVAL_COM1_GPIO_CLK}; + +static rcu_periph_enum GPIO_CLK[LED_MAX] = {LED1_GPIO_CLK, LED2_GPIO_CLK, + LED3_GPIO_CLK, LED4_GPIO_CLK}; + +static uint32_t KEY_PORT[KEY_MAX] = {WAKEUP_KEY_GPIO_PORT, + TAMPER_KEY_GPIO_PORT, + USER_KEY_GPIO_PORT}; +static uint32_t KEY_PIN[KEY_MAX] = {WAKEUP_KEY_PIN, TAMPER_KEY_PIN,USER_KEY_PIN,}; +static rcu_periph_enum KEY_CLK[KEY_MAX] = {WAKEUP_KEY_GPIO_CLK, + TAMPER_KEY_GPIO_CLK, + USER_KEY_GPIO_CLK}; +static exti_line_enum KEY_EXTI_LINE[KEY_MAX] = {WAKEUP_KEY_EXTI_LINE, + TAMPER_KEY_EXTI_LINE, + USER_KEY_EXTI_LINE}; +static uint8_t KEY_PORT_SOURCE[KEY_MAX] = {WAKEUP_KEY_EXTI_PORT_SOURCE, + TAMPER_KEY_EXTI_PORT_SOURCE, + USER_KEY_EXTI_PORT_SOURCE}; +static uint8_t KEY_PIN_SOURCE[KEY_MAX] = {WAKEUP_KEY_EXTI_PIN_SOURCE, + TAMPER_KEY_EXTI_PIN_SOURCE, + USER_KEY_EXTI_PIN_SOURCE}; +static IRQn_Type KEY_IRQn[KEY_MAX] = {WAKEUP_KEY_EXTI_IRQn, + TAMPER_KEY_EXTI_IRQn, + USER_KEY_EXTI_IRQn}; + +/*! + \brief configure led GPIO + \param[in] lednum: specify the led to be configured + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_init (led_typedef_enum lednum) +{ + /* enable the led clock */ + rcu_periph_clock_enable(GPIO_CLK[lednum]); + /* configure led GPIO port */ + gpio_init(GPIO_PORT[lednum], GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN[lednum]); + + GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief turn on selected led + \param[in] lednum: specify the led to be turned on + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_on(led_typedef_enum lednum) +{ + GPIO_BOP(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief turn off selected led + \param[in] lednum: specify the led to be turned off + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_off(led_typedef_enum lednum) +{ + GPIO_BC(GPIO_PORT[lednum]) = GPIO_PIN[lednum]; +} + +/*! + \brief toggle selected led + \param[in] lednum: specify the led to be toggled + \arg LED1 + \arg LED2 + \arg LED3 + \arg LED4 + \param[out] none + \retval none +*/ +void gd_eval_led_toggle(led_typedef_enum lednum) +{ + gpio_bit_write(GPIO_PORT[lednum], GPIO_PIN[lednum], + (bit_status)(1-gpio_input_bit_get(GPIO_PORT[lednum], GPIO_PIN[lednum]))); +} + +/*! + \brief configure key + \param[in] key_num: specify the key to be configured + \arg KEY_TAMPER: tamper key + \arg KEY_WAKEUP: wakeup key + \arg KEY_USER: user key + \param[in] key_mode: specify button mode + \arg KEY_MODE_GPIO: key will be used as simple IO + \arg KEY_MODE_EXTI: key will be connected to EXTI line with interrupt + \param[out] none + \retval none +*/ +void gd_eval_key_init(key_typedef_enum key_num, keymode_typedef_enum key_mode) +{ + /* enable the key clock */ + rcu_periph_clock_enable(KEY_CLK[key_num]); + rcu_periph_clock_enable(RCU_AF); + + /* configure button pin as input */ + gpio_init(KEY_PORT[key_num], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, KEY_PIN[key_num]); + + if (key_mode == KEY_MODE_EXTI) { + /* enable and set key EXTI interrupt to the lowest priority */ + nvic_irq_enable(KEY_IRQn[key_num], 2U, 0U); + + /* connect key EXTI line to key GPIO pin */ + gpio_exti_source_select(KEY_PORT_SOURCE[key_num], KEY_PIN_SOURCE[key_num]); + + /* configure key EXTI line */ + exti_init(KEY_EXTI_LINE[key_num], EXTI_INTERRUPT, EXTI_TRIG_FALLING); + exti_interrupt_flag_clear(KEY_EXTI_LINE[key_num]); + } +} + +/*! + \brief return the selected key state + \param[in] key: specify the key to be checked + \arg KEY_TAMPER: tamper key + \arg KEY_WAKEUP: wakeup key + \arg KEY_USER: user key + \param[out] none + \retval the key's GPIO pin value +*/ +uint8_t gd_eval_key_state_get(key_typedef_enum key) +{ + return gpio_input_bit_get(KEY_PORT[key], KEY_PIN[key]); +} + +/*! + \brief configure COM port + \param[in] com: COM on the board + \arg EVAL_COM0: COM0 on the board + \arg EVAL_COM1: COM1 on the board + \param[out] none + \retval none +*/ +void gd_eval_com_init(uint32_t com) +{ + uint32_t com_id = 0U; + if(EVAL_COM0 == com){ + com_id = 0U; + }else if(EVAL_COM1 == com){ + com_id = 1U; + }else{ + com_id = 2U; + } + + /* enable GPIO clock */ + rcu_periph_clock_enable(COM_GPIO_CLK[com_id]); + + /* enable USART clock */ + rcu_periph_clock_enable(COM_CLK[com_id]); + + /* connect port to USARTx_Tx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, COM_TX_PIN[com_id]); + + /* connect port to USARTx_Rx */ + gpio_init(COM_GPIO_PORT[com_id], GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, COM_RX_PIN[com_id]); + + /* USART configure */ + usart_deinit(com); + usart_baudrate_set(com, 115200U); + usart_receive_config(com, USART_RECEIVE_ENABLE); + usart_transmit_config(com, USART_TRANSMIT_ENABLE); + usart_enable(com); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exmc.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exmc.c new file mode 100644 index 0000000..8fb26c9 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exmc.c @@ -0,0 +1,229 @@ +/*! + \file gd32c10x_exmc.c + \brief EXMC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_exmc.h" + +/* EXMC bank0 register reset value */ +#define BANK0_SNCTL_RESET ((uint32_t)0x000030DBU) +#define BANK0_SNTCFG_RESET ((uint32_t)0x0FFFFFFFU) +#define BANK0_SNWTCFG_RESET ((uint32_t)0x0FFFFFFFU) + +/* EXMC register bit offset */ +#define SNCTL_NRMUX_OFFSET ((uint32_t)1U) +#define SNCTL_SBRSTEN_OFFSET ((uint32_t)8U) +#define SNCTL_WRAPEN_OFFSET ((uint32_t)10U) +#define SNCTL_WREN_OFFSET ((uint32_t)12U) +#define SNCTL_NRWTEN_OFFSET ((uint32_t)13U) +#define SNCTL_EXMODEN_OFFSET ((uint32_t)14U) +#define SNCTL_ASYNCWAIT_OFFSET ((uint32_t)15U) + +#define SNTCFG_AHLD_OFFSET ((uint32_t)4U) +#define SNTCFG_DSET_OFFSET ((uint32_t)8U) +#define SNTCFG_BUSLAT_OFFSET ((uint32_t)16U) + +#define SNWTCFG_WAHLD_OFFSET ((uint32_t)4U) +#define SNWTCFG_WDSET_OFFSET ((uint32_t)8U) +#define SNWTCFG_WBUSLAT_OFFSET ((uint32_t)16U) + +/*! + \brief deinitialize EXMC NOR/SRAM bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_norsram_deinit(void) +{ + /* reset the registers */ + EXMC_SNCTL = BANK0_SNCTL_RESET; + + EXMC_SNTCFG = BANK0_SNTCFG_RESET; + EXMC_SNWTCFG = BANK0_SNWTCFG_RESET; +} + +/*! + \brief initialize the struct exmc_norsram_parameter_struct + \param[in] none + \param[out] exmc_norsram_init_struct: the initialized struct exmc_norsram_parameter_struct pointer + \retval none +*/ +void exmc_norsram_struct_para_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct) +{ + /* configure the structure with default value */ + exmc_norsram_init_struct->address_data_mux = ENABLE; + exmc_norsram_init_struct->memory_type = EXMC_MEMORY_TYPE_NOR; + exmc_norsram_init_struct->databus_width = EXMC_NOR_DATABUS_WIDTH_16B; + exmc_norsram_init_struct->burst_mode = DISABLE; + exmc_norsram_init_struct->nwait_polarity = EXMC_NWAIT_POLARITY_LOW; + exmc_norsram_init_struct->wrap_burst_mode = DISABLE; + exmc_norsram_init_struct->nwait_config = EXMC_NWAIT_CONFIG_BEFORE; + exmc_norsram_init_struct->memory_write = ENABLE; + exmc_norsram_init_struct->nwait_signal = ENABLE; + exmc_norsram_init_struct->extended_mode = DISABLE; + exmc_norsram_init_struct->asyn_wait = DISABLE; + exmc_norsram_init_struct->write_mode = EXMC_ASYN_WRITE; + + /* read/write timing configure */ + exmc_norsram_init_struct->read_write_timing->asyn_address_setuptime = 0xFU; + exmc_norsram_init_struct->read_write_timing->asyn_address_holdtime = 0xFU; + exmc_norsram_init_struct->read_write_timing->asyn_data_setuptime = 0xFFU; + exmc_norsram_init_struct->read_write_timing->bus_latency = 0xFU; + exmc_norsram_init_struct->read_write_timing->syn_clk_division = EXMC_SYN_CLOCK_RATIO_16_CLK; + exmc_norsram_init_struct->read_write_timing->syn_data_latency = EXMC_DATALAT_17_CLK; + exmc_norsram_init_struct->read_write_timing->asyn_access_mode = EXMC_ACCESS_MODE_A; + + /* write timing configure, when extended mode is used */ + exmc_norsram_init_struct->write_timing->asyn_address_setuptime = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_address_holdtime = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_data_setuptime = 0xFFU; + exmc_norsram_init_struct->write_timing->bus_latency = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_access_mode = EXMC_ACCESS_MODE_A; +} + +/*! + \brief initialize EXMC NOR/SRAM bank + \param[in] exmc_norsram_parameter_struct: configure the EXMC NOR/SRAM parameter + write_mode: EXMC_ASYN_WRITE,EXMC_SYN_WRITE + extended_mode: ENABLE or DISABLE + asyn_wait: ENABLE or DISABLE + nwait_signal: ENABLE or DISABLE + memory_write: ENABLE or DISABLE + nwait_config: EXMC_NWAIT_CONFIG_BEFORE,EXMC_NWAIT_CONFIG_DURING + wrap_burst_mode: ENABLE or DISABLE + nwait_polarity: EXMC_NWAIT_POLARITY_LOW,EXMC_NWAIT_POLARITY_HIGH + burst_mode: ENABLE or DISABLE + databus_width: EXMC_NOR_DATABUS_WIDTH_8B,EXMC_NOR_DATABUS_WIDTH_16B + memory_type: EXMC_MEMORY_TYPE_SRAM,EXMC_MEMORY_TYPE_PSRAM,EXMC_MEMORY_TYPE_NOR + address_data_mux: ENABLE or DISABLE + read_write_timing: struct exmc_norsram_timing_parameter_struct set the time + write_timing: struct exmc_norsram_timing_parameter_struct set the time + \param[out] none + \retval none +*/ +void exmc_norsram_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct) +{ + uint32_t snctl = 0x00000000U, sntcfg = 0x00000000U, snwtcfg = 0x00000000U; + + /* get the register value */ + snctl = EXMC_SNCTL; + + /* clear relative bits */ + snctl &= ((uint32_t)~(EXMC_SNCTL_NRMUX | EXMC_SNCTL_NRTP | EXMC_SNCTL_NRW | EXMC_SNCTL_SBRSTEN | + EXMC_SNCTL_NREN | EXMC_SNCTL_NRWTPOL | EXMC_SNCTL_WRAPEN | EXMC_SNCTL_NRWTCFG | + EXMC_SNCTL_WREN | EXMC_SNCTL_NRWTEN | EXMC_SNCTL_EXMODEN | EXMC_SNCTL_ASYNCWAIT | + EXMC_SNCTL_SYNCWR )); + + snctl |= (uint32_t)(exmc_norsram_init_struct->address_data_mux << SNCTL_NRMUX_OFFSET) | + exmc_norsram_init_struct->memory_type | + exmc_norsram_init_struct->databus_width | + (exmc_norsram_init_struct->burst_mode << SNCTL_SBRSTEN_OFFSET) | + exmc_norsram_init_struct->nwait_polarity | + (exmc_norsram_init_struct->wrap_burst_mode << SNCTL_WRAPEN_OFFSET) | + exmc_norsram_init_struct->nwait_config | + (exmc_norsram_init_struct->memory_write << SNCTL_WREN_OFFSET) | + (exmc_norsram_init_struct->nwait_signal << SNCTL_NRWTEN_OFFSET) | + (exmc_norsram_init_struct->extended_mode << SNCTL_EXMODEN_OFFSET) | + (exmc_norsram_init_struct->asyn_wait << SNCTL_ASYNCWAIT_OFFSET) | + exmc_norsram_init_struct->write_mode; + + sntcfg = (uint32_t)((exmc_norsram_init_struct->read_write_timing->asyn_address_setuptime - 1U ) & EXMC_SNTCFG_ASET )| + (((exmc_norsram_init_struct->read_write_timing->asyn_address_holdtime - 1U ) << SNTCFG_AHLD_OFFSET ) & EXMC_SNTCFG_AHLD ) | + (((exmc_norsram_init_struct->read_write_timing->asyn_data_setuptime - 1U ) << SNTCFG_DSET_OFFSET ) & EXMC_SNTCFG_DSET ) | + (((exmc_norsram_init_struct->read_write_timing->bus_latency - 1U ) << SNTCFG_BUSLAT_OFFSET ) & EXMC_SNTCFG_BUSLAT )| + exmc_norsram_init_struct->read_write_timing->syn_clk_division | + exmc_norsram_init_struct->read_write_timing->syn_data_latency | + exmc_norsram_init_struct->read_write_timing->asyn_access_mode; + + /* nor flash access enable */ + if(EXMC_MEMORY_TYPE_NOR == exmc_norsram_init_struct->memory_type){ + snctl |= (uint32_t)EXMC_SNCTL_NREN; + } + + /* extended mode configure */ + if(ENABLE == exmc_norsram_init_struct->extended_mode){ + snwtcfg = (uint32_t)((exmc_norsram_init_struct->write_timing->asyn_address_setuptime - 1U) & EXMC_SNWTCFG_WASET ) | + (((exmc_norsram_init_struct->write_timing->asyn_address_holdtime -1U ) << SNWTCFG_WAHLD_OFFSET ) & EXMC_SNWTCFG_WAHLD )| + (((exmc_norsram_init_struct->write_timing->asyn_data_setuptime -1U ) << SNWTCFG_WDSET_OFFSET ) & EXMC_SNWTCFG_WDSET )| + (((exmc_norsram_init_struct->write_timing->bus_latency - 1U ) << SNWTCFG_WBUSLAT_OFFSET ) & EXMC_SNWTCFG_WBUSLAT ) | + exmc_norsram_init_struct->write_timing->asyn_access_mode; + }else{ + snwtcfg = BANK0_SNWTCFG_RESET; + } + + /* configure the registers */ + EXMC_SNCTL = snctl; + EXMC_SNTCFG = sntcfg; + EXMC_SNWTCFG = snwtcfg; +} + +/*! + \brief enable EXMC NOR/PSRAM bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_norsram_enable(void) +{ + EXMC_SNCTL |= (uint32_t)EXMC_SNCTL_NRBKEN; +} + +/*! + \brief disable EXMC NOR/PSRAM bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_norsram_disable(void) +{ + EXMC_SNCTL &= ~(uint32_t)EXMC_SNCTL_NRBKEN; +} + +/*! + \brief configure CRAM page size + \param[in] page_size: CRAM page size + only one parameter can be selected which is shown as below: + \arg EXMC_CRAM_AUTO_SPLIT: the clock is generated only during synchronous access + \arg EXMC_CRAM_PAGE_SIZE_128_BYTES: page size is 128 bytes + \arg EXMC_CRAM_PAGE_SIZE_256_BYTES: page size is 256 bytes + \arg EXMC_CRAM_PAGE_SIZE_512_BYTES: page size is 512 bytes + \arg EXMC_CRAM_PAGE_SIZE_1024_BYTES: page size is 1024 bytes + \param[out] none + \retval none +*/ +void exmc_norsram_page_size_config(uint32_t page_size) +{ + /* reset the bits */ + EXMC_SNCTL &= ~EXMC_SNCTL_CPS; + /* set the CPS bits */ + EXMC_SNCTL |= page_size; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exmc.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exmc.c.base@1.0.0 new file mode 100644 index 0000000..8fb26c9 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exmc.c.base@1.0.0 @@ -0,0 +1,229 @@ +/*! + \file gd32c10x_exmc.c + \brief EXMC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_exmc.h" + +/* EXMC bank0 register reset value */ +#define BANK0_SNCTL_RESET ((uint32_t)0x000030DBU) +#define BANK0_SNTCFG_RESET ((uint32_t)0x0FFFFFFFU) +#define BANK0_SNWTCFG_RESET ((uint32_t)0x0FFFFFFFU) + +/* EXMC register bit offset */ +#define SNCTL_NRMUX_OFFSET ((uint32_t)1U) +#define SNCTL_SBRSTEN_OFFSET ((uint32_t)8U) +#define SNCTL_WRAPEN_OFFSET ((uint32_t)10U) +#define SNCTL_WREN_OFFSET ((uint32_t)12U) +#define SNCTL_NRWTEN_OFFSET ((uint32_t)13U) +#define SNCTL_EXMODEN_OFFSET ((uint32_t)14U) +#define SNCTL_ASYNCWAIT_OFFSET ((uint32_t)15U) + +#define SNTCFG_AHLD_OFFSET ((uint32_t)4U) +#define SNTCFG_DSET_OFFSET ((uint32_t)8U) +#define SNTCFG_BUSLAT_OFFSET ((uint32_t)16U) + +#define SNWTCFG_WAHLD_OFFSET ((uint32_t)4U) +#define SNWTCFG_WDSET_OFFSET ((uint32_t)8U) +#define SNWTCFG_WBUSLAT_OFFSET ((uint32_t)16U) + +/*! + \brief deinitialize EXMC NOR/SRAM bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_norsram_deinit(void) +{ + /* reset the registers */ + EXMC_SNCTL = BANK0_SNCTL_RESET; + + EXMC_SNTCFG = BANK0_SNTCFG_RESET; + EXMC_SNWTCFG = BANK0_SNWTCFG_RESET; +} + +/*! + \brief initialize the struct exmc_norsram_parameter_struct + \param[in] none + \param[out] exmc_norsram_init_struct: the initialized struct exmc_norsram_parameter_struct pointer + \retval none +*/ +void exmc_norsram_struct_para_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct) +{ + /* configure the structure with default value */ + exmc_norsram_init_struct->address_data_mux = ENABLE; + exmc_norsram_init_struct->memory_type = EXMC_MEMORY_TYPE_NOR; + exmc_norsram_init_struct->databus_width = EXMC_NOR_DATABUS_WIDTH_16B; + exmc_norsram_init_struct->burst_mode = DISABLE; + exmc_norsram_init_struct->nwait_polarity = EXMC_NWAIT_POLARITY_LOW; + exmc_norsram_init_struct->wrap_burst_mode = DISABLE; + exmc_norsram_init_struct->nwait_config = EXMC_NWAIT_CONFIG_BEFORE; + exmc_norsram_init_struct->memory_write = ENABLE; + exmc_norsram_init_struct->nwait_signal = ENABLE; + exmc_norsram_init_struct->extended_mode = DISABLE; + exmc_norsram_init_struct->asyn_wait = DISABLE; + exmc_norsram_init_struct->write_mode = EXMC_ASYN_WRITE; + + /* read/write timing configure */ + exmc_norsram_init_struct->read_write_timing->asyn_address_setuptime = 0xFU; + exmc_norsram_init_struct->read_write_timing->asyn_address_holdtime = 0xFU; + exmc_norsram_init_struct->read_write_timing->asyn_data_setuptime = 0xFFU; + exmc_norsram_init_struct->read_write_timing->bus_latency = 0xFU; + exmc_norsram_init_struct->read_write_timing->syn_clk_division = EXMC_SYN_CLOCK_RATIO_16_CLK; + exmc_norsram_init_struct->read_write_timing->syn_data_latency = EXMC_DATALAT_17_CLK; + exmc_norsram_init_struct->read_write_timing->asyn_access_mode = EXMC_ACCESS_MODE_A; + + /* write timing configure, when extended mode is used */ + exmc_norsram_init_struct->write_timing->asyn_address_setuptime = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_address_holdtime = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_data_setuptime = 0xFFU; + exmc_norsram_init_struct->write_timing->bus_latency = 0xFU; + exmc_norsram_init_struct->write_timing->asyn_access_mode = EXMC_ACCESS_MODE_A; +} + +/*! + \brief initialize EXMC NOR/SRAM bank + \param[in] exmc_norsram_parameter_struct: configure the EXMC NOR/SRAM parameter + write_mode: EXMC_ASYN_WRITE,EXMC_SYN_WRITE + extended_mode: ENABLE or DISABLE + asyn_wait: ENABLE or DISABLE + nwait_signal: ENABLE or DISABLE + memory_write: ENABLE or DISABLE + nwait_config: EXMC_NWAIT_CONFIG_BEFORE,EXMC_NWAIT_CONFIG_DURING + wrap_burst_mode: ENABLE or DISABLE + nwait_polarity: EXMC_NWAIT_POLARITY_LOW,EXMC_NWAIT_POLARITY_HIGH + burst_mode: ENABLE or DISABLE + databus_width: EXMC_NOR_DATABUS_WIDTH_8B,EXMC_NOR_DATABUS_WIDTH_16B + memory_type: EXMC_MEMORY_TYPE_SRAM,EXMC_MEMORY_TYPE_PSRAM,EXMC_MEMORY_TYPE_NOR + address_data_mux: ENABLE or DISABLE + read_write_timing: struct exmc_norsram_timing_parameter_struct set the time + write_timing: struct exmc_norsram_timing_parameter_struct set the time + \param[out] none + \retval none +*/ +void exmc_norsram_init(exmc_norsram_parameter_struct* exmc_norsram_init_struct) +{ + uint32_t snctl = 0x00000000U, sntcfg = 0x00000000U, snwtcfg = 0x00000000U; + + /* get the register value */ + snctl = EXMC_SNCTL; + + /* clear relative bits */ + snctl &= ((uint32_t)~(EXMC_SNCTL_NRMUX | EXMC_SNCTL_NRTP | EXMC_SNCTL_NRW | EXMC_SNCTL_SBRSTEN | + EXMC_SNCTL_NREN | EXMC_SNCTL_NRWTPOL | EXMC_SNCTL_WRAPEN | EXMC_SNCTL_NRWTCFG | + EXMC_SNCTL_WREN | EXMC_SNCTL_NRWTEN | EXMC_SNCTL_EXMODEN | EXMC_SNCTL_ASYNCWAIT | + EXMC_SNCTL_SYNCWR )); + + snctl |= (uint32_t)(exmc_norsram_init_struct->address_data_mux << SNCTL_NRMUX_OFFSET) | + exmc_norsram_init_struct->memory_type | + exmc_norsram_init_struct->databus_width | + (exmc_norsram_init_struct->burst_mode << SNCTL_SBRSTEN_OFFSET) | + exmc_norsram_init_struct->nwait_polarity | + (exmc_norsram_init_struct->wrap_burst_mode << SNCTL_WRAPEN_OFFSET) | + exmc_norsram_init_struct->nwait_config | + (exmc_norsram_init_struct->memory_write << SNCTL_WREN_OFFSET) | + (exmc_norsram_init_struct->nwait_signal << SNCTL_NRWTEN_OFFSET) | + (exmc_norsram_init_struct->extended_mode << SNCTL_EXMODEN_OFFSET) | + (exmc_norsram_init_struct->asyn_wait << SNCTL_ASYNCWAIT_OFFSET) | + exmc_norsram_init_struct->write_mode; + + sntcfg = (uint32_t)((exmc_norsram_init_struct->read_write_timing->asyn_address_setuptime - 1U ) & EXMC_SNTCFG_ASET )| + (((exmc_norsram_init_struct->read_write_timing->asyn_address_holdtime - 1U ) << SNTCFG_AHLD_OFFSET ) & EXMC_SNTCFG_AHLD ) | + (((exmc_norsram_init_struct->read_write_timing->asyn_data_setuptime - 1U ) << SNTCFG_DSET_OFFSET ) & EXMC_SNTCFG_DSET ) | + (((exmc_norsram_init_struct->read_write_timing->bus_latency - 1U ) << SNTCFG_BUSLAT_OFFSET ) & EXMC_SNTCFG_BUSLAT )| + exmc_norsram_init_struct->read_write_timing->syn_clk_division | + exmc_norsram_init_struct->read_write_timing->syn_data_latency | + exmc_norsram_init_struct->read_write_timing->asyn_access_mode; + + /* nor flash access enable */ + if(EXMC_MEMORY_TYPE_NOR == exmc_norsram_init_struct->memory_type){ + snctl |= (uint32_t)EXMC_SNCTL_NREN; + } + + /* extended mode configure */ + if(ENABLE == exmc_norsram_init_struct->extended_mode){ + snwtcfg = (uint32_t)((exmc_norsram_init_struct->write_timing->asyn_address_setuptime - 1U) & EXMC_SNWTCFG_WASET ) | + (((exmc_norsram_init_struct->write_timing->asyn_address_holdtime -1U ) << SNWTCFG_WAHLD_OFFSET ) & EXMC_SNWTCFG_WAHLD )| + (((exmc_norsram_init_struct->write_timing->asyn_data_setuptime -1U ) << SNWTCFG_WDSET_OFFSET ) & EXMC_SNWTCFG_WDSET )| + (((exmc_norsram_init_struct->write_timing->bus_latency - 1U ) << SNWTCFG_WBUSLAT_OFFSET ) & EXMC_SNWTCFG_WBUSLAT ) | + exmc_norsram_init_struct->write_timing->asyn_access_mode; + }else{ + snwtcfg = BANK0_SNWTCFG_RESET; + } + + /* configure the registers */ + EXMC_SNCTL = snctl; + EXMC_SNTCFG = sntcfg; + EXMC_SNWTCFG = snwtcfg; +} + +/*! + \brief enable EXMC NOR/PSRAM bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_norsram_enable(void) +{ + EXMC_SNCTL |= (uint32_t)EXMC_SNCTL_NRBKEN; +} + +/*! + \brief disable EXMC NOR/PSRAM bank + \param[in] none + \param[out] none + \retval none +*/ +void exmc_norsram_disable(void) +{ + EXMC_SNCTL &= ~(uint32_t)EXMC_SNCTL_NRBKEN; +} + +/*! + \brief configure CRAM page size + \param[in] page_size: CRAM page size + only one parameter can be selected which is shown as below: + \arg EXMC_CRAM_AUTO_SPLIT: the clock is generated only during synchronous access + \arg EXMC_CRAM_PAGE_SIZE_128_BYTES: page size is 128 bytes + \arg EXMC_CRAM_PAGE_SIZE_256_BYTES: page size is 256 bytes + \arg EXMC_CRAM_PAGE_SIZE_512_BYTES: page size is 512 bytes + \arg EXMC_CRAM_PAGE_SIZE_1024_BYTES: page size is 1024 bytes + \param[out] none + \retval none +*/ +void exmc_norsram_page_size_config(uint32_t page_size) +{ + /* reset the bits */ + EXMC_SNCTL &= ~EXMC_SNCTL_CPS; + /* set the CPS bits */ + EXMC_SNCTL |= page_size; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c new file mode 100644 index 0000000..b1925dc --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c @@ -0,0 +1,247 @@ +/*! + \file gd32c10x_exti.c + \brief EXTI driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_exti.h" + +#define EXTI_REG_RESET_VALUE ((uint32_t)0x00000000U) + +/*! + \brief deinitialize the EXTI + \param[in] none + \param[out] none + \retval none +*/ +void exti_deinit(void) +{ + /* reset the value of all the EXTI registers */ + EXTI_INTEN = EXTI_REG_RESET_VALUE; + EXTI_EVEN = EXTI_REG_RESET_VALUE; + EXTI_RTEN = EXTI_REG_RESET_VALUE; + EXTI_FTEN = EXTI_REG_RESET_VALUE; + EXTI_SWIEV = EXTI_REG_RESET_VALUE; +} + +/*! + \brief initialize the EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[in] mode: interrupt or event mode, refer to exti_mode_enum + only one parameter can be selected which is shown as below: + \arg EXTI_INTERRUPT: interrupt mode + \arg EXTI_EVENT: event mode + \param[in] trig_type: interrupt trigger type, refer to exti_trig_type_enum + only one parameter can be selected which is shown as below: + \arg EXTI_TRIG_RISING: rising edge trigger + \arg EXTI_TRIG_FALLING: falling trigger + \arg EXTI_TRIG_BOTH: rising and falling trigger + \param[out] none + \retval none +*/ +void exti_init(exti_line_enum linex, exti_mode_enum mode, exti_trig_type_enum trig_type) +{ + /* reset the EXTI line x */ + EXTI_INTEN &= ~(uint32_t)linex; + EXTI_EVEN &= ~(uint32_t)linex; + EXTI_RTEN &= ~(uint32_t)linex; + EXTI_FTEN &= ~(uint32_t)linex; + + /* set the EXTI mode and enable the interrupts or events from EXTI line x */ + switch(mode) { + case EXTI_INTERRUPT: + EXTI_INTEN |= (uint32_t)linex; + break; + case EXTI_EVENT: + EXTI_EVEN |= (uint32_t)linex; + break; + default: + break; + } + + /* set the EXTI trigger type */ + switch(trig_type) { + case EXTI_TRIG_RISING: + EXTI_RTEN |= (uint32_t)linex; + EXTI_FTEN &= ~(uint32_t)linex; + break; + case EXTI_TRIG_FALLING: + EXTI_RTEN &= ~(uint32_t)linex; + EXTI_FTEN |= (uint32_t)linex; + break; + case EXTI_TRIG_BOTH: + EXTI_RTEN |= (uint32_t)linex; + EXTI_FTEN |= (uint32_t)linex; + break; + default: + break; + } +} + +/*! + \brief enable the interrupts from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_enable(exti_line_enum linex) +{ + EXTI_INTEN |= (uint32_t)linex; +} + +/*! + \brief disable the interrupt from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_disable(exti_line_enum linex) +{ + EXTI_INTEN &= ~(uint32_t)linex; +} + +/*! + \brief enable the events from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_event_enable(exti_line_enum linex) +{ + EXTI_EVEN |= (uint32_t)linex; +} + +/*! + \brief disable the events from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_event_disable(exti_line_enum linex) +{ + EXTI_EVEN &= ~(uint32_t)linex; +} + +/*! + \brief enable the software interrupt event from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_software_interrupt_enable(exti_line_enum linex) +{ + EXTI_SWIEV |= (uint32_t)linex; +} + +/*! + \brief disable the software interrupt event from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_software_interrupt_disable(exti_line_enum linex) +{ + EXTI_SWIEV &= ~(uint32_t)linex; +} + +/*! + \brief get EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus exti_flag_get(exti_line_enum linex) +{ + if(RESET != (EXTI_PD & (uint32_t)linex)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_flag_clear(exti_line_enum linex) +{ + EXTI_PD = (uint32_t)linex; +} + +/*! + \brief get EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus exti_interrupt_flag_get(exti_line_enum linex) +{ + if(RESET != (EXTI_PD & (uint32_t)linex)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_flag_clear(exti_line_enum linex) +{ + EXTI_PD = (uint32_t)linex; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c.base@1.0.0 new file mode 100644 index 0000000..b1925dc --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c.base@1.0.0 @@ -0,0 +1,247 @@ +/*! + \file gd32c10x_exti.c + \brief EXTI driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_exti.h" + +#define EXTI_REG_RESET_VALUE ((uint32_t)0x00000000U) + +/*! + \brief deinitialize the EXTI + \param[in] none + \param[out] none + \retval none +*/ +void exti_deinit(void) +{ + /* reset the value of all the EXTI registers */ + EXTI_INTEN = EXTI_REG_RESET_VALUE; + EXTI_EVEN = EXTI_REG_RESET_VALUE; + EXTI_RTEN = EXTI_REG_RESET_VALUE; + EXTI_FTEN = EXTI_REG_RESET_VALUE; + EXTI_SWIEV = EXTI_REG_RESET_VALUE; +} + +/*! + \brief initialize the EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[in] mode: interrupt or event mode, refer to exti_mode_enum + only one parameter can be selected which is shown as below: + \arg EXTI_INTERRUPT: interrupt mode + \arg EXTI_EVENT: event mode + \param[in] trig_type: interrupt trigger type, refer to exti_trig_type_enum + only one parameter can be selected which is shown as below: + \arg EXTI_TRIG_RISING: rising edge trigger + \arg EXTI_TRIG_FALLING: falling trigger + \arg EXTI_TRIG_BOTH: rising and falling trigger + \param[out] none + \retval none +*/ +void exti_init(exti_line_enum linex, exti_mode_enum mode, exti_trig_type_enum trig_type) +{ + /* reset the EXTI line x */ + EXTI_INTEN &= ~(uint32_t)linex; + EXTI_EVEN &= ~(uint32_t)linex; + EXTI_RTEN &= ~(uint32_t)linex; + EXTI_FTEN &= ~(uint32_t)linex; + + /* set the EXTI mode and enable the interrupts or events from EXTI line x */ + switch(mode) { + case EXTI_INTERRUPT: + EXTI_INTEN |= (uint32_t)linex; + break; + case EXTI_EVENT: + EXTI_EVEN |= (uint32_t)linex; + break; + default: + break; + } + + /* set the EXTI trigger type */ + switch(trig_type) { + case EXTI_TRIG_RISING: + EXTI_RTEN |= (uint32_t)linex; + EXTI_FTEN &= ~(uint32_t)linex; + break; + case EXTI_TRIG_FALLING: + EXTI_RTEN &= ~(uint32_t)linex; + EXTI_FTEN |= (uint32_t)linex; + break; + case EXTI_TRIG_BOTH: + EXTI_RTEN |= (uint32_t)linex; + EXTI_FTEN |= (uint32_t)linex; + break; + default: + break; + } +} + +/*! + \brief enable the interrupts from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_enable(exti_line_enum linex) +{ + EXTI_INTEN |= (uint32_t)linex; +} + +/*! + \brief disable the interrupt from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_disable(exti_line_enum linex) +{ + EXTI_INTEN &= ~(uint32_t)linex; +} + +/*! + \brief enable the events from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_event_enable(exti_line_enum linex) +{ + EXTI_EVEN |= (uint32_t)linex; +} + +/*! + \brief disable the events from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_event_disable(exti_line_enum linex) +{ + EXTI_EVEN &= ~(uint32_t)linex; +} + +/*! + \brief enable the software interrupt event from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_software_interrupt_enable(exti_line_enum linex) +{ + EXTI_SWIEV |= (uint32_t)linex; +} + +/*! + \brief disable the software interrupt event from EXTI line x + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_software_interrupt_disable(exti_line_enum linex) +{ + EXTI_SWIEV &= ~(uint32_t)linex; +} + +/*! + \brief get EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus exti_flag_get(exti_line_enum linex) +{ + if(RESET != (EXTI_PD & (uint32_t)linex)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_flag_clear(exti_line_enum linex) +{ + EXTI_PD = (uint32_t)linex; +} + +/*! + \brief get EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus exti_interrupt_flag_get(exti_line_enum linex) +{ + if(RESET != (EXTI_PD & (uint32_t)linex)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear EXTI line x interrupt pending flag + \param[in] linex: EXTI line number, refer to exti_line_enum + only one parameter can be selected which is shown as below: + \arg EXTI_x (x=0..18): EXTI line x + \param[out] none + \retval none +*/ +void exti_interrupt_flag_clear(exti_line_enum linex) +{ + EXTI_PD = (uint32_t)linex; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c new file mode 100644 index 0000000..7f29736 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c @@ -0,0 +1,1034 @@ +/*! + \file gd32c10x_fmc.c + \brief FMC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_fmc.h" +#include "stdio.h" + +/* FMC mask */ +#define LOW_8BITS_MASK ((uint32_t)0x000000FFU) +#define HIGH_8BITS_MASK ((uint32_t)0x0000FF00U) +#define LOW_8BITS_MASK1 ((uint32_t)0x00FF0000U) +#define HIGH_8BITS_MASK1 ((uint32_t)0xFF000000U) +#define LOW_16BITS_MASK ((uint32_t)0x0000FFFFU) +#define HIGH_16BITS_MASK ((uint32_t)0xFFFF0000U) + +/* USER of option bytes mask */ +#define OB_USER_MASK ((uint8_t)0xF8U) + +/* OB_WP mask */ +#define OB_WP0_MASK ((uint32_t)0x000000FFU) +#define OB_WP1_MASK ((uint32_t)0x0000FF00U) +#define OB_WP2_MASK ((uint32_t)0x00FF0000U) +#define OB_WP3_MASK ((uint32_t)0xFF000000U) + +/* return the FMC state */ +static fmc_state_enum fmc_state_get(void); +/* check FMC ready or not */ +static fmc_state_enum fmc_ready_wait(uint32_t timeout); + +/* FMC main memory programming functions */ + +/*! + \brief enable pre-fetch + \param[in] none + \param[out] none + \retval none +*/ +void fmc_prefetch_enable(void) +{ + FMC_WS |= FMC_WS_PFEN; +} + +/*! + \brief disable pre-fetch + \param[in] none + \param[out] none + \retval none +*/ +void fmc_prefetch_disable(void) +{ + FMC_WS &= ~FMC_WS_PFEN; +} + +/*! + \brief enable IBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_ibus_enable(void) +{ + FMC_WS |= FMC_WS_ICEN; +} + +/*! + \brief disable IBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_ibus_disable(void) +{ + FMC_WS &= ~FMC_WS_ICEN; +} + +/*! + \brief enable DBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_dbus_enable(void) +{ + FMC_WS |= FMC_WS_DCEN; +} + +/*! + \brief disable DBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_dbus_disable(void) +{ + FMC_WS &= ~FMC_WS_DCEN; +} + +/*! + \brief reset IBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_ibus_reset(void) +{ + FMC_WS |= FMC_WS_ICRST; +} + +/*! + \brief reset DBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_dbus_reset(void) +{ + FMC_WS |= FMC_WS_DCRST; +} + +/*! + \brief set program width to flash memory + \param[in] pgw + only one parameter can be selected which is shown as below: + \arg FMC_PROG_W_32B: 32-bit program width to flash memory + \arg FMC_PROG_W_64B: 64-bit program width to flash memory + \param[out] none + \retval none +*/ +void fmc_program_width_set(uint32_t pgw) +{ + uint32_t reg; + + reg = FMC_WS; + /* configure program width to flash memory */ + reg &= ~FMC_WS_PGW; + FMC_WS = (reg | pgw); +} + +/*! + \brief unlock the main FMC operation + \param[in] none + \param[out] none + \retval none +*/ +void fmc_unlock(void) +{ + if(RESET != (FMC_CTL & FMC_CTL_LK)){ + /* write the FMC unlock key */ + FMC_KEY = UNLOCK_KEY0; + FMC_KEY = UNLOCK_KEY1; + } +} + +/*! + \brief lock the main FMC operation + \param[in] none + \param[out] none + \retval none +*/ +void fmc_lock(void) +{ + /* set the LK bit */ + FMC_CTL |= FMC_CTL_LK; +} + +/*! + \brief set the wait state counter value + \param[in] wscnt:wait state counter value + only one parameter can be selected which is shown as below: + \arg FMC_WAIT_STATE_0: FMC 0 wait + \arg FMC_WAIT_STATE_1: FMC 1 wait + \arg FMC_WAIT_STATE_2: FMC 2 wait + \arg FMC_WAIT_STATE_3: FMC 3 wait + \param[out] none + \retval none +*/ +void fmc_wscnt_set(uint32_t wscnt) +{ + uint32_t reg; + + reg = FMC_WS; + /* set the wait state counter value */ + reg &= ~FMC_WS_WSCNT; + FMC_WS = (reg | wscnt); +} + +/*! + \brief FMC erase page + \param[in] page_address: target page address + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_page_erase(uint32_t page_address) +{ + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + FMC_CTL |= FMC_CTL_PER; + FMC_ADDR = page_address; + FMC_CTL |= FMC_CTL_START; + __DSB(); + __ISB(); + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the PER bit */ + FMC_CTL &= ~FMC_CTL_PER; + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief FMC erase whole chip + \param[in] none + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_mass_erase(void) +{ + fmc_state_enum fmc_state; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* start whole chip erase */ + FMC_CTL |= FMC_CTL_MER; + FMC_CTL |= FMC_CTL_START; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the MER bit */ + FMC_CTL &= ~FMC_CTL_MER; + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief FMC program a double word at the corresponding address + \param[in] address: address to program + \param[in] data: double word to program + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_doubleword_program(uint32_t address, uint64_t data) +{ + uint32_t data0, data1; + + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + data0 = (uint32_t)(data & 0xFFFFFFFFU); + data1 = (uint32_t)((data >> 32U) & 0xFFFFFFFFU); + + if(FMC_READY == fmc_state){ + /* set the PGW and PG bit to start program */ + FMC_WS |= FMC_WS_PGW; + FMC_CTL |= FMC_CTL_PG; + + REG32(address) = data0; + REG32(address + 4U) = data1; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the PG and PGW bit */ + FMC_CTL &= ~FMC_CTL_PG; + FMC_WS &= ~FMC_WS_PGW; + } + + /* return the FMC state */ + return fmc_state; +} + +#ifndef GD32C103XXA +/*! + \brief FMC program a word at the corresponding address + \param[in] address: address to program + \param[in] data: word to program + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_word_program(uint32_t address, uint32_t data) +{ + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL |= FMC_CTL_PG; + REG32(address) = data; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the PG bit */ + FMC_CTL &= ~FMC_CTL_PG; + } + + /* return the FMC state */ + return fmc_state; +} +#endif + +/*! + \brief unlock the option byte operation + it is better to used in pairs with ob_lock + \param[in] none + \param[out] none + \retval none +*/ +void ob_unlock(void) +{ + if(RESET == (FMC_CTL & FMC_CTL_OBWEN)){ + /* write the FMC key */ + FMC_OBKEY = UNLOCK_KEY0; + FMC_OBKEY = UNLOCK_KEY1; + } +} + +/*! + \brief lock the option byte operation + it is better to used in pairs with ob_unlock after an operation + \param[in] none + \param[out] none + \retval none +*/ +void ob_lock(void) +{ + /* reset the OBWEN bit */ + FMC_CTL &= ~FMC_CTL_OBWEN; +} + +/*! + \brief erase the FMC option bytes + programmer must ensure FMC & option byte are both unlocked before calling this function + \param[in] none + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_erase(void) +{ + uint8_t temp_spc; + uint32_t temp; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* check the option bytes security protection value */ + if(RESET == ob_security_protection_flag_get()){ + temp_spc = FMC_NSPC; + }else{ + temp_spc = FMC_USPC; + } + + temp = HIGH_16BITS_MASK | ((uint32_t)temp_spc); + + if(FMC_READY == fmc_state){ + /* start erase the option bytes */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + /* restore the last get option byte security protection code */ + OB_SPC_USER = temp; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief enable write protection + \param[in] ob_wp: specify sector to be write protected + one or more parameters can be selected which are shown as below: + \arg OB_WP_NONE: disable all write protection + \arg OB_WP_x(x=0..31): write protect specify sector + \arg OB_WP_ALL: write protect all sector + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_write_protection_enable(uint32_t ob_wp) +{ + uint32_t i; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + ob_wp = (uint32_t)(~ob_wp); + op_byte[2] = (ob_wp & LOW_8BITS_MASK) | ((ob_wp & HIGH_8BITS_MASK) << 8U); + op_byte[3] = ((ob_wp & LOW_8BITS_MASK1) >> 16U) | ((ob_wp & HIGH_8BITS_MASK1) >> 8U); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief configure security protection + \param[in] ob_spc: specify security protection code + only one parameter can be selected which is shown as below: + \arg FMC_NSPC: no security protection + \arg FMC_USPC: under security protection + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_security_protection_config(uint8_t ob_spc) +{ + uint8_t i; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + op_byte[0] = ((uint32_t)(ob_spc)) | ((op_byte[0] & HIGH_16BITS_MASK)); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief program option bytes USER + programmer must ensure FMC & option bytes are both unlocked before calling this function + \param[in] ob_fwdgt: option bytes free watchdog value + only one parameter can be selected which is shown as below: + \arg OB_FWDGT_SW: software free watchdog + \arg OB_FWDGT_HW: hardware free watchdog + \param[in] ob_deepsleep: option bytes deepsleep reset value + only one parameter can be selected which is shown as below: + \arg OB_DEEPSLEEP_NRST: no reset when entering deepsleep mode + \arg OB_DEEPSLEEP_RST: generate a reset instead of entering deepsleep mode + \param[in] ob_stdby: option bytes standby reset value + only one parameter can be selected which is shown as below: + \arg OB_STDBY_NRST: no reset when entering standby mode + \arg OB_STDBY_RST: generate a reset instead of entering standby mode + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_user_write(uint8_t ob_fwdgt, uint8_t ob_deepsleep, uint8_t ob_stdby) +{ + uint8_t i; + uint32_t temp; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + temp = ((uint8_t)((uint8_t)((uint8_t)(ob_fwdgt) | ob_deepsleep) | ob_stdby) | (OB_USER_MASK)); + op_byte[0] = ((uint32_t)(temp) << 16U) | ((op_byte[0] & LOW_16BITS_MASK)); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief program option bytes data + \param[in] ob_data: the byte to be programmed + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ + +fmc_state_enum ob_data_program(uint16_t ob_data) +{ + uint8_t i; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + op_byte[1] = (uint32_t)((ob_data & LOW_8BITS_MASK) | ((ob_data & HIGH_8BITS_MASK) << 8U)); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +#ifdef GD32C103XXA + +/*! + \brief get the address where ECC error occur on + \param[in] none + \param[out] none + \retval uint16_t: the address where ECC error occur on +*/ +uint16_t fmc_ecc_address_get(void) +{ + return (uint16_t)(FMC_ECCCS >> ECCEADDR_OFFSET); +} + +/*! + \brief check ECC flag is set or not + \param[in] flag: check FMC ECC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_ECCCOR: one bit error detected and correct flag + \arg FMC_FLAG_ECCDET: two bits error detect flag + \arg FMC_FLAG_SYSECC: an ECC error is detected in system memory flag + \arg FMC_FLAG_MFECC: an ECC error is detected in main Flash flag + \arg FMC_FLAG_OTPECC: an ECC error is detected in OTP flag + \arg FMC_FLAG_OBECC: an ECC error is detected in reading option bytes flag + \arg FMC_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_ecc_flag_get(uint32_t flag) +{ + FlagStatus status = RESET; + + if(FMC_ECCCS & flag){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief check ECC flag is set or not + \param[in] flag: check FMC ECC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_ECCCOR: one bit error detected and correct flag + \arg FMC_FLAG_ECCDET: two bits error detect flag + \arg FMC_FLAG_SYSECC: an ECC error is detected in system memory flag + \arg FMC_FLAG_MFECC: an ECC error is detected in main Flash flag + \arg FMC_FLAG_OTPECC: an ECC error is detected in OTP flag + \arg FMC_FLAG_OBECC: an ECC error is detected in reading option bytes flag + \arg FMC_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +void fmc_ecc_flag_clear(uint32_t flag) +{ + FMC_ECCCS |= flag; +} + +/*! + \brief enable FMC ECC interrupt + \param[in] interrupt: the FMC ECC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_ECCCOR: FMC one bit error correct interrupt + \arg FMC_INT_ECCDET: FMC two bits error interrupt + \param[out] none + \retval none +*/ +void fmc_ecc_interrupt_enable(uint32_t interrupt) +{ + FMC_ECCCS |= interrupt; +} + +/*! + \brief disable FMC ECC interrupt + \param[in] interrupt: the FMC ECC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_ECCCOR: FMC one bit error correct interrupt + \arg FMC_INT_ECCDET: FMC two bits error interrupt + \param[out] none + \retval none +*/ +void fmc_ecc_interrupt_disable(uint32_t interrupt) +{ + uint32_t temp = (FMC_ECCCS & BITS(14,15)); + temp &= ~(uint32_t)(interrupt); + FMC_ECCCS = temp; +} + +/*! + \brief get FMC ECC interrupt flag + \param[in] int_flag: FMC ECC interrupt flag + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_ECCCOR: one bit error detected and correct interrupt flag + \arg FMC_INT_FLAG_ECCDET: two bits error detect interrupt flag + \arg FMC_INT_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_ecc_interrupt_flag_get(uint32_t int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U; + /* get the interrupt enable bit status */ + intenable = (FMC_REG_VAL(int_flag) & BIT(FMC_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (FMC_REG_VAL2(int_flag) & BIT(FMC_BIT_POS2(int_flag))); + + if(flagstatus && intenable) { + return SET; + } else { + return RESET; + } + +} + +/*! + \brief clear FMC ECC interrupt flag + \param[in] int_flag: FMC ECC interrupt flag + one or more parameters can be selected which is shown as below: + \arg FMC_INT_FLAG_ECCCOR: one bit error detected and correct interrupt flag + \arg FMC_INT_FLAG_ECCDET: two bits error detect interrupt flag + \arg FMC_INT_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register interrupt flag + \param[out] none + \retval none +*/ +void fmc_ecc_interrupt_flag_clear(uint32_t int_flag) +{ + FMC_ECCCS |= int_flag; +} + +#endif +/*! + \brief get OB_USER in register FMC_OBSTAT + \param[in] none + \param[out] none + \retval the FMC user option bytes values +*/ +uint8_t ob_user_get(void) +{ + /* return the FMC user option bytes value */ + return (uint8_t)(FMC_OBSTAT >> 2U); +} + +/*! + \brief get OB_DATA in register FMC_OBSTAT + \param[in] none + \param[out] none + \retval ob_data +*/ +uint16_t ob_data_get(void) +{ + return (uint16_t)(FMC_OBSTAT >> 10U); +} + +/*! + \brief get the FMC option byte write protection (OB_WP) in register FMC_WP + \param[in] none + \param[out] none + \retval the FMC write protection option bytes value +*/ +uint32_t ob_write_protection_get(void) +{ + /* return the FMC write protection option bytes value */ + return FMC_WP; +} + +/*! + \brief get the FMC option bytes security protection state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus ob_security_protection_flag_get(void) +{ + FlagStatus spc_state = RESET; + + if(RESET != (FMC_OBSTAT & FMC_OBSTAT_SPC)){ + spc_state = SET; + }else{ + spc_state = RESET; + } + return spc_state; +} + +/*! + \brief check OBERR flag is set or not + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_oberr_flag_get(void) +{ + FlagStatus status = RESET; + + if(RESET != (FMC_OBSTAT & FMC_OBSTAT_OBERR)){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief check flag is set or not + \param[in] flag: check FMC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_BUSY: FMC busy flag bit + \arg FMC_FLAG_PGERR: FMC operation error flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_FLAG_WPERR: FMC erase/program protection error flag bit + \arg FMC_FLAG_END: FMC end of operation flag bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_flag_get(uint32_t flag) +{ + FlagStatus status = RESET; + + if(FMC_STAT & flag){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief clear the FMC flag + \param[in] flag: clear FMC flag + one or more parameters can be selected which is shown as below: + \arg FMC_FLAG_PGERR: FMC operation error flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_FLAG_WPERR: FMC erase/program protection error flag bit + \arg FMC_FLAG_END: FMC end of operation flag bit + \param[out] none + \retval none +*/ +void fmc_flag_clear(uint32_t flag) +{ + /* clear the flags */ + FMC_STAT = flag; +} + +/*! + \brief enable FMC interrupt + \param[in] interrupt: the FMC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_END: enable FMC end of program interrupt + \arg FMC_INT_ERR: enable FMC error interrupt + \param[out] none + \retval none +*/ +void fmc_interrupt_enable(uint32_t interrupt) +{ + FMC_CTL |= interrupt; +} + +/*! + \brief disable FMC interrupt + \param[in] interrupt: the FMC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_END: enable FMC end of program interrupt + \arg FMC_INT_ERR: enable FMC error interrupt + \param[out] none + \retval none +*/ +void fmc_interrupt_disable(uint32_t interrupt) +{ + FMC_CTL &= ~(uint32_t)interrupt; +} + +/*! + \brief get FMC interrupt flag state + \param[in] flag: FMC interrupt flags, refer to fmc_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_PGERR: FMC operation error interrupt flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_INT_FLAG_WPERR: FMC erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_END: FMC end of operation interrupt flag bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_interrupt_flag_get(uint32_t flag) +{ + FlagStatus status = RESET; + + if(FMC_STAT & flag){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief clear FMC interrupt flag state + \param[in] flag: FMC interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_PGERR: FMC operation error interrupt flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_INT_FLAG_WPERR: FMC erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_END: FMC end of operation interrupt flag bit + \param[out] none + \retval none +*/ +void fmc_interrupt_flag_clear(uint32_t flag) +{ + /* clear the flag */ + FMC_STAT = flag; +} + +/*! + \brief get the FMC state + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_state_get(void) +{ + fmc_state_enum fmc_state = FMC_READY; + + if((uint32_t)0x00U != (FMC_STAT & FMC_STAT_BUSY)){ + fmc_state = FMC_BUSY; + }else{ + if((uint32_t)0x00U != (FMC_STAT & FMC_STAT_WPERR)){ + fmc_state = FMC_WPERR; + }else{ + if((uint32_t)0x00U != (FMC_STAT & (FMC_STAT_PGERR))){ + fmc_state = FMC_PGERR; + }else{ + if((uint32_t)0x00U != (FMC_STAT & (FMC_STAT_PGAERR))){ + fmc_state = FMC_PGAERR; + } + } + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief check whether FMC is ready or not + \param[in] timeout: count of loop + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_ready_wait(uint32_t timeout) +{ + fmc_state_enum fmc_state = FMC_BUSY; + + /* wait for FMC ready */ + do{ + /* get FMC state */ + fmc_state = fmc_state_get(); + timeout--; + }while((FMC_BUSY == fmc_state) && (0x00U != timeout)); + + if(FMC_BUSY == fmc_state){ + fmc_state = FMC_TOERR; + } + /* return the FMC state */ + return fmc_state; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c.base@1.0.0 new file mode 100644 index 0000000..3a3eae2 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c.base@1.0.0 @@ -0,0 +1,1033 @@ +/*! + \file gd32c10x_fmc.c + \brief FMC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_fmc.h" + +/* FMC mask */ +#define LOW_8BITS_MASK ((uint32_t)0x000000FFU) +#define HIGH_8BITS_MASK ((uint32_t)0x0000FF00U) +#define LOW_8BITS_MASK1 ((uint32_t)0x00FF0000U) +#define HIGH_8BITS_MASK1 ((uint32_t)0xFF000000U) +#define LOW_16BITS_MASK ((uint32_t)0x0000FFFFU) +#define HIGH_16BITS_MASK ((uint32_t)0xFFFF0000U) + +/* USER of option bytes mask */ +#define OB_USER_MASK ((uint8_t)0xF8U) + +/* OB_WP mask */ +#define OB_WP0_MASK ((uint32_t)0x000000FFU) +#define OB_WP1_MASK ((uint32_t)0x0000FF00U) +#define OB_WP2_MASK ((uint32_t)0x00FF0000U) +#define OB_WP3_MASK ((uint32_t)0xFF000000U) + +/* return the FMC state */ +static fmc_state_enum fmc_state_get(void); +/* check FMC ready or not */ +static fmc_state_enum fmc_ready_wait(uint32_t timeout); + +/* FMC main memory programming functions */ + +/*! + \brief enable pre-fetch + \param[in] none + \param[out] none + \retval none +*/ +void fmc_prefetch_enable(void) +{ + FMC_WS |= FMC_WS_PFEN; +} + +/*! + \brief disable pre-fetch + \param[in] none + \param[out] none + \retval none +*/ +void fmc_prefetch_disable(void) +{ + FMC_WS &= ~FMC_WS_PFEN; +} + +/*! + \brief enable IBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_ibus_enable(void) +{ + FMC_WS |= FMC_WS_ICEN; +} + +/*! + \brief disable IBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_ibus_disable(void) +{ + FMC_WS &= ~FMC_WS_ICEN; +} + +/*! + \brief enable DBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_dbus_enable(void) +{ + FMC_WS |= FMC_WS_DCEN; +} + +/*! + \brief disable DBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_dbus_disable(void) +{ + FMC_WS &= ~FMC_WS_DCEN; +} + +/*! + \brief reset IBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_ibus_reset(void) +{ + FMC_WS |= FMC_WS_ICRST; +} + +/*! + \brief reset DBUS cache + \param[in] none + \param[out] none + \retval none +*/ +void fmc_dbus_reset(void) +{ + FMC_WS |= FMC_WS_DCRST; +} + +/*! + \brief set program width to flash memory + \param[in] pgw + only one parameter can be selected which is shown as below: + \arg FMC_PROG_W_32B: 32-bit program width to flash memory + \arg FMC_PROG_W_64B: 64-bit program width to flash memory + \param[out] none + \retval none +*/ +void fmc_program_width_set(uint32_t pgw) +{ + uint32_t reg; + + reg = FMC_WS; + /* configure program width to flash memory */ + reg &= ~FMC_WS_PGW; + FMC_WS = (reg | pgw); +} + +/*! + \brief unlock the main FMC operation + \param[in] none + \param[out] none + \retval none +*/ +void fmc_unlock(void) +{ + if(RESET != (FMC_CTL & FMC_CTL_LK)){ + /* write the FMC unlock key */ + FMC_KEY = UNLOCK_KEY0; + FMC_KEY = UNLOCK_KEY1; + } +} + +/*! + \brief lock the main FMC operation + \param[in] none + \param[out] none + \retval none +*/ +void fmc_lock(void) +{ + /* set the LK bit */ + FMC_CTL |= FMC_CTL_LK; +} + +/*! + \brief set the wait state counter value + \param[in] wscnt:wait state counter value + only one parameter can be selected which is shown as below: + \arg FMC_WAIT_STATE_0: FMC 0 wait + \arg FMC_WAIT_STATE_1: FMC 1 wait + \arg FMC_WAIT_STATE_2: FMC 2 wait + \arg FMC_WAIT_STATE_3: FMC 3 wait + \param[out] none + \retval none +*/ +void fmc_wscnt_set(uint32_t wscnt) +{ + uint32_t reg; + + reg = FMC_WS; + /* set the wait state counter value */ + reg &= ~FMC_WS_WSCNT; + FMC_WS = (reg | wscnt); +} + +/*! + \brief FMC erase page + \param[in] page_address: target page address + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_page_erase(uint32_t page_address) +{ + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + FMC_CTL |= FMC_CTL_PER; + FMC_ADDR = page_address; + FMC_CTL |= FMC_CTL_START; + __DSB(); + __ISB(); + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the PER bit */ + FMC_CTL &= ~FMC_CTL_PER; + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief FMC erase whole chip + \param[in] none + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_mass_erase(void) +{ + fmc_state_enum fmc_state; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* start whole chip erase */ + FMC_CTL |= FMC_CTL_MER; + FMC_CTL |= FMC_CTL_START; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + /* reset the MER bit */ + FMC_CTL &= ~FMC_CTL_MER; + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief FMC program a double word at the corresponding address + \param[in] address: address to program + \param[in] data: double word to program + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_doubleword_program(uint32_t address, uint64_t data) +{ + uint32_t data0, data1; + + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + data0 = (uint32_t)(data & 0xFFFFFFFFU); + data1 = (uint32_t)((data >> 32U) & 0xFFFFFFFFU); + + if(FMC_READY == fmc_state){ + /* set the PGW and PG bit to start program */ + FMC_WS |= FMC_WS_PGW; + FMC_CTL |= FMC_CTL_PG; + + REG32(address) = data0; + REG32(address + 4U) = data1; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the PG and PGW bit */ + FMC_CTL &= ~FMC_CTL_PG; + FMC_WS &= ~FMC_WS_PGW; + } + + /* return the FMC state */ + return fmc_state; +} + +#ifndef GD32C103XXA +/*! + \brief FMC program a word at the corresponding address + \param[in] address: address to program + \param[in] data: word to program + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_WPERR: erase/program protection error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum fmc_word_program(uint32_t address, uint32_t data) +{ + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* set the PG bit to start program */ + FMC_CTL |= FMC_CTL_PG; + REG32(address) = data; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the PG bit */ + FMC_CTL &= ~FMC_CTL_PG; + } + + /* return the FMC state */ + return fmc_state; +} +#endif + +/*! + \brief unlock the option byte operation + it is better to used in pairs with ob_lock + \param[in] none + \param[out] none + \retval none +*/ +void ob_unlock(void) +{ + if(RESET == (FMC_CTL & FMC_CTL_OBWEN)){ + /* write the FMC key */ + FMC_OBKEY = UNLOCK_KEY0; + FMC_OBKEY = UNLOCK_KEY1; + } +} + +/*! + \brief lock the option byte operation + it is better to used in pairs with ob_unlock after an operation + \param[in] none + \param[out] none + \retval none +*/ +void ob_lock(void) +{ + /* reset the OBWEN bit */ + FMC_CTL &= ~FMC_CTL_OBWEN; +} + +/*! + \brief erase the FMC option bytes + programmer must ensure FMC & option byte are both unlocked before calling this function + \param[in] none + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_erase(void) +{ + uint8_t temp_spc; + uint32_t temp; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* check the option bytes security protection value */ + if(RESET == ob_security_protection_flag_get()){ + temp_spc = FMC_NSPC; + }else{ + temp_spc = FMC_USPC; + } + + temp = HIGH_16BITS_MASK | ((uint32_t)temp_spc); + + if(FMC_READY == fmc_state){ + /* start erase the option bytes */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + /* restore the last get option byte security protection code */ + OB_SPC_USER = temp; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief enable write protection + \param[in] ob_wp: specify sector to be write protected + one or more parameters can be selected which are shown as below: + \arg OB_WP_NONE: disable all write protection + \arg OB_WP_x(x=0..31): write protect specify sector + \arg OB_WP_ALL: write protect all sector + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_write_protection_enable(uint32_t ob_wp) +{ + uint32_t i; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + ob_wp = (uint32_t)(~ob_wp); + op_byte[2] = (ob_wp & LOW_8BITS_MASK) | ((ob_wp & HIGH_8BITS_MASK) << 8U); + op_byte[3] = ((ob_wp & LOW_8BITS_MASK1) >> 16U) | ((ob_wp & HIGH_8BITS_MASK1) >> 8U); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief configure security protection + \param[in] ob_spc: specify security protection code + only one parameter can be selected which is shown as below: + \arg FMC_NSPC: no security protection + \arg FMC_USPC: under security protection + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_security_protection_config(uint8_t ob_spc) +{ + uint8_t i; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + op_byte[0] = ((uint32_t)(ob_spc)) | ((op_byte[0] & HIGH_16BITS_MASK)); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief program option bytes USER + programmer must ensure FMC & option bytes are both unlocked before calling this function + \param[in] ob_fwdgt: option bytes free watchdog value + only one parameter can be selected which is shown as below: + \arg OB_FWDGT_SW: software free watchdog + \arg OB_FWDGT_HW: hardware free watchdog + \param[in] ob_deepsleep: option bytes deepsleep reset value + only one parameter can be selected which is shown as below: + \arg OB_DEEPSLEEP_NRST: no reset when entering deepsleep mode + \arg OB_DEEPSLEEP_RST: generate a reset instead of entering deepsleep mode + \param[in] ob_stdby: option bytes standby reset value + only one parameter can be selected which is shown as below: + \arg OB_STDBY_NRST: no reset when entering standby mode + \arg OB_STDBY_RST: generate a reset instead of entering standby mode + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ +fmc_state_enum ob_user_write(uint8_t ob_fwdgt, uint8_t ob_deepsleep, uint8_t ob_stdby) +{ + uint8_t i; + uint32_t temp; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + temp = ((uint8_t)((uint8_t)((uint8_t)(ob_fwdgt) | ob_deepsleep) | ob_stdby) | (OB_USER_MASK)); + op_byte[0] = ((uint32_t)(temp) << 16U) | ((op_byte[0] & LOW_16BITS_MASK)); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief program option bytes data + \param[in] ob_data: the byte to be programmed + \param[out] none + \retval state of FMC + \arg FMC_READY: the operation has been completed + \arg FMC_PGERR: program error + \arg FMC_PGAERR: program alignment error + \arg FMC_TOERR: timeout error +*/ + +fmc_state_enum ob_data_program(uint16_t ob_data) +{ + uint8_t i; + uint32_t op_byte[4]; + fmc_state_enum fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + for(i = 0U; i < 4U; i++){ + op_byte[i] = OP_BYTE(i); + } + op_byte[1] = (uint32_t)((ob_data & LOW_8BITS_MASK) | ((ob_data & HIGH_8BITS_MASK) << 8U)); + + if(FMC_READY == fmc_state){ + /* start erase the option byte */ + FMC_CTL |= FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_START; + + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + + if(FMC_READY == fmc_state){ + /* reset the OBER bit and enable the option bytes programming */ + FMC_CTL &= ~FMC_CTL_OBER; + FMC_CTL |= FMC_CTL_OBPG; + + for(i = 0U; i < 4U; i++){ + OP_BYTE(i) = op_byte[i]; + /* wait for the FMC ready */ + fmc_state = fmc_ready_wait(FMC_TIMEOUT_COUNT); + if(FMC_READY != fmc_state){ + break; + } + } + + /* reset the OBPG bit */ + FMC_CTL &= ~FMC_CTL_OBPG; + }else{ + /* reset the OBER bit */ + FMC_CTL &= ~FMC_CTL_OBER; + } + } + + /* return the FMC state */ + return fmc_state; +} + +#ifdef GD32C103XXA + +/*! + \brief get the address where ECC error occur on + \param[in] none + \param[out] none + \retval uint16_t: the address where ECC error occur on +*/ +uint16_t fmc_ecc_address_get(void) +{ + return (uint16_t)(FMC_ECCCS >> ECCEADDR_OFFSET); +} + +/*! + \brief check ECC flag is set or not + \param[in] flag: check FMC ECC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_ECCCOR: one bit error detected and correct flag + \arg FMC_FLAG_ECCDET: two bits error detect flag + \arg FMC_FLAG_SYSECC: an ECC error is detected in system memory flag + \arg FMC_FLAG_MFECC: an ECC error is detected in main Flash flag + \arg FMC_FLAG_OTPECC: an ECC error is detected in OTP flag + \arg FMC_FLAG_OBECC: an ECC error is detected in reading option bytes flag + \arg FMC_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_ecc_flag_get(uint32_t flag) +{ + FlagStatus status = RESET; + + if(FMC_ECCCS & flag){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief check ECC flag is set or not + \param[in] flag: check FMC ECC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_ECCCOR: one bit error detected and correct flag + \arg FMC_FLAG_ECCDET: two bits error detect flag + \arg FMC_FLAG_SYSECC: an ECC error is detected in system memory flag + \arg FMC_FLAG_MFECC: an ECC error is detected in main Flash flag + \arg FMC_FLAG_OTPECC: an ECC error is detected in OTP flag + \arg FMC_FLAG_OBECC: an ECC error is detected in reading option bytes flag + \arg FMC_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +void fmc_ecc_flag_clear(uint32_t flag) +{ + FMC_ECCCS |= flag; +} + +/*! + \brief enable FMC ECC interrupt + \param[in] interrupt: the FMC ECC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_ECCCOR: FMC one bit error correct interrupt + \arg FMC_INT_ECCDET: FMC two bits error interrupt + \param[out] none + \retval none +*/ +void fmc_ecc_interrupt_enable(uint32_t interrupt) +{ + FMC_ECCCS |= interrupt; +} + +/*! + \brief disable FMC ECC interrupt + \param[in] interrupt: the FMC ECC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_ECCCOR: FMC one bit error correct interrupt + \arg FMC_INT_ECCDET: FMC two bits error interrupt + \param[out] none + \retval none +*/ +void fmc_ecc_interrupt_disable(uint32_t interrupt) +{ + uint32_t temp = (FMC_ECCCS & BITS(14,15)); + temp &= ~(uint32_t)(interrupt); + FMC_ECCCS = temp; +} + +/*! + \brief get FMC ECC interrupt flag + \param[in] int_flag: FMC ECC interrupt flag + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_ECCCOR: one bit error detected and correct interrupt flag + \arg FMC_INT_FLAG_ECCDET: two bits error detect interrupt flag + \arg FMC_INT_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_ecc_interrupt_flag_get(uint32_t int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U; + /* get the interrupt enable bit status */ + intenable = (FMC_REG_VAL(int_flag) & BIT(FMC_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (FMC_REG_VAL2(int_flag) & BIT(FMC_BIT_POS2(int_flag))); + + if(flagstatus && intenable) { + return SET; + } else { + return RESET; + } + +} + +/*! + \brief clear FMC ECC interrupt flag + \param[in] int_flag: FMC ECC interrupt flag + one or more parameters can be selected which is shown as below: + \arg FMC_INT_FLAG_ECCCOR: one bit error detected and correct interrupt flag + \arg FMC_INT_FLAG_ECCDET: two bits error detect interrupt flag + \arg FMC_INT_FLAG_OBECCDET: option bytes two bits error detect in loading option bytes to register interrupt flag + \param[out] none + \retval none +*/ +void fmc_ecc_interrupt_flag_clear(uint32_t int_flag) +{ + FMC_ECCCS |= int_flag; +} + +#endif +/*! + \brief get OB_USER in register FMC_OBSTAT + \param[in] none + \param[out] none + \retval the FMC user option bytes values +*/ +uint8_t ob_user_get(void) +{ + /* return the FMC user option bytes value */ + return (uint8_t)(FMC_OBSTAT >> 2U); +} + +/*! + \brief get OB_DATA in register FMC_OBSTAT + \param[in] none + \param[out] none + \retval ob_data +*/ +uint16_t ob_data_get(void) +{ + return (uint16_t)(FMC_OBSTAT >> 10U); +} + +/*! + \brief get the FMC option byte write protection (OB_WP) in register FMC_WP + \param[in] none + \param[out] none + \retval the FMC write protection option bytes value +*/ +uint32_t ob_write_protection_get(void) +{ + /* return the FMC write protection option bytes value */ + return FMC_WP; +} + +/*! + \brief get the FMC option bytes security protection state + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus ob_security_protection_flag_get(void) +{ + FlagStatus spc_state = RESET; + + if(RESET != (FMC_OBSTAT & FMC_OBSTAT_SPC)){ + spc_state = SET; + }else{ + spc_state = RESET; + } + return spc_state; +} + +/*! + \brief check OBERR flag is set or not + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_oberr_flag_get(void) +{ + FlagStatus status = RESET; + + if(RESET != (FMC_OBSTAT & FMC_OBSTAT_OBERR)){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief check flag is set or not + \param[in] flag: check FMC flag + only one parameter can be selected which is shown as below: + \arg FMC_FLAG_BUSY: FMC busy flag bit + \arg FMC_FLAG_PGERR: FMC operation error flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_FLAG_WPERR: FMC erase/program protection error flag bit + \arg FMC_FLAG_END: FMC end of operation flag bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_flag_get(uint32_t flag) +{ + FlagStatus status = RESET; + + if(FMC_STAT & flag){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief clear the FMC flag + \param[in] flag: clear FMC flag + one or more parameters can be selected which is shown as below: + \arg FMC_FLAG_PGERR: FMC operation error flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_FLAG_WPERR: FMC erase/program protection error flag bit + \arg FMC_FLAG_END: FMC end of operation flag bit + \param[out] none + \retval none +*/ +void fmc_flag_clear(uint32_t flag) +{ + /* clear the flags */ + FMC_STAT = flag; +} + +/*! + \brief enable FMC interrupt + \param[in] interrupt: the FMC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_END: enable FMC end of program interrupt + \arg FMC_INT_ERR: enable FMC error interrupt + \param[out] none + \retval none +*/ +void fmc_interrupt_enable(uint32_t interrupt) +{ + FMC_CTL |= interrupt; +} + +/*! + \brief disable FMC interrupt + \param[in] interrupt: the FMC interrupt source + only one parameter can be selected which is shown as below: + \arg FMC_INT_END: enable FMC end of program interrupt + \arg FMC_INT_ERR: enable FMC error interrupt + \param[out] none + \retval none +*/ +void fmc_interrupt_disable(uint32_t interrupt) +{ + FMC_CTL &= ~(uint32_t)interrupt; +} + +/*! + \brief get FMC interrupt flag state + \param[in] flag: FMC interrupt flags, refer to fmc_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_PGERR: FMC operation error interrupt flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_INT_FLAG_WPERR: FMC erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_END: FMC end of operation interrupt flag bit + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fmc_interrupt_flag_get(uint32_t flag) +{ + FlagStatus status = RESET; + + if(FMC_STAT & flag){ + status = SET; + } + /* return the state of corresponding FMC flag */ + return status; +} + +/*! + \brief clear FMC interrupt flag state + \param[in] flag: FMC interrupt flags, refer to can_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg FMC_INT_FLAG_PGERR: FMC operation error interrupt flag bit + \arg FMC_FLAG_PGAERR: FMC program alignment error flag bit + \arg FMC_INT_FLAG_WPERR: FMC erase/program protection error interrupt flag bit + \arg FMC_INT_FLAG_END: FMC end of operation interrupt flag bit + \param[out] none + \retval none +*/ +void fmc_interrupt_flag_clear(uint32_t flag) +{ + /* clear the flag */ + FMC_STAT = flag; +} + +/*! + \brief get the FMC state + \param[in] none + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_state_get(void) +{ + fmc_state_enum fmc_state = FMC_READY; + + if((uint32_t)0x00U != (FMC_STAT & FMC_STAT_BUSY)){ + fmc_state = FMC_BUSY; + }else{ + if((uint32_t)0x00U != (FMC_STAT & FMC_STAT_WPERR)){ + fmc_state = FMC_WPERR; + }else{ + if((uint32_t)0x00U != (FMC_STAT & (FMC_STAT_PGERR))){ + fmc_state = FMC_PGERR; + }else{ + if((uint32_t)0x00U != (FMC_STAT & (FMC_STAT_PGAERR))){ + fmc_state = FMC_PGAERR; + } + } + } + } + /* return the FMC state */ + return fmc_state; +} + +/*! + \brief check whether FMC is ready or not + \param[in] timeout: count of loop + \param[out] none + \retval state of FMC, refer to fmc_state_enum +*/ +static fmc_state_enum fmc_ready_wait(uint32_t timeout) +{ + fmc_state_enum fmc_state = FMC_BUSY; + + /* wait for FMC ready */ + do{ + /* get FMC state */ + fmc_state = fmc_state_get(); + timeout--; + }while((FMC_BUSY == fmc_state) && (0x00U != timeout)); + + if(FMC_BUSY == fmc_state){ + fmc_state = FMC_TOERR; + } + /* return the FMC state */ + return fmc_state; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c new file mode 100644 index 0000000..35661db --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c @@ -0,0 +1,215 @@ +/*! + \file gd32c10x_fwdgt.c + \brief FWDGT driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_fwdgt.h" + +/*! + \brief enable write access to FWDGT_PSC and FWDGT_RLD + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_write_enable(void) +{ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; +} + +/*! + \brief disable write access to FWDGT_PSC and FWDGT_RLD + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_write_disable(void) +{ + FWDGT_CTL = FWDGT_WRITEACCESS_DISABLE; +} + +/*! + \brief start the free watchdog timer counter + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_enable(void) +{ + FWDGT_CTL = FWDGT_KEY_ENABLE; +} + +/*! + \brief configure the free watchdog timer counter prescaler value + \param[in] prescaler_value: specify prescaler value + only one parameter can be selected which is shown as below: + \arg FWDGT_PSC_DIV4: FWDGT prescaler set to 4 + \arg FWDGT_PSC_DIV8: FWDGT prescaler set to 8 + \arg FWDGT_PSC_DIV16: FWDGT prescaler set to 16 + \arg FWDGT_PSC_DIV32: FWDGT prescaler set to 32 + \arg FWDGT_PSC_DIV64: FWDGT prescaler set to 64 + \arg FWDGT_PSC_DIV128: FWDGT prescaler set to 128 + \arg FWDGT_PSC_DIV256: FWDGT prescaler set to 256 + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_prescaler_value_config(uint16_t prescaler_value) +{ + uint32_t timeout = FWDGT_PSC_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_PSC */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the PUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_PUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + /* configure FWDGT */ + FWDGT_PSC = (uint32_t)prescaler_value; + + return SUCCESS; +} + +/*! + \brief configure the free watchdog timer counter reload value + \param[in] reload_value: specify reload value(0x0000 - 0x0FFF) + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_reload_value_config(uint16_t reload_value) +{ + uint32_t timeout = FWDGT_RLD_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_RLD */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the RUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_RUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + FWDGT_RLD = RLD_RLD(reload_value); + + return SUCCESS; +} + +/*! + \brief reload the counter of FWDGT + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_counter_reload(void) +{ + FWDGT_CTL = FWDGT_KEY_RELOAD; +} + +/*! + \brief configure counter reload value, and prescaler divider value + \param[in] reload_value: specify reload value(0x0000 - 0x0FFF) + \param[in] prescaler_div: FWDGT prescaler value + only one parameter can be selected which is shown as below: + \arg FWDGT_PSC_DIV4: FWDGT prescaler set to 4 + \arg FWDGT_PSC_DIV8: FWDGT prescaler set to 8 + \arg FWDGT_PSC_DIV16: FWDGT prescaler set to 16 + \arg FWDGT_PSC_DIV32: FWDGT prescaler set to 32 + \arg FWDGT_PSC_DIV64: FWDGT prescaler set to 64 + \arg FWDGT_PSC_DIV128: FWDGT prescaler set to 128 + \arg FWDGT_PSC_DIV256: FWDGT prescaler set to 256 + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_config(uint16_t reload_value, uint8_t prescaler_div) +{ + uint32_t timeout = FWDGT_PSC_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_PSC,and FWDGT_RLD */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the PUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_PUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + /* configure FWDGT */ + FWDGT_PSC = (uint32_t)prescaler_div; + + timeout = FWDGT_RLD_TIMEOUT; + /* wait until the RUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_RUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + FWDGT_RLD = RLD_RLD(reload_value); + + /* reload the counter */ + FWDGT_CTL = FWDGT_KEY_RELOAD; + + return SUCCESS; +} + +/*! + \brief get flag state of FWDGT + \param[in] flag: flag to get + only one parameter can be selected which is shown as below: + \arg FWDGT_FLAG_PUD: a write operation to FWDGT_PSC register is on going + \arg FWDGT_FLAG_RUD: a write operation to FWDGT_RLD register is on going + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fwdgt_flag_get(uint16_t flag) +{ + if(FWDGT_STAT & flag) { + return SET; + } + + return RESET; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c.base@1.0.0 new file mode 100644 index 0000000..35661db --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c.base@1.0.0 @@ -0,0 +1,215 @@ +/*! + \file gd32c10x_fwdgt.c + \brief FWDGT driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_fwdgt.h" + +/*! + \brief enable write access to FWDGT_PSC and FWDGT_RLD + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_write_enable(void) +{ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; +} + +/*! + \brief disable write access to FWDGT_PSC and FWDGT_RLD + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_write_disable(void) +{ + FWDGT_CTL = FWDGT_WRITEACCESS_DISABLE; +} + +/*! + \brief start the free watchdog timer counter + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_enable(void) +{ + FWDGT_CTL = FWDGT_KEY_ENABLE; +} + +/*! + \brief configure the free watchdog timer counter prescaler value + \param[in] prescaler_value: specify prescaler value + only one parameter can be selected which is shown as below: + \arg FWDGT_PSC_DIV4: FWDGT prescaler set to 4 + \arg FWDGT_PSC_DIV8: FWDGT prescaler set to 8 + \arg FWDGT_PSC_DIV16: FWDGT prescaler set to 16 + \arg FWDGT_PSC_DIV32: FWDGT prescaler set to 32 + \arg FWDGT_PSC_DIV64: FWDGT prescaler set to 64 + \arg FWDGT_PSC_DIV128: FWDGT prescaler set to 128 + \arg FWDGT_PSC_DIV256: FWDGT prescaler set to 256 + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_prescaler_value_config(uint16_t prescaler_value) +{ + uint32_t timeout = FWDGT_PSC_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_PSC */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the PUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_PUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + /* configure FWDGT */ + FWDGT_PSC = (uint32_t)prescaler_value; + + return SUCCESS; +} + +/*! + \brief configure the free watchdog timer counter reload value + \param[in] reload_value: specify reload value(0x0000 - 0x0FFF) + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_reload_value_config(uint16_t reload_value) +{ + uint32_t timeout = FWDGT_RLD_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_RLD */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the RUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_RUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + FWDGT_RLD = RLD_RLD(reload_value); + + return SUCCESS; +} + +/*! + \brief reload the counter of FWDGT + \param[in] none + \param[out] none + \retval none +*/ +void fwdgt_counter_reload(void) +{ + FWDGT_CTL = FWDGT_KEY_RELOAD; +} + +/*! + \brief configure counter reload value, and prescaler divider value + \param[in] reload_value: specify reload value(0x0000 - 0x0FFF) + \param[in] prescaler_div: FWDGT prescaler value + only one parameter can be selected which is shown as below: + \arg FWDGT_PSC_DIV4: FWDGT prescaler set to 4 + \arg FWDGT_PSC_DIV8: FWDGT prescaler set to 8 + \arg FWDGT_PSC_DIV16: FWDGT prescaler set to 16 + \arg FWDGT_PSC_DIV32: FWDGT prescaler set to 32 + \arg FWDGT_PSC_DIV64: FWDGT prescaler set to 64 + \arg FWDGT_PSC_DIV128: FWDGT prescaler set to 128 + \arg FWDGT_PSC_DIV256: FWDGT prescaler set to 256 + \param[out] none + \retval ErrStatus: ERROR or SUCCESS +*/ +ErrStatus fwdgt_config(uint16_t reload_value, uint8_t prescaler_div) +{ + uint32_t timeout = FWDGT_PSC_TIMEOUT; + uint32_t flag_status = RESET; + + /* enable write access to FWDGT_PSC,and FWDGT_RLD */ + FWDGT_CTL = FWDGT_WRITEACCESS_ENABLE; + + /* wait until the PUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_PUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + /* configure FWDGT */ + FWDGT_PSC = (uint32_t)prescaler_div; + + timeout = FWDGT_RLD_TIMEOUT; + /* wait until the RUD flag to be reset */ + do { + flag_status = FWDGT_STAT & FWDGT_STAT_RUD; + } while((--timeout > 0U) && ((uint32_t)RESET != flag_status)); + + if((uint32_t)RESET != flag_status) { + return ERROR; + } + + FWDGT_RLD = RLD_RLD(reload_value); + + /* reload the counter */ + FWDGT_CTL = FWDGT_KEY_RELOAD; + + return SUCCESS; +} + +/*! + \brief get flag state of FWDGT + \param[in] flag: flag to get + only one parameter can be selected which is shown as below: + \arg FWDGT_FLAG_PUD: a write operation to FWDGT_PSC register is on going + \arg FWDGT_FLAG_RUD: a write operation to FWDGT_RLD register is on going + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus fwdgt_flag_get(uint16_t flag) +{ + if(FWDGT_STAT & flag) { + return SET; + } + + return RESET; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c new file mode 100644 index 0000000..233dbc5 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c @@ -0,0 +1,538 @@ +/*! + \file gd32c10x_gpio.c + \brief GPIO driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_gpio.h" + +#define AFIO_EXTI_SOURCE_MASK ((uint8_t)0x03U) /*!< AFIO exti source selection mask*/ +#define AFIO_EXTI_SOURCE_FIELDS ((uint8_t)0x04U) /*!< select AFIO exti source registers */ +#define LSB_16BIT_MASK ((uint16_t)0xFFFFU) /*!< LSB 16-bit mask */ +#define PCF_POSITION_MASK ((uint32_t)0x000F0000U) /*!< AFIO_PCF register position mask */ +#define PCF_SWJCFG_MASK ((uint32_t)0xF8FFFFFFU) /*!< AFIO_PCF register SWJCFG mask */ +#define PCF_LOCATION1_MASK ((uint32_t)0x00200000U) /*!< AFIO_PCF register location1 mask */ +#define PCF_LOCATION2_MASK ((uint32_t)0x00100000U) /*!< AFIO_PCF register location2 mask */ +#define AFIO_PCF1_FIELDS ((uint32_t)0x80000000U) /*!< select AFIO_PCF1 register */ +#define GPIO_OUTPUT_PORT_OFFSET ((uint32_t)4U) /*!< GPIO event output port offset*/ + +/*! + \brief reset GPIO port + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[out] none + \retval none +*/ +void gpio_deinit(uint32_t gpio_periph) +{ + switch(gpio_periph){ + case GPIOA: + /* reset GPIOA */ + rcu_periph_reset_enable(RCU_GPIOARST); + rcu_periph_reset_disable(RCU_GPIOARST); + break; + case GPIOB: + /* reset GPIOB */ + rcu_periph_reset_enable(RCU_GPIOBRST); + rcu_periph_reset_disable(RCU_GPIOBRST); + break; + case GPIOC: + /* reset GPIOC */ + rcu_periph_reset_enable(RCU_GPIOCRST); + rcu_periph_reset_disable(RCU_GPIOCRST); + break; + case GPIOD: + /* reset GPIOD */ + rcu_periph_reset_enable(RCU_GPIODRST); + rcu_periph_reset_disable(RCU_GPIODRST); + break; + case GPIOE: + /* reset GPIOE */ + rcu_periph_reset_enable(RCU_GPIOERST); + rcu_periph_reset_disable(RCU_GPIOERST); + break; + default: + break; + } +} + +/*! + \brief reset alternate function I/O(AFIO) + \param[in] none + \param[out] none + \retval none +*/ +void gpio_afio_deinit(void) +{ + rcu_periph_reset_enable(RCU_AFRST); + rcu_periph_reset_disable(RCU_AFRST); +} + +/*! + \brief GPIO parameter initialization + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] mode: gpio pin mode + only one parameter can be selected which is shown as below: + \arg GPIO_MODE_AIN: analog input mode + \arg GPIO_MODE_IN_FLOATING: floating input mode + \arg GPIO_MODE_IPD: pull-down input mode + \arg GPIO_MODE_IPU: pull-up input mode + \arg GPIO_MODE_OUT_OD: GPIO output with open-drain + \arg GPIO_MODE_OUT_PP: GPIO output with push-pull + \arg GPIO_MODE_AF_OD: AFIO output with open-drain + \arg GPIO_MODE_AF_PP: AFIO output with push-pull + \param[in] speed: gpio output max speed value + only one parameter can be selected which is shown as below: + \arg GPIO_OSPEED_10MHZ: output max speed 10MHz + \arg GPIO_OSPEED_2MHZ: output max speed 2MHz + \arg GPIO_OSPEED_50MHZ: output max speed 50MHz + \arg GPIO_OSPEED_MAX: output max speed more than 50MHz + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_init(uint32_t gpio_periph, uint32_t mode, uint32_t speed, uint32_t pin) +{ + uint16_t i; + uint32_t temp_mode = 0U; + uint32_t reg = 0U; + + /* GPIO mode configuration */ + temp_mode = (uint32_t)(mode & ((uint32_t)0x0FU)); + + /* GPIO speed configuration */ + if(((uint32_t)0x00U) != ((uint32_t)mode & ((uint32_t)0x10U))){ + /* output mode max speed */ + if(GPIO_OSPEED_MAX == (uint32_t)speed){ + temp_mode |= (uint32_t)0x03U; + /* set the corresponding SPD bit */ + GPIOx_SPD(gpio_periph) |= (uint32_t)pin ; + }else{ + /* output mode max speed:10MHz,2MHz,50MHz */ + temp_mode |= (uint32_t)speed; + } + } + + /* configure the eight low port pins with GPIO_CTL0 */ + for(i = 0U;i < 8U;i++){ + if((1U << i) & pin){ + reg = GPIO_CTL0(gpio_periph); + + /* clear the specified pin mode bits */ + reg &= ~GPIO_MODE_MASK(i); + /* set the specified pin mode bits */ + reg |= GPIO_MODE_SET(i, temp_mode); + + /* set IPD or IPU */ + if(GPIO_MODE_IPD == mode){ + /* reset the corresponding OCTL bit */ + GPIO_BC(gpio_periph) = (uint32_t)((1U << i) & pin); + }else{ + /* set the corresponding OCTL bit */ + if(GPIO_MODE_IPU == mode){ + GPIO_BOP(gpio_periph) = (uint32_t)((1U << i) & pin); + } + } + /* set GPIO_CTL0 register */ + GPIO_CTL0(gpio_periph) = reg; + } + } + /* configure the eight high port pins with GPIO_CTL1 */ + for(i = 8U;i < 16U;i++){ + if((1U << i) & pin){ + reg = GPIO_CTL1(gpio_periph); + + /* clear the specified pin mode bits */ + reg &= ~GPIO_MODE_MASK(i - 8U); + /* set the specified pin mode bits */ + reg |= GPIO_MODE_SET(i - 8U, temp_mode); + + /* set IPD or IPU */ + if(GPIO_MODE_IPD == mode){ + /* reset the corresponding OCTL bit */ + GPIO_BC(gpio_periph) = (uint32_t)((1U << i) & pin); + }else{ + /* set the corresponding OCTL bit */ + if(GPIO_MODE_IPU == mode){ + GPIO_BOP(gpio_periph) = (uint32_t)((1U << i) & pin); + } + } + /* set GPIO_CTL1 register */ + GPIO_CTL1(gpio_periph) = reg; + } + } +} + +/*! + \brief set GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_bit_set(uint32_t gpio_periph, uint32_t pin) +{ + GPIO_BOP(gpio_periph) = (uint32_t)pin; +} + +/*! + \brief reset GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_bit_reset(uint32_t gpio_periph, uint32_t pin) +{ + GPIO_BC(gpio_periph) = (uint32_t)pin; +} + +/*! + \brief write data to the specified GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[in] bit_value: SET or RESET + \arg RESET: clear the port pin + \arg SET: set the port pin + \param[out] none + \retval none +*/ +void gpio_bit_write(uint32_t gpio_periph, uint32_t pin, bit_status bit_value) +{ + if(RESET != bit_value){ + GPIO_BOP(gpio_periph) = (uint32_t)pin; + }else{ + GPIO_BC(gpio_periph) = (uint32_t)pin; + } +} + +/*! + \brief write data to the specified GPIO port + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] data: specify the value to be written to the port output data register + \param[out] none + \retval none +*/ +void gpio_port_write(uint32_t gpio_periph,uint16_t data) +{ + GPIO_OCTL(gpio_periph) = (uint32_t)data; +} + +/*! + \brief get GPIO pin input status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + only one parameter can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval input status of gpio pin: SET or RESET +*/ +FlagStatus gpio_input_bit_get(uint32_t gpio_periph,uint32_t pin) +{ + if((uint32_t)RESET != (GPIO_ISTAT(gpio_periph)&(pin))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get GPIO port input status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[out] none + \retval input status of gpio all pins +*/ +uint16_t gpio_input_port_get(uint32_t gpio_periph) +{ + return (uint16_t)(GPIO_ISTAT(gpio_periph)); +} + +/*! + \brief get GPIO pin output status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + only one parameter can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval output status of gpio pin: SET or RESET +*/ +FlagStatus gpio_output_bit_get(uint32_t gpio_periph, uint32_t pin) +{ + if((uint32_t)RESET !=(GPIO_OCTL(gpio_periph)&(pin))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get GPIO port output status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[out] none + \retval output status of gpio all pins +*/ +uint16_t gpio_output_port_get(uint32_t gpio_periph) +{ + return ((uint16_t)GPIO_OCTL(gpio_periph)); +} + +/*! + \brief configure GPIO pin remap + \param[in] gpio_remap: select the pin to remap + only one parameter can be selected which are shown as below: + \arg GPIO_SPI0_REMAP: SPI0 remapping + \arg GPIO_I2C0_REMAP: I2C0 remapping + \arg GPIO_USART0_REMAP: USART0 remapping + \arg GPIO_USART1_REMAP: USART1 remapping + \arg GPIO_USART2_PARTIAL_REMAP: USART2 partial remapping + \arg GPIO_USART2_FULL_REMAP: USART2 full remapping + \arg GPIO_TIMER0_PARTIAL_REMAP: TIMER0 partial remapping + \arg GPIO_TIMER0_FULL_REMAP: TIMER0 full remapping + \arg GPIO_TIMER1_PARTIAL_REMAP0: TIMER1 partial remapping + \arg GPIO_TIMER1_PARTIAL_REMAP1: TIMER1 partial remapping + \arg GPIO_TIMER1_FULL_REMAP: TIMER1 full remapping + \arg GPIO_TIMER2_PARTIAL_REMAP: TIMER2 partial remapping + \arg GPIO_TIMER2_FULL_REMAP: TIMER2 full remapping + \arg GPIO_TIMER3_REMAP: TIMER3 remapping + \arg GPIO_CAN0_PARTIAL_REMAP: CAN0 partial remapping + \arg GPIO_CAN0_FULL_REMAP: CAN0 full remapping + \arg GPIO_PD01_REMAP: PD01 remapping + \arg GPIO_TIMER4CH3_IREMAP: TIMER4 channel3 internal remapping + \arg GPIO_ADC0_ETRGRT_REMAP: ADC0 external trigger routine conversion remapping + \arg GPIO_ADC1_ETRGRT_REMAP: ADC1 external trigger routine conversion remapping + \arg GPIO_CAN1_REMAP: CAN1 remapping + \arg GPIO_SWJ_NONJTRST_REMAP: full SWJ(JTAG-DP + SW-DP),but without NJTRST + \arg GPIO_SWJ_SWDPENABLE_REMAP: JTAG-DP disabled and SW-DP enabled + \arg GPIO_SWJ_DISABLE_REMAP: JTAG-DP disabled and SW-DP disabled + \arg GPIO_SPI2_REMAP: SPI2 remapping + \arg GPIO_TIMER1ITI1_REMAP: TIMER1 internal trigger 1 remapping + \arg GPIO_TIMER8_REMAP: TIMER8 remapping + \arg GPIO_EXMC_NADV_REMAP: EXMC_NADV connect/disconnect + \arg GPIO_CTC_REMAP0: CTC remapping(PD15) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void gpio_pin_remap_config(uint32_t remap, ControlStatus newvalue) +{ + uint32_t remap1 = 0U, remap2 = 0U, temp_reg = 0U, temp_mask = 0U; + + if(((uint32_t)0x80000000U) == (remap & 0x80000000U)){ + /* get AFIO_PCF1 register value */ + temp_reg = AFIO_PCF1; + }else{ + /* get AFIO_PCF0 register value */ + temp_reg = AFIO_PCF0; + } + + temp_mask = (remap & PCF_POSITION_MASK) >> 0x10U; + remap1 = remap & LSB_16BIT_MASK; + + /* judge pin remap type */ + if((PCF_LOCATION1_MASK | PCF_LOCATION2_MASK) == (remap & (PCF_LOCATION1_MASK | PCF_LOCATION2_MASK))){ + temp_reg &= PCF_SWJCFG_MASK; + AFIO_PCF0 &= PCF_SWJCFG_MASK; + }else if(PCF_LOCATION2_MASK == (remap & PCF_LOCATION2_MASK)){ + remap2 = ((uint32_t)0x03U) << temp_mask; + temp_reg &= ~remap2; + temp_reg |= ~PCF_SWJCFG_MASK; + }else{ + temp_reg &= ~(remap1 << ((remap >> 0x15U)*0x10U)); + temp_reg |= ~PCF_SWJCFG_MASK; + } + + /* set pin remap value */ + if(DISABLE != newvalue){ + temp_reg |= (remap1 << ((remap >> 0x15U)*0x10U)); + } + + if(AFIO_PCF1_FIELDS == (remap & AFIO_PCF1_FIELDS)){ + /* set AFIO_PCF1 register value */ + AFIO_PCF1 = temp_reg; + }else{ + /* set AFIO_PCF0 register value */ + AFIO_PCF0 = temp_reg; + } +} + +/*! + \brief select GPIO pin exti sources + \param[in] output_port: gpio event output port + only one parameter can be selected which are shown as below: + \arg GPIO_PORT_SOURCE_GPIOA: output port source A + \arg GPIO_PORT_SOURCE_GPIOB: output port source B + \arg GPIO_PORT_SOURCE_GPIOC: output port source C + \arg GPIO_PORT_SOURCE_GPIOD: output port source D + \arg GPIO_PORT_SOURCE_GPIOE: output port source E + \param[in] output_pin: + only one parameter can be selected which are shown as below: + \arg GPIO_PIN_SOURCE_x(x=0..15) + \param[out] none + \retval none +*/ +void gpio_exti_source_select(uint8_t output_port, uint8_t output_pin) +{ + uint32_t source = 0U; + source = ((uint32_t)0x0FU) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK)); + + /* select EXTI sources */ + if(GPIO_PIN_SOURCE_4 > output_pin){ + /* select EXTI0/EXTI1/EXTI2/EXTI3 */ + AFIO_EXTISS0 &= ~source; + AFIO_EXTISS0 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else if(GPIO_PIN_SOURCE_8 > output_pin){ + /* select EXTI4/EXTI5/EXTI6/EXTI7 */ + AFIO_EXTISS1 &= ~source; + AFIO_EXTISS1 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else if(GPIO_PIN_SOURCE_12 > output_pin){ + /* select EXTI8/EXTI9/EXTI10/EXTI11 */ + AFIO_EXTISS2 &= ~source; + AFIO_EXTISS2 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else{ + /* select EXTI12/EXTI13/EXTI14/EXTI15 */ + AFIO_EXTISS3 &= ~source; + AFIO_EXTISS3 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + } +} + +/*! + \brief configure GPIO pin event output + \param[in] output_port: gpio event output port + only one parameter can be selected which are shown as below: + \arg GPIO_EVENT_PORT_GPIOA: event output port A + \arg GPIO_EVENT_PORT_GPIOB: event output port B + \arg GPIO_EVENT_PORT_GPIOC: event output port C + \arg GPIO_EVENT_PORT_GPIOD: event output port D + \arg GPIO_EVENT_PORT_GPIOE: event output port E + \param[in] output_pin: + only one parameter can be selected which are shown as below: + \arg GPIO_EVENT_PIN_x(x=0..15) + \param[out] none + \retval none +*/ +void gpio_event_output_config(uint8_t output_port, uint8_t output_pin) +{ + uint32_t reg = 0U; + reg = AFIO_EC; + + /* clear AFIO_EC_PORT and AFIO_EC_PIN bits */ + reg &= (uint32_t)(~(AFIO_EC_PORT|AFIO_EC_PIN)); + + reg |= (uint32_t)((uint32_t)output_port << GPIO_OUTPUT_PORT_OFFSET); + reg |= (uint32_t)output_pin; + + AFIO_EC = reg; +} + +/*! + \brief enable GPIO pin event output + \param[in] none + \param[out] none + \retval none +*/ +void gpio_event_output_enable(void) +{ + AFIO_EC |= AFIO_EC_EOE; +} + +/*! + \brief disable GPIO pin event output + \param[in] none + \param[out] none + \retval none +*/ +void gpio_event_output_disable(void) +{ + AFIO_EC &= (uint32_t)(~AFIO_EC_EOE); +} + +/*! + \brief lock GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_pin_lock(uint32_t gpio_periph, uint32_t pin) +{ + uint32_t lock = 0x00010000U; + lock |= pin; + + /* lock key writing sequence: write 1 -> write 0 -> write 1 -> read 0 -> read 1 */ + GPIO_LOCK(gpio_periph) = (uint32_t)lock; + GPIO_LOCK(gpio_periph) = (uint32_t)pin; + GPIO_LOCK(gpio_periph) = (uint32_t)lock; + lock = GPIO_LOCK(gpio_periph); + lock = GPIO_LOCK(gpio_periph); +} + +/*! + \brief configure the I/O compensation cell + \param[in] compensation: specifies the I/O compensation cell mode + only one parameter can be selected which are shown as below: + \arg GPIO_COMPENSATION_ENABLE: I/O compensation cell is enabled + \arg GPIO_COMPENSATION_DISABLE: I/O compensation cell is disabled + \param[out] none + \retval none +*/ +void gpio_compensation_config(uint32_t compensation) +{ + uint32_t reg; + reg = AFIO_CPSCTL; + + /* reset the AFIO_CPSCTL_CPS_EN bit and set according to gpio_compensation */ + reg &= ~AFIO_CPSCTL_CPS_EN; + AFIO_CPSCTL = (reg | compensation); +} + +/*! + \brief check the I/O compensation cell is ready or not + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET + */ +FlagStatus gpio_compensation_flag_get(void) +{ + if(((uint32_t)RESET) != (AFIO_CPSCTL & AFIO_CPSCTL_CPS_RDY)){ + return SET; + }else{ + return RESET; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c.base@1.0.0 new file mode 100644 index 0000000..233dbc5 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c.base@1.0.0 @@ -0,0 +1,538 @@ +/*! + \file gd32c10x_gpio.c + \brief GPIO driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_gpio.h" + +#define AFIO_EXTI_SOURCE_MASK ((uint8_t)0x03U) /*!< AFIO exti source selection mask*/ +#define AFIO_EXTI_SOURCE_FIELDS ((uint8_t)0x04U) /*!< select AFIO exti source registers */ +#define LSB_16BIT_MASK ((uint16_t)0xFFFFU) /*!< LSB 16-bit mask */ +#define PCF_POSITION_MASK ((uint32_t)0x000F0000U) /*!< AFIO_PCF register position mask */ +#define PCF_SWJCFG_MASK ((uint32_t)0xF8FFFFFFU) /*!< AFIO_PCF register SWJCFG mask */ +#define PCF_LOCATION1_MASK ((uint32_t)0x00200000U) /*!< AFIO_PCF register location1 mask */ +#define PCF_LOCATION2_MASK ((uint32_t)0x00100000U) /*!< AFIO_PCF register location2 mask */ +#define AFIO_PCF1_FIELDS ((uint32_t)0x80000000U) /*!< select AFIO_PCF1 register */ +#define GPIO_OUTPUT_PORT_OFFSET ((uint32_t)4U) /*!< GPIO event output port offset*/ + +/*! + \brief reset GPIO port + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[out] none + \retval none +*/ +void gpio_deinit(uint32_t gpio_periph) +{ + switch(gpio_periph){ + case GPIOA: + /* reset GPIOA */ + rcu_periph_reset_enable(RCU_GPIOARST); + rcu_periph_reset_disable(RCU_GPIOARST); + break; + case GPIOB: + /* reset GPIOB */ + rcu_periph_reset_enable(RCU_GPIOBRST); + rcu_periph_reset_disable(RCU_GPIOBRST); + break; + case GPIOC: + /* reset GPIOC */ + rcu_periph_reset_enable(RCU_GPIOCRST); + rcu_periph_reset_disable(RCU_GPIOCRST); + break; + case GPIOD: + /* reset GPIOD */ + rcu_periph_reset_enable(RCU_GPIODRST); + rcu_periph_reset_disable(RCU_GPIODRST); + break; + case GPIOE: + /* reset GPIOE */ + rcu_periph_reset_enable(RCU_GPIOERST); + rcu_periph_reset_disable(RCU_GPIOERST); + break; + default: + break; + } +} + +/*! + \brief reset alternate function I/O(AFIO) + \param[in] none + \param[out] none + \retval none +*/ +void gpio_afio_deinit(void) +{ + rcu_periph_reset_enable(RCU_AFRST); + rcu_periph_reset_disable(RCU_AFRST); +} + +/*! + \brief GPIO parameter initialization + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] mode: gpio pin mode + only one parameter can be selected which is shown as below: + \arg GPIO_MODE_AIN: analog input mode + \arg GPIO_MODE_IN_FLOATING: floating input mode + \arg GPIO_MODE_IPD: pull-down input mode + \arg GPIO_MODE_IPU: pull-up input mode + \arg GPIO_MODE_OUT_OD: GPIO output with open-drain + \arg GPIO_MODE_OUT_PP: GPIO output with push-pull + \arg GPIO_MODE_AF_OD: AFIO output with open-drain + \arg GPIO_MODE_AF_PP: AFIO output with push-pull + \param[in] speed: gpio output max speed value + only one parameter can be selected which is shown as below: + \arg GPIO_OSPEED_10MHZ: output max speed 10MHz + \arg GPIO_OSPEED_2MHZ: output max speed 2MHz + \arg GPIO_OSPEED_50MHZ: output max speed 50MHz + \arg GPIO_OSPEED_MAX: output max speed more than 50MHz + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_init(uint32_t gpio_periph, uint32_t mode, uint32_t speed, uint32_t pin) +{ + uint16_t i; + uint32_t temp_mode = 0U; + uint32_t reg = 0U; + + /* GPIO mode configuration */ + temp_mode = (uint32_t)(mode & ((uint32_t)0x0FU)); + + /* GPIO speed configuration */ + if(((uint32_t)0x00U) != ((uint32_t)mode & ((uint32_t)0x10U))){ + /* output mode max speed */ + if(GPIO_OSPEED_MAX == (uint32_t)speed){ + temp_mode |= (uint32_t)0x03U; + /* set the corresponding SPD bit */ + GPIOx_SPD(gpio_periph) |= (uint32_t)pin ; + }else{ + /* output mode max speed:10MHz,2MHz,50MHz */ + temp_mode |= (uint32_t)speed; + } + } + + /* configure the eight low port pins with GPIO_CTL0 */ + for(i = 0U;i < 8U;i++){ + if((1U << i) & pin){ + reg = GPIO_CTL0(gpio_periph); + + /* clear the specified pin mode bits */ + reg &= ~GPIO_MODE_MASK(i); + /* set the specified pin mode bits */ + reg |= GPIO_MODE_SET(i, temp_mode); + + /* set IPD or IPU */ + if(GPIO_MODE_IPD == mode){ + /* reset the corresponding OCTL bit */ + GPIO_BC(gpio_periph) = (uint32_t)((1U << i) & pin); + }else{ + /* set the corresponding OCTL bit */ + if(GPIO_MODE_IPU == mode){ + GPIO_BOP(gpio_periph) = (uint32_t)((1U << i) & pin); + } + } + /* set GPIO_CTL0 register */ + GPIO_CTL0(gpio_periph) = reg; + } + } + /* configure the eight high port pins with GPIO_CTL1 */ + for(i = 8U;i < 16U;i++){ + if((1U << i) & pin){ + reg = GPIO_CTL1(gpio_periph); + + /* clear the specified pin mode bits */ + reg &= ~GPIO_MODE_MASK(i - 8U); + /* set the specified pin mode bits */ + reg |= GPIO_MODE_SET(i - 8U, temp_mode); + + /* set IPD or IPU */ + if(GPIO_MODE_IPD == mode){ + /* reset the corresponding OCTL bit */ + GPIO_BC(gpio_periph) = (uint32_t)((1U << i) & pin); + }else{ + /* set the corresponding OCTL bit */ + if(GPIO_MODE_IPU == mode){ + GPIO_BOP(gpio_periph) = (uint32_t)((1U << i) & pin); + } + } + /* set GPIO_CTL1 register */ + GPIO_CTL1(gpio_periph) = reg; + } + } +} + +/*! + \brief set GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_bit_set(uint32_t gpio_periph, uint32_t pin) +{ + GPIO_BOP(gpio_periph) = (uint32_t)pin; +} + +/*! + \brief reset GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_bit_reset(uint32_t gpio_periph, uint32_t pin) +{ + GPIO_BC(gpio_periph) = (uint32_t)pin; +} + +/*! + \brief write data to the specified GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[in] bit_value: SET or RESET + \arg RESET: clear the port pin + \arg SET: set the port pin + \param[out] none + \retval none +*/ +void gpio_bit_write(uint32_t gpio_periph, uint32_t pin, bit_status bit_value) +{ + if(RESET != bit_value){ + GPIO_BOP(gpio_periph) = (uint32_t)pin; + }else{ + GPIO_BC(gpio_periph) = (uint32_t)pin; + } +} + +/*! + \brief write data to the specified GPIO port + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] data: specify the value to be written to the port output data register + \param[out] none + \retval none +*/ +void gpio_port_write(uint32_t gpio_periph,uint16_t data) +{ + GPIO_OCTL(gpio_periph) = (uint32_t)data; +} + +/*! + \brief get GPIO pin input status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + only one parameter can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval input status of gpio pin: SET or RESET +*/ +FlagStatus gpio_input_bit_get(uint32_t gpio_periph,uint32_t pin) +{ + if((uint32_t)RESET != (GPIO_ISTAT(gpio_periph)&(pin))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get GPIO port input status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[out] none + \retval input status of gpio all pins +*/ +uint16_t gpio_input_port_get(uint32_t gpio_periph) +{ + return (uint16_t)(GPIO_ISTAT(gpio_periph)); +} + +/*! + \brief get GPIO pin output status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + only one parameter can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval output status of gpio pin: SET or RESET +*/ +FlagStatus gpio_output_bit_get(uint32_t gpio_periph, uint32_t pin) +{ + if((uint32_t)RESET !=(GPIO_OCTL(gpio_periph)&(pin))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get GPIO port output status + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[out] none + \retval output status of gpio all pins +*/ +uint16_t gpio_output_port_get(uint32_t gpio_periph) +{ + return ((uint16_t)GPIO_OCTL(gpio_periph)); +} + +/*! + \brief configure GPIO pin remap + \param[in] gpio_remap: select the pin to remap + only one parameter can be selected which are shown as below: + \arg GPIO_SPI0_REMAP: SPI0 remapping + \arg GPIO_I2C0_REMAP: I2C0 remapping + \arg GPIO_USART0_REMAP: USART0 remapping + \arg GPIO_USART1_REMAP: USART1 remapping + \arg GPIO_USART2_PARTIAL_REMAP: USART2 partial remapping + \arg GPIO_USART2_FULL_REMAP: USART2 full remapping + \arg GPIO_TIMER0_PARTIAL_REMAP: TIMER0 partial remapping + \arg GPIO_TIMER0_FULL_REMAP: TIMER0 full remapping + \arg GPIO_TIMER1_PARTIAL_REMAP0: TIMER1 partial remapping + \arg GPIO_TIMER1_PARTIAL_REMAP1: TIMER1 partial remapping + \arg GPIO_TIMER1_FULL_REMAP: TIMER1 full remapping + \arg GPIO_TIMER2_PARTIAL_REMAP: TIMER2 partial remapping + \arg GPIO_TIMER2_FULL_REMAP: TIMER2 full remapping + \arg GPIO_TIMER3_REMAP: TIMER3 remapping + \arg GPIO_CAN0_PARTIAL_REMAP: CAN0 partial remapping + \arg GPIO_CAN0_FULL_REMAP: CAN0 full remapping + \arg GPIO_PD01_REMAP: PD01 remapping + \arg GPIO_TIMER4CH3_IREMAP: TIMER4 channel3 internal remapping + \arg GPIO_ADC0_ETRGRT_REMAP: ADC0 external trigger routine conversion remapping + \arg GPIO_ADC1_ETRGRT_REMAP: ADC1 external trigger routine conversion remapping + \arg GPIO_CAN1_REMAP: CAN1 remapping + \arg GPIO_SWJ_NONJTRST_REMAP: full SWJ(JTAG-DP + SW-DP),but without NJTRST + \arg GPIO_SWJ_SWDPENABLE_REMAP: JTAG-DP disabled and SW-DP enabled + \arg GPIO_SWJ_DISABLE_REMAP: JTAG-DP disabled and SW-DP disabled + \arg GPIO_SPI2_REMAP: SPI2 remapping + \arg GPIO_TIMER1ITI1_REMAP: TIMER1 internal trigger 1 remapping + \arg GPIO_TIMER8_REMAP: TIMER8 remapping + \arg GPIO_EXMC_NADV_REMAP: EXMC_NADV connect/disconnect + \arg GPIO_CTC_REMAP0: CTC remapping(PD15) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void gpio_pin_remap_config(uint32_t remap, ControlStatus newvalue) +{ + uint32_t remap1 = 0U, remap2 = 0U, temp_reg = 0U, temp_mask = 0U; + + if(((uint32_t)0x80000000U) == (remap & 0x80000000U)){ + /* get AFIO_PCF1 register value */ + temp_reg = AFIO_PCF1; + }else{ + /* get AFIO_PCF0 register value */ + temp_reg = AFIO_PCF0; + } + + temp_mask = (remap & PCF_POSITION_MASK) >> 0x10U; + remap1 = remap & LSB_16BIT_MASK; + + /* judge pin remap type */ + if((PCF_LOCATION1_MASK | PCF_LOCATION2_MASK) == (remap & (PCF_LOCATION1_MASK | PCF_LOCATION2_MASK))){ + temp_reg &= PCF_SWJCFG_MASK; + AFIO_PCF0 &= PCF_SWJCFG_MASK; + }else if(PCF_LOCATION2_MASK == (remap & PCF_LOCATION2_MASK)){ + remap2 = ((uint32_t)0x03U) << temp_mask; + temp_reg &= ~remap2; + temp_reg |= ~PCF_SWJCFG_MASK; + }else{ + temp_reg &= ~(remap1 << ((remap >> 0x15U)*0x10U)); + temp_reg |= ~PCF_SWJCFG_MASK; + } + + /* set pin remap value */ + if(DISABLE != newvalue){ + temp_reg |= (remap1 << ((remap >> 0x15U)*0x10U)); + } + + if(AFIO_PCF1_FIELDS == (remap & AFIO_PCF1_FIELDS)){ + /* set AFIO_PCF1 register value */ + AFIO_PCF1 = temp_reg; + }else{ + /* set AFIO_PCF0 register value */ + AFIO_PCF0 = temp_reg; + } +} + +/*! + \brief select GPIO pin exti sources + \param[in] output_port: gpio event output port + only one parameter can be selected which are shown as below: + \arg GPIO_PORT_SOURCE_GPIOA: output port source A + \arg GPIO_PORT_SOURCE_GPIOB: output port source B + \arg GPIO_PORT_SOURCE_GPIOC: output port source C + \arg GPIO_PORT_SOURCE_GPIOD: output port source D + \arg GPIO_PORT_SOURCE_GPIOE: output port source E + \param[in] output_pin: + only one parameter can be selected which are shown as below: + \arg GPIO_PIN_SOURCE_x(x=0..15) + \param[out] none + \retval none +*/ +void gpio_exti_source_select(uint8_t output_port, uint8_t output_pin) +{ + uint32_t source = 0U; + source = ((uint32_t)0x0FU) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK)); + + /* select EXTI sources */ + if(GPIO_PIN_SOURCE_4 > output_pin){ + /* select EXTI0/EXTI1/EXTI2/EXTI3 */ + AFIO_EXTISS0 &= ~source; + AFIO_EXTISS0 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else if(GPIO_PIN_SOURCE_8 > output_pin){ + /* select EXTI4/EXTI5/EXTI6/EXTI7 */ + AFIO_EXTISS1 &= ~source; + AFIO_EXTISS1 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else if(GPIO_PIN_SOURCE_12 > output_pin){ + /* select EXTI8/EXTI9/EXTI10/EXTI11 */ + AFIO_EXTISS2 &= ~source; + AFIO_EXTISS2 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + }else{ + /* select EXTI12/EXTI13/EXTI14/EXTI15 */ + AFIO_EXTISS3 &= ~source; + AFIO_EXTISS3 |= (((uint32_t)output_port) << (AFIO_EXTI_SOURCE_FIELDS * (output_pin & AFIO_EXTI_SOURCE_MASK))); + } +} + +/*! + \brief configure GPIO pin event output + \param[in] output_port: gpio event output port + only one parameter can be selected which are shown as below: + \arg GPIO_EVENT_PORT_GPIOA: event output port A + \arg GPIO_EVENT_PORT_GPIOB: event output port B + \arg GPIO_EVENT_PORT_GPIOC: event output port C + \arg GPIO_EVENT_PORT_GPIOD: event output port D + \arg GPIO_EVENT_PORT_GPIOE: event output port E + \param[in] output_pin: + only one parameter can be selected which are shown as below: + \arg GPIO_EVENT_PIN_x(x=0..15) + \param[out] none + \retval none +*/ +void gpio_event_output_config(uint8_t output_port, uint8_t output_pin) +{ + uint32_t reg = 0U; + reg = AFIO_EC; + + /* clear AFIO_EC_PORT and AFIO_EC_PIN bits */ + reg &= (uint32_t)(~(AFIO_EC_PORT|AFIO_EC_PIN)); + + reg |= (uint32_t)((uint32_t)output_port << GPIO_OUTPUT_PORT_OFFSET); + reg |= (uint32_t)output_pin; + + AFIO_EC = reg; +} + +/*! + \brief enable GPIO pin event output + \param[in] none + \param[out] none + \retval none +*/ +void gpio_event_output_enable(void) +{ + AFIO_EC |= AFIO_EC_EOE; +} + +/*! + \brief disable GPIO pin event output + \param[in] none + \param[out] none + \retval none +*/ +void gpio_event_output_disable(void) +{ + AFIO_EC &= (uint32_t)(~AFIO_EC_EOE); +} + +/*! + \brief lock GPIO pin + \param[in] gpio_periph: GPIOx(x = A,B,C,D,E) + \param[in] pin: GPIO pin + one or more parameters can be selected which are shown as below: + \arg GPIO_PIN_x(x=0..15), GPIO_PIN_ALL + \param[out] none + \retval none +*/ +void gpio_pin_lock(uint32_t gpio_periph, uint32_t pin) +{ + uint32_t lock = 0x00010000U; + lock |= pin; + + /* lock key writing sequence: write 1 -> write 0 -> write 1 -> read 0 -> read 1 */ + GPIO_LOCK(gpio_periph) = (uint32_t)lock; + GPIO_LOCK(gpio_periph) = (uint32_t)pin; + GPIO_LOCK(gpio_periph) = (uint32_t)lock; + lock = GPIO_LOCK(gpio_periph); + lock = GPIO_LOCK(gpio_periph); +} + +/*! + \brief configure the I/O compensation cell + \param[in] compensation: specifies the I/O compensation cell mode + only one parameter can be selected which are shown as below: + \arg GPIO_COMPENSATION_ENABLE: I/O compensation cell is enabled + \arg GPIO_COMPENSATION_DISABLE: I/O compensation cell is disabled + \param[out] none + \retval none +*/ +void gpio_compensation_config(uint32_t compensation) +{ + uint32_t reg; + reg = AFIO_CPSCTL; + + /* reset the AFIO_CPSCTL_CPS_EN bit and set according to gpio_compensation */ + reg &= ~AFIO_CPSCTL_CPS_EN; + AFIO_CPSCTL = (reg | compensation); +} + +/*! + \brief check the I/O compensation cell is ready or not + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET + */ +FlagStatus gpio_compensation_flag_get(void) +{ + if(((uint32_t)RESET) != (AFIO_CPSCTL & AFIO_CPSCTL_CPS_RDY)){ + return SET; + }else{ + return RESET; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_i2c.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_i2c.c new file mode 100644 index 0000000..662a67f --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_i2c.c @@ -0,0 +1,797 @@ +/*! + \file gd32c10x_i2c.c + \brief I2C driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_i2c.h" + +/* I2C register bit mask */ +#define I2CCLK_MAX ((uint32_t)0x0000003FU) /*!< i2cclk maximum value */ +#define I2CCLK_MIN ((uint32_t)0x00000002U) /*!< i2cclk minimum value */ +#define I2C_FLAG_MASK ((uint32_t)0x0000FFFFU) /*!< i2c flag mask */ +#define I2C_ADDRESS_MASK ((uint32_t)0x000003FFU) /*!< i2c address mask */ +#define I2C_ADDRESS2_MASK ((uint32_t)0x000000FEU) /*!< the second i2c address mask */ + +/* I2C register bit offset */ +#define STAT1_PECV_OFFSET ((uint32_t)0x00000008U) /*!< bit offset of PECV in I2C_STAT1 */ + +/*! + \brief reset I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_deinit(uint32_t i2c_periph) +{ + switch(i2c_periph){ + case I2C0: + /* reset I2C0 */ + rcu_periph_reset_enable(RCU_I2C0RST); + rcu_periph_reset_disable(RCU_I2C0RST); + break; + case I2C1: + /* reset I2C1 */ + rcu_periph_reset_enable(RCU_I2C1RST); + rcu_periph_reset_disable(RCU_I2C1RST); + break; + default: + break; + } +} + +/*! + \brief configure I2C clock + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] clkspeed: I2C clock speed, supports standard mode (up to 100 kHz), fast mode (up to 400 kHz) + and fast mode plus (up to 1MHz) + \param[in] dutycyc: duty cycle in fast mode or fast mode plus, and only I2C_DTCY_2 can be selected in standard mode + only one parameter can be selected which is shown as below: + \arg I2C_DTCY_2: T_low/T_high=2 + \arg I2C_DTCY_16_9: T_low/T_high=16/9 + \param[out] none + \retval none +*/ +void i2c_clock_config(uint32_t i2c_periph, uint32_t clkspeed, uint32_t dutycyc) +{ + uint32_t pclk1, clkc, freq, risetime; + uint32_t temp; + + pclk1 = rcu_clock_freq_get(CK_APB1); + /* I2C peripheral clock frequency */ + freq = (uint32_t)(pclk1 / 1000000U); + if(freq >= I2CCLK_MAX) { + freq = I2CCLK_MAX; + } + temp = I2C_CTL1(i2c_periph); + temp &= ~I2C_CTL1_I2CCLK; + temp |= freq; + + I2C_CTL1(i2c_periph) = temp; + + if(100000U >= clkspeed) { + /* the maximum SCL rise time is 1000ns in standard mode */ + risetime = (uint32_t)((pclk1 / 1000000U) + 1U); + if(risetime >= I2CCLK_MAX) { + I2C_RT(i2c_periph) = I2CCLK_MAX; + } else if(risetime <= I2CCLK_MIN) { + I2C_RT(i2c_periph) = I2CCLK_MIN; + }else{ + I2C_RT(i2c_periph) = risetime; + } + clkc = (uint32_t)(pclk1 / (clkspeed * 2U)); + if(clkc < 0x04U) { + /* the CLKC in standard mode minimum value is 4 */ + clkc = 0x04U; + } + + I2C_CKCFG(i2c_periph) |= (I2C_CKCFG_CLKC & clkc); + } else if(400000U >= clkspeed) { + /* the maximum SCL rise time is 300ns in fast mode */ + I2C_RT(i2c_periph) = (uint32_t)(((freq * (uint32_t)300U) / (uint32_t)1000U) + (uint32_t)1U); + if(I2C_DTCY_2 == dutycyc) { + /* I2C duty cycle is 2 */ + clkc = (uint32_t)(pclk1 / (clkspeed * 3U)); + I2C_CKCFG(i2c_periph) &= ~I2C_CKCFG_DTCY; + } else { + /* I2C duty cycle is 16/9 */ + clkc = (uint32_t)(pclk1 / (clkspeed * 25U)); + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_DTCY; + } + if(0U == (clkc & I2C_CKCFG_CLKC)) { + /* the CLKC in fast mode minimum value is 1 */ + clkc |= 0x0001U; + } + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_FAST; + I2C_CKCFG(i2c_periph) |= clkc; + }else{ + /* fast mode plus, the maximum SCL rise time is 120ns */ + I2C_RT(i2c_periph) = (uint32_t)(((freq*(uint32_t)120U)/(uint32_t)1000U)+(uint32_t)1U); + if(I2C_DTCY_2 == dutycyc){ + /* I2C duty cycle is 2 */ + clkc = (uint32_t)(pclk1/(clkspeed*3U)); + I2C_CKCFG(i2c_periph) &= ~I2C_CKCFG_DTCY; + }else{ + /* I2C duty cycle is 16/9 */ + clkc = (uint32_t)(pclk1/(clkspeed*25U)); + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_DTCY; + } + /* enable fast mode */ + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_FAST; + I2C_CKCFG(i2c_periph) |= clkc; + /* enable I2C fast mode plus */ + I2C_FMPCFG(i2c_periph) = I2C_FMPCFG_FMPEN; + } +} + +/*! + \brief configure I2C address + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] mode: + only one parameter can be selected which is shown as below: + \arg I2C_I2CMODE_ENABLE: I2C mode + \arg I2C_SMBUSMODE_ENABLE: SMBus mode + \param[in] addformat: 7bits or 10bits + only one parameter can be selected which is shown as below: + \arg I2C_ADDFORMAT_7BITS: address format is 7 bits + \arg I2C_ADDFORMAT_10BITS: address format is 10 bits + \param[in] addr: I2C address + \param[out] none + \retval none +*/ +void i2c_mode_addr_config(uint32_t i2c_periph, uint32_t mode, uint32_t addformat, uint32_t addr) +{ + /* SMBus/I2C mode selected */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SMBEN); + ctl |= mode; + I2C_CTL0(i2c_periph) = ctl; + /* configure address */ + addr = addr & I2C_ADDRESS_MASK; + I2C_SADDR0(i2c_periph) = (addformat | addr); +} + +/*! + \brief select SMBus type + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] type: + only one parameter can be selected which is shown as below: + \arg I2C_SMBUS_DEVICE: SMBus mode device type + \arg I2C_SMBUS_HOST: SMBus mode host type + \param[out] none + \retval none +*/ +void i2c_smbus_type_config(uint32_t i2c_periph, uint32_t type) +{ + if(I2C_SMBUS_HOST == type){ + I2C_CTL0(i2c_periph) |= I2C_CTL0_SMBSEL; + }else{ + I2C_CTL0(i2c_periph) &= ~(I2C_CTL0_SMBSEL); + } +} + +/*! + \brief whether or not to send an ACK + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] ack: + only one parameter can be selected which is shown as below: + \arg I2C_ACK_ENABLE: ACK will be sent + \arg I2C_ACK_DISABLE: ACK will not be sent + \param[out] none + \retval none +*/ +void i2c_ack_config(uint32_t i2c_periph, uint32_t ack) +{ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_ACKEN); + ctl |= ack; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C POAP position + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pos: + only one parameter can be selected which is shown as below: + \arg I2C_ACKPOS_CURRENT: ACKEN bit decides whether or not to send ACK or not for the current byte + \arg I2C_ACKPOS_NEXT: ACKEN bit decides whether or not to send ACK for the next byte + \param[out] none + \retval none +*/ +void i2c_ackpos_config(uint32_t i2c_periph, uint32_t pos) +{ + uint32_t ctl = 0U; + + /* configure I2C POAP position */ + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_POAP); + ctl |= pos; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief master sends slave address + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] addr: slave address + \param[in] trandirection: transmitter or receiver + only one parameter can be selected which is shown as below: + \arg I2C_TRANSMITTER: transmitter + \arg I2C_RECEIVER: receiver + \param[out] none + \retval none +*/ +void i2c_master_addressing(uint32_t i2c_periph, uint32_t addr, uint32_t trandirection) +{ + /* master is a transmitter or a receiver */ + if(I2C_TRANSMITTER == trandirection){ + addr = addr & I2C_TRANSMITTER; + }else{ + addr = addr | I2C_RECEIVER; + } + /* send slave address */ + I2C_DATA(i2c_periph) = addr; +} + +/*! + \brief enable dual-address mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] addr: the second address in dual-address mode + \param[out] none + \retval none +*/ +void i2c_dualaddr_enable(uint32_t i2c_periph, uint32_t addr) +{ + /* configure address */ + addr = addr & I2C_ADDRESS2_MASK; + I2C_SADDR1(i2c_periph) = (I2C_SADDR1_DUADEN | addr); +} + +/*! + \brief disable dual-address mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_dualaddr_disable(uint32_t i2c_periph) +{ + I2C_SADDR1(i2c_periph) &= ~(I2C_SADDR1_DUADEN); +} + +/*! + \brief enable I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_enable(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_I2CEN; +} + +/*! + \brief disable I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_disable(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) &= ~(I2C_CTL0_I2CEN); +} + +/*! + \brief generate a START condition on I2C bus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_start_on_bus(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_START; +} + +/*! + \brief generate a STOP condition on I2C bus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_stop_on_bus(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_STOP; +} + +/*! + \brief I2C transmit data function + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] data: data of transmission + \param[out] none + \retval none +*/ +void i2c_data_transmit(uint32_t i2c_periph, uint8_t data) +{ + I2C_DATA(i2c_periph) = DATA_TRANS(data); +} + +/*! + \brief I2C receive data function + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval data of received +*/ +uint8_t i2c_data_receive(uint32_t i2c_periph) +{ + return (uint8_t)DATA_RECV(I2C_DATA(i2c_periph)); +} + +/*! + \brief configure I2C DMA mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] dmastate: + only one parameter can be selected which is shown as below: + \arg I2C_DMA_ON: enable DMA mode + \arg I2C_DMA_OFF: disable DMA mode + \param[out] none + \retval none +*/ +void i2c_dma_config(uint32_t i2c_periph, uint32_t dmastate) +{ + /* configure I2C DMA function */ + uint32_t ctl = 0U; + + ctl = I2C_CTL1(i2c_periph); + ctl &= ~(I2C_CTL1_DMAON); + ctl |= dmastate; + I2C_CTL1(i2c_periph) = ctl; +} + +/*! + \brief configure whether next DMA EOT is DMA last transfer or not + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] dmalast: + only one parameter can be selected which is shown as below: + \arg I2C_DMALST_ON: next DMA EOT is the last transfer + \arg I2C_DMALST_OFF: next DMA EOT is not the last transfer + \param[out] none + \retval none +*/ +void i2c_dma_last_transfer_config(uint32_t i2c_periph, uint32_t dmalast) +{ + /* configure DMA last transfer */ + uint32_t ctl = 0U; + + ctl = I2C_CTL1(i2c_periph); + ctl &= ~(I2C_CTL1_DMALST); + ctl |= dmalast; + I2C_CTL1(i2c_periph) = ctl; +} + +/*! + \brief whether to stretch SCL low when data is not ready in slave mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] stretchpara: + only one parameter can be selected which is shown as below: + \arg I2C_SCLSTRETCH_ENABLE: enable SCL stretching + \arg I2C_SCLSTRETCH_DISABLE: disable SCL stretching + \param[out] none + \retval none +*/ +void i2c_stretch_scl_low_config(uint32_t i2c_periph, uint32_t stretchpara) +{ + /* configure I2C SCL stretching */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SS); + ctl |= stretchpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief whether or not to response to a general call + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] gcallpara: + only one parameter can be selected which is shown as below: + \arg I2C_GCEN_ENABLE: slave will response to a general call + \arg I2C_GCEN_DISABLE: slave will not response to a general call + \param[out] none + \retval none +*/ +void i2c_slave_response_to_gcall_config(uint32_t i2c_periph, uint32_t gcallpara) +{ + /* configure slave response to a general call enable or disable */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_GCEN); + ctl |= gcallpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure software reset of I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] sreset: + only one parameter can be selected which is shown as below: + \arg I2C_SRESET_SET: I2C is under reset + \arg I2C_SRESET_RESET: I2C is not under reset + \param[out] none + \retval none +*/ +void i2c_software_reset_config(uint32_t i2c_periph, uint32_t sreset) +{ + /* modify CTL0 and configure software reset I2C state */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SRESET); + ctl |= sreset; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C PEC calculation + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pecstate: + only one parameter can be selected which is shown as below: + \arg I2C_PEC_ENABLE: PEC calculation on + \arg I2C_PEC_DISABLE: PEC calculation off + \param[out] none + \retval none +*/ +void i2c_pec_config(uint32_t i2c_periph, uint32_t pecstate) +{ + /* on/off PEC calculation */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_PECEN); + ctl |= pecstate; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure whether to transfer PEC value + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pecpara: + only one parameter can be selected which is shown as below: + \arg I2C_PECTRANS_ENABLE: transfer PEC value + \arg I2C_PECTRANS_DISABLE: not transfer PEC value + \param[out] none + \retval none +*/ +void i2c_pec_transfer_config(uint32_t i2c_periph, uint32_t pecpara) +{ + /* whether to transfer PEC */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_PECTRANS); + ctl |= pecpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief get packet error checking value + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval PEC value +*/ +uint8_t i2c_pec_value_get(uint32_t i2c_periph) +{ + return (uint8_t)((I2C_STAT1(i2c_periph) & I2C_STAT1_PECV) >> STAT1_PECV_OFFSET); +} + +/*! + \brief configure I2C alert through SMBA pin + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] smbuspara: + only one parameter can be selected which is shown as below: + \arg I2C_SALTSEND_ENABLE: issue alert through SMBA pin + \arg I2C_SALTSEND_DISABLE: not issue alert through SMBA pin + \param[out] none + \retval none +*/ +void i2c_smbus_alert_config(uint32_t i2c_periph, uint32_t smbuspara) +{ + /* configure smbus alert through SMBA pin */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SALT); + ctl |= smbuspara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C ARP protocol in SMBus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] arpstate: + only one parameter can be selected which is shown as below: + \arg I2C_ARP_ENABLE: enable ARP + \arg I2C_ARP_DISABLE: disable ARP + \param[out] none + \retval none +*/ +void i2c_smbus_arp_config(uint32_t i2c_periph, uint32_t arpstate) +{ + /* enable or disable I2C ARP protocol*/ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_ARPEN); + ctl |= arpstate; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief enable SAM_V interface + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_enable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) |= I2C_SAMCS_SAMEN; +} + +/*! + \brief disable SAM_V interface + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_disable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) &= ~(I2C_SAMCS_SAMEN); +} + +/*! + \brief enable SAM_V interface timeout detect + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_timeout_enable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) |= I2C_SAMCS_STOEN; +} + +/*! + \brief disable SAM_V interface timeout detect + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_timeout_disable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) &= ~(I2C_SAMCS_STOEN); +} + +/*! + \brief check I2C flag is set or not + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] flag: I2C flags, refer to i2c_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_FLAG_SBSEND: start condition sent out in master mode + \arg I2C_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode + \arg I2C_FLAG_BTC: byte transmission finishes + \arg I2C_FLAG_ADD10SEND: header of 10-bit address is sent in master mode + \arg I2C_FLAG_STPDET: stop condition detected in slave mode + \arg I2C_FLAG_RBNE: I2C_DATA is not empty during receiving + \arg I2C_FLAG_TBE: I2C_DATA is empty during transmitting + \arg I2C_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus + \arg I2C_FLAG_LOSTARB: arbitration lost in master mode + \arg I2C_FLAG_AERR: acknowledge error + \arg I2C_FLAG_OUERR: over-run or under-run situation occurs in slave mode + \arg I2C_FLAG_PECERR: PEC error when receiving data + \arg I2C_FLAG_SMBTO: timeout signal in SMBus mode + \arg I2C_FLAG_SMBALT: SMBus alert status + \arg I2C_FLAG_MASTER: a flag indicating whether I2C block is in master or slave mode + \arg I2C_FLAG_I2CBSY: busy flag + \arg I2C_FLAG_TR: whether the I2C is a transmitter or a receiver + \arg I2C_FLAG_RXGC: general call address (00h) received + \arg I2C_FLAG_DEFSMB: default address of SMBus device + \arg I2C_FLAG_HSTSMB: SMBus host header detected in slave mode + \arg I2C_FLAG_DUMOD: dual flag in slave mode indicating which address is matched in dual-address mode + \arg I2C_FLAG_TFF: txframe fall flag + \arg I2C_FLAG_TFR: txframe rise flag + \arg I2C_FLAG_RFF: rxframe fall flag + \arg I2C_FLAG_RFR: rxframe rise flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus i2c_flag_get(uint32_t i2c_periph, i2c_flag_enum flag) +{ + if(RESET != (I2C_REG_VAL(i2c_periph, flag) & BIT(I2C_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear I2C flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] flag: I2C flags, refer to i2c_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_FLAG_SMBALT: SMBus alert status + \arg I2C_FLAG_SMBTO: timeout signal in SMBus mode + \arg I2C_FLAG_PECERR: PEC error when receiving data + \arg I2C_FLAG_OUERR: over-run or under-run situation occurs in slave mode + \arg I2C_FLAG_AERR: acknowledge error + \arg I2C_FLAG_LOSTARB: arbitration lost in master mode + \arg I2C_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus + \arg I2C_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode + \arg I2C_FLAG_TFF: txframe fall flag + \arg I2C_FLAG_TFR: txframe rise flag + \arg I2C_FLAG_RFF: rxframe fall flag + \arg I2C_FLAG_RFR: rxframe rise flag + \param[out] none + \retval none +*/ +void i2c_flag_clear(uint32_t i2c_periph, i2c_flag_enum flag) +{ + if(I2C_FLAG_ADDSEND == flag){ + /* read I2C_STAT0 and then read I2C_STAT1 to clear ADDSEND */ + I2C_STAT0(i2c_periph); + I2C_STAT1(i2c_periph); + }else{ + I2C_REG_VAL(i2c_periph, flag) &= ~BIT(I2C_BIT_POS(flag)); + } +} + +/*! + \brief enable I2C interrupt + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] interrupt: I2C interrupts, refer to i2c_interrupt_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_ERR: error interrupt + \arg I2C_INT_EV: event interrupt + \arg I2C_INT_BUF: buffer interrupt + \arg I2C_INT_TFF: txframe fall interrupt + \arg I2C_INT_TFR: txframe rise interrupt + \arg I2C_INT_RFF: rxframe fall interrupt + \arg I2C_INT_RFR: rxframe rise interrupt + \param[out] none + \retval none +*/ +void i2c_interrupt_enable(uint32_t i2c_periph, i2c_interrupt_enum interrupt) +{ + I2C_REG_VAL(i2c_periph, interrupt) |= BIT(I2C_BIT_POS(interrupt)); +} + +/*! + \brief disable I2C interrupt + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] interrupt: I2C interrupts, refer to i2c_interrupt_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_ERR: error interrupt + \arg I2C_INT_EV: event interrupt + \arg I2C_INT_BUF: buffer interrupt + \arg I2C_INT_TFF: txframe fall interrupt + \arg I2C_INT_TFR: txframe rise interrupt + \arg I2C_INT_RFF: rxframe fall interrupt + \arg I2C_INT_RFR: rxframe rise interrupt + \param[out] none + \retval none +*/ +void i2c_interrupt_disable(uint32_t i2c_periph, i2c_interrupt_enum interrupt) +{ + I2C_REG_VAL(i2c_periph, interrupt) &= ~BIT(I2C_BIT_POS(interrupt)); +} + +/*! + \brief get I2C interrupt flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] int_flag: I2C interrupt flags, refer to i2c_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_FLAG_SBSEND: start condition sent out in master mode interrupt flag + \arg I2C_INT_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode interrupt flag + \arg I2C_INT_FLAG_BTC: byte transmission finishes interrupt flag + \arg I2C_INT_FLAG_ADD10SEND: header of 10-bit address is sent in master mode interrupt flag + \arg I2C_INT_FLAG_STPDET: stop condition detected in slave mode interrupt flag + \arg I2C_INT_FLAG_RBNE: I2C_DATA is not Empty during receiving interrupt flag + \arg I2C_INT_FLAG_TBE: I2C_DATA is empty during transmitting interrupt flag + \arg I2C_INT_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus interrupt flag + \arg I2C_INT_FLAG_LOSTARB: arbitration lost in master mode interrupt flag + \arg I2C_INT_FLAG_AERR: acknowledge error interrupt flag + \arg I2C_INT_FLAG_OUERR: over-run or under-run situation occurs in slave mode interrupt flag + \arg I2C_INT_FLAG_PECERR: PEC error when receiving data interrupt flag + \arg I2C_INT_FLAG_SMBTO: timeout signal in SMBus mode interrupt flag + \arg I2C_INT_FLAG_SMBALT: SMBus alert status interrupt flag + \arg I2C_INT_FLAG_TFF: txframe fall interrupt flag + \arg I2C_INT_FLAG_TFR: txframe rise interrupt flag + \arg I2C_INT_FLAG_RFF: rxframe fall interrupt flag + \arg I2C_INT_FLAG_RFR: rxframe rise interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus i2c_interrupt_flag_get(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U, bufie; + + /* check BUFIE */ + bufie = I2C_CTL1(i2c_periph)&I2C_CTL1_BUFIE; + + /* get the interrupt enable bit status */ + intenable = (I2C_REG_VAL(i2c_periph, int_flag) & BIT(I2C_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (I2C_REG_VAL2(i2c_periph, int_flag) & BIT(I2C_BIT_POS2(int_flag))); + + if((I2C_INT_FLAG_RBNE == int_flag) || (I2C_INT_FLAG_TBE == int_flag)){ + if(intenable && bufie){ + intenable = 1U; + }else{ + intenable = 0U; + } + } + if((0U != flagstatus) && (0U != intenable)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear I2C interrupt flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] int_flag: I2C interrupt flags, refer to i2c_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode interrupt flag + \arg I2C_INT_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus interrupt flag + \arg I2C_INT_FLAG_LOSTARB: arbitration lost in master mode interrupt flag + \arg I2C_INT_FLAG_AERR: acknowledge error interrupt flag + \arg I2C_INT_FLAG_OUERR: over-run or under-run situation occurs in slave mode interrupt flag + \arg I2C_INT_FLAG_PECERR: PEC error when receiving data interrupt flag + \arg I2C_INT_FLAG_SMBTO: timeout signal in SMBus mode interrupt flag + \arg I2C_INT_FLAG_SMBALT: SMBus alert status interrupt flag + \arg I2C_INT_FLAG_TFF: txframe fall interrupt flag + \arg I2C_INT_FLAG_TFR: txframe rise interrupt flag + \arg I2C_INT_FLAG_RFF: rxframe fall interrupt flag + \arg I2C_INT_FLAG_RFR: rxframe rise interrupt flag + \param[out] none + \retval none +*/ +void i2c_interrupt_flag_clear(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag) +{ + if(I2C_INT_FLAG_ADDSEND == int_flag){ + /* read I2C_STAT0 and then read I2C_STAT1 to clear ADDSEND */ + I2C_STAT0(i2c_periph); + I2C_STAT1(i2c_periph); + }else{ + I2C_REG_VAL2(i2c_periph, int_flag) &= ~BIT(I2C_BIT_POS2(int_flag)); + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_i2c.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_i2c.c.base@1.0.0 new file mode 100644 index 0000000..662a67f --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_i2c.c.base@1.0.0 @@ -0,0 +1,797 @@ +/*! + \file gd32c10x_i2c.c + \brief I2C driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_i2c.h" + +/* I2C register bit mask */ +#define I2CCLK_MAX ((uint32_t)0x0000003FU) /*!< i2cclk maximum value */ +#define I2CCLK_MIN ((uint32_t)0x00000002U) /*!< i2cclk minimum value */ +#define I2C_FLAG_MASK ((uint32_t)0x0000FFFFU) /*!< i2c flag mask */ +#define I2C_ADDRESS_MASK ((uint32_t)0x000003FFU) /*!< i2c address mask */ +#define I2C_ADDRESS2_MASK ((uint32_t)0x000000FEU) /*!< the second i2c address mask */ + +/* I2C register bit offset */ +#define STAT1_PECV_OFFSET ((uint32_t)0x00000008U) /*!< bit offset of PECV in I2C_STAT1 */ + +/*! + \brief reset I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_deinit(uint32_t i2c_periph) +{ + switch(i2c_periph){ + case I2C0: + /* reset I2C0 */ + rcu_periph_reset_enable(RCU_I2C0RST); + rcu_periph_reset_disable(RCU_I2C0RST); + break; + case I2C1: + /* reset I2C1 */ + rcu_periph_reset_enable(RCU_I2C1RST); + rcu_periph_reset_disable(RCU_I2C1RST); + break; + default: + break; + } +} + +/*! + \brief configure I2C clock + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] clkspeed: I2C clock speed, supports standard mode (up to 100 kHz), fast mode (up to 400 kHz) + and fast mode plus (up to 1MHz) + \param[in] dutycyc: duty cycle in fast mode or fast mode plus, and only I2C_DTCY_2 can be selected in standard mode + only one parameter can be selected which is shown as below: + \arg I2C_DTCY_2: T_low/T_high=2 + \arg I2C_DTCY_16_9: T_low/T_high=16/9 + \param[out] none + \retval none +*/ +void i2c_clock_config(uint32_t i2c_periph, uint32_t clkspeed, uint32_t dutycyc) +{ + uint32_t pclk1, clkc, freq, risetime; + uint32_t temp; + + pclk1 = rcu_clock_freq_get(CK_APB1); + /* I2C peripheral clock frequency */ + freq = (uint32_t)(pclk1 / 1000000U); + if(freq >= I2CCLK_MAX) { + freq = I2CCLK_MAX; + } + temp = I2C_CTL1(i2c_periph); + temp &= ~I2C_CTL1_I2CCLK; + temp |= freq; + + I2C_CTL1(i2c_periph) = temp; + + if(100000U >= clkspeed) { + /* the maximum SCL rise time is 1000ns in standard mode */ + risetime = (uint32_t)((pclk1 / 1000000U) + 1U); + if(risetime >= I2CCLK_MAX) { + I2C_RT(i2c_periph) = I2CCLK_MAX; + } else if(risetime <= I2CCLK_MIN) { + I2C_RT(i2c_periph) = I2CCLK_MIN; + }else{ + I2C_RT(i2c_periph) = risetime; + } + clkc = (uint32_t)(pclk1 / (clkspeed * 2U)); + if(clkc < 0x04U) { + /* the CLKC in standard mode minimum value is 4 */ + clkc = 0x04U; + } + + I2C_CKCFG(i2c_periph) |= (I2C_CKCFG_CLKC & clkc); + } else if(400000U >= clkspeed) { + /* the maximum SCL rise time is 300ns in fast mode */ + I2C_RT(i2c_periph) = (uint32_t)(((freq * (uint32_t)300U) / (uint32_t)1000U) + (uint32_t)1U); + if(I2C_DTCY_2 == dutycyc) { + /* I2C duty cycle is 2 */ + clkc = (uint32_t)(pclk1 / (clkspeed * 3U)); + I2C_CKCFG(i2c_periph) &= ~I2C_CKCFG_DTCY; + } else { + /* I2C duty cycle is 16/9 */ + clkc = (uint32_t)(pclk1 / (clkspeed * 25U)); + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_DTCY; + } + if(0U == (clkc & I2C_CKCFG_CLKC)) { + /* the CLKC in fast mode minimum value is 1 */ + clkc |= 0x0001U; + } + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_FAST; + I2C_CKCFG(i2c_periph) |= clkc; + }else{ + /* fast mode plus, the maximum SCL rise time is 120ns */ + I2C_RT(i2c_periph) = (uint32_t)(((freq*(uint32_t)120U)/(uint32_t)1000U)+(uint32_t)1U); + if(I2C_DTCY_2 == dutycyc){ + /* I2C duty cycle is 2 */ + clkc = (uint32_t)(pclk1/(clkspeed*3U)); + I2C_CKCFG(i2c_periph) &= ~I2C_CKCFG_DTCY; + }else{ + /* I2C duty cycle is 16/9 */ + clkc = (uint32_t)(pclk1/(clkspeed*25U)); + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_DTCY; + } + /* enable fast mode */ + I2C_CKCFG(i2c_periph) |= I2C_CKCFG_FAST; + I2C_CKCFG(i2c_periph) |= clkc; + /* enable I2C fast mode plus */ + I2C_FMPCFG(i2c_periph) = I2C_FMPCFG_FMPEN; + } +} + +/*! + \brief configure I2C address + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] mode: + only one parameter can be selected which is shown as below: + \arg I2C_I2CMODE_ENABLE: I2C mode + \arg I2C_SMBUSMODE_ENABLE: SMBus mode + \param[in] addformat: 7bits or 10bits + only one parameter can be selected which is shown as below: + \arg I2C_ADDFORMAT_7BITS: address format is 7 bits + \arg I2C_ADDFORMAT_10BITS: address format is 10 bits + \param[in] addr: I2C address + \param[out] none + \retval none +*/ +void i2c_mode_addr_config(uint32_t i2c_periph, uint32_t mode, uint32_t addformat, uint32_t addr) +{ + /* SMBus/I2C mode selected */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SMBEN); + ctl |= mode; + I2C_CTL0(i2c_periph) = ctl; + /* configure address */ + addr = addr & I2C_ADDRESS_MASK; + I2C_SADDR0(i2c_periph) = (addformat | addr); +} + +/*! + \brief select SMBus type + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] type: + only one parameter can be selected which is shown as below: + \arg I2C_SMBUS_DEVICE: SMBus mode device type + \arg I2C_SMBUS_HOST: SMBus mode host type + \param[out] none + \retval none +*/ +void i2c_smbus_type_config(uint32_t i2c_periph, uint32_t type) +{ + if(I2C_SMBUS_HOST == type){ + I2C_CTL0(i2c_periph) |= I2C_CTL0_SMBSEL; + }else{ + I2C_CTL0(i2c_periph) &= ~(I2C_CTL0_SMBSEL); + } +} + +/*! + \brief whether or not to send an ACK + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] ack: + only one parameter can be selected which is shown as below: + \arg I2C_ACK_ENABLE: ACK will be sent + \arg I2C_ACK_DISABLE: ACK will not be sent + \param[out] none + \retval none +*/ +void i2c_ack_config(uint32_t i2c_periph, uint32_t ack) +{ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_ACKEN); + ctl |= ack; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C POAP position + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pos: + only one parameter can be selected which is shown as below: + \arg I2C_ACKPOS_CURRENT: ACKEN bit decides whether or not to send ACK or not for the current byte + \arg I2C_ACKPOS_NEXT: ACKEN bit decides whether or not to send ACK for the next byte + \param[out] none + \retval none +*/ +void i2c_ackpos_config(uint32_t i2c_periph, uint32_t pos) +{ + uint32_t ctl = 0U; + + /* configure I2C POAP position */ + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_POAP); + ctl |= pos; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief master sends slave address + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] addr: slave address + \param[in] trandirection: transmitter or receiver + only one parameter can be selected which is shown as below: + \arg I2C_TRANSMITTER: transmitter + \arg I2C_RECEIVER: receiver + \param[out] none + \retval none +*/ +void i2c_master_addressing(uint32_t i2c_periph, uint32_t addr, uint32_t trandirection) +{ + /* master is a transmitter or a receiver */ + if(I2C_TRANSMITTER == trandirection){ + addr = addr & I2C_TRANSMITTER; + }else{ + addr = addr | I2C_RECEIVER; + } + /* send slave address */ + I2C_DATA(i2c_periph) = addr; +} + +/*! + \brief enable dual-address mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] addr: the second address in dual-address mode + \param[out] none + \retval none +*/ +void i2c_dualaddr_enable(uint32_t i2c_periph, uint32_t addr) +{ + /* configure address */ + addr = addr & I2C_ADDRESS2_MASK; + I2C_SADDR1(i2c_periph) = (I2C_SADDR1_DUADEN | addr); +} + +/*! + \brief disable dual-address mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_dualaddr_disable(uint32_t i2c_periph) +{ + I2C_SADDR1(i2c_periph) &= ~(I2C_SADDR1_DUADEN); +} + +/*! + \brief enable I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_enable(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_I2CEN; +} + +/*! + \brief disable I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_disable(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) &= ~(I2C_CTL0_I2CEN); +} + +/*! + \brief generate a START condition on I2C bus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_start_on_bus(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_START; +} + +/*! + \brief generate a STOP condition on I2C bus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_stop_on_bus(uint32_t i2c_periph) +{ + I2C_CTL0(i2c_periph) |= I2C_CTL0_STOP; +} + +/*! + \brief I2C transmit data function + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] data: data of transmission + \param[out] none + \retval none +*/ +void i2c_data_transmit(uint32_t i2c_periph, uint8_t data) +{ + I2C_DATA(i2c_periph) = DATA_TRANS(data); +} + +/*! + \brief I2C receive data function + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval data of received +*/ +uint8_t i2c_data_receive(uint32_t i2c_periph) +{ + return (uint8_t)DATA_RECV(I2C_DATA(i2c_periph)); +} + +/*! + \brief configure I2C DMA mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] dmastate: + only one parameter can be selected which is shown as below: + \arg I2C_DMA_ON: enable DMA mode + \arg I2C_DMA_OFF: disable DMA mode + \param[out] none + \retval none +*/ +void i2c_dma_config(uint32_t i2c_periph, uint32_t dmastate) +{ + /* configure I2C DMA function */ + uint32_t ctl = 0U; + + ctl = I2C_CTL1(i2c_periph); + ctl &= ~(I2C_CTL1_DMAON); + ctl |= dmastate; + I2C_CTL1(i2c_periph) = ctl; +} + +/*! + \brief configure whether next DMA EOT is DMA last transfer or not + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] dmalast: + only one parameter can be selected which is shown as below: + \arg I2C_DMALST_ON: next DMA EOT is the last transfer + \arg I2C_DMALST_OFF: next DMA EOT is not the last transfer + \param[out] none + \retval none +*/ +void i2c_dma_last_transfer_config(uint32_t i2c_periph, uint32_t dmalast) +{ + /* configure DMA last transfer */ + uint32_t ctl = 0U; + + ctl = I2C_CTL1(i2c_periph); + ctl &= ~(I2C_CTL1_DMALST); + ctl |= dmalast; + I2C_CTL1(i2c_periph) = ctl; +} + +/*! + \brief whether to stretch SCL low when data is not ready in slave mode + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] stretchpara: + only one parameter can be selected which is shown as below: + \arg I2C_SCLSTRETCH_ENABLE: enable SCL stretching + \arg I2C_SCLSTRETCH_DISABLE: disable SCL stretching + \param[out] none + \retval none +*/ +void i2c_stretch_scl_low_config(uint32_t i2c_periph, uint32_t stretchpara) +{ + /* configure I2C SCL stretching */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SS); + ctl |= stretchpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief whether or not to response to a general call + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] gcallpara: + only one parameter can be selected which is shown as below: + \arg I2C_GCEN_ENABLE: slave will response to a general call + \arg I2C_GCEN_DISABLE: slave will not response to a general call + \param[out] none + \retval none +*/ +void i2c_slave_response_to_gcall_config(uint32_t i2c_periph, uint32_t gcallpara) +{ + /* configure slave response to a general call enable or disable */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_GCEN); + ctl |= gcallpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure software reset of I2C + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] sreset: + only one parameter can be selected which is shown as below: + \arg I2C_SRESET_SET: I2C is under reset + \arg I2C_SRESET_RESET: I2C is not under reset + \param[out] none + \retval none +*/ +void i2c_software_reset_config(uint32_t i2c_periph, uint32_t sreset) +{ + /* modify CTL0 and configure software reset I2C state */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SRESET); + ctl |= sreset; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C PEC calculation + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pecstate: + only one parameter can be selected which is shown as below: + \arg I2C_PEC_ENABLE: PEC calculation on + \arg I2C_PEC_DISABLE: PEC calculation off + \param[out] none + \retval none +*/ +void i2c_pec_config(uint32_t i2c_periph, uint32_t pecstate) +{ + /* on/off PEC calculation */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_PECEN); + ctl |= pecstate; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure whether to transfer PEC value + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] pecpara: + only one parameter can be selected which is shown as below: + \arg I2C_PECTRANS_ENABLE: transfer PEC value + \arg I2C_PECTRANS_DISABLE: not transfer PEC value + \param[out] none + \retval none +*/ +void i2c_pec_transfer_config(uint32_t i2c_periph, uint32_t pecpara) +{ + /* whether to transfer PEC */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_PECTRANS); + ctl |= pecpara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief get packet error checking value + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval PEC value +*/ +uint8_t i2c_pec_value_get(uint32_t i2c_periph) +{ + return (uint8_t)((I2C_STAT1(i2c_periph) & I2C_STAT1_PECV) >> STAT1_PECV_OFFSET); +} + +/*! + \brief configure I2C alert through SMBA pin + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] smbuspara: + only one parameter can be selected which is shown as below: + \arg I2C_SALTSEND_ENABLE: issue alert through SMBA pin + \arg I2C_SALTSEND_DISABLE: not issue alert through SMBA pin + \param[out] none + \retval none +*/ +void i2c_smbus_alert_config(uint32_t i2c_periph, uint32_t smbuspara) +{ + /* configure smbus alert through SMBA pin */ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_SALT); + ctl |= smbuspara; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief configure I2C ARP protocol in SMBus + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] arpstate: + only one parameter can be selected which is shown as below: + \arg I2C_ARP_ENABLE: enable ARP + \arg I2C_ARP_DISABLE: disable ARP + \param[out] none + \retval none +*/ +void i2c_smbus_arp_config(uint32_t i2c_periph, uint32_t arpstate) +{ + /* enable or disable I2C ARP protocol*/ + uint32_t ctl = 0U; + + ctl = I2C_CTL0(i2c_periph); + ctl &= ~(I2C_CTL0_ARPEN); + ctl |= arpstate; + I2C_CTL0(i2c_periph) = ctl; +} + +/*! + \brief enable SAM_V interface + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_enable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) |= I2C_SAMCS_SAMEN; +} + +/*! + \brief disable SAM_V interface + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_disable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) &= ~(I2C_SAMCS_SAMEN); +} + +/*! + \brief enable SAM_V interface timeout detect + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_timeout_enable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) |= I2C_SAMCS_STOEN; +} + +/*! + \brief disable SAM_V interface timeout detect + \param[in] i2c_periph: I2Cx(x=0,1) + \param[out] none + \retval none +*/ +void i2c_sam_timeout_disable(uint32_t i2c_periph) +{ + I2C_SAMCS(i2c_periph) &= ~(I2C_SAMCS_STOEN); +} + +/*! + \brief check I2C flag is set or not + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] flag: I2C flags, refer to i2c_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_FLAG_SBSEND: start condition sent out in master mode + \arg I2C_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode + \arg I2C_FLAG_BTC: byte transmission finishes + \arg I2C_FLAG_ADD10SEND: header of 10-bit address is sent in master mode + \arg I2C_FLAG_STPDET: stop condition detected in slave mode + \arg I2C_FLAG_RBNE: I2C_DATA is not empty during receiving + \arg I2C_FLAG_TBE: I2C_DATA is empty during transmitting + \arg I2C_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus + \arg I2C_FLAG_LOSTARB: arbitration lost in master mode + \arg I2C_FLAG_AERR: acknowledge error + \arg I2C_FLAG_OUERR: over-run or under-run situation occurs in slave mode + \arg I2C_FLAG_PECERR: PEC error when receiving data + \arg I2C_FLAG_SMBTO: timeout signal in SMBus mode + \arg I2C_FLAG_SMBALT: SMBus alert status + \arg I2C_FLAG_MASTER: a flag indicating whether I2C block is in master or slave mode + \arg I2C_FLAG_I2CBSY: busy flag + \arg I2C_FLAG_TR: whether the I2C is a transmitter or a receiver + \arg I2C_FLAG_RXGC: general call address (00h) received + \arg I2C_FLAG_DEFSMB: default address of SMBus device + \arg I2C_FLAG_HSTSMB: SMBus host header detected in slave mode + \arg I2C_FLAG_DUMOD: dual flag in slave mode indicating which address is matched in dual-address mode + \arg I2C_FLAG_TFF: txframe fall flag + \arg I2C_FLAG_TFR: txframe rise flag + \arg I2C_FLAG_RFF: rxframe fall flag + \arg I2C_FLAG_RFR: rxframe rise flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus i2c_flag_get(uint32_t i2c_periph, i2c_flag_enum flag) +{ + if(RESET != (I2C_REG_VAL(i2c_periph, flag) & BIT(I2C_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear I2C flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] flag: I2C flags, refer to i2c_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_FLAG_SMBALT: SMBus alert status + \arg I2C_FLAG_SMBTO: timeout signal in SMBus mode + \arg I2C_FLAG_PECERR: PEC error when receiving data + \arg I2C_FLAG_OUERR: over-run or under-run situation occurs in slave mode + \arg I2C_FLAG_AERR: acknowledge error + \arg I2C_FLAG_LOSTARB: arbitration lost in master mode + \arg I2C_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus + \arg I2C_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode + \arg I2C_FLAG_TFF: txframe fall flag + \arg I2C_FLAG_TFR: txframe rise flag + \arg I2C_FLAG_RFF: rxframe fall flag + \arg I2C_FLAG_RFR: rxframe rise flag + \param[out] none + \retval none +*/ +void i2c_flag_clear(uint32_t i2c_periph, i2c_flag_enum flag) +{ + if(I2C_FLAG_ADDSEND == flag){ + /* read I2C_STAT0 and then read I2C_STAT1 to clear ADDSEND */ + I2C_STAT0(i2c_periph); + I2C_STAT1(i2c_periph); + }else{ + I2C_REG_VAL(i2c_periph, flag) &= ~BIT(I2C_BIT_POS(flag)); + } +} + +/*! + \brief enable I2C interrupt + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] interrupt: I2C interrupts, refer to i2c_interrupt_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_ERR: error interrupt + \arg I2C_INT_EV: event interrupt + \arg I2C_INT_BUF: buffer interrupt + \arg I2C_INT_TFF: txframe fall interrupt + \arg I2C_INT_TFR: txframe rise interrupt + \arg I2C_INT_RFF: rxframe fall interrupt + \arg I2C_INT_RFR: rxframe rise interrupt + \param[out] none + \retval none +*/ +void i2c_interrupt_enable(uint32_t i2c_periph, i2c_interrupt_enum interrupt) +{ + I2C_REG_VAL(i2c_periph, interrupt) |= BIT(I2C_BIT_POS(interrupt)); +} + +/*! + \brief disable I2C interrupt + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] interrupt: I2C interrupts, refer to i2c_interrupt_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_ERR: error interrupt + \arg I2C_INT_EV: event interrupt + \arg I2C_INT_BUF: buffer interrupt + \arg I2C_INT_TFF: txframe fall interrupt + \arg I2C_INT_TFR: txframe rise interrupt + \arg I2C_INT_RFF: rxframe fall interrupt + \arg I2C_INT_RFR: rxframe rise interrupt + \param[out] none + \retval none +*/ +void i2c_interrupt_disable(uint32_t i2c_periph, i2c_interrupt_enum interrupt) +{ + I2C_REG_VAL(i2c_periph, interrupt) &= ~BIT(I2C_BIT_POS(interrupt)); +} + +/*! + \brief get I2C interrupt flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] int_flag: I2C interrupt flags, refer to i2c_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_FLAG_SBSEND: start condition sent out in master mode interrupt flag + \arg I2C_INT_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode interrupt flag + \arg I2C_INT_FLAG_BTC: byte transmission finishes interrupt flag + \arg I2C_INT_FLAG_ADD10SEND: header of 10-bit address is sent in master mode interrupt flag + \arg I2C_INT_FLAG_STPDET: stop condition detected in slave mode interrupt flag + \arg I2C_INT_FLAG_RBNE: I2C_DATA is not Empty during receiving interrupt flag + \arg I2C_INT_FLAG_TBE: I2C_DATA is empty during transmitting interrupt flag + \arg I2C_INT_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus interrupt flag + \arg I2C_INT_FLAG_LOSTARB: arbitration lost in master mode interrupt flag + \arg I2C_INT_FLAG_AERR: acknowledge error interrupt flag + \arg I2C_INT_FLAG_OUERR: over-run or under-run situation occurs in slave mode interrupt flag + \arg I2C_INT_FLAG_PECERR: PEC error when receiving data interrupt flag + \arg I2C_INT_FLAG_SMBTO: timeout signal in SMBus mode interrupt flag + \arg I2C_INT_FLAG_SMBALT: SMBus alert status interrupt flag + \arg I2C_INT_FLAG_TFF: txframe fall interrupt flag + \arg I2C_INT_FLAG_TFR: txframe rise interrupt flag + \arg I2C_INT_FLAG_RFF: rxframe fall interrupt flag + \arg I2C_INT_FLAG_RFR: rxframe rise interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus i2c_interrupt_flag_get(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U, bufie; + + /* check BUFIE */ + bufie = I2C_CTL1(i2c_periph)&I2C_CTL1_BUFIE; + + /* get the interrupt enable bit status */ + intenable = (I2C_REG_VAL(i2c_periph, int_flag) & BIT(I2C_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (I2C_REG_VAL2(i2c_periph, int_flag) & BIT(I2C_BIT_POS2(int_flag))); + + if((I2C_INT_FLAG_RBNE == int_flag) || (I2C_INT_FLAG_TBE == int_flag)){ + if(intenable && bufie){ + intenable = 1U; + }else{ + intenable = 0U; + } + } + if((0U != flagstatus) && (0U != intenable)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear I2C interrupt flag status + \param[in] i2c_periph: I2Cx(x=0,1) + \param[in] int_flag: I2C interrupt flags, refer to i2c_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg I2C_INT_FLAG_ADDSEND: address is sent in master mode or received and matches in slave mode interrupt flag + \arg I2C_INT_FLAG_BERR: a bus error occurs indication a unexpected start or stop condition on I2C bus interrupt flag + \arg I2C_INT_FLAG_LOSTARB: arbitration lost in master mode interrupt flag + \arg I2C_INT_FLAG_AERR: acknowledge error interrupt flag + \arg I2C_INT_FLAG_OUERR: over-run or under-run situation occurs in slave mode interrupt flag + \arg I2C_INT_FLAG_PECERR: PEC error when receiving data interrupt flag + \arg I2C_INT_FLAG_SMBTO: timeout signal in SMBus mode interrupt flag + \arg I2C_INT_FLAG_SMBALT: SMBus alert status interrupt flag + \arg I2C_INT_FLAG_TFF: txframe fall interrupt flag + \arg I2C_INT_FLAG_TFR: txframe rise interrupt flag + \arg I2C_INT_FLAG_RFF: rxframe fall interrupt flag + \arg I2C_INT_FLAG_RFR: rxframe rise interrupt flag + \param[out] none + \retval none +*/ +void i2c_interrupt_flag_clear(uint32_t i2c_periph, i2c_interrupt_flag_enum int_flag) +{ + if(I2C_INT_FLAG_ADDSEND == int_flag){ + /* read I2C_STAT0 and then read I2C_STAT1 to clear ADDSEND */ + I2C_STAT0(i2c_periph); + I2C_STAT1(i2c_periph); + }else{ + I2C_REG_VAL2(i2c_periph, int_flag) &= ~BIT(I2C_BIT_POS2(int_flag)); + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_it.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_it.c new file mode 100644 index 0000000..bd96b46 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_it.c @@ -0,0 +1,139 @@ +/*! + \file gd32c10x_it.c + \brief interrupt service routines + + \version 2025-09-30, V1.0.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x.h" +#include "systick.h" + +/*! + \brief this function handles NMI exception + \param[in] none + \param[out] none + \retval none +*/ +void NMI_Handler(void) +{ +} + +/*! + \brief this function handles HardFault exception + \param[in] none + \param[out] none + \retval none +*/ +void HardFault_Handler(void) +{ + /* if Hard Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles MemManage exception + \param[in] none + \param[out] none + \retval none +*/ +void MemManage_Handler(void) +{ + /* if Memory Manage exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles BusFault exception + \param[in] none + \param[out] none + \retval none +*/ +void BusFault_Handler(void) +{ + /* if Bus Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles UsageFault exception + \param[in] none + \param[out] none + \retval none +*/ +void UsageFault_Handler(void) +{ + /* if Usage Fault exception occurs, go to infinite loop */ + while (1){ + } +} + +/*! + \brief this function handles SVC exception + \param[in] none + \param[out] none + \retval none +*/ +void SVC_Handler(void) +{ +} + +/*! + \brief this function handles DebugMon exception + \param[in] none + \param[out] none + \retval none +*/ +void DebugMon_Handler(void) +{ +} + +/*! + \brief this function handles PendSV exception + \param[in] none + \param[out] none + \retval none +*/ +void PendSV_Handler(void) +{ +} + +/*! + \brief this function handles SysTick exception + \param[in] none + \param[out] none + \retval none +*/ +void SysTick_Handler(void) +{ + delay_decrement(); +} \ No newline at end of file diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c new file mode 100644 index 0000000..5883aac --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c @@ -0,0 +1,184 @@ +/*! + \file gd32c10x_misc.c + \brief MISC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_misc.h" + +/*! + \brief set the priority group + \param[in] nvic_prigroup: the NVIC priority group + \arg NVIC_PRIGROUP_PRE0_SUB4: 0 bits for pre-emption priority, 4 bits for subpriority + \arg NVIC_PRIGROUP_PRE1_SUB3: 1 bits for pre-emption priority, 3 bits for subpriority + \arg NVIC_PRIGROUP_PRE2_SUB2: 2 bits for pre-emption priority, 2 bits for subpriority + \arg NVIC_PRIGROUP_PRE3_SUB1: 3 bits for pre-emption priority, 1 bits for subpriority + \arg NVIC_PRIGROUP_PRE4_SUB0: 4 bits for pre-emption priority, 0 bits for subpriority + \param[out] none + \retval none +*/ +void nvic_priority_group_set(uint32_t nvic_prigroup) +{ + /* set the priority group value */ + SCB->AIRCR = NVIC_AIRCR_VECTKEY_MASK | nvic_prigroup; +} + +/*! + \brief enable NVIC interrupt request + \param[in] nvic_irq: the NVIC interrupt request, detailed in IRQn_Type + \param[in] nvic_irq_pre_priority: the pre-emption priority needed to set + \param[in] nvic_irq_sub_priority: the subpriority needed to set + \param[out] none + \retval none +*/ +void nvic_irq_enable(IRQn_Type nvic_irq, + uint8_t nvic_irq_pre_priority, + uint8_t nvic_irq_sub_priority) +{ + uint32_t temp_priority = 0x00U, temp_pre = 0x00U, temp_sub = 0x00U; + + /* use the priority group value to get the temp_pre and the temp_sub */ + switch((SCB->AIRCR) & (uint32_t)0x700U) { + case NVIC_PRIGROUP_PRE0_SUB4: + temp_pre = 0U; + temp_sub = 0x4U; + break; + case NVIC_PRIGROUP_PRE1_SUB3: + temp_pre = 1U; + temp_sub = 0x3U; + break; + case NVIC_PRIGROUP_PRE2_SUB2: + temp_pre = 2U; + temp_sub = 0x2U; + break; + case NVIC_PRIGROUP_PRE3_SUB1: + temp_pre = 3U; + temp_sub = 0x1U; + break; + case NVIC_PRIGROUP_PRE4_SUB0: + temp_pre = 4U; + temp_sub = 0x0U; + break; + default: + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + temp_pre = 2U; + temp_sub = 0x2U; + break; + } + + /* get the temp_priority to fill the NVIC->IP register */ + temp_priority = (uint32_t)nvic_irq_pre_priority << (0x4U - temp_pre); + temp_priority |= nvic_irq_sub_priority & (0x0FU >> (0x4U - temp_sub)); + temp_priority = temp_priority << 0x04U; + NVIC->IP[nvic_irq] = (uint8_t)temp_priority; + + /* enable the selected IRQ */ + NVIC->ISER[nvic_irq >> 0x05U] = (uint32_t)0x01U << (nvic_irq & (uint8_t)0x1FU); +} + +/*! + \brief disable NVIC interrupt request + \param[in] nvic_irq: the NVIC interrupt request, detailed in IRQn_Type + \param[out] none + \retval none +*/ +void nvic_irq_disable(IRQn_Type nvic_irq) +{ + /* disable the selected IRQ.*/ + NVIC->ICER[nvic_irq >> 0x05U] = (uint32_t)0x01U << (nvic_irq & (uint8_t)0x1FU); +} + +/*! + \brief set the NVIC vector table base address + \param[in] nvic_vict_tab: the RAM or FLASH base address + \arg NVIC_VECTTAB_RAM: RAM base address + \are NVIC_VECTTAB_FLASH: Flash base address + \param[in] offset: vector table offset + \param[out] none + \retval none +*/ +void nvic_vector_table_set(uint32_t nvic_vict_tab, uint32_t offset) +{ + SCB->VTOR = nvic_vict_tab | (offset & NVIC_VECTTAB_OFFSET_MASK); + __DSB(); +} + +/*! + \brief set the state of the low power mode + \param[in] lowpower_mode: the low power mode state + \arg SCB_LPM_SLEEP_EXIT_ISR: if chose this para, the system always enter low power + mode by exiting from ISR + \arg SCB_LPM_DEEPSLEEP: if chose this para, the system will enter the DEEPSLEEP mode + \arg SCB_LPM_WAKE_BY_ALL_INT: if chose this para, the low power mode can be woke up + by all the enable and disable interrupts + \param[out] none + \retval none +*/ +void system_lowpower_set(uint8_t lowpower_mode) +{ + SCB->SCR |= (uint32_t)lowpower_mode; +} + +/*! + \brief reset the state of the low power mode + \param[in] lowpower_mode: the low power mode state + \arg SCB_LPM_SLEEP_EXIT_ISR: if chose this para, the system will exit low power + mode by exiting from ISR + \arg SCB_LPM_DEEPSLEEP: if chose this para, the system will enter the SLEEP mode + \arg SCB_LPM_WAKE_BY_ALL_INT: if chose this para, the low power mode only can be + woke up by the enable interrupts + \param[out] none + \retval none +*/ +void system_lowpower_reset(uint8_t lowpower_mode) +{ + SCB->SCR &= (~(uint32_t)lowpower_mode); +} + +/*! + \brief set the systick clock source + \param[in] systick_clksource: the systick clock source needed to choose + \arg SYSTICK_CLKSOURCE_HCLK: systick clock source is from HCLK + \arg SYSTICK_CLKSOURCE_HCLK_DIV8: systick clock source is from HCLK/8 + \param[out] none + \retval none +*/ + +void systick_clksource_set(uint32_t systick_clksource) +{ + if(SYSTICK_CLKSOURCE_HCLK == systick_clksource) { + /* set the systick clock source from HCLK */ + SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; + } else { + /* set the systick clock source from HCLK/8 */ + SysTick->CTRL &= SYSTICK_CLKSOURCE_HCLK_DIV8; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c.base@1.0.0 new file mode 100644 index 0000000..5883aac --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c.base@1.0.0 @@ -0,0 +1,184 @@ +/*! + \file gd32c10x_misc.c + \brief MISC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_misc.h" + +/*! + \brief set the priority group + \param[in] nvic_prigroup: the NVIC priority group + \arg NVIC_PRIGROUP_PRE0_SUB4: 0 bits for pre-emption priority, 4 bits for subpriority + \arg NVIC_PRIGROUP_PRE1_SUB3: 1 bits for pre-emption priority, 3 bits for subpriority + \arg NVIC_PRIGROUP_PRE2_SUB2: 2 bits for pre-emption priority, 2 bits for subpriority + \arg NVIC_PRIGROUP_PRE3_SUB1: 3 bits for pre-emption priority, 1 bits for subpriority + \arg NVIC_PRIGROUP_PRE4_SUB0: 4 bits for pre-emption priority, 0 bits for subpriority + \param[out] none + \retval none +*/ +void nvic_priority_group_set(uint32_t nvic_prigroup) +{ + /* set the priority group value */ + SCB->AIRCR = NVIC_AIRCR_VECTKEY_MASK | nvic_prigroup; +} + +/*! + \brief enable NVIC interrupt request + \param[in] nvic_irq: the NVIC interrupt request, detailed in IRQn_Type + \param[in] nvic_irq_pre_priority: the pre-emption priority needed to set + \param[in] nvic_irq_sub_priority: the subpriority needed to set + \param[out] none + \retval none +*/ +void nvic_irq_enable(IRQn_Type nvic_irq, + uint8_t nvic_irq_pre_priority, + uint8_t nvic_irq_sub_priority) +{ + uint32_t temp_priority = 0x00U, temp_pre = 0x00U, temp_sub = 0x00U; + + /* use the priority group value to get the temp_pre and the temp_sub */ + switch((SCB->AIRCR) & (uint32_t)0x700U) { + case NVIC_PRIGROUP_PRE0_SUB4: + temp_pre = 0U; + temp_sub = 0x4U; + break; + case NVIC_PRIGROUP_PRE1_SUB3: + temp_pre = 1U; + temp_sub = 0x3U; + break; + case NVIC_PRIGROUP_PRE2_SUB2: + temp_pre = 2U; + temp_sub = 0x2U; + break; + case NVIC_PRIGROUP_PRE3_SUB1: + temp_pre = 3U; + temp_sub = 0x1U; + break; + case NVIC_PRIGROUP_PRE4_SUB0: + temp_pre = 4U; + temp_sub = 0x0U; + break; + default: + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + temp_pre = 2U; + temp_sub = 0x2U; + break; + } + + /* get the temp_priority to fill the NVIC->IP register */ + temp_priority = (uint32_t)nvic_irq_pre_priority << (0x4U - temp_pre); + temp_priority |= nvic_irq_sub_priority & (0x0FU >> (0x4U - temp_sub)); + temp_priority = temp_priority << 0x04U; + NVIC->IP[nvic_irq] = (uint8_t)temp_priority; + + /* enable the selected IRQ */ + NVIC->ISER[nvic_irq >> 0x05U] = (uint32_t)0x01U << (nvic_irq & (uint8_t)0x1FU); +} + +/*! + \brief disable NVIC interrupt request + \param[in] nvic_irq: the NVIC interrupt request, detailed in IRQn_Type + \param[out] none + \retval none +*/ +void nvic_irq_disable(IRQn_Type nvic_irq) +{ + /* disable the selected IRQ.*/ + NVIC->ICER[nvic_irq >> 0x05U] = (uint32_t)0x01U << (nvic_irq & (uint8_t)0x1FU); +} + +/*! + \brief set the NVIC vector table base address + \param[in] nvic_vict_tab: the RAM or FLASH base address + \arg NVIC_VECTTAB_RAM: RAM base address + \are NVIC_VECTTAB_FLASH: Flash base address + \param[in] offset: vector table offset + \param[out] none + \retval none +*/ +void nvic_vector_table_set(uint32_t nvic_vict_tab, uint32_t offset) +{ + SCB->VTOR = nvic_vict_tab | (offset & NVIC_VECTTAB_OFFSET_MASK); + __DSB(); +} + +/*! + \brief set the state of the low power mode + \param[in] lowpower_mode: the low power mode state + \arg SCB_LPM_SLEEP_EXIT_ISR: if chose this para, the system always enter low power + mode by exiting from ISR + \arg SCB_LPM_DEEPSLEEP: if chose this para, the system will enter the DEEPSLEEP mode + \arg SCB_LPM_WAKE_BY_ALL_INT: if chose this para, the low power mode can be woke up + by all the enable and disable interrupts + \param[out] none + \retval none +*/ +void system_lowpower_set(uint8_t lowpower_mode) +{ + SCB->SCR |= (uint32_t)lowpower_mode; +} + +/*! + \brief reset the state of the low power mode + \param[in] lowpower_mode: the low power mode state + \arg SCB_LPM_SLEEP_EXIT_ISR: if chose this para, the system will exit low power + mode by exiting from ISR + \arg SCB_LPM_DEEPSLEEP: if chose this para, the system will enter the SLEEP mode + \arg SCB_LPM_WAKE_BY_ALL_INT: if chose this para, the low power mode only can be + woke up by the enable interrupts + \param[out] none + \retval none +*/ +void system_lowpower_reset(uint8_t lowpower_mode) +{ + SCB->SCR &= (~(uint32_t)lowpower_mode); +} + +/*! + \brief set the systick clock source + \param[in] systick_clksource: the systick clock source needed to choose + \arg SYSTICK_CLKSOURCE_HCLK: systick clock source is from HCLK + \arg SYSTICK_CLKSOURCE_HCLK_DIV8: systick clock source is from HCLK/8 + \param[out] none + \retval none +*/ + +void systick_clksource_set(uint32_t systick_clksource) +{ + if(SYSTICK_CLKSOURCE_HCLK == systick_clksource) { + /* set the systick clock source from HCLK */ + SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; + } else { + /* set the systick clock source from HCLK/8 */ + SysTick->CTRL &= SYSTICK_CLKSOURCE_HCLK_DIV8; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c new file mode 100644 index 0000000..a852732 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c @@ -0,0 +1,294 @@ +/*! + \file gd32c10x_pmu.c + \brief PMU driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_pmu.h" + +/*! + \brief reset PMU register + \param[in] none + \param[out] none + \retval none +*/ +void pmu_deinit(void) +{ + /* reset PMU */ + rcu_periph_reset_enable(RCU_PMURST); + rcu_periph_reset_disable(RCU_PMURST); +} + +/*! + \brief select low voltage detector threshold + \param[in] lvdt_n: + only one parameter can be selected which is shown as below: + \arg PMU_LVDT_0: voltage threshold is 2.1V + \arg PMU_LVDT_1: voltage threshold is 2.3V + \arg PMU_LVDT_2: voltage threshold is 2.4V + \arg PMU_LVDT_3: voltage threshold is 2.6V + \arg PMU_LVDT_4: voltage threshold is 2.7V + \arg PMU_LVDT_5: voltage threshold is 2.9V + \arg PMU_LVDT_6: voltage threshold is 3.0V + \arg PMU_LVDT_7: voltage threshold is 3.1V + \param[out] none + \retval none +*/ +void pmu_lvd_select(uint32_t lvdt_n) +{ + /* disable LVD */ + PMU_CTL &= ~PMU_CTL_LVDEN; + /* clear LVDT bits */ + PMU_CTL &= ~PMU_CTL_LVDT; + /* set LVDT bits according to lvdt_n */ + PMU_CTL |= lvdt_n; + /* enable LVD */ + PMU_CTL |= PMU_CTL_LVDEN; +} + +/*! + \brief select LDO output voltage + this bit set by software when the main PLL closed, before closing PLL, change the system clock to IRC16M or HXTAL + \param[in] ldo_output: + only one parameter can be selected which is shown as below: + \arg PMU_LDOVS_LOW: LDO output voltage select low mode + \arg PMU_LDOVS_NORMAL: LDO output voltage select normal mode + \param[out] none + \retval none +*/ +void pmu_ldo_output_select(uint32_t ldo_output) +{ + PMU_CTL &= ~PMU_CTL_LDOVS; + PMU_CTL |= ldo_output; +} + +/*! + \brief disable PMU lvd + \param[in] none + \param[out] none + \retval none +*/ +void pmu_lvd_disable(void) +{ + /* disable LVD */ + PMU_CTL &= ~PMU_CTL_LVDEN; +} + +/*! + \brief PMU work at sleep mode + \param[in] sleepmodecmd: + only one parameter can be selected which is shown as below: + \arg WFI_CMD: use WFI command + \arg WFE_CMD: use WFE command + \param[out] none + \retval none +*/ +void pmu_to_sleepmode(uint8_t sleepmodecmd) +{ + /* clear sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR &= ~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); + + /* select WFI or WFE command to enter sleep mode */ + if(WFI_CMD == sleepmodecmd){ + __WFI(); + }else{ + __SEV(); + __WFE(); + __WFE(); + } +} + +/*! + \brief PMU work at deepsleep mode + \param[in] ldo: + only one parameter can be selected which is shown as below: + \arg PMU_LDO_NORMAL: LDO work at normal power mode when pmu enter deepsleep mode + \arg PMU_LDO_LOWPOWER: LDO work at low power mode when pmu enter deepsleep mode + \param[in] deepsleepmodecmd: + only one parameter can be selected which is shown as below: + \arg WFI_CMD: use WFI command + \arg WFE_CMD: use WFE command + \param[out] none + \retval none +*/ +void pmu_to_deepsleepmode(uint32_t ldo,uint8_t deepsleepmodecmd) +{ + static uint32_t reg_snap[4]; + /* clear stbmod and ldolp bits */ + PMU_CTL &= ~((uint32_t)(PMU_CTL_STBMOD | PMU_CTL_LDOLP)); + + /* set ldolp bit according to pmu_ldo */ + PMU_CTL |= ldo; + + /* set sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + reg_snap[0] = REG32(0xE000E010U); + reg_snap[1] = REG32(0xE000E100U); + reg_snap[2] = REG32(0xE000E104U); + reg_snap[3] = REG32(0xE000E108U); + + REG32(0xE000E010U) &= 0x00010004U; + REG32(0xE000E180U) = 0XFF7FF83DU; + REG32(0xE000E184U) = 0XFFFFF8FFU; + REG32(0xE000E188U) = 0xFFFFFFFFU; + + /* select WFI or WFE command to enter deepsleep mode */ + if(WFI_CMD == deepsleepmodecmd){ + __WFI(); + }else{ + __SEV(); + __WFE(); + __WFE(); + } + + REG32(0xE000E010U) = reg_snap[0]; + REG32(0xE000E100U) = reg_snap[1]; + REG32(0xE000E104U) = reg_snap[2]; + REG32(0xE000E108U) = reg_snap[3]; + + /* reset sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR &= ~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); +} + +/*! + \brief pmu work at standby mode + \param[in] none + \param[out] none + \retval none +*/ +void pmu_to_standbymode(void) +{ + /* set stbmod bit */ + PMU_CTL |= PMU_CTL_STBMOD; + + /* reset wakeup flag */ + PMU_CTL |= PMU_CTL_WURST; + + /* set sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + REG32(0xE000E010U) &= 0x00010004U; + REG32(0xE000E180U) = 0XFFFFFFF7U; + REG32(0xE000E184U) = 0XFFFFFDFFU; + REG32(0xE000E188U) = 0xFFFFFFFFU; + + /* select WFI or WFE command to enter standby mode */ + __WFI(); +} + +/*! + \brief enable wakeup pin + \param[in] none + \param[out] none + \retval none +*/ +void pmu_wakeup_pin_enable(void) +{ + PMU_CS |= PMU_CS_WUPEN; +} + +/*! + \brief disable wakeup pin + \param[in] none + \param[out] none + \retval none +*/ +void pmu_wakeup_pin_disable(void) +{ + PMU_CS &= ~PMU_CS_WUPEN; +} + +/*! + \brief enable write access to the registers in backup domain + \param[in] none + \param[out] none + \retval none +*/ +void pmu_backup_write_enable(void) +{ + PMU_CTL |= PMU_CTL_BKPWEN; +} + +/*! + \brief disable write access to the registers in backup domain + \param[in] none + \param[out] none + \retval none +*/ +void pmu_backup_write_disable(void) +{ + PMU_CTL &= ~PMU_CTL_BKPWEN; +} + +/*! + \brief get flag state + \param[in] flag: + only one parameter can be selected which is shown as below: + \arg PMU_FLAG_WAKEUP: wakeup flag + \arg PMU_FLAG_STANDBY: standby flag + \arg PMU_FLAG_LVD: lvd flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus pmu_flag_get(uint32_t flag) +{ + if(RESET != (PMU_CS & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear flag bit + \param[in] flag: + only one parameter can be selected which is shown as below: + \arg PMU_FLAG_RESET_WAKEUP: reset wakeup flag + \arg PMU_FLAG_RESET_STANDBY: reset standby flag + \param[out] none + \retval none +*/ +void pmu_flag_clear(uint32_t flag) +{ + switch(flag){ + case PMU_FLAG_RESET_WAKEUP: + /* reset wakeup flag */ + PMU_CTL |= PMU_CTL_WURST; + break; + case PMU_FLAG_RESET_STANDBY: + /* reset standby flag */ + PMU_CTL |= PMU_CTL_STBRST; + break; + default: + break; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c.base@1.0.0 new file mode 100644 index 0000000..a852732 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c.base@1.0.0 @@ -0,0 +1,294 @@ +/*! + \file gd32c10x_pmu.c + \brief PMU driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_pmu.h" + +/*! + \brief reset PMU register + \param[in] none + \param[out] none + \retval none +*/ +void pmu_deinit(void) +{ + /* reset PMU */ + rcu_periph_reset_enable(RCU_PMURST); + rcu_periph_reset_disable(RCU_PMURST); +} + +/*! + \brief select low voltage detector threshold + \param[in] lvdt_n: + only one parameter can be selected which is shown as below: + \arg PMU_LVDT_0: voltage threshold is 2.1V + \arg PMU_LVDT_1: voltage threshold is 2.3V + \arg PMU_LVDT_2: voltage threshold is 2.4V + \arg PMU_LVDT_3: voltage threshold is 2.6V + \arg PMU_LVDT_4: voltage threshold is 2.7V + \arg PMU_LVDT_5: voltage threshold is 2.9V + \arg PMU_LVDT_6: voltage threshold is 3.0V + \arg PMU_LVDT_7: voltage threshold is 3.1V + \param[out] none + \retval none +*/ +void pmu_lvd_select(uint32_t lvdt_n) +{ + /* disable LVD */ + PMU_CTL &= ~PMU_CTL_LVDEN; + /* clear LVDT bits */ + PMU_CTL &= ~PMU_CTL_LVDT; + /* set LVDT bits according to lvdt_n */ + PMU_CTL |= lvdt_n; + /* enable LVD */ + PMU_CTL |= PMU_CTL_LVDEN; +} + +/*! + \brief select LDO output voltage + this bit set by software when the main PLL closed, before closing PLL, change the system clock to IRC16M or HXTAL + \param[in] ldo_output: + only one parameter can be selected which is shown as below: + \arg PMU_LDOVS_LOW: LDO output voltage select low mode + \arg PMU_LDOVS_NORMAL: LDO output voltage select normal mode + \param[out] none + \retval none +*/ +void pmu_ldo_output_select(uint32_t ldo_output) +{ + PMU_CTL &= ~PMU_CTL_LDOVS; + PMU_CTL |= ldo_output; +} + +/*! + \brief disable PMU lvd + \param[in] none + \param[out] none + \retval none +*/ +void pmu_lvd_disable(void) +{ + /* disable LVD */ + PMU_CTL &= ~PMU_CTL_LVDEN; +} + +/*! + \brief PMU work at sleep mode + \param[in] sleepmodecmd: + only one parameter can be selected which is shown as below: + \arg WFI_CMD: use WFI command + \arg WFE_CMD: use WFE command + \param[out] none + \retval none +*/ +void pmu_to_sleepmode(uint8_t sleepmodecmd) +{ + /* clear sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR &= ~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); + + /* select WFI or WFE command to enter sleep mode */ + if(WFI_CMD == sleepmodecmd){ + __WFI(); + }else{ + __SEV(); + __WFE(); + __WFE(); + } +} + +/*! + \brief PMU work at deepsleep mode + \param[in] ldo: + only one parameter can be selected which is shown as below: + \arg PMU_LDO_NORMAL: LDO work at normal power mode when pmu enter deepsleep mode + \arg PMU_LDO_LOWPOWER: LDO work at low power mode when pmu enter deepsleep mode + \param[in] deepsleepmodecmd: + only one parameter can be selected which is shown as below: + \arg WFI_CMD: use WFI command + \arg WFE_CMD: use WFE command + \param[out] none + \retval none +*/ +void pmu_to_deepsleepmode(uint32_t ldo,uint8_t deepsleepmodecmd) +{ + static uint32_t reg_snap[4]; + /* clear stbmod and ldolp bits */ + PMU_CTL &= ~((uint32_t)(PMU_CTL_STBMOD | PMU_CTL_LDOLP)); + + /* set ldolp bit according to pmu_ldo */ + PMU_CTL |= ldo; + + /* set sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + reg_snap[0] = REG32(0xE000E010U); + reg_snap[1] = REG32(0xE000E100U); + reg_snap[2] = REG32(0xE000E104U); + reg_snap[3] = REG32(0xE000E108U); + + REG32(0xE000E010U) &= 0x00010004U; + REG32(0xE000E180U) = 0XFF7FF83DU; + REG32(0xE000E184U) = 0XFFFFF8FFU; + REG32(0xE000E188U) = 0xFFFFFFFFU; + + /* select WFI or WFE command to enter deepsleep mode */ + if(WFI_CMD == deepsleepmodecmd){ + __WFI(); + }else{ + __SEV(); + __WFE(); + __WFE(); + } + + REG32(0xE000E010U) = reg_snap[0]; + REG32(0xE000E100U) = reg_snap[1]; + REG32(0xE000E104U) = reg_snap[2]; + REG32(0xE000E108U) = reg_snap[3]; + + /* reset sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR &= ~((uint32_t)SCB_SCR_SLEEPDEEP_Msk); +} + +/*! + \brief pmu work at standby mode + \param[in] none + \param[out] none + \retval none +*/ +void pmu_to_standbymode(void) +{ + /* set stbmod bit */ + PMU_CTL |= PMU_CTL_STBMOD; + + /* reset wakeup flag */ + PMU_CTL |= PMU_CTL_WURST; + + /* set sleepdeep bit of Cortex-M4 system control register */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + + REG32(0xE000E010U) &= 0x00010004U; + REG32(0xE000E180U) = 0XFFFFFFF7U; + REG32(0xE000E184U) = 0XFFFFFDFFU; + REG32(0xE000E188U) = 0xFFFFFFFFU; + + /* select WFI or WFE command to enter standby mode */ + __WFI(); +} + +/*! + \brief enable wakeup pin + \param[in] none + \param[out] none + \retval none +*/ +void pmu_wakeup_pin_enable(void) +{ + PMU_CS |= PMU_CS_WUPEN; +} + +/*! + \brief disable wakeup pin + \param[in] none + \param[out] none + \retval none +*/ +void pmu_wakeup_pin_disable(void) +{ + PMU_CS &= ~PMU_CS_WUPEN; +} + +/*! + \brief enable write access to the registers in backup domain + \param[in] none + \param[out] none + \retval none +*/ +void pmu_backup_write_enable(void) +{ + PMU_CTL |= PMU_CTL_BKPWEN; +} + +/*! + \brief disable write access to the registers in backup domain + \param[in] none + \param[out] none + \retval none +*/ +void pmu_backup_write_disable(void) +{ + PMU_CTL &= ~PMU_CTL_BKPWEN; +} + +/*! + \brief get flag state + \param[in] flag: + only one parameter can be selected which is shown as below: + \arg PMU_FLAG_WAKEUP: wakeup flag + \arg PMU_FLAG_STANDBY: standby flag + \arg PMU_FLAG_LVD: lvd flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus pmu_flag_get(uint32_t flag) +{ + if(RESET != (PMU_CS & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear flag bit + \param[in] flag: + only one parameter can be selected which is shown as below: + \arg PMU_FLAG_RESET_WAKEUP: reset wakeup flag + \arg PMU_FLAG_RESET_STANDBY: reset standby flag + \param[out] none + \retval none +*/ +void pmu_flag_clear(uint32_t flag) +{ + switch(flag){ + case PMU_FLAG_RESET_WAKEUP: + /* reset wakeup flag */ + PMU_CTL |= PMU_CTL_WURST; + break; + case PMU_FLAG_RESET_STANDBY: + /* reset standby flag */ + PMU_CTL |= PMU_CTL_STBRST; + break; + default: + break; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c new file mode 100644 index 0000000..89007c4 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c @@ -0,0 +1,1249 @@ +/*! + \file gd32c10x_rcu.c + \brief RCU driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_rcu.h" + +/* define clock source */ +#define SEL_IRC8M ((uint16_t)0U) /* IRC8M is selected as CK_SYS */ +#define SEL_HXTAL ((uint16_t)1U) /* HXTAL is selected as CK_SYS */ +#define SEL_PLL ((uint16_t)2U) /* PLL is selected as CK_SYS */ + +/* define startup timeout count */ +#define OSC_STARTUP_TIMEOUT ((uint32_t)0x000FFFFFU) +#define LXTAL_STARTUP_TIMEOUT ((uint32_t)0x03FFFFFFU) + +/* ADC clock prescaler offset */ +#define RCU_ADC_PSC_OFFSET ((uint32_t)14U) + +/* RCU IRC8M adjust value mask and offset*/ +#define RCU_IRC8M_ADJUST_MASK ((uint8_t)0x1FU) +#define RCU_IRC8M_ADJUST_OFFSET ((uint32_t)3U) + +/* RCU PLL1 clock multiplication factor offset */ +#define RCU_CFG1_PLL1MF_OFFSET ((uint32_t)8U) +/* RCU PREDV1 division factor offset*/ +#define RCU_CFG1_PREDV1_OFFSET ((uint32_t)4U) + +/*! + \brief deinitialize the RCU + \param[in] none + \param[out] none + \retval none +*/ +void rcu_deinit(void) +{ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + rcu_osci_stab_wait(RCU_IRC8M); + + RCU_CFG0 &= ~(RCU_CFG0_SCS); + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* reset CFG0 register */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_CKOUT0SEL | RCU_CFG0_ADCPSC_2); + + /* reset HXTALBPS bit */ + RCU_CTL &= ~RCU_CTL_HXTALBPS; + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4 | RCU_CFG0_USBFSPSC_2); + /* reset PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLL1EN | RCU_CTL_PLL2EN); + + /* reset INT and CFG1 register */ + RCU_INT = 0x00ff0000U; + RCU_CFG1 &= ~(RCU_CFG1_PREDV0 | RCU_CFG1_PREDV1 | RCU_CFG1_PLL1MF | RCU_CFG1_PLL2MF | + RCU_CFG1_PREDV0SEL | RCU_CFG1_I2S1SEL | RCU_CFG1_I2S2SEL | RCU_CFG1_ADCPSC_3 | + RCU_CFG1_PLLPRESEL); +} +/*! + \brief enable the peripherals clock + \param[in] periph: RCU peripherals, refer to rcu_periph_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOx (x=A,B,C,D,E): GPIO ports clock + \arg RCU_AF : alternate function clock + \arg RCU_CRC: CRC clock + \arg RCU_DMAx (x=0,1): DMA clock + \arg RCU_USBFS: USBFS clock + \arg RCU_EXMC: EXMC clock + \arg RCU_TIMERx (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): TIMER clock + \arg RCU_WWDGT: WWDGT clock + \arg RCU_SPIx (x=0,1,2): SPI clock + \arg RCU_USARTx (x=0,1,2): USART clock + \arg RCU_UARTx (x=3,4): UART clock + \arg RCU_I2Cx (x=0,1): I2C clock + \arg RCU_CANx (x=0,1): CAN clock + \arg RCU_PMU: PMU clock + \arg RCU_DAC: DAC clock + \arg RCU_RTC: RTC clock + \arg RCU_ADCx (x=0,1): ADC clock + \arg RCU_CTC: CTC clock + \arg RCU_BKPI: BKP interface clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_enable(rcu_periph_enum periph) +{ + RCU_REG_VAL(periph) |= BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief disable the peripherals clock + \param[in] periph: RCU peripherals, refer to rcu_periph_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOx (x=A,B,C,D,E): GPIO ports clock + \arg RCU_AF: alternate function clock + \arg RCU_CRC: CRC clock + \arg RCU_DMAx (x=0,1): DMA clock + \arg RCU_USBFS: USBFS clock + \arg RCU_EXMC: EXMC clock + \arg RCU_TIMERx (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): TIMER clock + \arg RCU_WWDGT: WWDGT clock + \arg RCU_SPIx (x=0,1,2): SPI clock + \arg RCU_USARTx (x=0,1,2): USART clock + \arg RCU_UARTx (x=3,4): UART clock + \arg RCU_I2Cx (x=0,1): I2C clock + \arg RCU_CANx (x=0,1): CAN clock + \arg RCU_PMU: PMU clock + \arg RCU_DAC: DAC clock + \arg RCU_RTC: RTC clock + \arg RCU_ADCx (x=0,1): ADC clock + \arg RCU_CTC: CTC clock + \arg RCU_BKPI: BKP interface clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_disable(rcu_periph_enum periph) +{ + RCU_REG_VAL(periph) &= ~BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief enable the peripherals clock when sleep mode + \param[in] periph: RCU peripherals, refer to rcu_periph_sleep_enum + only one parameter can be selected which is shown as below: + \arg RCU_FMC_SLP: FMC clock + \arg RCU_SRAM_SLP: SRAM clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_sleep_enable(rcu_periph_sleep_enum periph) +{ + RCU_REG_VAL(periph) |= BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief disable the peripherals clock when sleep mode + \param[in] periph: RCU peripherals, refer to rcu_periph_sleep_enum + only one parameter can be selected which is shown as below: + \arg RCU_FMC_SLP: FMC clock + \arg RCU_SRAM_SLP: SRAM clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_sleep_disable(rcu_periph_sleep_enum periph) +{ + RCU_REG_VAL(periph) &= ~BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief reset the peripherals + \param[in] periph_reset: RCU peripherals reset, refer to rcu_periph_reset_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOxRST (x=A,B,C,D,E): reset GPIO ports + \arg RCU_AFRST : reset alternate function clock + \arg RCU_USBFSRST: reset USBFS + \arg RCU_TIMERxRST (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): reset TIMER + \arg RCU_WWDGTRST: reset WWDGT + \arg RCU_SPIxRST (x=0,1,2): reset SPI + \arg RCU_USARTxRST (x=0,1,2): reset USART + \arg RCU_UARTxRST (x=3,4): reset UART + \arg RCU_I2CxRST (x=0,1): reset I2C + \arg RCU_CANxRST (x=0,1): reset CAN + \arg RCU_PMURST: reset PMU + \arg RCU_DACRST: reset DAC + \arg RCU_ADCxRST (x=0,1): reset ADC + \arg RCU_CTCRST: reset CTC + \arg RCU_BKPIRST: reset BKPI + \param[out] none + \retval none +*/ +void rcu_periph_reset_enable(rcu_periph_reset_enum periph_reset) +{ + RCU_REG_VAL(periph_reset) |= BIT(RCU_BIT_POS(periph_reset)); +} + +/*! + \brief disable reset the peripheral + \param[in] periph_reset: RCU peripherals reset, refer to rcu_periph_reset_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOxRST (x=A,B,C,D,E): reset GPIO ports + \arg RCU_AFRST : reset alternate function clock + \arg RCU_USBFSRST: reset USBFS + \arg RCU_TIMERxRST (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): reset TIMER + \arg RCU_WWDGTRST: reset WWDGT + \arg RCU_SPIxRST (x=0,1,2): reset SPI + \arg RCU_USARTxRST (x=0,1,2): reset USART + \arg RCU_UARTxRST (x=3,4): reset UART + \arg RCU_I2CxRST (x=0,1): reset I2C + \arg RCU_CANxRST (x=0,1): reset CAN + \arg RCU_PMURST: reset PMU + \arg RCU_DACRST: reset DAC + \arg RCU_ADCxRST (x=0,1): reset ADC + \arg RCU_CTCRST: reset CTC + \arg RCU_BKPIRST: reset BKPI + \param[out] none + \retval none +*/ +void rcu_periph_reset_disable(rcu_periph_reset_enum periph_reset) +{ + RCU_REG_VAL(periph_reset) &= ~BIT(RCU_BIT_POS(periph_reset)); +} + +/*! + \brief reset the BKP domain + \param[in] none + \param[out] none + \retval none +*/ +void rcu_bkp_reset_enable(void) +{ + RCU_BDCTL |= RCU_BDCTL_BKPRST; +} + +/*! + \brief disable the BKP domain reset + \param[in] none + \param[out] none + \retval none +*/ +void rcu_bkp_reset_disable(void) +{ + RCU_BDCTL &= ~RCU_BDCTL_BKPRST; +} + +/*! + \brief configure the system clock source + \param[in] ck_sys: system clock source select + only one parameter can be selected which is shown as below: + \arg RCU_CKSYSSRC_IRC8M: select CK_IRC8M as the CK_SYS source + \arg RCU_CKSYSSRC_HXTAL: select CK_HXTAL as the CK_SYS source + \arg RCU_CKSYSSRC_PLL: select CK_PLL as the CK_SYS source + \param[out] none + \retval none +*/ +void rcu_system_clock_source_config(uint32_t ck_sys) +{ + uint32_t reg; + + reg = RCU_CFG0; + /* reset the SCS bits and set according to ck_sys */ + reg &= ~RCU_CFG0_SCS; + RCU_CFG0 = (reg | ck_sys); +} + +/*! + \brief get the system clock source + \param[in] none + \param[out] none + \retval which clock is selected as CK_SYS source + \arg RCU_SCSS_IRC8M: CK_IRC8M is selected as the CK_SYS source + \arg RCU_SCSS_HXTAL: CK_HXTAL is selected as the CK_SYS source + \arg RCU_SCSS_PLL: CK_PLL is selected as the CK_SYS source +*/ +uint32_t rcu_system_clock_source_get(void) +{ + return (RCU_CFG0 & RCU_CFG0_SCSS); +} + +/*! + \brief configure the AHB clock prescaler selection + \param[in] ck_ahb: AHB clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_AHB_CKSYS_DIVx, x=1, 2, 4, 8, 16, 64, 128, 256, 512 + \param[out] none + \retval none +*/ +void rcu_ahb_clock_config(uint32_t ck_ahb) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the AHBPSC bits and set according to ck_ahb */ + reg &= ~RCU_CFG0_AHBPSC; + RCU_CFG0 = (reg | ck_ahb); +} + +/*! + \brief configure the APB1 clock prescaler selection + \param[in] ck_apb1: APB1 clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_APB1_CKAHB_DIV1: select CK_AHB as CK_APB1 + \arg RCU_APB1_CKAHB_DIV2: select CK_AHB/2 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV4: select CK_AHB/4 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV8: select CK_AHB/8 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV16: select CK_AHB/16 as CK_APB1 + \param[out] none + \retval none +*/ +void rcu_apb1_clock_config(uint32_t ck_apb1) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the APB1PSC and set according to ck_apb1 */ + reg &= ~RCU_CFG0_APB1PSC; + RCU_CFG0 = (reg | ck_apb1); +} + +/*! + \brief configure the APB2 clock prescaler selection + \param[in] ck_apb2: APB2 clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_APB2_CKAHB_DIV1: select CK_AHB as CK_APB2 + \arg RCU_APB2_CKAHB_DIV2: select CK_AHB/2 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV4: select CK_AHB/4 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV8: select CK_AHB/8 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV16: select CK_AHB/16 as CK_APB2 + \param[out] none + \retval none +*/ +void rcu_apb2_clock_config(uint32_t ck_apb2) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the APB2PSC and set according to ck_apb2 */ + reg &= ~RCU_CFG0_APB2PSC; + RCU_CFG0 = (reg | ck_apb2); +} + +/*! + \brief configure the CK_OUT0 clock source + \param[in] ckout0_src: CK_OUT0 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_CKOUT0SRC_NONE: no clock selected + \arg RCU_CKOUT0SRC_CKSYS: system clock selected + \arg RCU_CKOUT0SRC_IRC8M: high speed 8M internal oscillator clock selected + \arg RCU_CKOUT0SRC_HXTAL: HXTAL selected + \arg RCU_CKOUT0SRC_CKPLL_DIV2: CK_PLL/2 selected + \arg RCU_CKOUT0SRC_CKPLL1: CK_PLL1 selected + \arg RCU_CKOUT0SRC_CKPLL2_DIV2: CK_PLL2/2 selected + \arg RCU_CKOUT0SRC_CKPLL2: PLL2 selected + \arg RCU_CKOUT0SRC_IRC48M: IRC48M selected + \arg RCU_CKOUT0SRC_IRC48M_DIV8: IRC48M/8 selected + \param[out] none + \retval none +*/ +void rcu_ckout0_config(uint32_t ckout0_src) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the CKOUT0SRC, set according to ckout0_src */ + reg &= ~RCU_CFG0_CKOUT0SEL; + RCU_CFG0 = (reg | ckout0_src); +} + +/*! + \brief configure the main PLL clock + \param[in] pll_src: PLL clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_PLLSRC_IRC8M_DIV2: IRC8M/2 clock selected as source clock of PLL + \arg RCU_PLLSRC_HXTAL_IRC48M: HXTAL or IRC48M selected as source clock of PLL + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL_MULx (x = 2..14, 16..31, 6.5) + \param[out] none + \retval none +*/ +void rcu_pll_config(uint32_t pll_src, uint32_t pll_mul) +{ + uint32_t reg = 0U; + + reg = RCU_CFG0; + + /* PLL clock source and multiplication factor configuration */ + reg &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + reg |= (pll_src | pll_mul); + + RCU_CFG0 = reg; +} + +/*! + \brief configure the PLL clock source preselection + \param[in] pll_presel: PLL clock source preselection + only one parameter can be selected which is shown as below: + \arg RCU_PLLPRESRC_HXTAL: HXTAL selected as PLL source clock + \arg RCU_PLLPRESRC_IRC48M: CK_PLL selected as PREDV0 input source clock + \param[out] none + \retval none +*/ +void rcu_pllpresel_config(uint32_t pll_presel) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + + /* PLL clock source preselection */ + reg &= ~RCU_CFG1_PLLPRESEL; + reg |= pll_presel; + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PREDV0 division factor and clock source + \param[in] predv0_source: PREDV0 input clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_PREDV0SRC_HXTAL_IRC48M: HXTAL or IRC48M selected as PREDV0 input source clock + \arg RCU_PREDV0SRC_CKPLL1: CK_PLL1 selected as PREDV0 input source clock + \param[in] predv0_div: PREDV0 division factor + only one parameter can be selected which is shown as below: + \arg RCU_PREDV0_DIVx, x = 1..16 + \param[out] none + \retval none +*/ +void rcu_predv0_config(uint32_t predv0_source, uint32_t predv0_div) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + /* reset PREDV0SEL and PREDV0 bits */ + reg &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PREDV0); + /* set the PREDV0SEL and PREDV0 division factor */ + reg |= (predv0_source | predv0_div); + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PREDV1 division factor + \param[in] predv1_div: PREDV1 division factor + only one parameter can be selected which is shown as below: + \arg RCU_PREDV1_DIVx, x = 1..16 + \param[out] none + \retval none +*/ +void rcu_predv1_config(uint32_t predv1_div) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + /* reset the PREDV1 bits */ + reg &= ~RCU_CFG1_PREDV1; + /* set the PREDV1 division factor */ + reg |= predv1_div; + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PLL1 clock + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL1_MULx (x = 8..16, 20) + \param[out] none + \retval none +*/ +void rcu_pll1_config(uint32_t pll_mul) +{ + RCU_CFG1 &= ~RCU_CFG1_PLL1MF; + RCU_CFG1 |= pll_mul; +} + +/*! + \brief configure the PLL2 clock + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL2_MULx (x = 8..16, 20) + \param[out] none + \retval none +*/ +void rcu_pll2_config(uint32_t pll_mul) +{ + RCU_CFG1 &= ~RCU_CFG1_PLL2MF; + RCU_CFG1 |= pll_mul; +} + +/*! + \brief configure the ADC prescaler factor + \param[in] adc_psc: ADC prescaler factor + only one parameter can be selected which is shown as below: + \arg RCU_CKADC_CKAPB2_DIV2: ADC prescaler select CK_APB2/2 + \arg RCU_CKADC_CKAPB2_DIV4: ADC prescaler select CK_APB2/4 + \arg RCU_CKADC_CKAPB2_DIV6: ADC prescaler select CK_APB2/6 + \arg RCU_CKADC_CKAPB2_DIV8: ADC prescaler select CK_APB2/8 + \arg RCU_CKADC_CKAPB2_DIV12: ADC prescaler select CK_APB2/12 + \arg RCU_CKADC_CKAPB2_DIV16: ADC prescaler select CK_APB2/16 + \arg RCU_CKADC_CKAHB_DIV3: ADC prescaler select CK_AHB/3 + \arg RCU_CKADC_CKAHB_DIV5: ADC prescaler select CK_AHB/5 + \arg RCU_CKADC_CKAHB_DIV7: ADC prescaler select CK_AHB/7 + \arg RCU_CKADC_CKAHB_DIV9: ADC prescaler select CK_AHB/9 + \param[out] none + \retval none +*/ +void rcu_adc_clock_config(uint32_t adc_psc) +{ + uint32_t reg0,reg1; + + /* reset the ADCPSC bits */ + reg0 = RCU_CFG0; + reg0 &= ~(RCU_CFG0_ADCPSC_2 | RCU_CFG0_ADCPSC); + reg1 = RCU_CFG1; + reg1 &= ~RCU_CFG1_ADCPSC_3; + + /* set the ADC prescaler factor */ + switch(adc_psc){ + case RCU_CKADC_CKAPB2_DIV2: + case RCU_CKADC_CKAPB2_DIV4: + case RCU_CKADC_CKAPB2_DIV6: + case RCU_CKADC_CKAPB2_DIV8: + reg0 |= (adc_psc << RCU_ADC_PSC_OFFSET); + break; + + case RCU_CKADC_CKAPB2_DIV12: + case RCU_CKADC_CKAPB2_DIV16: + adc_psc &= ~BIT(2); + reg0 |= ((adc_psc << RCU_ADC_PSC_OFFSET) | RCU_CFG0_ADCPSC_2); + break; + + case RCU_CKADC_CKAHB_DIV3: + case RCU_CKADC_CKAHB_DIV5: + case RCU_CKADC_CKAHB_DIV7: + case RCU_CKADC_CKAHB_DIV9: + adc_psc &= ~BITS(2,3); + reg0 |= (adc_psc << RCU_ADC_PSC_OFFSET); + reg1 |= RCU_CFG1_ADCPSC_3; + break; + + default: + break; + } + + /* set the register */ + RCU_CFG0 = reg0; + RCU_CFG1 = reg1; +} + +/*! + \brief configure the USBFS prescaler factor + \param[in] adc_div: USB prescaler factor + only one parameter can be selected which is shown as below: + \arg RCU_CKUSB_CKPLL_DIV1_5: USBFS prescaler select CK_PLL/1.5 + \arg RCU_CKUSB_CKPLL_DIV1: USBFS prescaler select CK_PLL/1 + \arg RCU_CKUSB_CKPLL_DIV2_5: USBFS prescaler select CK_PLL/2.5 + \arg RCU_CKUSB_CKPLL_DIV2: USBFS prescaler select CK_PLL/2 + \arg RCU_CKUSB_CKPLL_DIV3: USBFS prescaler select CK_PLL/3 + \arg RCU_CKUSB_CKPLL_DIV3_5: USBFS prescaler select CK_PLL/3.5 + \arg RCU_CKUSB_CKPLL_DIV4: USBFS prescaler select CK_PLL/4 + \param[out] none + \retval none +*/ +void rcu_usb_clock_config(uint32_t usb_psc) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* configure the USBFS prescaler factor */ + reg &= ~RCU_CFG0_USBFSPSC; + + RCU_CFG0 = (reg | usb_psc); +} + +/*! + \brief configure the RTC clock source selection + \param[in] rtc_clock_source: RTC clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_RTCSRC_NONE: no clock selected + \arg RCU_RTCSRC_LXTAL: CK_LXTAL selected as RTC source clock + \arg RCU_RTCSRC_IRC40K: CK_IRC40K selected as RTC source clock + \arg RCU_RTCSRC_HXTAL_DIV_128: CK_HXTAL/128 selected as RTC source clock + \param[out] none + \retval none +*/ +void rcu_rtc_clock_config(uint32_t rtc_clock_source) +{ + uint32_t reg; + + reg = RCU_BDCTL; + /* reset the RTCSRC bits and set according to rtc_clock_source */ + reg &= ~RCU_BDCTL_RTCSRC; + RCU_BDCTL = (reg | rtc_clock_source); +} + +/*! + \brief configure the I2S1 clock source selection + \param[in] i2s_clock_source: I2S1 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_I2S1SRC_CKSYS: system clock selected as I2S1 source clock + \arg RCU_I2S1SRC_CKPLL2_MUL2: CK_PLL2x2 selected as I2S1 source clock + \param[out] none + \retval none +*/ +void rcu_i2s1_clock_config(uint32_t i2s_clock_source) +{ + uint32_t reg; + + reg = RCU_CFG1; + /* reset the I2S1SEL bit and set according to i2s_clock_source */ + reg &= ~RCU_CFG1_I2S1SEL; + RCU_CFG1 = (reg | i2s_clock_source); +} + +/*! + \brief configure the I2S2 clock source selection + \param[in] i2s_clock_source: I2S2 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_I2S2SRC_CKSYS: system clock selected as I2S2 source clock + \arg RCU_I2S2SRC_CKPLL2_MUL2: CK_PLL2x2 selected as I2S2 source clock + \param[out] none + \retval none +*/ +void rcu_i2s2_clock_config(uint32_t i2s_clock_source) +{ + uint32_t reg; + + reg = RCU_CFG1; + /* reset the I2S2SEL bit and set according to i2s_clock_source */ + reg &= ~RCU_CFG1_I2S2SEL; + RCU_CFG1 = (reg | i2s_clock_source); +} + +/*! + \brief configure the CK48M clock source selection + \param[in] ck48m_clock_source: CK48M clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_CK48MSRC_CKPLL: CK_PLL selected as CK48M source clock + \arg RCU_CK48MSRC_IRC48M: CK_IRC48M selected as CK48M source clock + \param[out] none + \retval none +*/ +void rcu_ck48m_clock_config(uint32_t ck48m_clock_source) +{ + uint32_t reg; + + reg = RCU_ADDCTL; + /* reset the CK48MSEL bit and set according to ck48m_clock_source */ + reg &= ~RCU_ADDCTL_CK48MSEL; + RCU_ADDCTL = (reg | ck48m_clock_source); +} + +/*! + \brief get the clock stabilization and peripheral reset flags + \param[in] flag: the clock stabilization and peripheral reset flags, refer to rcu_flag_enum + only one parameter can be selected which is shown as below: + \arg RCU_FLAG_IRC8MSTB: IRC8M stabilization flag + \arg RCU_FLAG_HXTALSTB: HXTAL stabilization flag + \arg RCU_FLAG_PLLSTB: PLL stabilization flag + \arg RCU_FLAG_PLL1STB: PLL1 stabilization flag + \arg RCU_FLAG_PLL2STB: PLL2 stabilization flag + \arg RCU_FLAG_LXTALSTB: LXTAL stabilization flag + \arg RCU_FLAG_IRC40KSTB: IRC40K stabilization flag + \arg RCU_FLAG_IRC48MSTB: IRC48M stabilization flag + \arg RCU_FLAG_EPRST: external PIN reset flag + \arg RCU_FLAG_PORRST: power reset flag + \arg RCU_FLAG_SWRST: software reset flag + \arg RCU_FLAG_FWDGTRST: free watchdog timer reset flag + \arg RCU_FLAG_WWDGTRST: window watchdog timer reset flag + \arg RCU_FLAG_LPRST: low-power reset flag + \param[out] none + \retval none +*/ +FlagStatus rcu_flag_get(rcu_flag_enum flag) +{ + /* get the rcu flag */ + if(RESET != (RCU_REG_VAL(flag) & BIT(RCU_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear all the reset flag + \param[in] none + \param[out] none + \retval none +*/ +void rcu_all_reset_flag_clear(void) +{ + RCU_RSTSCK |= RCU_RSTSCK_RSTFC; +} + +/*! + \brief get the clock stabilization interrupt and ckm flags + \param[in] int_flag: interrupt and ckm flags, refer to rcu_int_flag_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_FLAG_IRC40KSTB: IRC40K stabilization interrupt flag + \arg RCU_INT_FLAG_LXTALSTB: LXTAL stabilization interrupt flag + \arg RCU_INT_FLAG_IRC8MSTB: IRC8M stabilization interrupt flag + \arg RCU_INT_FLAG_HXTALSTB: HXTAL stabilization interrupt flag + \arg RCU_INT_FLAG_PLLSTB: PLL stabilization interrupt flag + \arg RCU_INT_FLAG_PLL1STB: PLL1 stabilization interrupt flag + \arg RCU_INT_FLAG_PLL2STB: PLL2 stabilization interrupt flag + \arg RCU_INT_FLAG_CKM: HXTAL clock stuck interrupt flag + \arg RCU_INT_FLAG_IRC48MSTB: IRC48M stabilization interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus rcu_interrupt_flag_get(rcu_int_flag_enum int_flag) +{ + /* get the rcu interrupt flag */ + if(RESET != (RCU_REG_VAL(int_flag) & BIT(RCU_BIT_POS(int_flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear the interrupt flags + \param[in] int_flag_clear: clock stabilization and stuck interrupt flags clear, refer to rcu_int_flag_clear_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_FLAG_IRC40KSTB_CLR: IRC40K stabilization interrupt flag clear + \arg RCU_INT_FLAG_LXTALSTB_CLR: LXTAL stabilization interrupt flag clear + \arg RCU_INT_FLAG_IRC8MSTB_CLR: IRC8M stabilization interrupt flag clear + \arg RCU_INT_FLAG_HXTALSTB_CLR: HXTAL stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLLSTB_CLR: PLL stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLL1STB_CLR: PLL1 stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLL2STB_CLR: PLL2 stabilization interrupt flag clear + \arg RCU_INT_FLAG_CKM_CLR: clock stuck interrupt flag clear + \arg RCU_INT_FLAG_IRC48MSTB_CLR: IRC48M stabilization interrupt flag clear + \param[out] none + \retval none +*/ +void rcu_interrupt_flag_clear(rcu_int_flag_clear_enum int_flag_clear) +{ + RCU_REG_VAL(int_flag_clear) |= BIT(RCU_BIT_POS(int_flag_clear)); +} + +/*! + \brief enable the stabilization interrupt + \param[in] stab_int: clock stabilization interrupt, refer to rcu_int_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_IRC40KSTB: IRC40K stabilization interrupt enable + \arg RCU_INT_LXTALSTB: LXTAL stabilization interrupt enable + \arg RCU_INT_IRC8MSTB: IRC8M stabilization interrupt enable + \arg RCU_INT_HXTALSTB: HXTAL stabilization interrupt enable + \arg RCU_INT_PLLSTB: PLL stabilization interrupt enable + \arg RCU_INT_PLL1STB: PLL1 stabilization interrupt enable + \arg RCU_INT_PLL2STB: PLL2 stabilization interrupt enable + \arg RCU_INT_IRC48MSTB: IRC48M stabilization interrupt enable + \param[out] none + \retval none +*/ +void rcu_interrupt_enable(rcu_int_enum stab_int) +{ + RCU_REG_VAL(stab_int) |= BIT(RCU_BIT_POS(stab_int)); +} + +/*! + \brief disable the stabilization interrupt + \param[in] stab_int: clock stabilization interrupt, refer to rcu_int_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_IRC40KSTB: IRC40K stabilization interrupt enable + \arg RCU_INT_LXTALSTB: LXTAL stabilization interrupt enable + \arg RCU_INT_IRC8MSTB: IRC8M stabilization interrupt enable + \arg RCU_INT_HXTALSTB: HXTAL stabilization interrupt enable + \arg RCU_INT_PLLSTB: PLL stabilization interrupt enable + \arg RCU_INT_PLL1STB: PLL1 stabilization interrupt enable + \arg RCU_INT_PLL2STB: PLL2 stabilization interrupt enable + \arg RCU_INT_IRC48MSTB: IRC48M stabilization interrupt enable + \param[out] none + \retval none +*/ +void rcu_interrupt_disable(rcu_int_enum stab_int) +{ + RCU_REG_VAL(stab_int) &= ~BIT(RCU_BIT_POS(stab_int)); +} + +/*! + \brief configure the LXTAL drive capability + \param[in] lxtal_dricap: drive capability of LXTAL + only one parameter can be selected which is shown as below: + \arg RCU_LXTAL_LOWDRI: lower driving capability + \arg RCU_LXTAL_MED_LOWDRI: medium low driving capability + \arg RCU_LXTAL_MED_HIGHDRI: medium high driving capability + \arg RCU_LXTAL_HIGHDRI: higher driving capability + \param[out] none + \retval none +*/ +void rcu_lxtal_drive_capability_config(uint32_t lxtal_dricap) +{ + uint32_t reg; + + reg = RCU_BDCTL; + + /* reset the LXTALDRI bits and set according to lxtal_dricap */ + reg &= ~RCU_BDCTL_LXTALDRI; + RCU_BDCTL = (reg | lxtal_dricap); +} + +/*! + \brief wait for oscillator stabilization flags is SET or oscillator startup is timeout + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC48M: internal 48M RC oscillators(IRC48M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1 + \arg RCU_PLL2_CK: phase locked loop 2 + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus rcu_osci_stab_wait(rcu_osci_type_enum osci) +{ + uint32_t stb_cnt = 0U; + ErrStatus reval = ERROR; + FlagStatus osci_stat = RESET; + + switch(osci){ + /* wait HXTAL stable */ + case RCU_HXTAL: + while((RESET == osci_stat) && (HXTAL_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_HXTALSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_HXTALSTB)){ + reval = SUCCESS; + } + break; + + /* wait LXTAL stable */ + case RCU_LXTAL: + while((RESET == osci_stat) && (LXTAL_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_LXTALSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_LXTALSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC8M stable */ + case RCU_IRC8M: + while((RESET == osci_stat) && (IRC8M_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC8MSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_IRC8MSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC48M stable */ + case RCU_IRC48M: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC48MSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if (RESET != rcu_flag_get(RCU_FLAG_IRC48MSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC40K stable */ + case RCU_IRC40K: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC40KSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_IRC40KSTB)){ + reval = SUCCESS; + } + break; + + /* wait PLL stable */ + case RCU_PLL_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLLSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLLSTB)){ + reval = SUCCESS; + } + break; + + /* wait PLL1 stable */ + case RCU_PLL1_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLL1STB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLL1STB)){ + reval = SUCCESS; + } + break; + /* wait PLL2 stable */ + case RCU_PLL2_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLL2STB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLL2STB)){ + reval = SUCCESS; + } + break; + + default: + break; + } + + /* return value */ + return reval; +} + +/*! + \brief turn on the oscillator + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC48M: internal 48M RC oscillators(IRC48M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1 + \arg RCU_PLL2_CK: phase locked loop 2 + \param[out] none + \retval none +*/ +void rcu_osci_on(rcu_osci_type_enum osci) +{ + RCU_REG_VAL(osci) |= BIT(RCU_BIT_POS(osci)); +} + +/*! + \brief turn off the oscillator + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC48M: internal 48M RC oscillators(IRC48M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1 + \arg RCU_PLL2_CK: phase locked loop 2 + \param[out] none + \retval none +*/ +void rcu_osci_off(rcu_osci_type_enum osci) +{ + RCU_REG_VAL(osci) &= ~BIT(RCU_BIT_POS(osci)); +} + +/*! + \brief enable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \param[out] none + \retval none +*/ +void rcu_osci_bypass_mode_enable(rcu_osci_type_enum osci) +{ + uint32_t reg; + + switch(osci){ + /* enable HXTAL to bypass mode */ + case RCU_HXTAL: + reg = RCU_CTL; + RCU_CTL &= ~RCU_CTL_HXTALEN; + RCU_CTL = (reg | RCU_CTL_HXTALBPS); + break; + /* enable LXTAL to bypass mode */ + case RCU_LXTAL: + reg = RCU_BDCTL; + RCU_BDCTL &= ~RCU_BDCTL_LXTALEN; + RCU_BDCTL = (reg | RCU_BDCTL_LXTALBPS); + break; + case RCU_IRC8M: + case RCU_IRC48M: + case RCU_IRC40K: + case RCU_PLL_CK: + case RCU_PLL1_CK: + case RCU_PLL2_CK: + break; + default: + break; + } +} + +/*! + \brief disable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \param[out] none + \retval none +*/ +void rcu_osci_bypass_mode_disable(rcu_osci_type_enum osci) +{ + uint32_t reg; + + switch(osci){ + /* disable HXTAL to bypass mode */ + case RCU_HXTAL: + reg = RCU_CTL; + RCU_CTL &= ~RCU_CTL_HXTALEN; + RCU_CTL = (reg & ~RCU_CTL_HXTALBPS); + break; + /* disable LXTAL to bypass mode */ + case RCU_LXTAL: + reg = RCU_BDCTL; + RCU_BDCTL &= ~RCU_BDCTL_LXTALEN; + RCU_BDCTL = (reg & ~RCU_BDCTL_LXTALBPS); + break; + case RCU_IRC8M: + case RCU_IRC48M: + case RCU_IRC40K: + case RCU_PLL_CK: + case RCU_PLL1_CK: + case RCU_PLL2_CK: + break; + default: + break; + } +} + +/*! + \brief enable the HXTAL clock monitor + \param[in] none + \param[out] none + \retval none +*/ + +void rcu_hxtal_clock_monitor_enable(void) +{ + RCU_CTL |= RCU_CTL_CKMEN; +} + +/*! + \brief disable the HXTAL clock monitor + \param[in] none + \param[out] none + \retval none +*/ +void rcu_hxtal_clock_monitor_disable(void) +{ + RCU_CTL &= ~RCU_CTL_CKMEN; +} + +/*! + \brief set the IRC8M adjust value + \param[in] irc8m_adjval: IRC8M adjust value, must be between 0 and 0x1F + \arg 0x00 - 0x1F + \param[out] none + \retval none +*/ +void rcu_irc8m_adjust_value_set(uint32_t irc8m_adjval) +{ + uint32_t reg; + + reg = RCU_CTL; + /* reset the IRC8MADJ bits and set according to irc8m_adjval */ + reg &= ~RCU_CTL_IRC8MADJ; + RCU_CTL = (reg | ((irc8m_adjval & RCU_IRC8M_ADJUST_MASK) << RCU_IRC8M_ADJUST_OFFSET)); +} + +/*! + \brief deep-sleep mode voltage select + \param[in] dsvol: deep sleep mode voltage + only one parameter can be selected which is shown as below: + \arg RCU_DEEPSLEEP_V_1_0: the core voltage is 1.0V + \arg RCU_DEEPSLEEP_V_0_9: the core voltage is 0.9V + \arg RCU_DEEPSLEEP_V_0_8: the core voltage is 0.8V + \arg RCU_DEEPSLEEP_V_1_2: the core voltage is 1.2V + \param[out] none + \retval none +*/ +void rcu_deepsleep_voltage_set(uint32_t dsvol) +{ + dsvol &= RCU_DSV_DSLPVS; + RCU_DSV = dsvol; +} + +/*! + \brief get the system clock, bus and peripheral clock frequency + \param[in] clock: the clock frequency which to get + only one parameter can be selected which is shown as below: + \arg CK_SYS: system clock frequency + \arg CK_AHB: AHB clock frequency + \arg CK_APB1: APB1 clock frequency + \arg CK_APB2: APB2 clock frequency + \param[out] none + \retval clock frequency of system, AHB, APB1, APB2 +*/ +uint32_t rcu_clock_freq_get(rcu_clock_freq_enum clock) +{ + uint32_t sws, ck_freq = 0U; + uint32_t cksys_freq, ahb_freq, apb1_freq, apb2_freq; + uint32_t pllsel, pllpresel, predv0sel, pllmf,ck_src, idx, clk_exp; + uint32_t predv0, predv1, pll1mf; + + /* exponent of AHB, APB1 and APB2 clock divider */ + uint8_t ahb_exp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + uint8_t apb1_exp[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + uint8_t apb2_exp[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + + sws = GET_BITS(RCU_CFG0, 2, 3); + switch(sws){ + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + cksys_freq = IRC8M_VALUE; + break; + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + cksys_freq = HXTAL_VALUE; + break; + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL, IRC48M or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + if(RCU_PLLSRC_HXTAL_IRC48M == pllsel) { + /* PLL clock source is HXTAL or IRC48M */ + pllpresel = (RCU_CFG1 & RCU_CFG1_PLLPRESEL); + + if(RCU_PLLPRESRC_HXTAL == pllpresel){ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + }else{ + /* PLL clock source is IRC48 */ + ck_src = IRC48M_VALUE; + } + + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> RCU_CFG1_PREDV1_OFFSET) + 1U; + pll1mf = (uint32_t)((RCU_CFG1 & RCU_CFG1_PLL1MF) >> RCU_CFG1_PLL1MF_OFFSET) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src/predv1)*pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; + }else{ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE/2U; + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + if(pllmf < 15U){ + pllmf += 2U; + }else{ + pllmf += 1U; + } + cksys_freq = ck_src*pllmf; + if(15U == pllmf){ + cksys_freq = ck_src*6U + ck_src/2U; + } + + break; + /* IRC8M is selected as CK_SYS */ + default: + cksys_freq = IRC8M_VALUE; + break; + } + + /* calculate AHB clock frequency */ + idx = GET_BITS(RCU_CFG0, 4, 7); + clk_exp = ahb_exp[idx]; + ahb_freq = cksys_freq >> clk_exp; + + /* calculate APB1 clock frequency */ + idx = GET_BITS(RCU_CFG0, 8, 10); + clk_exp = apb1_exp[idx]; + apb1_freq = ahb_freq >> clk_exp; + + /* calculate APB2 clock frequency */ + idx = GET_BITS(RCU_CFG0, 11, 13); + clk_exp = apb2_exp[idx]; + apb2_freq = ahb_freq >> clk_exp; + + /* return the clocks frequency */ + switch(clock){ + case CK_SYS: + ck_freq = cksys_freq; + break; + case CK_AHB: + ck_freq = ahb_freq; + break; + case CK_APB1: + ck_freq = apb1_freq; + break; + case CK_APB2: + ck_freq = apb2_freq; + break; + default: + break; + } + return ck_freq; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c.base@1.0.0 new file mode 100644 index 0000000..89007c4 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c.base@1.0.0 @@ -0,0 +1,1249 @@ +/*! + \file gd32c10x_rcu.c + \brief RCU driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_rcu.h" + +/* define clock source */ +#define SEL_IRC8M ((uint16_t)0U) /* IRC8M is selected as CK_SYS */ +#define SEL_HXTAL ((uint16_t)1U) /* HXTAL is selected as CK_SYS */ +#define SEL_PLL ((uint16_t)2U) /* PLL is selected as CK_SYS */ + +/* define startup timeout count */ +#define OSC_STARTUP_TIMEOUT ((uint32_t)0x000FFFFFU) +#define LXTAL_STARTUP_TIMEOUT ((uint32_t)0x03FFFFFFU) + +/* ADC clock prescaler offset */ +#define RCU_ADC_PSC_OFFSET ((uint32_t)14U) + +/* RCU IRC8M adjust value mask and offset*/ +#define RCU_IRC8M_ADJUST_MASK ((uint8_t)0x1FU) +#define RCU_IRC8M_ADJUST_OFFSET ((uint32_t)3U) + +/* RCU PLL1 clock multiplication factor offset */ +#define RCU_CFG1_PLL1MF_OFFSET ((uint32_t)8U) +/* RCU PREDV1 division factor offset*/ +#define RCU_CFG1_PREDV1_OFFSET ((uint32_t)4U) + +/*! + \brief deinitialize the RCU + \param[in] none + \param[out] none + \retval none +*/ +void rcu_deinit(void) +{ + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + rcu_osci_stab_wait(RCU_IRC8M); + + RCU_CFG0 &= ~(RCU_CFG0_SCS); + /* reset HXTALEN, CKMEN, PLLEN bits */ + RCU_CTL &= ~(RCU_CTL_HXTALEN | RCU_CTL_CKMEN | RCU_CTL_PLLEN); + + /* reset CFG0 register */ + RCU_CFG0 &= ~(RCU_CFG0_SCS | RCU_CFG0_AHBPSC | RCU_CFG0_APB1PSC | RCU_CFG0_APB2PSC | + RCU_CFG0_ADCPSC | RCU_CFG0_CKOUT0SEL | RCU_CFG0_ADCPSC_2); + + /* reset HXTALBPS bit */ + RCU_CTL &= ~RCU_CTL_HXTALBPS; + /* reset PLLSEL, PREDV0_LSB, PLLMF, USBFSPSC bits */ + RCU_CFG0 &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PREDV0_LSB | RCU_CFG0_PLLMF | + RCU_CFG0_USBFSPSC | RCU_CFG0_PLLMF_4 | RCU_CFG0_USBFSPSC_2); + /* reset PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLL1EN | RCU_CTL_PLL2EN); + + /* reset INT and CFG1 register */ + RCU_INT = 0x00ff0000U; + RCU_CFG1 &= ~(RCU_CFG1_PREDV0 | RCU_CFG1_PREDV1 | RCU_CFG1_PLL1MF | RCU_CFG1_PLL2MF | + RCU_CFG1_PREDV0SEL | RCU_CFG1_I2S1SEL | RCU_CFG1_I2S2SEL | RCU_CFG1_ADCPSC_3 | + RCU_CFG1_PLLPRESEL); +} +/*! + \brief enable the peripherals clock + \param[in] periph: RCU peripherals, refer to rcu_periph_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOx (x=A,B,C,D,E): GPIO ports clock + \arg RCU_AF : alternate function clock + \arg RCU_CRC: CRC clock + \arg RCU_DMAx (x=0,1): DMA clock + \arg RCU_USBFS: USBFS clock + \arg RCU_EXMC: EXMC clock + \arg RCU_TIMERx (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): TIMER clock + \arg RCU_WWDGT: WWDGT clock + \arg RCU_SPIx (x=0,1,2): SPI clock + \arg RCU_USARTx (x=0,1,2): USART clock + \arg RCU_UARTx (x=3,4): UART clock + \arg RCU_I2Cx (x=0,1): I2C clock + \arg RCU_CANx (x=0,1): CAN clock + \arg RCU_PMU: PMU clock + \arg RCU_DAC: DAC clock + \arg RCU_RTC: RTC clock + \arg RCU_ADCx (x=0,1): ADC clock + \arg RCU_CTC: CTC clock + \arg RCU_BKPI: BKP interface clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_enable(rcu_periph_enum periph) +{ + RCU_REG_VAL(periph) |= BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief disable the peripherals clock + \param[in] periph: RCU peripherals, refer to rcu_periph_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOx (x=A,B,C,D,E): GPIO ports clock + \arg RCU_AF: alternate function clock + \arg RCU_CRC: CRC clock + \arg RCU_DMAx (x=0,1): DMA clock + \arg RCU_USBFS: USBFS clock + \arg RCU_EXMC: EXMC clock + \arg RCU_TIMERx (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): TIMER clock + \arg RCU_WWDGT: WWDGT clock + \arg RCU_SPIx (x=0,1,2): SPI clock + \arg RCU_USARTx (x=0,1,2): USART clock + \arg RCU_UARTx (x=3,4): UART clock + \arg RCU_I2Cx (x=0,1): I2C clock + \arg RCU_CANx (x=0,1): CAN clock + \arg RCU_PMU: PMU clock + \arg RCU_DAC: DAC clock + \arg RCU_RTC: RTC clock + \arg RCU_ADCx (x=0,1): ADC clock + \arg RCU_CTC: CTC clock + \arg RCU_BKPI: BKP interface clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_disable(rcu_periph_enum periph) +{ + RCU_REG_VAL(periph) &= ~BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief enable the peripherals clock when sleep mode + \param[in] periph: RCU peripherals, refer to rcu_periph_sleep_enum + only one parameter can be selected which is shown as below: + \arg RCU_FMC_SLP: FMC clock + \arg RCU_SRAM_SLP: SRAM clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_sleep_enable(rcu_periph_sleep_enum periph) +{ + RCU_REG_VAL(periph) |= BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief disable the peripherals clock when sleep mode + \param[in] periph: RCU peripherals, refer to rcu_periph_sleep_enum + only one parameter can be selected which is shown as below: + \arg RCU_FMC_SLP: FMC clock + \arg RCU_SRAM_SLP: SRAM clock + \param[out] none + \retval none +*/ +void rcu_periph_clock_sleep_disable(rcu_periph_sleep_enum periph) +{ + RCU_REG_VAL(periph) &= ~BIT(RCU_BIT_POS(periph)); +} + +/*! + \brief reset the peripherals + \param[in] periph_reset: RCU peripherals reset, refer to rcu_periph_reset_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOxRST (x=A,B,C,D,E): reset GPIO ports + \arg RCU_AFRST : reset alternate function clock + \arg RCU_USBFSRST: reset USBFS + \arg RCU_TIMERxRST (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): reset TIMER + \arg RCU_WWDGTRST: reset WWDGT + \arg RCU_SPIxRST (x=0,1,2): reset SPI + \arg RCU_USARTxRST (x=0,1,2): reset USART + \arg RCU_UARTxRST (x=3,4): reset UART + \arg RCU_I2CxRST (x=0,1): reset I2C + \arg RCU_CANxRST (x=0,1): reset CAN + \arg RCU_PMURST: reset PMU + \arg RCU_DACRST: reset DAC + \arg RCU_ADCxRST (x=0,1): reset ADC + \arg RCU_CTCRST: reset CTC + \arg RCU_BKPIRST: reset BKPI + \param[out] none + \retval none +*/ +void rcu_periph_reset_enable(rcu_periph_reset_enum periph_reset) +{ + RCU_REG_VAL(periph_reset) |= BIT(RCU_BIT_POS(periph_reset)); +} + +/*! + \brief disable reset the peripheral + \param[in] periph_reset: RCU peripherals reset, refer to rcu_periph_reset_enum + only one parameter can be selected which is shown as below: + \arg RCU_GPIOxRST (x=A,B,C,D,E): reset GPIO ports + \arg RCU_AFRST : reset alternate function clock + \arg RCU_USBFSRST: reset USBFS + \arg RCU_TIMERxRST (x=0,1,2,3,4,5,6,7,8,9,10,11,12,13): reset TIMER + \arg RCU_WWDGTRST: reset WWDGT + \arg RCU_SPIxRST (x=0,1,2): reset SPI + \arg RCU_USARTxRST (x=0,1,2): reset USART + \arg RCU_UARTxRST (x=3,4): reset UART + \arg RCU_I2CxRST (x=0,1): reset I2C + \arg RCU_CANxRST (x=0,1): reset CAN + \arg RCU_PMURST: reset PMU + \arg RCU_DACRST: reset DAC + \arg RCU_ADCxRST (x=0,1): reset ADC + \arg RCU_CTCRST: reset CTC + \arg RCU_BKPIRST: reset BKPI + \param[out] none + \retval none +*/ +void rcu_periph_reset_disable(rcu_periph_reset_enum periph_reset) +{ + RCU_REG_VAL(periph_reset) &= ~BIT(RCU_BIT_POS(periph_reset)); +} + +/*! + \brief reset the BKP domain + \param[in] none + \param[out] none + \retval none +*/ +void rcu_bkp_reset_enable(void) +{ + RCU_BDCTL |= RCU_BDCTL_BKPRST; +} + +/*! + \brief disable the BKP domain reset + \param[in] none + \param[out] none + \retval none +*/ +void rcu_bkp_reset_disable(void) +{ + RCU_BDCTL &= ~RCU_BDCTL_BKPRST; +} + +/*! + \brief configure the system clock source + \param[in] ck_sys: system clock source select + only one parameter can be selected which is shown as below: + \arg RCU_CKSYSSRC_IRC8M: select CK_IRC8M as the CK_SYS source + \arg RCU_CKSYSSRC_HXTAL: select CK_HXTAL as the CK_SYS source + \arg RCU_CKSYSSRC_PLL: select CK_PLL as the CK_SYS source + \param[out] none + \retval none +*/ +void rcu_system_clock_source_config(uint32_t ck_sys) +{ + uint32_t reg; + + reg = RCU_CFG0; + /* reset the SCS bits and set according to ck_sys */ + reg &= ~RCU_CFG0_SCS; + RCU_CFG0 = (reg | ck_sys); +} + +/*! + \brief get the system clock source + \param[in] none + \param[out] none + \retval which clock is selected as CK_SYS source + \arg RCU_SCSS_IRC8M: CK_IRC8M is selected as the CK_SYS source + \arg RCU_SCSS_HXTAL: CK_HXTAL is selected as the CK_SYS source + \arg RCU_SCSS_PLL: CK_PLL is selected as the CK_SYS source +*/ +uint32_t rcu_system_clock_source_get(void) +{ + return (RCU_CFG0 & RCU_CFG0_SCSS); +} + +/*! + \brief configure the AHB clock prescaler selection + \param[in] ck_ahb: AHB clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_AHB_CKSYS_DIVx, x=1, 2, 4, 8, 16, 64, 128, 256, 512 + \param[out] none + \retval none +*/ +void rcu_ahb_clock_config(uint32_t ck_ahb) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the AHBPSC bits and set according to ck_ahb */ + reg &= ~RCU_CFG0_AHBPSC; + RCU_CFG0 = (reg | ck_ahb); +} + +/*! + \brief configure the APB1 clock prescaler selection + \param[in] ck_apb1: APB1 clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_APB1_CKAHB_DIV1: select CK_AHB as CK_APB1 + \arg RCU_APB1_CKAHB_DIV2: select CK_AHB/2 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV4: select CK_AHB/4 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV8: select CK_AHB/8 as CK_APB1 + \arg RCU_APB1_CKAHB_DIV16: select CK_AHB/16 as CK_APB1 + \param[out] none + \retval none +*/ +void rcu_apb1_clock_config(uint32_t ck_apb1) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the APB1PSC and set according to ck_apb1 */ + reg &= ~RCU_CFG0_APB1PSC; + RCU_CFG0 = (reg | ck_apb1); +} + +/*! + \brief configure the APB2 clock prescaler selection + \param[in] ck_apb2: APB2 clock prescaler selection + only one parameter can be selected which is shown as below: + \arg RCU_APB2_CKAHB_DIV1: select CK_AHB as CK_APB2 + \arg RCU_APB2_CKAHB_DIV2: select CK_AHB/2 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV4: select CK_AHB/4 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV8: select CK_AHB/8 as CK_APB2 + \arg RCU_APB2_CKAHB_DIV16: select CK_AHB/16 as CK_APB2 + \param[out] none + \retval none +*/ +void rcu_apb2_clock_config(uint32_t ck_apb2) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the APB2PSC and set according to ck_apb2 */ + reg &= ~RCU_CFG0_APB2PSC; + RCU_CFG0 = (reg | ck_apb2); +} + +/*! + \brief configure the CK_OUT0 clock source + \param[in] ckout0_src: CK_OUT0 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_CKOUT0SRC_NONE: no clock selected + \arg RCU_CKOUT0SRC_CKSYS: system clock selected + \arg RCU_CKOUT0SRC_IRC8M: high speed 8M internal oscillator clock selected + \arg RCU_CKOUT0SRC_HXTAL: HXTAL selected + \arg RCU_CKOUT0SRC_CKPLL_DIV2: CK_PLL/2 selected + \arg RCU_CKOUT0SRC_CKPLL1: CK_PLL1 selected + \arg RCU_CKOUT0SRC_CKPLL2_DIV2: CK_PLL2/2 selected + \arg RCU_CKOUT0SRC_CKPLL2: PLL2 selected + \arg RCU_CKOUT0SRC_IRC48M: IRC48M selected + \arg RCU_CKOUT0SRC_IRC48M_DIV8: IRC48M/8 selected + \param[out] none + \retval none +*/ +void rcu_ckout0_config(uint32_t ckout0_src) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* reset the CKOUT0SRC, set according to ckout0_src */ + reg &= ~RCU_CFG0_CKOUT0SEL; + RCU_CFG0 = (reg | ckout0_src); +} + +/*! + \brief configure the main PLL clock + \param[in] pll_src: PLL clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_PLLSRC_IRC8M_DIV2: IRC8M/2 clock selected as source clock of PLL + \arg RCU_PLLSRC_HXTAL_IRC48M: HXTAL or IRC48M selected as source clock of PLL + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL_MULx (x = 2..14, 16..31, 6.5) + \param[out] none + \retval none +*/ +void rcu_pll_config(uint32_t pll_src, uint32_t pll_mul) +{ + uint32_t reg = 0U; + + reg = RCU_CFG0; + + /* PLL clock source and multiplication factor configuration */ + reg &= ~(RCU_CFG0_PLLSEL | RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + reg |= (pll_src | pll_mul); + + RCU_CFG0 = reg; +} + +/*! + \brief configure the PLL clock source preselection + \param[in] pll_presel: PLL clock source preselection + only one parameter can be selected which is shown as below: + \arg RCU_PLLPRESRC_HXTAL: HXTAL selected as PLL source clock + \arg RCU_PLLPRESRC_IRC48M: CK_PLL selected as PREDV0 input source clock + \param[out] none + \retval none +*/ +void rcu_pllpresel_config(uint32_t pll_presel) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + + /* PLL clock source preselection */ + reg &= ~RCU_CFG1_PLLPRESEL; + reg |= pll_presel; + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PREDV0 division factor and clock source + \param[in] predv0_source: PREDV0 input clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_PREDV0SRC_HXTAL_IRC48M: HXTAL or IRC48M selected as PREDV0 input source clock + \arg RCU_PREDV0SRC_CKPLL1: CK_PLL1 selected as PREDV0 input source clock + \param[in] predv0_div: PREDV0 division factor + only one parameter can be selected which is shown as below: + \arg RCU_PREDV0_DIVx, x = 1..16 + \param[out] none + \retval none +*/ +void rcu_predv0_config(uint32_t predv0_source, uint32_t predv0_div) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + /* reset PREDV0SEL and PREDV0 bits */ + reg &= ~(RCU_CFG1_PREDV0SEL | RCU_CFG1_PREDV0); + /* set the PREDV0SEL and PREDV0 division factor */ + reg |= (predv0_source | predv0_div); + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PREDV1 division factor + \param[in] predv1_div: PREDV1 division factor + only one parameter can be selected which is shown as below: + \arg RCU_PREDV1_DIVx, x = 1..16 + \param[out] none + \retval none +*/ +void rcu_predv1_config(uint32_t predv1_div) +{ + uint32_t reg = 0U; + + reg = RCU_CFG1; + /* reset the PREDV1 bits */ + reg &= ~RCU_CFG1_PREDV1; + /* set the PREDV1 division factor */ + reg |= predv1_div; + + RCU_CFG1 = reg; +} + +/*! + \brief configure the PLL1 clock + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL1_MULx (x = 8..16, 20) + \param[out] none + \retval none +*/ +void rcu_pll1_config(uint32_t pll_mul) +{ + RCU_CFG1 &= ~RCU_CFG1_PLL1MF; + RCU_CFG1 |= pll_mul; +} + +/*! + \brief configure the PLL2 clock + \param[in] pll_mul: PLL clock multiplication factor + only one parameter can be selected which is shown as below: + \arg RCU_PLL2_MULx (x = 8..16, 20) + \param[out] none + \retval none +*/ +void rcu_pll2_config(uint32_t pll_mul) +{ + RCU_CFG1 &= ~RCU_CFG1_PLL2MF; + RCU_CFG1 |= pll_mul; +} + +/*! + \brief configure the ADC prescaler factor + \param[in] adc_psc: ADC prescaler factor + only one parameter can be selected which is shown as below: + \arg RCU_CKADC_CKAPB2_DIV2: ADC prescaler select CK_APB2/2 + \arg RCU_CKADC_CKAPB2_DIV4: ADC prescaler select CK_APB2/4 + \arg RCU_CKADC_CKAPB2_DIV6: ADC prescaler select CK_APB2/6 + \arg RCU_CKADC_CKAPB2_DIV8: ADC prescaler select CK_APB2/8 + \arg RCU_CKADC_CKAPB2_DIV12: ADC prescaler select CK_APB2/12 + \arg RCU_CKADC_CKAPB2_DIV16: ADC prescaler select CK_APB2/16 + \arg RCU_CKADC_CKAHB_DIV3: ADC prescaler select CK_AHB/3 + \arg RCU_CKADC_CKAHB_DIV5: ADC prescaler select CK_AHB/5 + \arg RCU_CKADC_CKAHB_DIV7: ADC prescaler select CK_AHB/7 + \arg RCU_CKADC_CKAHB_DIV9: ADC prescaler select CK_AHB/9 + \param[out] none + \retval none +*/ +void rcu_adc_clock_config(uint32_t adc_psc) +{ + uint32_t reg0,reg1; + + /* reset the ADCPSC bits */ + reg0 = RCU_CFG0; + reg0 &= ~(RCU_CFG0_ADCPSC_2 | RCU_CFG0_ADCPSC); + reg1 = RCU_CFG1; + reg1 &= ~RCU_CFG1_ADCPSC_3; + + /* set the ADC prescaler factor */ + switch(adc_psc){ + case RCU_CKADC_CKAPB2_DIV2: + case RCU_CKADC_CKAPB2_DIV4: + case RCU_CKADC_CKAPB2_DIV6: + case RCU_CKADC_CKAPB2_DIV8: + reg0 |= (adc_psc << RCU_ADC_PSC_OFFSET); + break; + + case RCU_CKADC_CKAPB2_DIV12: + case RCU_CKADC_CKAPB2_DIV16: + adc_psc &= ~BIT(2); + reg0 |= ((adc_psc << RCU_ADC_PSC_OFFSET) | RCU_CFG0_ADCPSC_2); + break; + + case RCU_CKADC_CKAHB_DIV3: + case RCU_CKADC_CKAHB_DIV5: + case RCU_CKADC_CKAHB_DIV7: + case RCU_CKADC_CKAHB_DIV9: + adc_psc &= ~BITS(2,3); + reg0 |= (adc_psc << RCU_ADC_PSC_OFFSET); + reg1 |= RCU_CFG1_ADCPSC_3; + break; + + default: + break; + } + + /* set the register */ + RCU_CFG0 = reg0; + RCU_CFG1 = reg1; +} + +/*! + \brief configure the USBFS prescaler factor + \param[in] adc_div: USB prescaler factor + only one parameter can be selected which is shown as below: + \arg RCU_CKUSB_CKPLL_DIV1_5: USBFS prescaler select CK_PLL/1.5 + \arg RCU_CKUSB_CKPLL_DIV1: USBFS prescaler select CK_PLL/1 + \arg RCU_CKUSB_CKPLL_DIV2_5: USBFS prescaler select CK_PLL/2.5 + \arg RCU_CKUSB_CKPLL_DIV2: USBFS prescaler select CK_PLL/2 + \arg RCU_CKUSB_CKPLL_DIV3: USBFS prescaler select CK_PLL/3 + \arg RCU_CKUSB_CKPLL_DIV3_5: USBFS prescaler select CK_PLL/3.5 + \arg RCU_CKUSB_CKPLL_DIV4: USBFS prescaler select CK_PLL/4 + \param[out] none + \retval none +*/ +void rcu_usb_clock_config(uint32_t usb_psc) +{ + uint32_t reg; + + reg = RCU_CFG0; + + /* configure the USBFS prescaler factor */ + reg &= ~RCU_CFG0_USBFSPSC; + + RCU_CFG0 = (reg | usb_psc); +} + +/*! + \brief configure the RTC clock source selection + \param[in] rtc_clock_source: RTC clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_RTCSRC_NONE: no clock selected + \arg RCU_RTCSRC_LXTAL: CK_LXTAL selected as RTC source clock + \arg RCU_RTCSRC_IRC40K: CK_IRC40K selected as RTC source clock + \arg RCU_RTCSRC_HXTAL_DIV_128: CK_HXTAL/128 selected as RTC source clock + \param[out] none + \retval none +*/ +void rcu_rtc_clock_config(uint32_t rtc_clock_source) +{ + uint32_t reg; + + reg = RCU_BDCTL; + /* reset the RTCSRC bits and set according to rtc_clock_source */ + reg &= ~RCU_BDCTL_RTCSRC; + RCU_BDCTL = (reg | rtc_clock_source); +} + +/*! + \brief configure the I2S1 clock source selection + \param[in] i2s_clock_source: I2S1 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_I2S1SRC_CKSYS: system clock selected as I2S1 source clock + \arg RCU_I2S1SRC_CKPLL2_MUL2: CK_PLL2x2 selected as I2S1 source clock + \param[out] none + \retval none +*/ +void rcu_i2s1_clock_config(uint32_t i2s_clock_source) +{ + uint32_t reg; + + reg = RCU_CFG1; + /* reset the I2S1SEL bit and set according to i2s_clock_source */ + reg &= ~RCU_CFG1_I2S1SEL; + RCU_CFG1 = (reg | i2s_clock_source); +} + +/*! + \brief configure the I2S2 clock source selection + \param[in] i2s_clock_source: I2S2 clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_I2S2SRC_CKSYS: system clock selected as I2S2 source clock + \arg RCU_I2S2SRC_CKPLL2_MUL2: CK_PLL2x2 selected as I2S2 source clock + \param[out] none + \retval none +*/ +void rcu_i2s2_clock_config(uint32_t i2s_clock_source) +{ + uint32_t reg; + + reg = RCU_CFG1; + /* reset the I2S2SEL bit and set according to i2s_clock_source */ + reg &= ~RCU_CFG1_I2S2SEL; + RCU_CFG1 = (reg | i2s_clock_source); +} + +/*! + \brief configure the CK48M clock source selection + \param[in] ck48m_clock_source: CK48M clock source selection + only one parameter can be selected which is shown as below: + \arg RCU_CK48MSRC_CKPLL: CK_PLL selected as CK48M source clock + \arg RCU_CK48MSRC_IRC48M: CK_IRC48M selected as CK48M source clock + \param[out] none + \retval none +*/ +void rcu_ck48m_clock_config(uint32_t ck48m_clock_source) +{ + uint32_t reg; + + reg = RCU_ADDCTL; + /* reset the CK48MSEL bit and set according to ck48m_clock_source */ + reg &= ~RCU_ADDCTL_CK48MSEL; + RCU_ADDCTL = (reg | ck48m_clock_source); +} + +/*! + \brief get the clock stabilization and peripheral reset flags + \param[in] flag: the clock stabilization and peripheral reset flags, refer to rcu_flag_enum + only one parameter can be selected which is shown as below: + \arg RCU_FLAG_IRC8MSTB: IRC8M stabilization flag + \arg RCU_FLAG_HXTALSTB: HXTAL stabilization flag + \arg RCU_FLAG_PLLSTB: PLL stabilization flag + \arg RCU_FLAG_PLL1STB: PLL1 stabilization flag + \arg RCU_FLAG_PLL2STB: PLL2 stabilization flag + \arg RCU_FLAG_LXTALSTB: LXTAL stabilization flag + \arg RCU_FLAG_IRC40KSTB: IRC40K stabilization flag + \arg RCU_FLAG_IRC48MSTB: IRC48M stabilization flag + \arg RCU_FLAG_EPRST: external PIN reset flag + \arg RCU_FLAG_PORRST: power reset flag + \arg RCU_FLAG_SWRST: software reset flag + \arg RCU_FLAG_FWDGTRST: free watchdog timer reset flag + \arg RCU_FLAG_WWDGTRST: window watchdog timer reset flag + \arg RCU_FLAG_LPRST: low-power reset flag + \param[out] none + \retval none +*/ +FlagStatus rcu_flag_get(rcu_flag_enum flag) +{ + /* get the rcu flag */ + if(RESET != (RCU_REG_VAL(flag) & BIT(RCU_BIT_POS(flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear all the reset flag + \param[in] none + \param[out] none + \retval none +*/ +void rcu_all_reset_flag_clear(void) +{ + RCU_RSTSCK |= RCU_RSTSCK_RSTFC; +} + +/*! + \brief get the clock stabilization interrupt and ckm flags + \param[in] int_flag: interrupt and ckm flags, refer to rcu_int_flag_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_FLAG_IRC40KSTB: IRC40K stabilization interrupt flag + \arg RCU_INT_FLAG_LXTALSTB: LXTAL stabilization interrupt flag + \arg RCU_INT_FLAG_IRC8MSTB: IRC8M stabilization interrupt flag + \arg RCU_INT_FLAG_HXTALSTB: HXTAL stabilization interrupt flag + \arg RCU_INT_FLAG_PLLSTB: PLL stabilization interrupt flag + \arg RCU_INT_FLAG_PLL1STB: PLL1 stabilization interrupt flag + \arg RCU_INT_FLAG_PLL2STB: PLL2 stabilization interrupt flag + \arg RCU_INT_FLAG_CKM: HXTAL clock stuck interrupt flag + \arg RCU_INT_FLAG_IRC48MSTB: IRC48M stabilization interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus rcu_interrupt_flag_get(rcu_int_flag_enum int_flag) +{ + /* get the rcu interrupt flag */ + if(RESET != (RCU_REG_VAL(int_flag) & BIT(RCU_BIT_POS(int_flag)))){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear the interrupt flags + \param[in] int_flag_clear: clock stabilization and stuck interrupt flags clear, refer to rcu_int_flag_clear_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_FLAG_IRC40KSTB_CLR: IRC40K stabilization interrupt flag clear + \arg RCU_INT_FLAG_LXTALSTB_CLR: LXTAL stabilization interrupt flag clear + \arg RCU_INT_FLAG_IRC8MSTB_CLR: IRC8M stabilization interrupt flag clear + \arg RCU_INT_FLAG_HXTALSTB_CLR: HXTAL stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLLSTB_CLR: PLL stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLL1STB_CLR: PLL1 stabilization interrupt flag clear + \arg RCU_INT_FLAG_PLL2STB_CLR: PLL2 stabilization interrupt flag clear + \arg RCU_INT_FLAG_CKM_CLR: clock stuck interrupt flag clear + \arg RCU_INT_FLAG_IRC48MSTB_CLR: IRC48M stabilization interrupt flag clear + \param[out] none + \retval none +*/ +void rcu_interrupt_flag_clear(rcu_int_flag_clear_enum int_flag_clear) +{ + RCU_REG_VAL(int_flag_clear) |= BIT(RCU_BIT_POS(int_flag_clear)); +} + +/*! + \brief enable the stabilization interrupt + \param[in] stab_int: clock stabilization interrupt, refer to rcu_int_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_IRC40KSTB: IRC40K stabilization interrupt enable + \arg RCU_INT_LXTALSTB: LXTAL stabilization interrupt enable + \arg RCU_INT_IRC8MSTB: IRC8M stabilization interrupt enable + \arg RCU_INT_HXTALSTB: HXTAL stabilization interrupt enable + \arg RCU_INT_PLLSTB: PLL stabilization interrupt enable + \arg RCU_INT_PLL1STB: PLL1 stabilization interrupt enable + \arg RCU_INT_PLL2STB: PLL2 stabilization interrupt enable + \arg RCU_INT_IRC48MSTB: IRC48M stabilization interrupt enable + \param[out] none + \retval none +*/ +void rcu_interrupt_enable(rcu_int_enum stab_int) +{ + RCU_REG_VAL(stab_int) |= BIT(RCU_BIT_POS(stab_int)); +} + +/*! + \brief disable the stabilization interrupt + \param[in] stab_int: clock stabilization interrupt, refer to rcu_int_enum + only one parameter can be selected which is shown as below: + \arg RCU_INT_IRC40KSTB: IRC40K stabilization interrupt enable + \arg RCU_INT_LXTALSTB: LXTAL stabilization interrupt enable + \arg RCU_INT_IRC8MSTB: IRC8M stabilization interrupt enable + \arg RCU_INT_HXTALSTB: HXTAL stabilization interrupt enable + \arg RCU_INT_PLLSTB: PLL stabilization interrupt enable + \arg RCU_INT_PLL1STB: PLL1 stabilization interrupt enable + \arg RCU_INT_PLL2STB: PLL2 stabilization interrupt enable + \arg RCU_INT_IRC48MSTB: IRC48M stabilization interrupt enable + \param[out] none + \retval none +*/ +void rcu_interrupt_disable(rcu_int_enum stab_int) +{ + RCU_REG_VAL(stab_int) &= ~BIT(RCU_BIT_POS(stab_int)); +} + +/*! + \brief configure the LXTAL drive capability + \param[in] lxtal_dricap: drive capability of LXTAL + only one parameter can be selected which is shown as below: + \arg RCU_LXTAL_LOWDRI: lower driving capability + \arg RCU_LXTAL_MED_LOWDRI: medium low driving capability + \arg RCU_LXTAL_MED_HIGHDRI: medium high driving capability + \arg RCU_LXTAL_HIGHDRI: higher driving capability + \param[out] none + \retval none +*/ +void rcu_lxtal_drive_capability_config(uint32_t lxtal_dricap) +{ + uint32_t reg; + + reg = RCU_BDCTL; + + /* reset the LXTALDRI bits and set according to lxtal_dricap */ + reg &= ~RCU_BDCTL_LXTALDRI; + RCU_BDCTL = (reg | lxtal_dricap); +} + +/*! + \brief wait for oscillator stabilization flags is SET or oscillator startup is timeout + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC48M: internal 48M RC oscillators(IRC48M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1 + \arg RCU_PLL2_CK: phase locked loop 2 + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +ErrStatus rcu_osci_stab_wait(rcu_osci_type_enum osci) +{ + uint32_t stb_cnt = 0U; + ErrStatus reval = ERROR; + FlagStatus osci_stat = RESET; + + switch(osci){ + /* wait HXTAL stable */ + case RCU_HXTAL: + while((RESET == osci_stat) && (HXTAL_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_HXTALSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_HXTALSTB)){ + reval = SUCCESS; + } + break; + + /* wait LXTAL stable */ + case RCU_LXTAL: + while((RESET == osci_stat) && (LXTAL_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_LXTALSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_LXTALSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC8M stable */ + case RCU_IRC8M: + while((RESET == osci_stat) && (IRC8M_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC8MSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_IRC8MSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC48M stable */ + case RCU_IRC48M: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC48MSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if (RESET != rcu_flag_get(RCU_FLAG_IRC48MSTB)){ + reval = SUCCESS; + } + break; + + /* wait IRC40K stable */ + case RCU_IRC40K: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_IRC40KSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_IRC40KSTB)){ + reval = SUCCESS; + } + break; + + /* wait PLL stable */ + case RCU_PLL_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLLSTB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLLSTB)){ + reval = SUCCESS; + } + break; + + /* wait PLL1 stable */ + case RCU_PLL1_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLL1STB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLL1STB)){ + reval = SUCCESS; + } + break; + /* wait PLL2 stable */ + case RCU_PLL2_CK: + while((RESET == osci_stat) && (OSC_STARTUP_TIMEOUT != stb_cnt)){ + osci_stat = rcu_flag_get(RCU_FLAG_PLL2STB); + stb_cnt++; + } + + /* check whether flag is set or not */ + if(RESET != rcu_flag_get(RCU_FLAG_PLL2STB)){ + reval = SUCCESS; + } + break; + + default: + break; + } + + /* return value */ + return reval; +} + +/*! + \brief turn on the oscillator + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC48M: internal 48M RC oscillators(IRC48M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1 + \arg RCU_PLL2_CK: phase locked loop 2 + \param[out] none + \retval none +*/ +void rcu_osci_on(rcu_osci_type_enum osci) +{ + RCU_REG_VAL(osci) |= BIT(RCU_BIT_POS(osci)); +} + +/*! + \brief turn off the oscillator + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \arg RCU_IRC8M: internal 8M RC oscillators(IRC8M) + \arg RCU_IRC48M: internal 48M RC oscillators(IRC48M) + \arg RCU_IRC40K: internal 40K RC oscillator(IRC40K) + \arg RCU_PLL_CK: phase locked loop(PLL) + \arg RCU_PLL1_CK: phase locked loop 1 + \arg RCU_PLL2_CK: phase locked loop 2 + \param[out] none + \retval none +*/ +void rcu_osci_off(rcu_osci_type_enum osci) +{ + RCU_REG_VAL(osci) &= ~BIT(RCU_BIT_POS(osci)); +} + +/*! + \brief enable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \param[out] none + \retval none +*/ +void rcu_osci_bypass_mode_enable(rcu_osci_type_enum osci) +{ + uint32_t reg; + + switch(osci){ + /* enable HXTAL to bypass mode */ + case RCU_HXTAL: + reg = RCU_CTL; + RCU_CTL &= ~RCU_CTL_HXTALEN; + RCU_CTL = (reg | RCU_CTL_HXTALBPS); + break; + /* enable LXTAL to bypass mode */ + case RCU_LXTAL: + reg = RCU_BDCTL; + RCU_BDCTL &= ~RCU_BDCTL_LXTALEN; + RCU_BDCTL = (reg | RCU_BDCTL_LXTALBPS); + break; + case RCU_IRC8M: + case RCU_IRC48M: + case RCU_IRC40K: + case RCU_PLL_CK: + case RCU_PLL1_CK: + case RCU_PLL2_CK: + break; + default: + break; + } +} + +/*! + \brief disable the oscillator bypass mode, HXTALEN or LXTALEN must be reset before it + \param[in] osci: oscillator types, refer to rcu_osci_type_enum + only one parameter can be selected which is shown as below: + \arg RCU_HXTAL: high speed crystal oscillator(HXTAL) + \arg RCU_LXTAL: low speed crystal oscillator(LXTAL) + \param[out] none + \retval none +*/ +void rcu_osci_bypass_mode_disable(rcu_osci_type_enum osci) +{ + uint32_t reg; + + switch(osci){ + /* disable HXTAL to bypass mode */ + case RCU_HXTAL: + reg = RCU_CTL; + RCU_CTL &= ~RCU_CTL_HXTALEN; + RCU_CTL = (reg & ~RCU_CTL_HXTALBPS); + break; + /* disable LXTAL to bypass mode */ + case RCU_LXTAL: + reg = RCU_BDCTL; + RCU_BDCTL &= ~RCU_BDCTL_LXTALEN; + RCU_BDCTL = (reg & ~RCU_BDCTL_LXTALBPS); + break; + case RCU_IRC8M: + case RCU_IRC48M: + case RCU_IRC40K: + case RCU_PLL_CK: + case RCU_PLL1_CK: + case RCU_PLL2_CK: + break; + default: + break; + } +} + +/*! + \brief enable the HXTAL clock monitor + \param[in] none + \param[out] none + \retval none +*/ + +void rcu_hxtal_clock_monitor_enable(void) +{ + RCU_CTL |= RCU_CTL_CKMEN; +} + +/*! + \brief disable the HXTAL clock monitor + \param[in] none + \param[out] none + \retval none +*/ +void rcu_hxtal_clock_monitor_disable(void) +{ + RCU_CTL &= ~RCU_CTL_CKMEN; +} + +/*! + \brief set the IRC8M adjust value + \param[in] irc8m_adjval: IRC8M adjust value, must be between 0 and 0x1F + \arg 0x00 - 0x1F + \param[out] none + \retval none +*/ +void rcu_irc8m_adjust_value_set(uint32_t irc8m_adjval) +{ + uint32_t reg; + + reg = RCU_CTL; + /* reset the IRC8MADJ bits and set according to irc8m_adjval */ + reg &= ~RCU_CTL_IRC8MADJ; + RCU_CTL = (reg | ((irc8m_adjval & RCU_IRC8M_ADJUST_MASK) << RCU_IRC8M_ADJUST_OFFSET)); +} + +/*! + \brief deep-sleep mode voltage select + \param[in] dsvol: deep sleep mode voltage + only one parameter can be selected which is shown as below: + \arg RCU_DEEPSLEEP_V_1_0: the core voltage is 1.0V + \arg RCU_DEEPSLEEP_V_0_9: the core voltage is 0.9V + \arg RCU_DEEPSLEEP_V_0_8: the core voltage is 0.8V + \arg RCU_DEEPSLEEP_V_1_2: the core voltage is 1.2V + \param[out] none + \retval none +*/ +void rcu_deepsleep_voltage_set(uint32_t dsvol) +{ + dsvol &= RCU_DSV_DSLPVS; + RCU_DSV = dsvol; +} + +/*! + \brief get the system clock, bus and peripheral clock frequency + \param[in] clock: the clock frequency which to get + only one parameter can be selected which is shown as below: + \arg CK_SYS: system clock frequency + \arg CK_AHB: AHB clock frequency + \arg CK_APB1: APB1 clock frequency + \arg CK_APB2: APB2 clock frequency + \param[out] none + \retval clock frequency of system, AHB, APB1, APB2 +*/ +uint32_t rcu_clock_freq_get(rcu_clock_freq_enum clock) +{ + uint32_t sws, ck_freq = 0U; + uint32_t cksys_freq, ahb_freq, apb1_freq, apb2_freq; + uint32_t pllsel, pllpresel, predv0sel, pllmf,ck_src, idx, clk_exp; + uint32_t predv0, predv1, pll1mf; + + /* exponent of AHB, APB1 and APB2 clock divider */ + uint8_t ahb_exp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + uint8_t apb1_exp[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + uint8_t apb2_exp[8] = {0, 0, 0, 0, 1, 2, 3, 4}; + + sws = GET_BITS(RCU_CFG0, 2, 3); + switch(sws){ + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + cksys_freq = IRC8M_VALUE; + break; + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + cksys_freq = HXTAL_VALUE; + break; + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL, IRC48M or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + if(RCU_PLLSRC_HXTAL_IRC48M == pllsel) { + /* PLL clock source is HXTAL or IRC48M */ + pllpresel = (RCU_CFG1 & RCU_CFG1_PLLPRESEL); + + if(RCU_PLLPRESRC_HXTAL == pllpresel){ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + }else{ + /* PLL clock source is IRC48 */ + ck_src = IRC48M_VALUE; + } + + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> RCU_CFG1_PREDV1_OFFSET) + 1U; + pll1mf = (uint32_t)((RCU_CFG1 & RCU_CFG1_PLL1MF) >> RCU_CFG1_PLL1MF_OFFSET) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src/predv1)*pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; + }else{ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE/2U; + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + if(pllmf < 15U){ + pllmf += 2U; + }else{ + pllmf += 1U; + } + cksys_freq = ck_src*pllmf; + if(15U == pllmf){ + cksys_freq = ck_src*6U + ck_src/2U; + } + + break; + /* IRC8M is selected as CK_SYS */ + default: + cksys_freq = IRC8M_VALUE; + break; + } + + /* calculate AHB clock frequency */ + idx = GET_BITS(RCU_CFG0, 4, 7); + clk_exp = ahb_exp[idx]; + ahb_freq = cksys_freq >> clk_exp; + + /* calculate APB1 clock frequency */ + idx = GET_BITS(RCU_CFG0, 8, 10); + clk_exp = apb1_exp[idx]; + apb1_freq = ahb_freq >> clk_exp; + + /* calculate APB2 clock frequency */ + idx = GET_BITS(RCU_CFG0, 11, 13); + clk_exp = apb2_exp[idx]; + apb2_freq = ahb_freq >> clk_exp; + + /* return the clocks frequency */ + switch(clock){ + case CK_SYS: + ck_freq = cksys_freq; + break; + case CK_AHB: + ck_freq = ahb_freq; + break; + case CK_APB1: + ck_freq = apb1_freq; + break; + case CK_APB2: + ck_freq = apb2_freq; + break; + default: + break; + } + return ck_freq; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rtc.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rtc.c new file mode 100644 index 0000000..d124ad7 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rtc.c @@ -0,0 +1,281 @@ +/*! + \file gd32c10x_rtc.c + \brief RTC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_rtc.h" + +/* RTC register high / low bits mask */ +#define RTC_HIGH_BITS_MASK ((uint32_t)0x000F0000U) /* RTC high bits mask */ +#define RTC_LOW_BITS_MASK ((uint32_t)0x0000FFFFU) /* RTC low bits mask */ + +/* RTC register high bits offset */ +#define RTC_HIGH_BITS_OFFSET ((uint32_t)16U) + +/*! + \brief enter RTC configuration mode + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration_mode_enter(void) +{ + RTC_CTL |= RTC_CTL_CMF; +} + +/*! + \brief exit RTC configuration mode + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration_mode_exit(void) +{ + RTC_CTL &= ~RTC_CTL_CMF; +} + +/*! + \brief set RTC counter value + \param[in] cnt: RTC counter value + \param[out] none + \retval none +*/ +void rtc_counter_set(uint32_t cnt) +{ + rtc_configuration_mode_enter(); + /* set the RTC counter high bits */ + RTC_CNTH = (cnt >> RTC_HIGH_BITS_OFFSET); + /* set the RTC counter low bits */ + RTC_CNTL = (cnt & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief set RTC prescaler value + \param[in] psc: RTC prescaler value + \param[out] none + \retval none +*/ +void rtc_prescaler_set(uint32_t psc) +{ + rtc_configuration_mode_enter(); + /* set the RTC prescaler high bits */ + RTC_PSCH = ((psc & RTC_HIGH_BITS_MASK) >> RTC_HIGH_BITS_OFFSET); + /* set the RTC prescaler low bits */ + RTC_PSCL = (psc & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief wait RTC last write operation finished flag set + \param[in] none + \param[out] none + \retval none +*/ +void rtc_lwoff_wait(void) +{ + /* loop until LWOFF flag is set */ + while(RESET == (RTC_CTL & RTC_CTL_LWOFF)){ + } +} + +/*! + \brief wait RTC registers synchronized flag set + \param[in] none + \param[out] none + \retval none +*/ +void rtc_register_sync_wait(void) +{ + /* clear RSYNF flag */ + RTC_CTL &= ~RTC_CTL_RSYNF; + /* loop until RSYNF flag is set */ + while(RESET == (RTC_CTL & RTC_CTL_RSYNF)){ + } +} + +/*! + \brief set RTC alarm value + \param[in] alarm: RTC alarm value + \param[out] none + \retval none +*/ +void rtc_alarm_config(uint32_t alarm) +{ + rtc_configuration_mode_enter(); + /* set the alarm high bits */ + RTC_ALRMH = (alarm >> RTC_HIGH_BITS_OFFSET); + /* set the alarm low bits */ + RTC_ALRML = (alarm & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief get RTC counter value + \param[in] none + \param[out] none + \retval RTC counter value +*/ +uint32_t rtc_counter_get(void) +{ + uint32_t temp = 0x0U, high_old, high_new; + + high_old = RTC_CNTH; + temp = RTC_CNTL; + high_new = RTC_CNTH; + + if(high_old != high_new){ + temp = (high_new << RTC_HIGH_BITS_OFFSET) | RTC_CNTL; + }else{ + temp |= (high_new << RTC_HIGH_BITS_OFFSET); + } + + return temp; +} + +/*! + \brief get RTC divider value + \param[in] none + \param[out] none + \retval RTC divider value +*/ +uint32_t rtc_divider_get(void) +{ + uint32_t temp = 0x00U; + + temp = ((RTC_DIVH & RTC_DIVH_DIV) << RTC_HIGH_BITS_OFFSET); + temp |= RTC_DIVL; + return temp; +} + +/*! + \brief get RTC flag status + \param[in] flag: specify which flag status to get + only one parameter can be selected which is shown as below: + \arg RTC_FLAG_SECOND: second interrupt flag + \arg RTC_FLAG_ALARM: alarm interrupt flag + \arg RTC_FLAG_OVERFLOW: overflow interrupt flag + \arg RTC_FLAG_RSYN: registers synchronized flag + \arg RTC_FLAG_LWOF: last write operation finished flag + \param[out] none + \retval SET or RESET +*/ +FlagStatus rtc_flag_get(uint32_t flag) +{ + if(RESET != (RTC_CTL & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear RTC flag status + \param[in] flag: specify which flag status to clear + one or more parameters can be selected which are shown as below: + \arg RTC_FLAG_SECOND: second interrupt flag + \arg RTC_FLAG_ALARM: alarm interrupt flag + \arg RTC_FLAG_OVERFLOW: overflow interrupt flag + \arg RTC_FLAG_RSYN: registers synchronized flag + \param[out] none + \retval none +*/ +void rtc_flag_clear(uint32_t flag) +{ + /* clear RTC flag */ + RTC_CTL &= ~flag; +} + +/*! + \brief get RTC interrupt flag status + \param[in] flag: specify which flag status to get + only one parameter can be selected which is shown as below: + \arg RTC_INT_FLAG_SECOND: second interrupt flag + \arg RTC_INT_FLAG_ALARM: alarm interrupt flag + \arg RTC_INT_FLAG_OVERFLOW: overflow interrupt flag + \param[out] none + \retval SET or RESET +*/ +FlagStatus rtc_interrupt_flag_get(uint32_t flag) +{ + if(RESET != (RTC_CTL & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear RTC interrupt flag status + \param[in] flag: specify which flag status to clear + one or more parameters can be selected which are shown as below: + \arg RTC_INT_FLAG_SECOND: second interrupt flag + \arg RTC_INT_FLAG_ALARM: alarm interrupt flag + \arg RTC_INT_FLAG_OVERFLOW: overflow interrupt flag + \param[out] none + \retval none +*/ +void rtc_interrupt_flag_clear(uint32_t flag) +{ + /* clear RTC interrupt flag */ + RTC_CTL &= ~flag; +} + +/*! + \brief enable RTC interrupt + \param[in] interrupt: specify which interrupt to enable + one or more parameters can be selected which are shown as below: + \arg RTC_INT_SECOND: second interrupt + \arg RTC_INT_ALARM: alarm interrupt + \arg RTC_INT_OVERFLOW: overflow interrupt + \param[out] none + \retval none +*/ +void rtc_interrupt_enable(uint32_t interrupt) +{ + RTC_INTEN |= interrupt; +} + +/*! + \brief disable RTC interrupt + \param[in] interrupt: specify which interrupt to disable + one or more parameters can be selected which are shown as below: + \arg RTC_INT_SECOND: second interrupt + \arg RTC_INT_ALARM: alarm interrupt + \arg RTC_INT_OVERFLOW: overflow interrupt + \param[out] none + \retval none +*/ +void rtc_interrupt_disable(uint32_t interrupt) +{ + RTC_INTEN &= ~interrupt; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rtc.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rtc.c.base@1.0.0 new file mode 100644 index 0000000..d124ad7 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rtc.c.base@1.0.0 @@ -0,0 +1,281 @@ +/*! + \file gd32c10x_rtc.c + \brief RTC driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_rtc.h" + +/* RTC register high / low bits mask */ +#define RTC_HIGH_BITS_MASK ((uint32_t)0x000F0000U) /* RTC high bits mask */ +#define RTC_LOW_BITS_MASK ((uint32_t)0x0000FFFFU) /* RTC low bits mask */ + +/* RTC register high bits offset */ +#define RTC_HIGH_BITS_OFFSET ((uint32_t)16U) + +/*! + \brief enter RTC configuration mode + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration_mode_enter(void) +{ + RTC_CTL |= RTC_CTL_CMF; +} + +/*! + \brief exit RTC configuration mode + \param[in] none + \param[out] none + \retval none +*/ +void rtc_configuration_mode_exit(void) +{ + RTC_CTL &= ~RTC_CTL_CMF; +} + +/*! + \brief set RTC counter value + \param[in] cnt: RTC counter value + \param[out] none + \retval none +*/ +void rtc_counter_set(uint32_t cnt) +{ + rtc_configuration_mode_enter(); + /* set the RTC counter high bits */ + RTC_CNTH = (cnt >> RTC_HIGH_BITS_OFFSET); + /* set the RTC counter low bits */ + RTC_CNTL = (cnt & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief set RTC prescaler value + \param[in] psc: RTC prescaler value + \param[out] none + \retval none +*/ +void rtc_prescaler_set(uint32_t psc) +{ + rtc_configuration_mode_enter(); + /* set the RTC prescaler high bits */ + RTC_PSCH = ((psc & RTC_HIGH_BITS_MASK) >> RTC_HIGH_BITS_OFFSET); + /* set the RTC prescaler low bits */ + RTC_PSCL = (psc & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief wait RTC last write operation finished flag set + \param[in] none + \param[out] none + \retval none +*/ +void rtc_lwoff_wait(void) +{ + /* loop until LWOFF flag is set */ + while(RESET == (RTC_CTL & RTC_CTL_LWOFF)){ + } +} + +/*! + \brief wait RTC registers synchronized flag set + \param[in] none + \param[out] none + \retval none +*/ +void rtc_register_sync_wait(void) +{ + /* clear RSYNF flag */ + RTC_CTL &= ~RTC_CTL_RSYNF; + /* loop until RSYNF flag is set */ + while(RESET == (RTC_CTL & RTC_CTL_RSYNF)){ + } +} + +/*! + \brief set RTC alarm value + \param[in] alarm: RTC alarm value + \param[out] none + \retval none +*/ +void rtc_alarm_config(uint32_t alarm) +{ + rtc_configuration_mode_enter(); + /* set the alarm high bits */ + RTC_ALRMH = (alarm >> RTC_HIGH_BITS_OFFSET); + /* set the alarm low bits */ + RTC_ALRML = (alarm & RTC_LOW_BITS_MASK); + rtc_configuration_mode_exit(); +} + +/*! + \brief get RTC counter value + \param[in] none + \param[out] none + \retval RTC counter value +*/ +uint32_t rtc_counter_get(void) +{ + uint32_t temp = 0x0U, high_old, high_new; + + high_old = RTC_CNTH; + temp = RTC_CNTL; + high_new = RTC_CNTH; + + if(high_old != high_new){ + temp = (high_new << RTC_HIGH_BITS_OFFSET) | RTC_CNTL; + }else{ + temp |= (high_new << RTC_HIGH_BITS_OFFSET); + } + + return temp; +} + +/*! + \brief get RTC divider value + \param[in] none + \param[out] none + \retval RTC divider value +*/ +uint32_t rtc_divider_get(void) +{ + uint32_t temp = 0x00U; + + temp = ((RTC_DIVH & RTC_DIVH_DIV) << RTC_HIGH_BITS_OFFSET); + temp |= RTC_DIVL; + return temp; +} + +/*! + \brief get RTC flag status + \param[in] flag: specify which flag status to get + only one parameter can be selected which is shown as below: + \arg RTC_FLAG_SECOND: second interrupt flag + \arg RTC_FLAG_ALARM: alarm interrupt flag + \arg RTC_FLAG_OVERFLOW: overflow interrupt flag + \arg RTC_FLAG_RSYN: registers synchronized flag + \arg RTC_FLAG_LWOF: last write operation finished flag + \param[out] none + \retval SET or RESET +*/ +FlagStatus rtc_flag_get(uint32_t flag) +{ + if(RESET != (RTC_CTL & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear RTC flag status + \param[in] flag: specify which flag status to clear + one or more parameters can be selected which are shown as below: + \arg RTC_FLAG_SECOND: second interrupt flag + \arg RTC_FLAG_ALARM: alarm interrupt flag + \arg RTC_FLAG_OVERFLOW: overflow interrupt flag + \arg RTC_FLAG_RSYN: registers synchronized flag + \param[out] none + \retval none +*/ +void rtc_flag_clear(uint32_t flag) +{ + /* clear RTC flag */ + RTC_CTL &= ~flag; +} + +/*! + \brief get RTC interrupt flag status + \param[in] flag: specify which flag status to get + only one parameter can be selected which is shown as below: + \arg RTC_INT_FLAG_SECOND: second interrupt flag + \arg RTC_INT_FLAG_ALARM: alarm interrupt flag + \arg RTC_INT_FLAG_OVERFLOW: overflow interrupt flag + \param[out] none + \retval SET or RESET +*/ +FlagStatus rtc_interrupt_flag_get(uint32_t flag) +{ + if(RESET != (RTC_CTL & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear RTC interrupt flag status + \param[in] flag: specify which flag status to clear + one or more parameters can be selected which are shown as below: + \arg RTC_INT_FLAG_SECOND: second interrupt flag + \arg RTC_INT_FLAG_ALARM: alarm interrupt flag + \arg RTC_INT_FLAG_OVERFLOW: overflow interrupt flag + \param[out] none + \retval none +*/ +void rtc_interrupt_flag_clear(uint32_t flag) +{ + /* clear RTC interrupt flag */ + RTC_CTL &= ~flag; +} + +/*! + \brief enable RTC interrupt + \param[in] interrupt: specify which interrupt to enable + one or more parameters can be selected which are shown as below: + \arg RTC_INT_SECOND: second interrupt + \arg RTC_INT_ALARM: alarm interrupt + \arg RTC_INT_OVERFLOW: overflow interrupt + \param[out] none + \retval none +*/ +void rtc_interrupt_enable(uint32_t interrupt) +{ + RTC_INTEN |= interrupt; +} + +/*! + \brief disable RTC interrupt + \param[in] interrupt: specify which interrupt to disable + one or more parameters can be selected which are shown as below: + \arg RTC_INT_SECOND: second interrupt + \arg RTC_INT_ALARM: alarm interrupt + \arg RTC_INT_OVERFLOW: overflow interrupt + \param[out] none + \retval none +*/ +void rtc_interrupt_disable(uint32_t interrupt) +{ + RTC_INTEN &= ~interrupt; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_spi.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_spi.c new file mode 100644 index 0000000..f07e114 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_spi.c @@ -0,0 +1,855 @@ +/*! + \file gd32c10x_spi.c + \brief SPI driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_spi.h" + +#define SPI_ERROR_HANDLE(s) do{}while(1) + +/* SPI/I2S parameter initialization mask */ +#define SPI_INIT_MASK ((uint32_t)0x00003040U) /* SPI parameter initialization mask */ +#define I2S_INIT_MASK ((uint32_t)0x0000F047U) /* I2S parameter initialization mask */ + +/* I2S clock source selection, multiplication and division mask */ +#define I2S1_CLOCK_SEL ((uint32_t)0x00020000U) /* I2S1 clock source selection */ +#define I2S2_CLOCK_SEL ((uint32_t)0x00040000U) /* I2S2 clock source selection */ +#define I2S_CLOCK_MUL_MASK ((uint32_t)0x0000F000U) /* I2S clock multiplication mask */ +#define I2S_CLOCK_DIV_MASK ((uint32_t)0x000000F0U) /* I2S clock division mask */ + +/* default value and offset */ +#define SPI_I2SPSC_DEFAULT_VALUE ((uint32_t)0x00000002U) /* default value of SPI_I2SPSC register */ +#define RCU_CFG1_PREDV1_OFFSET 4U /* PREDV1 offset in RCU_CFG1 */ +#define RCU_CFG1_PLL2MF_OFFSET 12U /* PLL2MF offset in RCU_CFG1 */ + +/*! + \brief reset SPI and I2S + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_i2s_deinit(uint32_t spi_periph) +{ + switch(spi_periph){ + case SPI0: + /* reset SPI0 */ + rcu_periph_reset_enable(RCU_SPI0RST); + rcu_periph_reset_disable(RCU_SPI0RST); + break; + case SPI1: + /* reset SPI1 and I2S1 */ + rcu_periph_reset_enable(RCU_SPI1RST); + rcu_periph_reset_disable(RCU_SPI1RST); + break; + case SPI2: + /* reset SPI2 and I2S2 */ + rcu_periph_reset_enable(RCU_SPI2RST); + rcu_periph_reset_disable(RCU_SPI2RST); + break; + default: + break; + } +} + +/*! + \brief initialize the parameters of SPI struct with the default values + \param[in] spi_struct: SPI parameter struct + \param[out] none + \retval none +*/ +void spi_struct_para_init(spi_parameter_struct* spi_struct) +{ + /* set the SPI struct with the default values */ + spi_struct->device_mode = SPI_SLAVE; + spi_struct->trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_struct->frame_size = SPI_FRAMESIZE_8BIT; + spi_struct->nss = SPI_NSS_HARD; + spi_struct->endian = SPI_ENDIAN_MSB; + spi_struct->clock_polarity_phase = SPI_CK_PL_LOW_PH_1EDGE; + spi_struct->prescale = SPI_PSC_2; +} + +/*! + \brief initialize SPI parameter + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] spi_struct: SPI parameter initialization stuct members of the structure + and the member values are shown as below: + device_mode: SPI_MASTER, SPI_SLAVE + trans_mode: SPI_TRANSMODE_FULLDUPLEX, SPI_TRANSMODE_RECEIVEONLY, + SPI_TRANSMODE_BDRECEIVE, SPI_TRANSMODE_BDTRANSMIT + frame_size: SPI_FRAMESIZE_16BIT, SPI_FRAMESIZE_8BIT + nss: SPI_NSS_SOFT, SPI_NSS_HARD + endian: SPI_ENDIAN_MSB, SPI_ENDIAN_LSB + clock_polarity_phase: SPI_CK_PL_LOW_PH_1EDGE, SPI_CK_PL_HIGH_PH_1EDGE + SPI_CK_PL_LOW_PH_2EDGE, SPI_CK_PL_HIGH_PH_2EDGE + prescale: SPI_PSC_n (n=2,4,8,16,32,64,128,256) + \param[out] none + \retval none +*/ +void spi_init(uint32_t spi_periph, spi_parameter_struct* spi_struct) +{ + uint32_t reg = 0U; + reg = SPI_CTL0(spi_periph); + reg &= SPI_INIT_MASK; + + /* select SPI as master or slave */ + reg |= spi_struct->device_mode; + /* select SPI transfer mode */ + reg |= spi_struct->trans_mode; + /* select SPI frame size */ + reg |= spi_struct->frame_size; + /* select SPI NSS use hardware or software */ + reg |= spi_struct->nss; + /* select SPI LSB or MSB */ + reg |= spi_struct->endian; + /* select SPI polarity and phase */ + reg |= spi_struct->clock_polarity_phase; + /* select SPI prescale to adjust transmit speed */ + reg |= spi_struct->prescale; + + /* write to SPI_CTL0 register */ + SPI_CTL0(spi_periph) = (uint32_t)reg; + + SPI_I2SCTL(spi_periph) &= (uint32_t)(~SPI_I2SCTL_I2SSEL); +} + +/*! + \brief enable SPI + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_enable(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_SPIEN; +} + +/*! + \brief disable SPI + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_disable(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_SPIEN); +} + +/*! + \brief initialize I2S parameter + \param[in] spi_periph: SPIx(x=1,2) + \param[in] mode: I2S operation mode + only one parameter can be selected which is shown as below: + \arg I2S_MODE_SLAVETX: I2S slave transmit mode + \arg I2S_MODE_SLAVERX: I2S slave receive mode + \arg I2S_MODE_MASTERTX: I2S master transmit mode + \arg I2S_MODE_MASTERRX: I2S master receive mode + \param[in] standard: I2S standard + only one parameter can be selected which is shown as below: + \arg I2S_STD_PHILIPS: I2S Philips standard + \arg I2S_STD_MSB: I2S MSB standard + \arg I2S_STD_LSB: I2S LSB standard + \arg I2S_STD_PCMSHORT: I2S PCM short standard + \arg I2S_STD_PCMLONG: I2S PCM long standard + \param[in] ckpl: I2S idle state clock polarity + only one parameter can be selected which is shown as below: + \arg I2S_CKPL_LOW: I2S clock polarity low level + \arg I2S_CKPL_HIGH: I2S clock polarity high level + \param[out] none + \retval none +*/ +void i2s_init(uint32_t spi_periph, uint32_t mode, uint32_t standard, uint32_t ckpl) +{ + uint32_t reg = 0U; + reg = SPI_I2SCTL(spi_periph); + reg &= I2S_INIT_MASK; + + /* enable I2S mode */ + reg |= (uint32_t)SPI_I2SCTL_I2SSEL; + /* select I2S mode */ + reg |= (uint32_t)mode; + /* select I2S standard */ + reg |= (uint32_t)standard; + /* select I2S polarity */ + reg |= (uint32_t)ckpl; + + /* write to SPI_I2SCTL register */ + SPI_I2SCTL(spi_periph) = (uint32_t)reg; +} + +/*! + \brief configure I2S prescaler + \param[in] spi_periph: SPIx(x=1,2) + \param[in] audiosample: I2S audio sample rate + only one parameter can be selected which is shown as below: + \arg I2S_AUDIOSAMPLE_8K: audio sample rate is 8KHz + \arg I2S_AUDIOSAMPLE_11K: audio sample rate is 11KHz + \arg I2S_AUDIOSAMPLE_16K: audio sample rate is 16KHz + \arg I2S_AUDIOSAMPLE_22K: audio sample rate is 22KHz + \arg I2S_AUDIOSAMPLE_32K: audio sample rate is 32KHz + \arg I2S_AUDIOSAMPLE_44K: audio sample rate is 44KHz + \arg I2S_AUDIOSAMPLE_48K: audio sample rate is 48KHz + \arg I2S_AUDIOSAMPLE_96K: audio sample rate is 96KHz + \arg I2S_AUDIOSAMPLE_192K: audio sample rate is 192KHz + \param[in] frameformat: I2S data length and channel length + only one parameter can be selected which is shown as below: + \arg I2S_FRAMEFORMAT_DT16B_CH16B: I2S data length is 16 bit and channel length is 16 bit + \arg I2S_FRAMEFORMAT_DT16B_CH32B: I2S data length is 16 bit and channel length is 32 bit + \arg I2S_FRAMEFORMAT_DT24B_CH32B: I2S data length is 24 bit and channel length is 32 bit + \arg I2S_FRAMEFORMAT_DT32B_CH32B: I2S data length is 32 bit and channel length is 32 bit + \param[in] mckout: I2S master clock output + only one parameter can be selected which is shown as below: + \arg I2S_MCKOUT_ENABLE: I2S master clock output enable + \arg I2S_MCKOUT_DISABLE: I2S master clock output disable + \param[out] none + \retval none +*/ +void i2s_psc_config(uint32_t spi_periph, uint32_t audiosample, uint32_t frameformat, uint32_t mckout) +{ + uint32_t i2sdiv = 2U, i2sof = 0U; + uint32_t clks = 0U; + uint32_t i2sclock = 0U; + + /* judge whether the audiosample is 0 */ + if(0U == audiosample){ + SPI_ERROR_HANDLE("the parameter can not be 0 \r\n"); + } + + /* deinit SPI_I2SPSC register */ + SPI_I2SPSC(spi_periph) = SPI_I2SPSC_DEFAULT_VALUE; + + /* get the I2S clock source */ + if(SPI1 == ((uint32_t)spi_periph)){ + /* I2S1 clock source selection */ + clks = I2S1_CLOCK_SEL; + }else{ + /* I2S2 clock source selection */ + clks = I2S2_CLOCK_SEL; + } + + if(0U != (RCU_CFG1 & clks)){ + /* get RCU PLL2 clock multiplication factor */ + clks = (uint32_t)((RCU_CFG1 & I2S_CLOCK_MUL_MASK) >> RCU_CFG1_PLL2MF_OFFSET); + + if((clks > 5U) && (clks < 15U)){ + /* multiplier is between 8 and 16 */ + clks += 2U; + }else{ + if(15U == clks){ + /* multiplier is 20 */ + clks = 20U; + } + } + + /* get the PREDV1 value */ + i2sclock = (uint32_t)(((RCU_CFG1 & I2S_CLOCK_DIV_MASK) >> RCU_CFG1_PREDV1_OFFSET) + 1U); + /* calculate I2S clock based on PLL2 and PREDV1 */ + if(0U != (RCU_CFG1_PLLPRESEL & RCU_CFG1)){ + i2sclock = (uint32_t)((IRC48M_VALUE / i2sclock) * clks * 2U); + }else{ + i2sclock = (uint32_t)((HXTAL_VALUE / i2sclock) * clks * 2U); + } + }else{ + /* get system clock */ + i2sclock = rcu_clock_freq_get(CK_SYS); + } + + /* config the prescaler depending on the mclk output state, the frame format and audio sample rate */ + if(I2S_MCKOUT_ENABLE == mckout){ + clks = (uint32_t)(((i2sclock / 256U) * 10U) / audiosample); + }else{ + if(I2S_FRAMEFORMAT_DT16B_CH16B == frameformat){ + clks = (uint32_t)(((i2sclock / 32U) *10U) / audiosample); + }else{ + clks = (uint32_t)(((i2sclock / 64U) *10U) / audiosample); + } + } + + /* remove the floating point */ + clks = (clks + 5U) / 10U; + i2sof = (clks & 0x00000001U); + i2sdiv = ((clks - i2sof) / 2U); + i2sof = (i2sof << 8U); + + /* set the default values */ + if((i2sdiv < 2U) || (i2sdiv > 255U)){ + i2sdiv = 2U; + i2sof = 0U; + } + + /* configure SPI_I2SPSC */ + SPI_I2SPSC(spi_periph) = (uint32_t)(i2sdiv | i2sof | mckout); + + /* clear SPI_I2SCTL_DTLEN and SPI_I2SCTL_CHLEN bits */ + SPI_I2SCTL(spi_periph) &= (uint32_t)(~(SPI_I2SCTL_DTLEN | SPI_I2SCTL_CHLEN)); + /* configure data frame format */ + SPI_I2SCTL(spi_periph) |= (uint32_t)frameformat; +} + +/*! + \brief enable I2S + \param[in] spi_periph: SPIx(x=1,2) + \param[out] none + \retval none +*/ +void i2s_enable(uint32_t spi_periph) +{ + SPI_I2SCTL(spi_periph) |= (uint32_t)SPI_I2SCTL_I2SEN; +} + +/*! + \brief disable I2S + \param[in] spi_periph: SPIx(x=1,2) + \param[out] none + \retval none +*/ +void i2s_disable(uint32_t spi_periph) +{ + SPI_I2SCTL(spi_periph) &= (uint32_t)(~SPI_I2SCTL_I2SEN); +} + +/*! + \brief enable SPI NSS output + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_output_enable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_NSSDRV; +} + +/*! + \brief disable SPI NSS output + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_output_disable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_NSSDRV); +} + +/*! + \brief SPI NSS pin high level in software mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_internal_high(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_SWNSS; +} + +/*! + \brief SPI NSS pin low level in software mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_internal_low(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_SWNSS); +} + +/*! + \brief enable SPI DMA send or receive + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] dma: SPI DMA mode + only one parameter can be selected which is shown as below: + \arg SPI_DMA_TRANSMIT: SPI transmit data using DMA + \arg SPI_DMA_RECEIVE: SPI receive data using DMA + \param[out] none + \retval none +*/ +void spi_dma_enable(uint32_t spi_periph, uint8_t dma) +{ + if(SPI_DMA_TRANSMIT == dma){ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_DMATEN; + }else{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_DMAREN; + } +} + +/*! + \brief disable SPI DMA send or receive + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] dma: SPI DMA mode + only one parameter can be selected which is shown as below: + \arg SPI_DMA_TRANSMIT: SPI transmit data using DMA + \arg SPI_DMA_RECEIVE: SPI receive data using DMA + \param[out] none + \retval none +*/ +void spi_dma_disable(uint32_t spi_periph, uint8_t dma) +{ + if(SPI_DMA_TRANSMIT == dma){ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_DMATEN); + }else{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_DMAREN); + } +} + +/*! + \brief configure SPI/I2S data frame format + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] frame_format: SPI frame size + only one parameter can be selected which is shown as below: + \arg SPI_FRAMESIZE_16BIT: SPI frame size is 16 bits + \arg SPI_FRAMESIZE_8BIT: SPI frame size is 8 bits + \param[out] none + \retval none +*/ +void spi_i2s_data_frame_format_config(uint32_t spi_periph, uint16_t frame_format) +{ + /* clear SPI_CTL0_FF16 bit */ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_FF16); + /* configure SPI_CTL0_FF16 bit */ + SPI_CTL0(spi_periph) |= (uint32_t)frame_format; +} + +/*! + \brief SPI transmit data + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] data: 16-bit data + \param[out] none + \retval none +*/ +void spi_i2s_data_transmit(uint32_t spi_periph, uint16_t data) +{ + SPI_DATA(spi_periph) = (uint32_t)data; +} + +/*! + \brief SPI receive data + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval 16-bit data +*/ +uint16_t spi_i2s_data_receive(uint32_t spi_periph) +{ + return ((uint16_t)SPI_DATA(spi_periph)); +} + +/*! + \brief configure SPI bidirectional transfer direction + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] transfer_direction: SPI transfer direction + only one parameter can be selected which is shown as below: + \arg SPI_BIDIRECTIONAL_TRANSMIT: SPI work in transmit-only mode + \arg SPI_BIDIRECTIONAL_RECEIVE: SPI work in receive-only mode + \param[out] none + \retval none +*/ +void spi_bidirectional_transfer_config(uint32_t spi_periph, uint32_t transfer_direction) +{ + if(SPI_BIDIRECTIONAL_TRANSMIT == transfer_direction){ + /* set the transmit-only mode */ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_BIDIRECTIONAL_TRANSMIT; + }else{ + /* set the receive-only mode */ + SPI_CTL0(spi_periph) &= SPI_BIDIRECTIONAL_RECEIVE; + } +} + +/*! + \brief clear SPI/I2S format error flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] flag: SPI/I2S frame format error flag + \arg SPI_FLAG_FERR: only for SPI work in TI mode + \arg I2S_FLAG_FERR: for I2S + \param[out] none + \retval none +*/ +void spi_i2s_format_error_clear(uint32_t spi_periph, uint32_t flag) +{ + SPI_STAT(spi_periph) = (uint32_t)(~flag); +} + +/*! + \brief set SPI CRC polynomial + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] crc_poly: CRC polynomial value + \param[out] none + \retval none +*/ +void spi_crc_polynomial_set(uint32_t spi_periph,uint16_t crc_poly) +{ + /* set SPI CRC polynomial */ + SPI_CRCPOLY(spi_periph) = (uint32_t)crc_poly; +} + +/*! + \brief get SPI CRC polynomial + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval 16-bit CRC polynomial +*/ +uint16_t spi_crc_polynomial_get(uint32_t spi_periph) +{ + return ((uint16_t)SPI_CRCPOLY(spi_periph)); +} + +/*! + \brief turn on CRC function + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_on(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_CRCEN; +} + +/*! + \brief turn off CRC function + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_off(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_CRCEN); +} + +/*! + \brief SPI next data is CRC value + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_next(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_CRCNT; +} + +/*! + \brief get SPI CRC send value or receive value + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] crc: SPI crc value + only one parameter can be selected which is shown as below: + \arg SPI_CRC_TX: get transmit crc value + \arg SPI_CRC_RX: get receive crc value + \param[out] none + \retval 16-bit CRC value +*/ +uint16_t spi_crc_get(uint32_t spi_periph,uint8_t crc) +{ + if(SPI_CRC_TX == crc){ + return ((uint16_t)(SPI_TCRC(spi_periph))); + }else{ + return ((uint16_t)(SPI_RCRC(spi_periph))); + } +} + +/*! + \brief clear SPI CRC error flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_error_clear(uint32_t spi_periph) +{ + SPI_STAT(spi_periph) = (uint32_t)(~SPI_FLAG_CRCERR); +} + +/*! + \brief enable SPI TI mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_ti_mode_enable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_TMOD; +} + +/*! + \brief disable SPI TI mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_ti_mode_disable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_TMOD); +} + +/*! + \brief enable SPI NSS pulse mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nssp_mode_enable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_NSSP; +} + +/*! + \brief disable SPI NSS pulse mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nssp_mode_disable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_NSSP); +} + +/*! + \brief enable SPI quad wire mode + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) |= (uint32_t)SPI_QCTL_QMOD; +} + +/*! + \brief disable SPI quad wire mode + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_disable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) &= (uint32_t)(~SPI_QCTL_QMOD); +} + +/*! + \brief enable SPI quad wire mode write + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_write_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) &= (uint32_t)(~SPI_QCTL_QRD); +} + +/*! + \brief enable SPI quad wire mode read + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_read_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) |= (uint32_t)SPI_QCTL_QRD; +} + +/*! + \brief enable SPI quad wire mode SPI_IO2 and SPI_IO3 pin output + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_io23_output_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) |= (uint32_t)SPI_QCTL_IO23_DRV; +} + + /*! + \brief disable SPI quad wire mode SPI_IO2 and SPI_IO3 pin output + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_io23_output_disable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) &= (uint32_t)(~SPI_QCTL_IO23_DRV); +} + +/*! + \brief enable SPI and I2S interrupt + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_TBE: transmit buffer empty interrupt + \arg SPI_I2S_INT_RBNE: receive buffer not empty interrupt + \arg SPI_I2S_INT_ERR: CRC error,configuration error,reception overrun error, + transmission underrun error and format error interrupt + \param[out] none + \retval none +*/ +void spi_i2s_interrupt_enable(uint32_t spi_periph, uint8_t interrupt) +{ + switch(interrupt){ + /* SPI/I2S transmit buffer empty interrupt */ + case SPI_I2S_INT_TBE: + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_TBEIE; + break; + /* SPI/I2S receive buffer not empty interrupt */ + case SPI_I2S_INT_RBNE: + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_RBNEIE; + break; + /* SPI/I2S error */ + case SPI_I2S_INT_ERR: + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_ERRIE; + break; + default: + break; + } +} + +/*! + \brief disable SPI and I2S interrupt + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_TBE: transmit buffer empty interrupt + \arg SPI_I2S_INT_RBNE: receive buffer not empty interrupt + \arg SPI_I2S_INT_ERR: CRC error,configuration error,reception overrun error, + transmission underrun error and format error interrupt + \param[out] none + \retval none +*/ +void spi_i2s_interrupt_disable(uint32_t spi_periph, uint8_t interrupt) +{ + switch(interrupt){ + /* SPI/I2S transmit buffer empty interrupt */ + case SPI_I2S_INT_TBE: + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_TBEIE); + break; + /* SPI/I2S receive buffer not empty interrupt */ + case SPI_I2S_INT_RBNE: + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_RBNEIE); + break; + /* SPI/I2S error */ + case SPI_I2S_INT_ERR: + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_ERRIE); + break; + default: + break; + } +} + +/*! + \brief get SPI and I2S interrupt flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt flag status + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_FLAG_TBE: transmit buffer empty interrupt flag + \arg SPI_I2S_INT_FLAG_RBNE: receive buffer not empty interrupt flag + \arg SPI_I2S_INT_FLAG_RXORERR: overrun interrupt flag + \arg SPI_INT_FLAG_CONFERR: config error interrupt flag + \arg SPI_INT_FLAG_CRCERR: CRC error interrupt flag + \arg I2S_INT_FLAG_TXURERR: underrun error interrupt flag + \arg SPI_I2S_INT_FLAG_FERR: format error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus spi_i2s_interrupt_flag_get(uint32_t spi_periph, uint8_t interrupt) +{ + uint32_t reg1 = SPI_STAT(spi_periph); + uint32_t reg2 = SPI_CTL1(spi_periph); + + switch(interrupt){ + /* SPI/I2S transmit buffer empty interrupt */ + case SPI_I2S_INT_FLAG_TBE: + reg1 = reg1 & SPI_STAT_TBE; + reg2 = reg2 & SPI_CTL1_TBEIE; + break; + /* SPI/I2S receive buffer not empty interrupt */ + case SPI_I2S_INT_FLAG_RBNE: + reg1 = reg1 & SPI_STAT_RBNE; + reg2 = reg2 & SPI_CTL1_RBNEIE; + break; + /* SPI/I2S overrun interrupt */ + case SPI_I2S_INT_FLAG_RXORERR: + reg1 = reg1 & SPI_STAT_RXORERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI config error interrupt */ + case SPI_INT_FLAG_CONFERR: + reg1 = reg1 & SPI_STAT_CONFERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI CRC error interrupt */ + case SPI_INT_FLAG_CRCERR: + reg1 = reg1 & SPI_STAT_CRCERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* I2S underrun error interrupt */ + case I2S_INT_FLAG_TXURERR: + reg1 = reg1 & SPI_STAT_TXURERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI/I2S format error interrupt */ + case SPI_I2S_INT_FLAG_FERR: + reg1 = reg1 & SPI_STAT_FERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + default: + break; + } + /* get SPI/I2S interrupt flag status */ + if((0U != reg1) && (0U != reg2)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get SPI and I2S flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] flag: SPI/I2S flag status + one or more parameters can be selected which are shown as below: + \arg SPI_FLAG_TBE: transmit buffer empty flag + \arg SPI_FLAG_RBNE: receive buffer not empty flag + \arg SPI_FLAG_TRANS: transmit on-going flag + \arg SPI_FLAG_RXORERR: receive overrun error flag + \arg SPI_FLAG_CONFERR: mode config error flag + \arg SPI_FLAG_CRCERR: CRC error flag + \arg SPI_FLAG_FERR: format error interrupt flag + \arg I2S_FLAG_TBE: transmit buffer empty flag + \arg I2S_FLAG_RBNE: receive buffer not empty flag + \arg I2S_FLAG_TRANS: transmit on-going flag + \arg I2S_FLAG_RXORERR: overrun error flag + \arg I2S_FLAG_TXURERR: underrun error flag + \arg I2S_FLAG_CH: channel side flag + \arg I2S_FLAG_FERR: format error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus spi_i2s_flag_get(uint32_t spi_periph, uint32_t flag) +{ + if(RESET != (SPI_STAT(spi_periph) & flag)){ + return SET; + }else{ + return RESET; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_spi.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_spi.c.base@1.0.0 new file mode 100644 index 0000000..f07e114 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_spi.c.base@1.0.0 @@ -0,0 +1,855 @@ +/*! + \file gd32c10x_spi.c + \brief SPI driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_spi.h" + +#define SPI_ERROR_HANDLE(s) do{}while(1) + +/* SPI/I2S parameter initialization mask */ +#define SPI_INIT_MASK ((uint32_t)0x00003040U) /* SPI parameter initialization mask */ +#define I2S_INIT_MASK ((uint32_t)0x0000F047U) /* I2S parameter initialization mask */ + +/* I2S clock source selection, multiplication and division mask */ +#define I2S1_CLOCK_SEL ((uint32_t)0x00020000U) /* I2S1 clock source selection */ +#define I2S2_CLOCK_SEL ((uint32_t)0x00040000U) /* I2S2 clock source selection */ +#define I2S_CLOCK_MUL_MASK ((uint32_t)0x0000F000U) /* I2S clock multiplication mask */ +#define I2S_CLOCK_DIV_MASK ((uint32_t)0x000000F0U) /* I2S clock division mask */ + +/* default value and offset */ +#define SPI_I2SPSC_DEFAULT_VALUE ((uint32_t)0x00000002U) /* default value of SPI_I2SPSC register */ +#define RCU_CFG1_PREDV1_OFFSET 4U /* PREDV1 offset in RCU_CFG1 */ +#define RCU_CFG1_PLL2MF_OFFSET 12U /* PLL2MF offset in RCU_CFG1 */ + +/*! + \brief reset SPI and I2S + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_i2s_deinit(uint32_t spi_periph) +{ + switch(spi_periph){ + case SPI0: + /* reset SPI0 */ + rcu_periph_reset_enable(RCU_SPI0RST); + rcu_periph_reset_disable(RCU_SPI0RST); + break; + case SPI1: + /* reset SPI1 and I2S1 */ + rcu_periph_reset_enable(RCU_SPI1RST); + rcu_periph_reset_disable(RCU_SPI1RST); + break; + case SPI2: + /* reset SPI2 and I2S2 */ + rcu_periph_reset_enable(RCU_SPI2RST); + rcu_periph_reset_disable(RCU_SPI2RST); + break; + default: + break; + } +} + +/*! + \brief initialize the parameters of SPI struct with the default values + \param[in] spi_struct: SPI parameter struct + \param[out] none + \retval none +*/ +void spi_struct_para_init(spi_parameter_struct* spi_struct) +{ + /* set the SPI struct with the default values */ + spi_struct->device_mode = SPI_SLAVE; + spi_struct->trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_struct->frame_size = SPI_FRAMESIZE_8BIT; + spi_struct->nss = SPI_NSS_HARD; + spi_struct->endian = SPI_ENDIAN_MSB; + spi_struct->clock_polarity_phase = SPI_CK_PL_LOW_PH_1EDGE; + spi_struct->prescale = SPI_PSC_2; +} + +/*! + \brief initialize SPI parameter + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] spi_struct: SPI parameter initialization stuct members of the structure + and the member values are shown as below: + device_mode: SPI_MASTER, SPI_SLAVE + trans_mode: SPI_TRANSMODE_FULLDUPLEX, SPI_TRANSMODE_RECEIVEONLY, + SPI_TRANSMODE_BDRECEIVE, SPI_TRANSMODE_BDTRANSMIT + frame_size: SPI_FRAMESIZE_16BIT, SPI_FRAMESIZE_8BIT + nss: SPI_NSS_SOFT, SPI_NSS_HARD + endian: SPI_ENDIAN_MSB, SPI_ENDIAN_LSB + clock_polarity_phase: SPI_CK_PL_LOW_PH_1EDGE, SPI_CK_PL_HIGH_PH_1EDGE + SPI_CK_PL_LOW_PH_2EDGE, SPI_CK_PL_HIGH_PH_2EDGE + prescale: SPI_PSC_n (n=2,4,8,16,32,64,128,256) + \param[out] none + \retval none +*/ +void spi_init(uint32_t spi_periph, spi_parameter_struct* spi_struct) +{ + uint32_t reg = 0U; + reg = SPI_CTL0(spi_periph); + reg &= SPI_INIT_MASK; + + /* select SPI as master or slave */ + reg |= spi_struct->device_mode; + /* select SPI transfer mode */ + reg |= spi_struct->trans_mode; + /* select SPI frame size */ + reg |= spi_struct->frame_size; + /* select SPI NSS use hardware or software */ + reg |= spi_struct->nss; + /* select SPI LSB or MSB */ + reg |= spi_struct->endian; + /* select SPI polarity and phase */ + reg |= spi_struct->clock_polarity_phase; + /* select SPI prescale to adjust transmit speed */ + reg |= spi_struct->prescale; + + /* write to SPI_CTL0 register */ + SPI_CTL0(spi_periph) = (uint32_t)reg; + + SPI_I2SCTL(spi_periph) &= (uint32_t)(~SPI_I2SCTL_I2SSEL); +} + +/*! + \brief enable SPI + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_enable(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_SPIEN; +} + +/*! + \brief disable SPI + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_disable(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_SPIEN); +} + +/*! + \brief initialize I2S parameter + \param[in] spi_periph: SPIx(x=1,2) + \param[in] mode: I2S operation mode + only one parameter can be selected which is shown as below: + \arg I2S_MODE_SLAVETX: I2S slave transmit mode + \arg I2S_MODE_SLAVERX: I2S slave receive mode + \arg I2S_MODE_MASTERTX: I2S master transmit mode + \arg I2S_MODE_MASTERRX: I2S master receive mode + \param[in] standard: I2S standard + only one parameter can be selected which is shown as below: + \arg I2S_STD_PHILIPS: I2S Philips standard + \arg I2S_STD_MSB: I2S MSB standard + \arg I2S_STD_LSB: I2S LSB standard + \arg I2S_STD_PCMSHORT: I2S PCM short standard + \arg I2S_STD_PCMLONG: I2S PCM long standard + \param[in] ckpl: I2S idle state clock polarity + only one parameter can be selected which is shown as below: + \arg I2S_CKPL_LOW: I2S clock polarity low level + \arg I2S_CKPL_HIGH: I2S clock polarity high level + \param[out] none + \retval none +*/ +void i2s_init(uint32_t spi_periph, uint32_t mode, uint32_t standard, uint32_t ckpl) +{ + uint32_t reg = 0U; + reg = SPI_I2SCTL(spi_periph); + reg &= I2S_INIT_MASK; + + /* enable I2S mode */ + reg |= (uint32_t)SPI_I2SCTL_I2SSEL; + /* select I2S mode */ + reg |= (uint32_t)mode; + /* select I2S standard */ + reg |= (uint32_t)standard; + /* select I2S polarity */ + reg |= (uint32_t)ckpl; + + /* write to SPI_I2SCTL register */ + SPI_I2SCTL(spi_periph) = (uint32_t)reg; +} + +/*! + \brief configure I2S prescaler + \param[in] spi_periph: SPIx(x=1,2) + \param[in] audiosample: I2S audio sample rate + only one parameter can be selected which is shown as below: + \arg I2S_AUDIOSAMPLE_8K: audio sample rate is 8KHz + \arg I2S_AUDIOSAMPLE_11K: audio sample rate is 11KHz + \arg I2S_AUDIOSAMPLE_16K: audio sample rate is 16KHz + \arg I2S_AUDIOSAMPLE_22K: audio sample rate is 22KHz + \arg I2S_AUDIOSAMPLE_32K: audio sample rate is 32KHz + \arg I2S_AUDIOSAMPLE_44K: audio sample rate is 44KHz + \arg I2S_AUDIOSAMPLE_48K: audio sample rate is 48KHz + \arg I2S_AUDIOSAMPLE_96K: audio sample rate is 96KHz + \arg I2S_AUDIOSAMPLE_192K: audio sample rate is 192KHz + \param[in] frameformat: I2S data length and channel length + only one parameter can be selected which is shown as below: + \arg I2S_FRAMEFORMAT_DT16B_CH16B: I2S data length is 16 bit and channel length is 16 bit + \arg I2S_FRAMEFORMAT_DT16B_CH32B: I2S data length is 16 bit and channel length is 32 bit + \arg I2S_FRAMEFORMAT_DT24B_CH32B: I2S data length is 24 bit and channel length is 32 bit + \arg I2S_FRAMEFORMAT_DT32B_CH32B: I2S data length is 32 bit and channel length is 32 bit + \param[in] mckout: I2S master clock output + only one parameter can be selected which is shown as below: + \arg I2S_MCKOUT_ENABLE: I2S master clock output enable + \arg I2S_MCKOUT_DISABLE: I2S master clock output disable + \param[out] none + \retval none +*/ +void i2s_psc_config(uint32_t spi_periph, uint32_t audiosample, uint32_t frameformat, uint32_t mckout) +{ + uint32_t i2sdiv = 2U, i2sof = 0U; + uint32_t clks = 0U; + uint32_t i2sclock = 0U; + + /* judge whether the audiosample is 0 */ + if(0U == audiosample){ + SPI_ERROR_HANDLE("the parameter can not be 0 \r\n"); + } + + /* deinit SPI_I2SPSC register */ + SPI_I2SPSC(spi_periph) = SPI_I2SPSC_DEFAULT_VALUE; + + /* get the I2S clock source */ + if(SPI1 == ((uint32_t)spi_periph)){ + /* I2S1 clock source selection */ + clks = I2S1_CLOCK_SEL; + }else{ + /* I2S2 clock source selection */ + clks = I2S2_CLOCK_SEL; + } + + if(0U != (RCU_CFG1 & clks)){ + /* get RCU PLL2 clock multiplication factor */ + clks = (uint32_t)((RCU_CFG1 & I2S_CLOCK_MUL_MASK) >> RCU_CFG1_PLL2MF_OFFSET); + + if((clks > 5U) && (clks < 15U)){ + /* multiplier is between 8 and 16 */ + clks += 2U; + }else{ + if(15U == clks){ + /* multiplier is 20 */ + clks = 20U; + } + } + + /* get the PREDV1 value */ + i2sclock = (uint32_t)(((RCU_CFG1 & I2S_CLOCK_DIV_MASK) >> RCU_CFG1_PREDV1_OFFSET) + 1U); + /* calculate I2S clock based on PLL2 and PREDV1 */ + if(0U != (RCU_CFG1_PLLPRESEL & RCU_CFG1)){ + i2sclock = (uint32_t)((IRC48M_VALUE / i2sclock) * clks * 2U); + }else{ + i2sclock = (uint32_t)((HXTAL_VALUE / i2sclock) * clks * 2U); + } + }else{ + /* get system clock */ + i2sclock = rcu_clock_freq_get(CK_SYS); + } + + /* config the prescaler depending on the mclk output state, the frame format and audio sample rate */ + if(I2S_MCKOUT_ENABLE == mckout){ + clks = (uint32_t)(((i2sclock / 256U) * 10U) / audiosample); + }else{ + if(I2S_FRAMEFORMAT_DT16B_CH16B == frameformat){ + clks = (uint32_t)(((i2sclock / 32U) *10U) / audiosample); + }else{ + clks = (uint32_t)(((i2sclock / 64U) *10U) / audiosample); + } + } + + /* remove the floating point */ + clks = (clks + 5U) / 10U; + i2sof = (clks & 0x00000001U); + i2sdiv = ((clks - i2sof) / 2U); + i2sof = (i2sof << 8U); + + /* set the default values */ + if((i2sdiv < 2U) || (i2sdiv > 255U)){ + i2sdiv = 2U; + i2sof = 0U; + } + + /* configure SPI_I2SPSC */ + SPI_I2SPSC(spi_periph) = (uint32_t)(i2sdiv | i2sof | mckout); + + /* clear SPI_I2SCTL_DTLEN and SPI_I2SCTL_CHLEN bits */ + SPI_I2SCTL(spi_periph) &= (uint32_t)(~(SPI_I2SCTL_DTLEN | SPI_I2SCTL_CHLEN)); + /* configure data frame format */ + SPI_I2SCTL(spi_periph) |= (uint32_t)frameformat; +} + +/*! + \brief enable I2S + \param[in] spi_periph: SPIx(x=1,2) + \param[out] none + \retval none +*/ +void i2s_enable(uint32_t spi_periph) +{ + SPI_I2SCTL(spi_periph) |= (uint32_t)SPI_I2SCTL_I2SEN; +} + +/*! + \brief disable I2S + \param[in] spi_periph: SPIx(x=1,2) + \param[out] none + \retval none +*/ +void i2s_disable(uint32_t spi_periph) +{ + SPI_I2SCTL(spi_periph) &= (uint32_t)(~SPI_I2SCTL_I2SEN); +} + +/*! + \brief enable SPI NSS output + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_output_enable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_NSSDRV; +} + +/*! + \brief disable SPI NSS output + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_output_disable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_NSSDRV); +} + +/*! + \brief SPI NSS pin high level in software mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_internal_high(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_SWNSS; +} + +/*! + \brief SPI NSS pin low level in software mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nss_internal_low(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_SWNSS); +} + +/*! + \brief enable SPI DMA send or receive + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] dma: SPI DMA mode + only one parameter can be selected which is shown as below: + \arg SPI_DMA_TRANSMIT: SPI transmit data using DMA + \arg SPI_DMA_RECEIVE: SPI receive data using DMA + \param[out] none + \retval none +*/ +void spi_dma_enable(uint32_t spi_periph, uint8_t dma) +{ + if(SPI_DMA_TRANSMIT == dma){ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_DMATEN; + }else{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_DMAREN; + } +} + +/*! + \brief disable SPI DMA send or receive + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] dma: SPI DMA mode + only one parameter can be selected which is shown as below: + \arg SPI_DMA_TRANSMIT: SPI transmit data using DMA + \arg SPI_DMA_RECEIVE: SPI receive data using DMA + \param[out] none + \retval none +*/ +void spi_dma_disable(uint32_t spi_periph, uint8_t dma) +{ + if(SPI_DMA_TRANSMIT == dma){ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_DMATEN); + }else{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_DMAREN); + } +} + +/*! + \brief configure SPI/I2S data frame format + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] frame_format: SPI frame size + only one parameter can be selected which is shown as below: + \arg SPI_FRAMESIZE_16BIT: SPI frame size is 16 bits + \arg SPI_FRAMESIZE_8BIT: SPI frame size is 8 bits + \param[out] none + \retval none +*/ +void spi_i2s_data_frame_format_config(uint32_t spi_periph, uint16_t frame_format) +{ + /* clear SPI_CTL0_FF16 bit */ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_FF16); + /* configure SPI_CTL0_FF16 bit */ + SPI_CTL0(spi_periph) |= (uint32_t)frame_format; +} + +/*! + \brief SPI transmit data + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] data: 16-bit data + \param[out] none + \retval none +*/ +void spi_i2s_data_transmit(uint32_t spi_periph, uint16_t data) +{ + SPI_DATA(spi_periph) = (uint32_t)data; +} + +/*! + \brief SPI receive data + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval 16-bit data +*/ +uint16_t spi_i2s_data_receive(uint32_t spi_periph) +{ + return ((uint16_t)SPI_DATA(spi_periph)); +} + +/*! + \brief configure SPI bidirectional transfer direction + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] transfer_direction: SPI transfer direction + only one parameter can be selected which is shown as below: + \arg SPI_BIDIRECTIONAL_TRANSMIT: SPI work in transmit-only mode + \arg SPI_BIDIRECTIONAL_RECEIVE: SPI work in receive-only mode + \param[out] none + \retval none +*/ +void spi_bidirectional_transfer_config(uint32_t spi_periph, uint32_t transfer_direction) +{ + if(SPI_BIDIRECTIONAL_TRANSMIT == transfer_direction){ + /* set the transmit-only mode */ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_BIDIRECTIONAL_TRANSMIT; + }else{ + /* set the receive-only mode */ + SPI_CTL0(spi_periph) &= SPI_BIDIRECTIONAL_RECEIVE; + } +} + +/*! + \brief clear SPI/I2S format error flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] flag: SPI/I2S frame format error flag + \arg SPI_FLAG_FERR: only for SPI work in TI mode + \arg I2S_FLAG_FERR: for I2S + \param[out] none + \retval none +*/ +void spi_i2s_format_error_clear(uint32_t spi_periph, uint32_t flag) +{ + SPI_STAT(spi_periph) = (uint32_t)(~flag); +} + +/*! + \brief set SPI CRC polynomial + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] crc_poly: CRC polynomial value + \param[out] none + \retval none +*/ +void spi_crc_polynomial_set(uint32_t spi_periph,uint16_t crc_poly) +{ + /* set SPI CRC polynomial */ + SPI_CRCPOLY(spi_periph) = (uint32_t)crc_poly; +} + +/*! + \brief get SPI CRC polynomial + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval 16-bit CRC polynomial +*/ +uint16_t spi_crc_polynomial_get(uint32_t spi_periph) +{ + return ((uint16_t)SPI_CRCPOLY(spi_periph)); +} + +/*! + \brief turn on CRC function + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_on(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_CRCEN; +} + +/*! + \brief turn off CRC function + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_off(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) &= (uint32_t)(~SPI_CTL0_CRCEN); +} + +/*! + \brief SPI next data is CRC value + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_next(uint32_t spi_periph) +{ + SPI_CTL0(spi_periph) |= (uint32_t)SPI_CTL0_CRCNT; +} + +/*! + \brief get SPI CRC send value or receive value + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] crc: SPI crc value + only one parameter can be selected which is shown as below: + \arg SPI_CRC_TX: get transmit crc value + \arg SPI_CRC_RX: get receive crc value + \param[out] none + \retval 16-bit CRC value +*/ +uint16_t spi_crc_get(uint32_t spi_periph,uint8_t crc) +{ + if(SPI_CRC_TX == crc){ + return ((uint16_t)(SPI_TCRC(spi_periph))); + }else{ + return ((uint16_t)(SPI_RCRC(spi_periph))); + } +} + +/*! + \brief clear SPI CRC error flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_crc_error_clear(uint32_t spi_periph) +{ + SPI_STAT(spi_periph) = (uint32_t)(~SPI_FLAG_CRCERR); +} + +/*! + \brief enable SPI TI mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_ti_mode_enable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_TMOD; +} + +/*! + \brief disable SPI TI mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_ti_mode_disable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_TMOD); +} + +/*! + \brief enable SPI NSS pulse mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nssp_mode_enable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_NSSP; +} + +/*! + \brief disable SPI NSS pulse mode + \param[in] spi_periph: SPIx(x=0,1,2) + \param[out] none + \retval none +*/ +void spi_nssp_mode_disable(uint32_t spi_periph) +{ + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_NSSP); +} + +/*! + \brief enable SPI quad wire mode + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) |= (uint32_t)SPI_QCTL_QMOD; +} + +/*! + \brief disable SPI quad wire mode + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_disable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) &= (uint32_t)(~SPI_QCTL_QMOD); +} + +/*! + \brief enable SPI quad wire mode write + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_write_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) &= (uint32_t)(~SPI_QCTL_QRD); +} + +/*! + \brief enable SPI quad wire mode read + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_read_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) |= (uint32_t)SPI_QCTL_QRD; +} + +/*! + \brief enable SPI quad wire mode SPI_IO2 and SPI_IO3 pin output + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_io23_output_enable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) |= (uint32_t)SPI_QCTL_IO23_DRV; +} + + /*! + \brief disable SPI quad wire mode SPI_IO2 and SPI_IO3 pin output + \param[in] spi_periph: SPIx(only x=0) + \param[out] none + \retval none +*/ +void spi_quad_io23_output_disable(uint32_t spi_periph) +{ + SPI_QCTL(spi_periph) &= (uint32_t)(~SPI_QCTL_IO23_DRV); +} + +/*! + \brief enable SPI and I2S interrupt + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_TBE: transmit buffer empty interrupt + \arg SPI_I2S_INT_RBNE: receive buffer not empty interrupt + \arg SPI_I2S_INT_ERR: CRC error,configuration error,reception overrun error, + transmission underrun error and format error interrupt + \param[out] none + \retval none +*/ +void spi_i2s_interrupt_enable(uint32_t spi_periph, uint8_t interrupt) +{ + switch(interrupt){ + /* SPI/I2S transmit buffer empty interrupt */ + case SPI_I2S_INT_TBE: + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_TBEIE; + break; + /* SPI/I2S receive buffer not empty interrupt */ + case SPI_I2S_INT_RBNE: + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_RBNEIE; + break; + /* SPI/I2S error */ + case SPI_I2S_INT_ERR: + SPI_CTL1(spi_periph) |= (uint32_t)SPI_CTL1_ERRIE; + break; + default: + break; + } +} + +/*! + \brief disable SPI and I2S interrupt + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_TBE: transmit buffer empty interrupt + \arg SPI_I2S_INT_RBNE: receive buffer not empty interrupt + \arg SPI_I2S_INT_ERR: CRC error,configuration error,reception overrun error, + transmission underrun error and format error interrupt + \param[out] none + \retval none +*/ +void spi_i2s_interrupt_disable(uint32_t spi_periph, uint8_t interrupt) +{ + switch(interrupt){ + /* SPI/I2S transmit buffer empty interrupt */ + case SPI_I2S_INT_TBE: + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_TBEIE); + break; + /* SPI/I2S receive buffer not empty interrupt */ + case SPI_I2S_INT_RBNE: + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_RBNEIE); + break; + /* SPI/I2S error */ + case SPI_I2S_INT_ERR: + SPI_CTL1(spi_periph) &= (uint32_t)(~SPI_CTL1_ERRIE); + break; + default: + break; + } +} + +/*! + \brief get SPI and I2S interrupt flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] interrupt: SPI/I2S interrupt flag status + only one parameter can be selected which is shown as below: + \arg SPI_I2S_INT_FLAG_TBE: transmit buffer empty interrupt flag + \arg SPI_I2S_INT_FLAG_RBNE: receive buffer not empty interrupt flag + \arg SPI_I2S_INT_FLAG_RXORERR: overrun interrupt flag + \arg SPI_INT_FLAG_CONFERR: config error interrupt flag + \arg SPI_INT_FLAG_CRCERR: CRC error interrupt flag + \arg I2S_INT_FLAG_TXURERR: underrun error interrupt flag + \arg SPI_I2S_INT_FLAG_FERR: format error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus spi_i2s_interrupt_flag_get(uint32_t spi_periph, uint8_t interrupt) +{ + uint32_t reg1 = SPI_STAT(spi_periph); + uint32_t reg2 = SPI_CTL1(spi_periph); + + switch(interrupt){ + /* SPI/I2S transmit buffer empty interrupt */ + case SPI_I2S_INT_FLAG_TBE: + reg1 = reg1 & SPI_STAT_TBE; + reg2 = reg2 & SPI_CTL1_TBEIE; + break; + /* SPI/I2S receive buffer not empty interrupt */ + case SPI_I2S_INT_FLAG_RBNE: + reg1 = reg1 & SPI_STAT_RBNE; + reg2 = reg2 & SPI_CTL1_RBNEIE; + break; + /* SPI/I2S overrun interrupt */ + case SPI_I2S_INT_FLAG_RXORERR: + reg1 = reg1 & SPI_STAT_RXORERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI config error interrupt */ + case SPI_INT_FLAG_CONFERR: + reg1 = reg1 & SPI_STAT_CONFERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI CRC error interrupt */ + case SPI_INT_FLAG_CRCERR: + reg1 = reg1 & SPI_STAT_CRCERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* I2S underrun error interrupt */ + case I2S_INT_FLAG_TXURERR: + reg1 = reg1 & SPI_STAT_TXURERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + /* SPI/I2S format error interrupt */ + case SPI_I2S_INT_FLAG_FERR: + reg1 = reg1 & SPI_STAT_FERR; + reg2 = reg2 & SPI_CTL1_ERRIE; + break; + default: + break; + } + /* get SPI/I2S interrupt flag status */ + if((0U != reg1) && (0U != reg2)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief get SPI and I2S flag status + \param[in] spi_periph: SPIx(x=0,1,2) + \param[in] flag: SPI/I2S flag status + one or more parameters can be selected which are shown as below: + \arg SPI_FLAG_TBE: transmit buffer empty flag + \arg SPI_FLAG_RBNE: receive buffer not empty flag + \arg SPI_FLAG_TRANS: transmit on-going flag + \arg SPI_FLAG_RXORERR: receive overrun error flag + \arg SPI_FLAG_CONFERR: mode config error flag + \arg SPI_FLAG_CRCERR: CRC error flag + \arg SPI_FLAG_FERR: format error interrupt flag + \arg I2S_FLAG_TBE: transmit buffer empty flag + \arg I2S_FLAG_RBNE: receive buffer not empty flag + \arg I2S_FLAG_TRANS: transmit on-going flag + \arg I2S_FLAG_RXORERR: overrun error flag + \arg I2S_FLAG_TXURERR: underrun error flag + \arg I2S_FLAG_CH: channel side flag + \arg I2S_FLAG_FERR: format error interrupt flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus spi_i2s_flag_get(uint32_t spi_periph, uint32_t flag) +{ + if(RESET != (SPI_STAT(spi_periph) & flag)){ + return SET; + }else{ + return RESET; + } +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_timer.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_timer.c new file mode 100644 index 0000000..5112573 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_timer.c @@ -0,0 +1,2039 @@ +/*! + \file gd32c10x_timer.c + \brief TIMER driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_timer.h" + +/* TIMER init parameter mask */ +#define ALIGNEDMODE_MASK ((uint32_t)0x00000060U) /*!< TIMER init parameter aligne dmode mask */ +#define COUNTERDIRECTION_MASK ((uint32_t)0x00000010U) /*!< TIMER init parameter counter direction mask */ +#define CLOCKDIVISION_MASK ((uint32_t)0x00000300U) /*!< TIMER init parameter clock division value mask */ + +/*! + \brief deinit a timer + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_deinit(uint32_t timer_periph) +{ + switch(timer_periph){ + case TIMER0: + /* reset TIMER0 */ + rcu_periph_reset_enable(RCU_TIMER0RST); + rcu_periph_reset_disable(RCU_TIMER0RST); + break; + case TIMER1: + /* reset TIMER1 */ + rcu_periph_reset_enable(RCU_TIMER1RST); + rcu_periph_reset_disable(RCU_TIMER1RST); + break; + case TIMER2: + /* reset TIMER2 */ + rcu_periph_reset_enable(RCU_TIMER2RST); + rcu_periph_reset_disable(RCU_TIMER2RST); + break; + case TIMER3: + /* reset TIMER3 */ + rcu_periph_reset_enable(RCU_TIMER3RST); + rcu_periph_reset_disable(RCU_TIMER3RST); + break; + case TIMER4: + /* reset TIMER4 */ + rcu_periph_reset_enable(RCU_TIMER4RST); + rcu_periph_reset_disable(RCU_TIMER4RST); + break; + case TIMER5: + /* reset TIMER5 */ + rcu_periph_reset_enable(RCU_TIMER5RST); + rcu_periph_reset_disable(RCU_TIMER5RST); + break; + case TIMER6: + /* reset TIMER6 */ + rcu_periph_reset_enable(RCU_TIMER6RST); + rcu_periph_reset_disable(RCU_TIMER6RST); + break; + case TIMER7: + /* reset TIMER7 */ + rcu_periph_reset_enable(RCU_TIMER7RST); + rcu_periph_reset_disable(RCU_TIMER7RST); + break; + case TIMER8: + /* reset TIMER8 */ + rcu_periph_reset_enable(RCU_TIMER8RST); + rcu_periph_reset_disable(RCU_TIMER8RST); + break; + case TIMER9: + /* reset TIMER9 */ + rcu_periph_reset_enable(RCU_TIMER9RST); + rcu_periph_reset_disable(RCU_TIMER9RST); + break; + case TIMER10: + /* reset TIMER10 */ + rcu_periph_reset_enable(RCU_TIMER10RST); + rcu_periph_reset_disable(RCU_TIMER10RST); + break; + case TIMER11: + /* reset TIMER11 */ + rcu_periph_reset_enable(RCU_TIMER11RST); + rcu_periph_reset_disable(RCU_TIMER11RST); + break; + case TIMER12: + /* reset TIMER12 */ + rcu_periph_reset_enable(RCU_TIMER12RST); + rcu_periph_reset_disable(RCU_TIMER12RST); + break; + case TIMER13: + /* reset TIMER13 */ + rcu_periph_reset_enable(RCU_TIMER13RST); + rcu_periph_reset_disable(RCU_TIMER13RST); + break; + default: + break; + } +} + +/*! + \brief initialize TIMER init parameter struct with a default value + \param[in] initpara: init parameter struct + \param[out] none + \retval none +*/ +void timer_struct_para_init(timer_parameter_struct* initpara) +{ + /* initialize the init parameter struct member with the default value */ + initpara->prescaler = 0U; + initpara->alignedmode = TIMER_COUNTER_EDGE; + initpara->counterdirection = TIMER_COUNTER_UP; + initpara->period = 65535U; + initpara->clockdivision = TIMER_CKDIV_DIV1; + initpara->repetitioncounter = 0U; +} + +/*! + \brief initialize TIMER counter + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] initpara: init parameter struct + prescaler: prescaler value of the counter clock, 0~65535 + alignedmode: TIMER_COUNTER_EDGE, TIMER_COUNTER_CENTER_DOWN, TIMER_COUNTER_CENTER_UP, + TIMER_COUNTER_CENTER_BOTH + counterdirection: TIMER_COUNTER_UP, TIMER_COUNTER_DOWN + period: counter auto reload value, 0~65535 + clockdivision: TIMER_CKDIV_DIV1, TIMER_CKDIV_DIV2, TIMER_CKDIV_DIV4 + repetitioncounter: counter repetition value, 0~255 + \param[out] none + \retval none +*/ +void timer_init(uint32_t timer_periph, timer_parameter_struct* initpara) +{ + /* configure the counter prescaler value */ + TIMER_PSC(timer_periph) = (uint16_t)initpara->prescaler; + + /* configure the counter direction and aligned mode */ + if((TIMER0 == timer_periph) || (TIMER1 == timer_periph) || (TIMER2 == timer_periph) + || (TIMER3 == timer_periph) || (TIMER4 == timer_periph) || (TIMER7 == timer_periph)){ + TIMER_CTL0(timer_periph) &= (~(uint32_t)(TIMER_CTL0_DIR | TIMER_CTL0_CAM)); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->alignedmode & ALIGNEDMODE_MASK); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->counterdirection & COUNTERDIRECTION_MASK); + } + + /* configure the autoreload value */ + TIMER_CAR(timer_periph) = (uint32_t)initpara->period; + + if((TIMER5 != timer_periph) && (TIMER6 != timer_periph)){ + /* reset the CKDIV bit */ + TIMER_CTL0(timer_periph) &= (~(uint32_t)TIMER_CTL0_CKDIV); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->clockdivision & CLOCKDIVISION_MASK); + } + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* configure the repetition counter value */ + TIMER_CREP(timer_periph) = (uint32_t)initpara->repetitioncounter; + } + + /* generate an update event */ + TIMER_SWEVG(timer_periph) |= (uint32_t)TIMER_SWEVG_UPG; +} + +/*! + \brief enable a timer + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_CEN; +} + +/*! + \brief disable a timer + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_CEN; +} + +/*! + \brief enable the auto reload shadow function + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_auto_reload_shadow_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_ARSE; +} + +/*! + \brief disable the auto reload shadow function + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_auto_reload_shadow_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_ARSE; +} + +/*! + \brief enable the update event + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_update_event_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_UPDIS; +} + +/*! + \brief disable the update event + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_update_event_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t) TIMER_CTL0_UPDIS; +} + +/*! + \brief set TIMER counter alignment mode + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] aligned: + only one parameter can be selected which is shown as below: + \arg TIMER_COUNTER_EDGE: edge-aligned mode + \arg TIMER_COUNTER_CENTER_DOWN: center-aligned and counting down assert mode + \arg TIMER_COUNTER_CENTER_UP: center-aligned and counting up assert mode + \arg TIMER_COUNTER_CENTER_BOTH: center-aligned and counting up/down assert mode + \param[out] none + \retval none +*/ +void timer_counter_alignment(uint32_t timer_periph, uint16_t aligned) +{ + TIMER_CTL0(timer_periph) &= (uint32_t)(~TIMER_CTL0_CAM); + TIMER_CTL0(timer_periph) |= (uint32_t)aligned; +} + +/*! + \brief set TIMER counter up direction + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_counter_up_direction(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_DIR; +} + +/*! + \brief set TIMER counter down direction + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_counter_down_direction(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_DIR; +} + +/*! + \brief configure TIMER prescaler + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] prescaler: prescaler value + \param[in] pscreload: prescaler reload mode + only one parameter can be selected which is shown as below: + \arg TIMER_PSC_RELOAD_NOW: the prescaler is loaded right now + \arg TIMER_PSC_RELOAD_UPDATE: the prescaler is loaded at the next update event + \param[out] none + \retval none +*/ +void timer_prescaler_config(uint32_t timer_periph, uint16_t prescaler, uint32_t pscreload) +{ + TIMER_PSC(timer_periph) = (uint32_t)prescaler; + + if(TIMER_PSC_RELOAD_NOW == pscreload){ + TIMER_SWEVG(timer_periph) |= (uint32_t)TIMER_SWEVG_UPG; + } +} + +/*! + \brief configure TIMER repetition register value + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] repetition: the counter repetition value, 0~255 + \param[out] none + \retval none +*/ +void timer_repetition_value_config(uint32_t timer_periph, uint16_t repetition) +{ + TIMER_CREP(timer_periph) = (uint32_t)repetition; +} + +/*! + \brief configure TIMER autoreload register value + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] autoreload: the counter auto-reload value + \param[out] none + \retval none +*/ +void timer_autoreload_value_config(uint32_t timer_periph, uint16_t autoreload) +{ + TIMER_CAR(timer_periph) = (uint32_t)autoreload; +} + +/*! + \brief configure TIMER counter register value + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] counter: the counter value + \param[out] none + \retval none +*/ +void timer_counter_value_config(uint32_t timer_periph, uint16_t counter) +{ + TIMER_CNT(timer_periph) = (uint32_t)counter; +} + +/*! + \brief read TIMER counter value + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval counter value +*/ +uint32_t timer_counter_read(uint32_t timer_periph) +{ + uint32_t count_value = 0U; + count_value = TIMER_CNT(timer_periph); + return (count_value); +} + +/*! + \brief read TIMER prescaler value + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval prescaler register value +*/ +uint16_t timer_prescaler_read(uint32_t timer_periph) +{ + uint16_t prescaler_value = 0U; + prescaler_value = (uint16_t)(TIMER_PSC(timer_periph)); + return (prescaler_value); +} + +/*! + \brief configure TIMER single pulse mode + \param[in] timer_periph: TIMERx(x=0..8,11) + \param[in] spmode: + only one parameter can be selected which is shown as below: + \arg TIMER_SP_MODE_SINGLE: single pulse mode + \arg TIMER_SP_MODE_REPETITIVE: repetitive pulse mode + \param[out] none + \retval none +*/ +void timer_single_pulse_mode_config(uint32_t timer_periph, uint32_t spmode) +{ + if(TIMER_SP_MODE_SINGLE == spmode){ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_SPM; + }else if(TIMER_SP_MODE_REPETITIVE == spmode){ + TIMER_CTL0(timer_periph) &= ~((uint32_t)TIMER_CTL0_SPM); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER update source + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] update: + only one parameter can be selected which is shown as below: + \arg TIMER_UPDATE_SRC_GLOBAL: update generate by setting of UPG bit or the counter overflow/underflow, + or the slave mode controller trigger + \arg TIMER_UPDATE_SRC_REGULAR: update generate only by counter overflow/underflow + \param[out] none + \retval none +*/ +void timer_update_source_config(uint32_t timer_periph, uint32_t update) +{ + if(TIMER_UPDATE_SRC_REGULAR == update){ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_UPS; + }else if(TIMER_UPDATE_SRC_GLOBAL == update){ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_UPS; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable the TIMER DMA + \param[in] timer_periph: TIMERx(x=0..7) + \param[in] dma: specify which DMA to enable + one or more parameters can be selected which are shown as below: + \arg TIMER_DMA_UPD: update DMA enable, TIMERx(x=0..7) + \arg TIMER_DMA_CH0D: channel 0 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH1D: channel 1 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH2D: channel 2 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH3D: channel 3 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CMTD: channel commutation DMA request enable, TIMERx(x=0,7) + \arg TIMER_DMA_TRGD: trigger DMA enable, TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_dma_enable(uint32_t timer_periph, uint16_t dma) +{ + TIMER_DMAINTEN(timer_periph) |= (uint32_t) dma; +} + +/*! + \brief disable the TIMER DMA + \param[in] timer_periph: TIMERxTIMERx(x=0..7) + \param[in] dma: specify which DMA to disable + one or more parameters can be selected which are shown as below: + \arg TIMER_DMA_UPD: update DMA enable, TIMERx(x=0..7) + \arg TIMER_DMA_CH0D: channel 0 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH1D: channel 1 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH2D: channel 2 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH3D: channel 3 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CMTD: channel commutation DMA request enable, TIMERx(x=0,7) + \arg TIMER_DMA_TRGD: trigger DMA enable, TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_dma_disable(uint32_t timer_periph, uint16_t dma) +{ + TIMER_DMAINTEN(timer_periph) &= (~(uint32_t)(dma)); +} + +/*! + \brief channel DMA request source selection + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] dma_request: channel DMA request source selection + only one parameter can be selected which is shown as below: + \arg TIMER_DMAREQUEST_CHANNELEVENT: DMA request of channel n is sent when channel n event occurs + \arg TIMER_DMAREQUEST_UPDATEEVENT: DMA request of channel n is sent when update event occurs + \param[out] none + \retval none +*/ +void timer_channel_dma_request_source_select(uint32_t timer_periph, uint32_t dma_request) +{ + if(TIMER_DMAREQUEST_UPDATEEVENT == dma_request){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_DMAS; + }else if(TIMER_DMAREQUEST_CHANNELEVENT == dma_request){ + TIMER_CTL1(timer_periph) &= ~(uint32_t)TIMER_CTL1_DMAS; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure the TIMER DMA transfer + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] dma_baseaddr: + only one parameter can be selected which is shown as below: + \arg TIMER_DMACFG_DMATA_CTL0: DMA transfer address is TIMER_CTL0, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CTL1: DMA transfer address is TIMER_CTL1, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_SMCFG: DMA transfer address is TIMER_SMCFG, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_DMAINTEN: DMA transfer address is TIMER_DMAINTEN, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_INTF: DMA transfer address is TIMER_INTF, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_SWEVG: DMA transfer address is TIMER_SWEVG, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL0: DMA transfer address is TIMER_CHCTL0, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL1: DMA transfer address is TIMER_CHCTL1, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL2: DMA transfer address is TIMER_CHCTL2, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CNT: DMA transfer address is TIMER_CNT, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_PSC: DMA transfer address is TIMER_PSC, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CAR: DMA transfer address is TIMER_CAR, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CREP: DMA transfer address is TIMER_CREP, TIMERx(x=0,7) + \arg TIMER_DMACFG_DMATA_CH0CV: DMA transfer address is TIMER_CH0CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH1CV: DMA transfer address is TIMER_CH1CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH2CV: DMA transfer address is TIMER_CH2CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH3CV: DMA transfer address is TIMER_CH3CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CCHP: DMA transfer address is TIMER_CCHP, TIMERx(x=0,7) + \arg TIMER_DMACFG_DMATA_DMACFG: DMA transfer address is TIMER_DMACFG, TIMERx(x=0..4,7) + \param[in] dma_lenth: + only one parameter can be selected which is shown as below: + \arg TIMER_DMACFG_DMATC_xTRANSFER(x=1..18): DMA transfer x time + \param[out] none + \retval none +*/ +void timer_dma_transfer_config(uint32_t timer_periph, uint32_t dma_baseaddr, uint32_t dma_lenth) +{ + TIMER_DMACFG(timer_periph) &= (~(uint32_t)(TIMER_DMACFG_DMATA | TIMER_DMACFG_DMATC)); + TIMER_DMACFG(timer_periph) |= (uint32_t)(dma_baseaddr | dma_lenth); +} + +/*! + \brief software generate events + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] event: the timer software event generation sources + one or more parameters can be selected which are shown as below: + \arg TIMER_EVENT_SRC_UPG: update event generation, TIMERx(x=0..13) + \arg TIMER_EVENT_SRC_CH0G: channel 0 capture or compare event generation, TIMERx(x=0..4,7..13) + \arg TIMER_EVENT_SRC_CH1G: channel 1 capture or compare event generation, TIMERx(x=0..4,7,8,11) + \arg TIMER_EVENT_SRC_CH2G: channel 2 capture or compare event generation, TIMERx(x=0..4,7) + \arg TIMER_EVENT_SRC_CH3G: channel 3 capture or compare event generation, TIMERx(x=0..4,7) + \arg TIMER_EVENT_SRC_CMTG: channel commutation event generation, TIMERx(x=0,7) + \arg TIMER_EVENT_SRC_TRGG: trigger event generation, TIMERx(x=0..4,7,8,11) + \arg TIMER_EVENT_SRC_BRKG: break event generation, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_event_software_generate(uint32_t timer_periph, uint16_t event) +{ + TIMER_SWEVG(timer_periph) |= (uint32_t)event; +} + +/*! + \brief initialize TIMER break parameter struct with a default value + \param[in] breakpara: TIMER break parameter struct + \param[out] none + \retval none +*/ +void timer_break_struct_para_init(timer_break_parameter_struct* breakpara) +{ + /* initialize the break parameter struct member with the default value */ + breakpara->runoffstate = TIMER_ROS_STATE_DISABLE; + breakpara->ideloffstate = TIMER_IOS_STATE_DISABLE; + breakpara->deadtime = 0U; + breakpara->breakpolarity = TIMER_BREAK_POLARITY_LOW; + breakpara->outputautostate = TIMER_OUTAUTO_DISABLE; + breakpara->protectmode = TIMER_CCHP_PROT_OFF; + breakpara->breakstate = TIMER_BREAK_DISABLE; +} + +/*! + \brief configure TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] breakpara: TIMER break parameter struct + runoffstate: TIMER_ROS_STATE_ENABLE, TIMER_ROS_STATE_DISABLE + ideloffstate: TIMER_IOS_STATE_ENABLE, TIMER_IOS_STATE_DISABLE + deadtime: 0~255 + breakpolarity: TIMER_BREAK_POLARITY_LOW, TIMER_BREAK_POLARITY_HIGH + outputautostate: TIMER_OUTAUTO_ENABLE, TIMER_OUTAUTO_DISABLE + protectmode: TIMER_CCHP_PROT_OFF, TIMER_CCHP_PROT_0, TIMER_CCHP_PROT_1, TIMER_CCHP_PROT_2 + breakstate: TIMER_BREAK_ENABLE, TIMER_BREAK_DISABLE + \param[out] none + \retval none +*/ +void timer_break_config(uint32_t timer_periph, timer_break_parameter_struct* breakpara) +{ + TIMER_CCHP(timer_periph) = (uint32_t)(((uint32_t)(breakpara->runoffstate)) | + ((uint32_t)(breakpara->ideloffstate))| + ((uint32_t)(breakpara->deadtime)) | + ((uint32_t)(breakpara->breakpolarity)) | + ((uint32_t)(breakpara->outputautostate)) | + ((uint32_t)(breakpara->protectmode)) | + ((uint32_t)(breakpara->breakstate))); +} + +/*! + \brief enable TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_break_enable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_BRKEN; +} + +/*! + \brief disable TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_break_disable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) &= ~(uint32_t)TIMER_CCHP_BRKEN; +} + +/*! + \brief enable TIMER output automatic function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_automatic_output_enable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_OAEN; +} + +/*! + \brief disable TIMER output automatic function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_automatic_output_disable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) &= ~(uint32_t)TIMER_CCHP_OAEN; +} + +/*! + \brief enable or disable TIMER primary output function + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void timer_primary_output_config(uint32_t timer_periph, ControlStatus newvalue) +{ + if(ENABLE == newvalue){ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_POEN; + }else{ + TIMER_CCHP(timer_periph) &= (~(uint32_t)TIMER_CCHP_POEN); + } +} + +/*! + \brief enable or disable channel capture/compare control shadow register + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void timer_channel_control_shadow_config(uint32_t timer_periph, ControlStatus newvalue) +{ + if(ENABLE == newvalue){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_CCSE; + }else{ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_CCSE); + } +} + +/*! + \brief configure TIMER channel control shadow register update control + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] ccuctl: channel control shadow register update control + only one parameter can be selected which is shown as below: + \arg TIMER_UPDATECTL_CCU: the shadow registers update by when CMTG bit is set + \arg TIMER_UPDATECTL_CCUTRI: the shadow registers update by when CMTG bit is set or an rising edge of TRGI occurs + \param[out] none + \retval none +*/ +void timer_channel_control_shadow_update_config(uint32_t timer_periph, uint32_t ccuctl) +{ + if(TIMER_UPDATECTL_CCU == ccuctl){ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_CCUC); + }else if(TIMER_UPDATECTL_CCUTRI == ccuctl){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_CCUC; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief initialize TIMER channel output parameter struct with a default value + \param[in] ocpara: TIMER channel n output parameter struct + \param[out] none + \retval none +*/ +void timer_channel_output_struct_para_init(timer_oc_parameter_struct* ocpara) +{ + /* initialize the channel output parameter struct member with the default value */ + ocpara->outputstate = TIMER_CCX_DISABLE; + ocpara->outputnstate = TIMER_CCXN_DISABLE; + ocpara->ocpolarity = TIMER_OC_POLARITY_HIGH; + ocpara->ocnpolarity = TIMER_OCN_POLARITY_HIGH; + ocpara->ocidlestate = TIMER_OC_IDLE_STATE_LOW; + ocpara->ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; +} + +/*! + \brief configure TIMER channel output function + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocpara: TIMER channel output parameter struct + outputstate: TIMER_CCX_ENABLE, TIMER_CCX_DISABLE + outputnstate: TIMER_CCXN_ENABLE, TIMER_CCXN_DISABLE + ocpolarity: TIMER_OC_POLARITY_HIGH, TIMER_OC_POLARITY_LOW + ocnpolarity: TIMER_OCN_POLARITY_HIGH, TIMER_OCN_POLARITY_LOW + ocidlestate: TIMER_OC_IDLE_STATE_LOW, TIMER_OC_IDLE_STATE_HIGH + ocnidlestate: TIMER_OCN_IDLE_STATE_LOW, TIMER_OCN_IDLE_STATE_HIGH + \param[out] none + \retval none +*/ +void timer_channel_output_config(uint32_t timer_periph, uint16_t channel, timer_oc_parameter_struct* ocpara) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->outputstate; + /* reset the CH0P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0P); + /* set the CH0P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->ocpolarity; + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH0NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NEN); + /* set the CH0NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->outputnstate; + /* reset the CH0NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NP); + /* set the CH0NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->ocnpolarity; + /* reset the ISO0 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO0); + /* set the ISO0 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)ocpara->ocidlestate; + /* reset the ISO0N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO0N); + /* set the ISO0N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)ocpara->ocnidlestate; + } + TIMER_CHCTL0(timer_periph) &= ~(uint32_t)TIMER_CHCTL0_CH0MS; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 4U); + /* reset the CH1P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1P); + /* set the CH1P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity) << 4U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH1NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NEN); + /* set the CH1NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputnstate) << 4U); + /* reset the CH1NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NP); + /* set the CH1NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnpolarity) << 4U); + /* reset the ISO1 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO1); + /* set the ISO1 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate) << 2U); + /* reset the ISO1N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO1N); + /* set the ISO1N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnidlestate) << 2U); + } + TIMER_CHCTL0(timer_periph) &= ~(uint32_t)TIMER_CHCTL0_CH1MS; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + /* reset the CH2EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + /* set the CH2EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 8U); + /* reset the CH2P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2P); + /* set the CH2P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity) << 8U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH2NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NEN); + /* set the CH2NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputnstate) << 8U); + /* reset the CH2NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NP); + /* set the CH2NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnpolarity) << 8U); + /* reset the ISO2 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO2); + /* set the ISO2 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate) << 4U); + /* reset the ISO2N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO2N); + /* set the ISO2N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnidlestate) << 4U); + } + TIMER_CHCTL1(timer_periph) &= ~(uint32_t)TIMER_CHCTL1_CH2MS; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + /* reset the CH3EN bit */ + TIMER_CHCTL2(timer_periph) &=(~(uint32_t)TIMER_CHCTL2_CH3EN); + /* set the CH3EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 12U); + /* reset the CH3P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3P); + /* set the CH3P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity) << 12U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the ISO3 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO3); + /* set the ISO3 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate) << 6U); + } + TIMER_CHCTL1(timer_periph) &= ~(uint32_t)TIMER_CHCTL1_CH3MS; + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output compare mode + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocmode: channel output compare mode + only one parameter can be selected which is shown as below: + \arg TIMER_OC_MODE_TIMING: timing mode + \arg TIMER_OC_MODE_ACTIVE: active mode + \arg TIMER_OC_MODE_INACTIVE: inactive mode + \arg TIMER_OC_MODE_TOGGLE: toggle mode + \arg TIMER_OC_MODE_LOW: force low mode + \arg TIMER_OC_MODE_HIGH: force high mode + \arg TIMER_OC_MODE_PWM0: PWM mode 0 + \arg TIMER_OC_MODE_PWM1: PWM mode 1 + \param[out] none + \retval none +*/ +void timer_channel_output_mode_config(uint32_t timer_periph, uint16_t channel, uint16_t ocmode) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMCTL); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocmode; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMCTL); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(ocmode) << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMCTL); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocmode; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMCTL); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(ocmode) << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output pulse value + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] pulse: channel output pulse value + \param[out] none + \retval none +*/ +void timer_channel_output_pulse_value_config(uint32_t timer_periph, uint16_t channel, uint32_t pulse) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CH0CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CH1CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CH2CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CH3CV(timer_periph) = (uint32_t)pulse; + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output shadow function + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocshadow: channel output shadow state + only one parameter can be selected which is shown as below: + \arg TIMER_OC_SHADOW_ENABLE: channel output shadow state enable + \arg TIMER_OC_SHADOW_DISABLE: channel output shadow state disable + \param[out] none + \retval none +*/ +void timer_channel_output_shadow_config(uint32_t timer_periph, uint16_t channel, uint16_t ocshadow) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMSEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocshadow; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMSEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(ocshadow) << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMSEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocshadow; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMSEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(ocshadow) << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output fast function + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocfast: channel output fast function + only one parameter can be selected which is shown as below: + \arg TIMER_OC_FAST_ENABLE: channel output fast function enable + \arg TIMER_OC_FAST_DISABLE: channel output fast function disable + \param[out] none + \retval none +*/ +void timer_channel_output_fast_config(uint32_t timer_periph, uint16_t channel, uint16_t ocfast) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMFEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocfast; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMFEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)ocfast << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMFEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocfast; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMFEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)ocfast << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output clear function + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] occlear: channel output clear function + only one parameter can be selected which is shown as below: + \arg TIMER_OC_CLEAR_ENABLE: channel output clear function enable + \arg TIMER_OC_CLEAR_DISABLE: channel output clear function disable + \param[out] none + \retval none +*/ +void timer_channel_output_clear_config(uint32_t timer_periph, uint16_t channel, uint16_t occlear) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMCEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)occlear; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMCEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)occlear << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMCEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)occlear; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMCEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)occlear << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output polarity + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocpolarity: channel output polarity + only one parameter can be selected which is shown as below: + \arg TIMER_OC_POLARITY_HIGH: channel output polarity is high + \arg TIMER_OC_POLARITY_LOW: channel output polarity is low + \param[out] none + \retval none +*/ +void timer_channel_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocpolarity) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpolarity; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 8U); + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 12U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel complementary output polarity + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0,7)) + \param[in] ocnpolarity: channel complementary output polarity + only one parameter can be selected which is shown as below: + \arg TIMER_OCN_POLARITY_HIGH: channel complementary output polarity is high + \arg TIMER_OCN_POLARITY_LOW: channel complementary output polarity is low + \param[out] none + \retval none +*/ +void timer_channel_complementary_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnpolarity) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocnpolarity; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnpolarity << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnpolarity << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel enable state + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] state: TIMER channel enable state + only one parameter can be selected which is shown as below: + \arg TIMER_CCX_ENABLE: channel enable + \arg TIMER_CCX_DISABLE: channel disable + \param[out] none + \retval none +*/ +void timer_channel_output_state_config(uint32_t timer_periph, uint16_t channel, uint32_t state) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)state; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 8U); + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 12U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel complementary output enable state + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0,7)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0,7)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0,7)) + \param[in] ocnstate: TIMER channel complementary output enable state + only one parameter can be selected which is shown as below: + \arg TIMER_CCXN_ENABLE: channel complementary enable + \arg TIMER_CCXN_DISABLE: channel complementary disable + \param[out] none + \retval none +*/ +void timer_channel_complementary_output_state_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnstate) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocnstate; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnstate << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnstate << 8U); + break; + default: + break; + } +} + +/*! + \brief initialize TIMER channel input parameter struct with a default value + \param[in] icpara: TIMER channel input parameter struct + \param[out] none + \retval none +*/ +void timer_channel_input_struct_para_init(timer_ic_parameter_struct* icpara) +{ + /* initialize the channel input parameter struct member with the default value */ + icpara->icpolarity = TIMER_IC_POLARITY_RISING; + icpara->icselection = TIMER_IC_SELECTION_DIRECTTI; + icpara->icprescaler = TIMER_IC_PSC_DIV1; + icpara->icfilter = 0U; +} + +/*! + \brief configure TIMER input capture parameter + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] icpara: TIMER channel input parameter struct + icpolarity: TIMER_IC_POLARITY_RISING, TIMER_IC_POLARITY_FALLING, + TIMER_IC_POLARITY_BOTH_EDGE(only for TIMER8~TIMER13) + icselection: TIMER_IC_SELECTION_DIRECTTI, TIMER_IC_SELECTION_INDIRECTTI, + TIMER_IC_SELECTION_ITS + icprescaler: TIMER_IC_PSC_DIV1, TIMER_IC_PSC_DIV2, TIMER_IC_PSC_DIV4, + TIMER_IC_PSC_DIV8 + icfilter: 0~15 + \param[out] none + \retval none +*/ +void timer_input_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpara) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)(icpara->icpolarity); + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + TIMER_CHCTL0(timer_periph) |= (uint32_t)(icpara->icselection); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 4U); + + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + break; + + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection) << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 12U); + + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + /* reset the CH2EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + + /* reset the CH2P and CH2NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH2P | TIMER_CHCTL2_CH2NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 8U); + + /* reset the CH2MS bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2MS); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection)); + + /* reset the CH2CAPFLT bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2CAPFLT); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 4U); + + /* set the CH2EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH2EN; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + /* reset the CH3EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3EN); + + /* reset the CH3P bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH3P)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 12U); + + /* reset the CH3MS bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3MS); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection) << 8U); + + /* reset the CH3CAPFLT bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3CAPFLT); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 12U); + + /* set the CH3EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH3EN; + break; + default: + break; + } + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, channel, (uint16_t)(icpara->icprescaler)); +} + +/*! + \brief configure TIMER channel input capture prescaler value + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] prescaler: channel input capture prescaler value + only one parameter can be selected which is shown as below: + \arg TIMER_IC_PSC_DIV1: no prescaler + \arg TIMER_IC_PSC_DIV2: divided by 2 + \arg TIMER_IC_PSC_DIV4: divided by 4 + \arg TIMER_IC_PSC_DIV8: divided by 8 + \param[out] none + \retval none +*/ +void timer_channel_input_capture_prescaler_config(uint32_t timer_periph, uint16_t channel, uint16_t prescaler) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPPSC); + TIMER_CHCTL0(timer_periph) |= (uint32_t)prescaler; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPPSC); + TIMER_CHCTL0(timer_periph) |= ((uint32_t)prescaler << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2CAPPSC); + TIMER_CHCTL1(timer_periph) |= (uint32_t)prescaler; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3CAPPSC); + TIMER_CHCTL1(timer_periph) |= ((uint32_t)prescaler << 8U); + break; + default: + break; + } +} + +/*! + \brief read TIMER channel capture compare register value + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[out] none + \retval channel capture compare register value +*/ +uint32_t timer_channel_capture_value_register_read(uint32_t timer_periph, uint16_t channel) +{ + uint32_t count_value = 0U; + + switch(channel){ + case TIMER_CH_0: + /* read TIMER channel 0 capture compare register value */ + count_value = TIMER_CH0CV(timer_periph); + break; + case TIMER_CH_1: + /* read TIMER channel 1 capture compare register value */ + count_value = TIMER_CH1CV(timer_periph); + break; + case TIMER_CH_2: + /* read TIMER channel 2 capture compare register value */ + count_value = TIMER_CH2CV(timer_periph); + break; + case TIMER_CH_3: + /* read TIMER channel 3 capture compare register value */ + count_value = TIMER_CH3CV(timer_periph); + break; + default: + break; + } + return (count_value); +} + +/*! + \brief configure TIMER input pwm capture function + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0 + \arg TIMER_CH_1: TIMER channel 1 + \param[in] icpwm: TIMER channel input pwm parameter struct + icpolarity: TIMER_IC_POLARITY_RISING, TIMER_IC_POLARITY_FALLING + icselection: TIMER_IC_SELECTION_DIRECTTI, TIMER_IC_SELECTION_INDIRECTTI + icprescaler: TIMER_IC_PSC_DIV1, TIMER_IC_PSC_DIV2, TIMER_IC_PSC_DIV4, + TIMER_IC_PSC_DIV8 + icfilter: 0~15 + \param[out] none + \retval none +*/ +void timer_input_pwm_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpwm) +{ + uint16_t icpolarity = 0x0U; + uint16_t icselection = 0x0U; + + /* Set channel input polarity */ + if(TIMER_IC_POLARITY_RISING == icpwm->icpolarity){ + icpolarity = TIMER_IC_POLARITY_FALLING; + }else{ + icpolarity = TIMER_IC_POLARITY_RISING; + } + /* Set channel input mode selection */ + if(TIMER_IC_SELECTION_DIRECTTI == icpwm->icselection){ + icselection = TIMER_IC_SELECTION_INDIRECTTI; + }else{ + icselection = TIMER_IC_SELECTION_DIRECTTI; + } + + if(TIMER_CH_0 == channel){ + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)(icpwm->icpolarity); + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(icpwm->icselection); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* set the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= ((uint32_t)(icpwm->icfilter) << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_0, (uint16_t)(icpwm->icprescaler)); + + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + /* set the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)icpolarity<< 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)icselection << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icfilter) << 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_1, (uint16_t)(icpwm->icprescaler)); + }else{ + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + /* set the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icpolarity) << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icselection) << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icfilter) << 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_1, (uint16_t)(icpwm->icprescaler)); + + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)icpolarity; + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)icselection; + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* set the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= ((uint32_t)(icpwm->icfilter) << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_0, (uint16_t)(icpwm->icprescaler)); + } +} + +/*! + \brief configure TIMER hall sensor mode + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] hallmode: + only one parameter can be selected which is shown as below: + \arg TIMER_HALLINTERFACE_ENABLE: TIMER hall sensor mode enable + \arg TIMER_HALLINTERFACE_DISABLE: TIMER hall sensor mode disable + \param[out] none + \retval none +*/ +void timer_hall_mode_config(uint32_t timer_periph, uint32_t hallmode) +{ + if(TIMER_HALLINTERFACE_ENABLE == hallmode){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_TI0S; + }else if(TIMER_HALLINTERFACE_DISABLE == hallmode){ + TIMER_CTL1(timer_periph) &= ~(uint32_t)TIMER_CTL1_TI0S; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief select TIMER input trigger source + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] intrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_ITI0: internal trigger 0(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ITI1: internal trigger 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ITI2: internal trigger 2(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ITI3: internal trigger 3(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_CI0F_ED: TI0 edge detector(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_CI0FE0: filtered TIMER input 0(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_CI1FE1: filtered TIMER input 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ETIFP: filtered external trigger input(TIMERx(x=0..4,7)) + \param[out] none + \retval none +*/ +void timer_input_trigger_source_select(uint32_t timer_periph, uint32_t intrigger) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_TRGS); + TIMER_SMCFG(timer_periph) |= (uint32_t)intrigger; +} + +/*! + \brief select TIMER master mode output trigger source + \param[in] timer_periph: TIMERx(x=0..7) + \param[in] outrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_TRI_OUT_SRC_RESET: the UPG bit as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_ENABLE: the counter enable signal TIMER_CTL0_CEN as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_UPDATE: update event as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_CH0: a capture or a compare match occurred in channel 0 as trigger output TRGO(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O0CPRE: O0CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O1CPRE: O1CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O2CPRE: O2CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O3CPRE: O3CPRE as trigger output(TIMERx(x=0..4,7)) + \param[out] none + \retval none +*/ +void timer_master_output_trigger_source_select(uint32_t timer_periph, uint32_t outrigger) +{ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_MMC); + TIMER_CTL1(timer_periph) |= (uint32_t)outrigger; +} + +/*! + \brief select TIMER slave mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] slavemode: + only one parameter can be selected which is shown as below: + \arg TIMER_SLAVE_MODE_DISABLE: slave mode disable + \arg TIMER_QUAD_DECODER_MODE0: quadrature decoder mode 0 + \arg TIMER_QUAD_DECODER_MODE1: quadrature decoder mode 1 + \arg TIMER_QUAD_DECODER_MODE2: quadrature decoder mode 2 + \arg TIMER_SLAVE_MODE_RESTART: restart mode + \arg TIMER_SLAVE_MODE_PAUSE: pause mode + \arg TIMER_SLAVE_MODE_EVENT: event mode + \arg TIMER_SLAVE_MODE_EXTERNAL0: external clock mode 0 + \param[out] none + \retval none +*/ + +void timer_slave_mode_select(uint32_t timer_periph, uint32_t slavemode) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + TIMER_SMCFG(timer_periph) |= (uint32_t)slavemode; +} + +/*! + \brief configure TIMER master slave mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] masterslave: + only one parameter can be selected which is shown as below: + \arg TIMER_MASTER_SLAVE_MODE_ENABLE: master slave mode enable + \arg TIMER_MASTER_SLAVE_MODE_DISABLE: master slave mode disable + \param[out] none + \retval none +*/ +void timer_master_slave_mode_config(uint32_t timer_periph, uint32_t masterslave) +{ + if(TIMER_MASTER_SLAVE_MODE_ENABLE == masterslave){ + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SMCFG_MSM; + }else if(TIMER_MASTER_SLAVE_MODE_DISABLE == masterslave){ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_MSM; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER external trigger input + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_trigger_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint32_t extfilter) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)(TIMER_SMCFG_ETP | TIMER_SMCFG_ETPSC | TIMER_SMCFG_ETFC)); + TIMER_SMCFG(timer_periph) |= (uint32_t)(extprescaler | extpolarity); + TIMER_SMCFG(timer_periph) |= (uint32_t)(extfilter << 8U); +} + +/*! + \brief configure TIMER quadrature decoder mode + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] decomode: + only one parameter can be selected which is shown as below: + \arg TIMER_QUAD_DECODER_MODE0: counter counts on CI0FE0 edge depending on CI1FE1 level + \arg TIMER_QUAD_DECODER_MODE1: counter counts on CI1FE1 edge depending on CI0FE0 level + \arg TIMER_QUAD_DECODER_MODE2: counter counts on both CI0FE0 and CI1FE1 edges depending on the level of the other input + \param[in] ic0polarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: capture rising edge + \arg TIMER_IC_POLARITY_FALLING: capture falling edge + \param[in] ic1polarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: capture rising edge + \arg TIMER_IC_POLARITY_FALLING: capture falling edge + \param[out] none + \retval none +*/ +void timer_quadrature_decoder_mode_config(uint32_t timer_periph, uint32_t decomode, uint16_t ic0polarity, uint16_t ic1polarity) +{ + /* configure the quadrature decoder mode */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + TIMER_SMCFG(timer_periph) |= (uint32_t)decomode; + /* configure input capture selection */ + TIMER_CHCTL0(timer_periph) &= (uint32_t)(((~(uint32_t)TIMER_CHCTL0_CH0MS)) & ((~(uint32_t)TIMER_CHCTL0_CH1MS))); + TIMER_CHCTL0(timer_periph) |= (uint32_t)(TIMER_IC_SELECTION_DIRECTTI | ((uint32_t)TIMER_IC_SELECTION_DIRECTTI << 8U)); + /* configure channel input capture polarity */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + TIMER_CHCTL2(timer_periph) |= ((uint32_t)ic0polarity | ((uint32_t)ic1polarity << 4U)); +} + +/*! + \brief configure TIMER internal clock mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[out] none + \retval none +*/ +void timer_internal_clock_config(uint32_t timer_periph) +{ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC; +} + +/*! + \brief configure TIMER the internal trigger as external clock input + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] intrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_ITI0: internal trigger 0 + \arg TIMER_SMCFG_TRGSEL_ITI1: internal trigger 1 + \arg TIMER_SMCFG_TRGSEL_ITI2: internal trigger 2 + \arg TIMER_SMCFG_TRGSEL_ITI3: internal trigger 3 + \param[out] none + \retval none +*/ +void timer_internal_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t intrigger) +{ + timer_input_trigger_source_select(timer_periph, intrigger); + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC; + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SLAVE_MODE_EXTERNAL0; +} + +/*! + \brief configure TIMER the external trigger as external clock input + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] extrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_CI0F_ED: TI0 edge detector + \arg TIMER_SMCFG_TRGSEL_CI0FE0: filtered TIMER input 0 + \arg TIMER_SMCFG_TRGSEL_CI1FE1: filtered TIMER input 1 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: active low or falling edge active + \arg TIMER_IC_POLARITY_FALLING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t extrigger, uint16_t extpolarity, uint32_t extfilter) +{ + if(TIMER_SMCFG_TRGSEL_CI1FE1 == extrigger){ + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + /* set the CH1NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)extpolarity << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)TIMER_IC_SELECTION_DIRECTTI << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(extfilter << 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + }else{ + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)extpolarity; + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)TIMER_IC_SELECTION_DIRECTTI; + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(extfilter << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + } + /* select TIMER input trigger source */ + timer_input_trigger_source_select(timer_periph, extrigger); + /* reset the SMC bit */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + /* set the SMC bit */ + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SLAVE_MODE_EXTERNAL0; +} + +/*! + \brief configure TIMER the external clock mode0 + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_clock_mode0_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint32_t extfilter) +{ + /* configure TIMER external trigger input */ + timer_external_trigger_config(timer_periph, extprescaler, extpolarity, extfilter); + /* reset the SMC bit,TRGS bit */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)(TIMER_SMCFG_SMC | TIMER_SMCFG_TRGS)); + /* set the SMC bit,TRGS bit */ + TIMER_SMCFG(timer_periph) |= (uint32_t)(TIMER_SLAVE_MODE_EXTERNAL0 | TIMER_SMCFG_TRGSEL_ETIFP); +} + +/*! + \brief configure TIMER the external clock mode1 + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_clock_mode1_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint32_t extfilter) +{ + /* configure TIMER external trigger input */ + timer_external_trigger_config(timer_periph, extprescaler, extpolarity, extfilter); + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SMCFG_SMC1; +} + +/*! + \brief disable TIMER the external clock mode1 + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_external_clock_mode1_disable(uint32_t timer_periph) +{ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC1; +} + +/*! + \brief configure TIMER write CHxVAL register selection + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] ccsel: + only one parameter can be selected which is shown as below: + \arg TIMER_CHVSEL_DISABLE: no effect + \arg TIMER_CHVSEL_ENABLE: when write the CHxVAL register, if the write value is same as the CHxVAL value, the write access is ignored + \param[out] none + \retval none +*/ +void timer_write_chxval_register_config(uint32_t timer_periph, uint16_t ccsel) +{ + if(TIMER_CHVSEL_ENABLE == ccsel){ + TIMER_CFG(timer_periph) |= (uint32_t)TIMER_CFG_CHVSEL; + }else if(TIMER_CHVSEL_DISABLE == ccsel){ + TIMER_CFG(timer_periph) &= ~(uint32_t)TIMER_CFG_CHVSEL; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER output value selection + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] outsel: + only one parameter can be selected which is shown as below: + \arg TIMER_OUTSEL_DISABLE: no effect + \arg TIMER_OUTSEL_ENABLE: if POEN and IOS is 0, the output disabled + \param[out] none + \retval none +*/ +void timer_output_value_selection_config(uint32_t timer_periph, uint16_t outsel) +{ + if(TIMER_OUTSEL_ENABLE == outsel){ + TIMER_CFG(timer_periph) |= (uint32_t)TIMER_CFG_OUTSEL; + }else if(TIMER_OUTSEL_DISABLE == outsel){ + TIMER_CFG(timer_periph) &= ~(uint32_t)TIMER_CFG_OUTSEL; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable the TIMER interrupt + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: specify which interrupt to enable + one or more parameters can be selected which are shown as below: + \arg TIMER_INT_UP: update interrupt enable, TIMERx(x=0..13) + \arg TIMER_INT_CH0: channel 0 interrupt enable, TIMERx(x=0..4,7..13) + \arg TIMER_INT_CH1: channel 1 interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_CH2: channel 2 interrupt enable, TIMERx(x=0..4,7) + \arg TIMER_INT_CH3: channel 3 interrupt enable, TIMERx(x=0..4,7) + \arg TIMER_INT_CMT: commutation interrupt enable, TIMERx(x=0,7) + \arg TIMER_INT_TRG: trigger interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_BRK: break interrupt enable, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_enable(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_DMAINTEN(timer_periph) |= (uint32_t) interrupt; +} + +/*! + \brief disable the TIMER interrupt + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: specify which interrupt to disable + one or more parameters can be selected which are shown as below: + \arg TIMER_INT_UP: update interrupt enable, TIMERx(x=0..13) + \arg TIMER_INT_CH0: channel 0 interrupt enable, TIMERx(x=0..4,7..13) + \arg TIMER_INT_CH1: channel 1 interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_CH2: channel 2 interrupt enable, TIMERx(x=0..4,7) + \arg TIMER_INT_CH3: channel 3 interrupt enable , TIMERx(x=0..4,7) + \arg TIMER_INT_CMT: commutation interrupt enable, TIMERx(x=0,7) + \arg TIMER_INT_TRG: trigger interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_BRK: break interrupt enable, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_disable(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_DMAINTEN(timer_periph) &= (~(uint32_t)interrupt); +} + +/*! + \brief get timer interrupt flag + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: the timer interrupt bits + only one parameter can be selected which is shown as below: + \arg TIMER_INT_FLAG_UP: update interrupt flag, TIMERx(x=0..13) + \arg TIMER_INT_FLAG_CH0: channel 0 interrupt flag, TIMERx(x=0..4,7..13) + \arg TIMER_INT_FLAG_CH1: channel 1 interrupt flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_FLAG_CH2: channel 2 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CH3: channel 3 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CMT: channel commutation interrupt flag, TIMERx(x=0,7) + \arg TIMER_INT_FLAG_TRG: trigger interrupt flag, TIMERx(x=0,7,8,11) + \arg TIMER_INT_FLAG_BRK: break interrupt flag, TIMERx(x=0,7) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus timer_interrupt_flag_get(uint32_t timer_periph, uint32_t interrupt) +{ + uint32_t val; + val = (TIMER_DMAINTEN(timer_periph) & interrupt); + if((RESET != (TIMER_INTF(timer_periph) & interrupt)) && (RESET != val)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear TIMER interrupt flag + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: the timer interrupt bits + one or more parameters can be selected which are shown as below: + \arg TIMER_INT_FLAG_UP: update interrupt flag, TIMERx(x=0..13) + \arg TIMER_INT_FLAG_CH0: channel 0 interrupt flag, TIMERx(x=0..4,7..13) + \arg TIMER_INT_FLAG_CH1: channel 1 interrupt flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_FLAG_CH2: channel 2 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CH3: channel 3 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CMT: channel commutation interrupt flag, TIMERx(x=0,7) + \arg TIMER_INT_FLAG_TRG: trigger interrupt flag, TIMERx(x=0,7,8,11) + \arg TIMER_INT_FLAG_BRK: break interrupt flag, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_flag_clear(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_INTF(timer_periph) = (~(uint32_t)interrupt); +} + +/*! + \brief get TIMER flags + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] flag: the timer interrupt flags + only one parameter can be selected which is shown as below: + \arg TIMER_FLAG_UP: update flag, TIMERx(x=0..13) + \arg TIMER_FLAG_CH0: channel 0 flag, TIMERx(x=0..4,7..13) + \arg TIMER_FLAG_CH1: channel 1 flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2: channel 2 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3: channel 3 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CMT: channel commutation flag, TIMERx(x=0,7) + \arg TIMER_FLAG_TRG: trigger flag, TIMERx(x=0,7,8,11) + \arg TIMER_FLAG_BRK: break flag, TIMERx(x=0,7) + \arg TIMER_FLAG_CH0O: channel 0 overcapture flag, TIMERx(x=0..4,7..11) + \arg TIMER_FLAG_CH1O: channel 1 overcapture flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2O: channel 2 overcapture flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3O: channel 3 overcapture flag, TIMERx(x=0..4,7) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus timer_flag_get(uint32_t timer_periph, uint32_t flag) +{ + if(RESET != (TIMER_INTF(timer_periph) & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear TIMER flags + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] flag: the timer interrupt flags + one or more parameters can be selected which are shown as below: + \arg TIMER_FLAG_UP: update flag, TIMERx(x=0..13) + \arg TIMER_FLAG_CH0: channel 0 flag, TIMERx(x=0..4,7..13) + \arg TIMER_FLAG_CH1: channel 1 flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2: channel 2 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3: channel 3 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CMT: channel commutation flag, TIMERx(x=0,7) + \arg TIMER_FLAG_TRG: trigger flag, TIMERx(x=0,7,8,11) + \arg TIMER_FLAG_BRK: break flag, TIMERx(x=0,7) + \arg TIMER_FLAG_CH0O: channel 0 overcapture flag, TIMERx(x=0..4,7..11) + \arg TIMER_FLAG_CH1O: channel 1 overcapture flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2O: channel 2 overcapture flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3O: channel 3 overcapture flag, TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_flag_clear(uint32_t timer_periph, uint32_t flag) +{ + TIMER_INTF(timer_periph) = (~(uint32_t)flag); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_timer.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_timer.c.base@1.0.0 new file mode 100644 index 0000000..5112573 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_timer.c.base@1.0.0 @@ -0,0 +1,2039 @@ +/*! + \file gd32c10x_timer.c + \brief TIMER driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_timer.h" + +/* TIMER init parameter mask */ +#define ALIGNEDMODE_MASK ((uint32_t)0x00000060U) /*!< TIMER init parameter aligne dmode mask */ +#define COUNTERDIRECTION_MASK ((uint32_t)0x00000010U) /*!< TIMER init parameter counter direction mask */ +#define CLOCKDIVISION_MASK ((uint32_t)0x00000300U) /*!< TIMER init parameter clock division value mask */ + +/*! + \brief deinit a timer + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_deinit(uint32_t timer_periph) +{ + switch(timer_periph){ + case TIMER0: + /* reset TIMER0 */ + rcu_periph_reset_enable(RCU_TIMER0RST); + rcu_periph_reset_disable(RCU_TIMER0RST); + break; + case TIMER1: + /* reset TIMER1 */ + rcu_periph_reset_enable(RCU_TIMER1RST); + rcu_periph_reset_disable(RCU_TIMER1RST); + break; + case TIMER2: + /* reset TIMER2 */ + rcu_periph_reset_enable(RCU_TIMER2RST); + rcu_periph_reset_disable(RCU_TIMER2RST); + break; + case TIMER3: + /* reset TIMER3 */ + rcu_periph_reset_enable(RCU_TIMER3RST); + rcu_periph_reset_disable(RCU_TIMER3RST); + break; + case TIMER4: + /* reset TIMER4 */ + rcu_periph_reset_enable(RCU_TIMER4RST); + rcu_periph_reset_disable(RCU_TIMER4RST); + break; + case TIMER5: + /* reset TIMER5 */ + rcu_periph_reset_enable(RCU_TIMER5RST); + rcu_periph_reset_disable(RCU_TIMER5RST); + break; + case TIMER6: + /* reset TIMER6 */ + rcu_periph_reset_enable(RCU_TIMER6RST); + rcu_periph_reset_disable(RCU_TIMER6RST); + break; + case TIMER7: + /* reset TIMER7 */ + rcu_periph_reset_enable(RCU_TIMER7RST); + rcu_periph_reset_disable(RCU_TIMER7RST); + break; + case TIMER8: + /* reset TIMER8 */ + rcu_periph_reset_enable(RCU_TIMER8RST); + rcu_periph_reset_disable(RCU_TIMER8RST); + break; + case TIMER9: + /* reset TIMER9 */ + rcu_periph_reset_enable(RCU_TIMER9RST); + rcu_periph_reset_disable(RCU_TIMER9RST); + break; + case TIMER10: + /* reset TIMER10 */ + rcu_periph_reset_enable(RCU_TIMER10RST); + rcu_periph_reset_disable(RCU_TIMER10RST); + break; + case TIMER11: + /* reset TIMER11 */ + rcu_periph_reset_enable(RCU_TIMER11RST); + rcu_periph_reset_disable(RCU_TIMER11RST); + break; + case TIMER12: + /* reset TIMER12 */ + rcu_periph_reset_enable(RCU_TIMER12RST); + rcu_periph_reset_disable(RCU_TIMER12RST); + break; + case TIMER13: + /* reset TIMER13 */ + rcu_periph_reset_enable(RCU_TIMER13RST); + rcu_periph_reset_disable(RCU_TIMER13RST); + break; + default: + break; + } +} + +/*! + \brief initialize TIMER init parameter struct with a default value + \param[in] initpara: init parameter struct + \param[out] none + \retval none +*/ +void timer_struct_para_init(timer_parameter_struct* initpara) +{ + /* initialize the init parameter struct member with the default value */ + initpara->prescaler = 0U; + initpara->alignedmode = TIMER_COUNTER_EDGE; + initpara->counterdirection = TIMER_COUNTER_UP; + initpara->period = 65535U; + initpara->clockdivision = TIMER_CKDIV_DIV1; + initpara->repetitioncounter = 0U; +} + +/*! + \brief initialize TIMER counter + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] initpara: init parameter struct + prescaler: prescaler value of the counter clock, 0~65535 + alignedmode: TIMER_COUNTER_EDGE, TIMER_COUNTER_CENTER_DOWN, TIMER_COUNTER_CENTER_UP, + TIMER_COUNTER_CENTER_BOTH + counterdirection: TIMER_COUNTER_UP, TIMER_COUNTER_DOWN + period: counter auto reload value, 0~65535 + clockdivision: TIMER_CKDIV_DIV1, TIMER_CKDIV_DIV2, TIMER_CKDIV_DIV4 + repetitioncounter: counter repetition value, 0~255 + \param[out] none + \retval none +*/ +void timer_init(uint32_t timer_periph, timer_parameter_struct* initpara) +{ + /* configure the counter prescaler value */ + TIMER_PSC(timer_periph) = (uint16_t)initpara->prescaler; + + /* configure the counter direction and aligned mode */ + if((TIMER0 == timer_periph) || (TIMER1 == timer_periph) || (TIMER2 == timer_periph) + || (TIMER3 == timer_periph) || (TIMER4 == timer_periph) || (TIMER7 == timer_periph)){ + TIMER_CTL0(timer_periph) &= (~(uint32_t)(TIMER_CTL0_DIR | TIMER_CTL0_CAM)); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->alignedmode & ALIGNEDMODE_MASK); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->counterdirection & COUNTERDIRECTION_MASK); + } + + /* configure the autoreload value */ + TIMER_CAR(timer_periph) = (uint32_t)initpara->period; + + if((TIMER5 != timer_periph) && (TIMER6 != timer_periph)){ + /* reset the CKDIV bit */ + TIMER_CTL0(timer_periph) &= (~(uint32_t)TIMER_CTL0_CKDIV); + TIMER_CTL0(timer_periph) |= (uint32_t)(initpara->clockdivision & CLOCKDIVISION_MASK); + } + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* configure the repetition counter value */ + TIMER_CREP(timer_periph) = (uint32_t)initpara->repetitioncounter; + } + + /* generate an update event */ + TIMER_SWEVG(timer_periph) |= (uint32_t)TIMER_SWEVG_UPG; +} + +/*! + \brief enable a timer + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_CEN; +} + +/*! + \brief disable a timer + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_CEN; +} + +/*! + \brief enable the auto reload shadow function + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_auto_reload_shadow_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_ARSE; +} + +/*! + \brief disable the auto reload shadow function + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_auto_reload_shadow_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_ARSE; +} + +/*! + \brief enable the update event + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_update_event_enable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_UPDIS; +} + +/*! + \brief disable the update event + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval none +*/ +void timer_update_event_disable(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t) TIMER_CTL0_UPDIS; +} + +/*! + \brief set TIMER counter alignment mode + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] aligned: + only one parameter can be selected which is shown as below: + \arg TIMER_COUNTER_EDGE: edge-aligned mode + \arg TIMER_COUNTER_CENTER_DOWN: center-aligned and counting down assert mode + \arg TIMER_COUNTER_CENTER_UP: center-aligned and counting up assert mode + \arg TIMER_COUNTER_CENTER_BOTH: center-aligned and counting up/down assert mode + \param[out] none + \retval none +*/ +void timer_counter_alignment(uint32_t timer_periph, uint16_t aligned) +{ + TIMER_CTL0(timer_periph) &= (uint32_t)(~TIMER_CTL0_CAM); + TIMER_CTL0(timer_periph) |= (uint32_t)aligned; +} + +/*! + \brief set TIMER counter up direction + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_counter_up_direction(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_DIR; +} + +/*! + \brief set TIMER counter down direction + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_counter_down_direction(uint32_t timer_periph) +{ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_DIR; +} + +/*! + \brief configure TIMER prescaler + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] prescaler: prescaler value + \param[in] pscreload: prescaler reload mode + only one parameter can be selected which is shown as below: + \arg TIMER_PSC_RELOAD_NOW: the prescaler is loaded right now + \arg TIMER_PSC_RELOAD_UPDATE: the prescaler is loaded at the next update event + \param[out] none + \retval none +*/ +void timer_prescaler_config(uint32_t timer_periph, uint16_t prescaler, uint32_t pscreload) +{ + TIMER_PSC(timer_periph) = (uint32_t)prescaler; + + if(TIMER_PSC_RELOAD_NOW == pscreload){ + TIMER_SWEVG(timer_periph) |= (uint32_t)TIMER_SWEVG_UPG; + } +} + +/*! + \brief configure TIMER repetition register value + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] repetition: the counter repetition value, 0~255 + \param[out] none + \retval none +*/ +void timer_repetition_value_config(uint32_t timer_periph, uint16_t repetition) +{ + TIMER_CREP(timer_periph) = (uint32_t)repetition; +} + +/*! + \brief configure TIMER autoreload register value + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] autoreload: the counter auto-reload value + \param[out] none + \retval none +*/ +void timer_autoreload_value_config(uint32_t timer_periph, uint16_t autoreload) +{ + TIMER_CAR(timer_periph) = (uint32_t)autoreload; +} + +/*! + \brief configure TIMER counter register value + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] counter: the counter value + \param[out] none + \retval none +*/ +void timer_counter_value_config(uint32_t timer_periph, uint16_t counter) +{ + TIMER_CNT(timer_periph) = (uint32_t)counter; +} + +/*! + \brief read TIMER counter value + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval counter value +*/ +uint32_t timer_counter_read(uint32_t timer_periph) +{ + uint32_t count_value = 0U; + count_value = TIMER_CNT(timer_periph); + return (count_value); +} + +/*! + \brief read TIMER prescaler value + \param[in] timer_periph: TIMERx(x=0..13) + \param[out] none + \retval prescaler register value +*/ +uint16_t timer_prescaler_read(uint32_t timer_periph) +{ + uint16_t prescaler_value = 0U; + prescaler_value = (uint16_t)(TIMER_PSC(timer_periph)); + return (prescaler_value); +} + +/*! + \brief configure TIMER single pulse mode + \param[in] timer_periph: TIMERx(x=0..8,11) + \param[in] spmode: + only one parameter can be selected which is shown as below: + \arg TIMER_SP_MODE_SINGLE: single pulse mode + \arg TIMER_SP_MODE_REPETITIVE: repetitive pulse mode + \param[out] none + \retval none +*/ +void timer_single_pulse_mode_config(uint32_t timer_periph, uint32_t spmode) +{ + if(TIMER_SP_MODE_SINGLE == spmode){ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_SPM; + }else if(TIMER_SP_MODE_REPETITIVE == spmode){ + TIMER_CTL0(timer_periph) &= ~((uint32_t)TIMER_CTL0_SPM); + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER update source + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] update: + only one parameter can be selected which is shown as below: + \arg TIMER_UPDATE_SRC_GLOBAL: update generate by setting of UPG bit or the counter overflow/underflow, + or the slave mode controller trigger + \arg TIMER_UPDATE_SRC_REGULAR: update generate only by counter overflow/underflow + \param[out] none + \retval none +*/ +void timer_update_source_config(uint32_t timer_periph, uint32_t update) +{ + if(TIMER_UPDATE_SRC_REGULAR == update){ + TIMER_CTL0(timer_periph) |= (uint32_t)TIMER_CTL0_UPS; + }else if(TIMER_UPDATE_SRC_GLOBAL == update){ + TIMER_CTL0(timer_periph) &= ~(uint32_t)TIMER_CTL0_UPS; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable the TIMER DMA + \param[in] timer_periph: TIMERx(x=0..7) + \param[in] dma: specify which DMA to enable + one or more parameters can be selected which are shown as below: + \arg TIMER_DMA_UPD: update DMA enable, TIMERx(x=0..7) + \arg TIMER_DMA_CH0D: channel 0 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH1D: channel 1 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH2D: channel 2 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH3D: channel 3 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CMTD: channel commutation DMA request enable, TIMERx(x=0,7) + \arg TIMER_DMA_TRGD: trigger DMA enable, TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_dma_enable(uint32_t timer_periph, uint16_t dma) +{ + TIMER_DMAINTEN(timer_periph) |= (uint32_t) dma; +} + +/*! + \brief disable the TIMER DMA + \param[in] timer_periph: TIMERxTIMERx(x=0..7) + \param[in] dma: specify which DMA to disable + one or more parameters can be selected which are shown as below: + \arg TIMER_DMA_UPD: update DMA enable, TIMERx(x=0..7) + \arg TIMER_DMA_CH0D: channel 0 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH1D: channel 1 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH2D: channel 2 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CH3D: channel 3 DMA enable, TIMERx(x=0..4,7) + \arg TIMER_DMA_CMTD: channel commutation DMA request enable, TIMERx(x=0,7) + \arg TIMER_DMA_TRGD: trigger DMA enable, TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_dma_disable(uint32_t timer_periph, uint16_t dma) +{ + TIMER_DMAINTEN(timer_periph) &= (~(uint32_t)(dma)); +} + +/*! + \brief channel DMA request source selection + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] dma_request: channel DMA request source selection + only one parameter can be selected which is shown as below: + \arg TIMER_DMAREQUEST_CHANNELEVENT: DMA request of channel n is sent when channel n event occurs + \arg TIMER_DMAREQUEST_UPDATEEVENT: DMA request of channel n is sent when update event occurs + \param[out] none + \retval none +*/ +void timer_channel_dma_request_source_select(uint32_t timer_periph, uint32_t dma_request) +{ + if(TIMER_DMAREQUEST_UPDATEEVENT == dma_request){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_DMAS; + }else if(TIMER_DMAREQUEST_CHANNELEVENT == dma_request){ + TIMER_CTL1(timer_periph) &= ~(uint32_t)TIMER_CTL1_DMAS; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure the TIMER DMA transfer + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] dma_baseaddr: + only one parameter can be selected which is shown as below: + \arg TIMER_DMACFG_DMATA_CTL0: DMA transfer address is TIMER_CTL0, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CTL1: DMA transfer address is TIMER_CTL1, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_SMCFG: DMA transfer address is TIMER_SMCFG, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_DMAINTEN: DMA transfer address is TIMER_DMAINTEN, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_INTF: DMA transfer address is TIMER_INTF, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_SWEVG: DMA transfer address is TIMER_SWEVG, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL0: DMA transfer address is TIMER_CHCTL0, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL1: DMA transfer address is TIMER_CHCTL1, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CHCTL2: DMA transfer address is TIMER_CHCTL2, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CNT: DMA transfer address is TIMER_CNT, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_PSC: DMA transfer address is TIMER_PSC, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CAR: DMA transfer address is TIMER_CAR, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CREP: DMA transfer address is TIMER_CREP, TIMERx(x=0,7) + \arg TIMER_DMACFG_DMATA_CH0CV: DMA transfer address is TIMER_CH0CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH1CV: DMA transfer address is TIMER_CH1CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH2CV: DMA transfer address is TIMER_CH2CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CH3CV: DMA transfer address is TIMER_CH3CV, TIMERx(x=0..4,7) + \arg TIMER_DMACFG_DMATA_CCHP: DMA transfer address is TIMER_CCHP, TIMERx(x=0,7) + \arg TIMER_DMACFG_DMATA_DMACFG: DMA transfer address is TIMER_DMACFG, TIMERx(x=0..4,7) + \param[in] dma_lenth: + only one parameter can be selected which is shown as below: + \arg TIMER_DMACFG_DMATC_xTRANSFER(x=1..18): DMA transfer x time + \param[out] none + \retval none +*/ +void timer_dma_transfer_config(uint32_t timer_periph, uint32_t dma_baseaddr, uint32_t dma_lenth) +{ + TIMER_DMACFG(timer_periph) &= (~(uint32_t)(TIMER_DMACFG_DMATA | TIMER_DMACFG_DMATC)); + TIMER_DMACFG(timer_periph) |= (uint32_t)(dma_baseaddr | dma_lenth); +} + +/*! + \brief software generate events + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] event: the timer software event generation sources + one or more parameters can be selected which are shown as below: + \arg TIMER_EVENT_SRC_UPG: update event generation, TIMERx(x=0..13) + \arg TIMER_EVENT_SRC_CH0G: channel 0 capture or compare event generation, TIMERx(x=0..4,7..13) + \arg TIMER_EVENT_SRC_CH1G: channel 1 capture or compare event generation, TIMERx(x=0..4,7,8,11) + \arg TIMER_EVENT_SRC_CH2G: channel 2 capture or compare event generation, TIMERx(x=0..4,7) + \arg TIMER_EVENT_SRC_CH3G: channel 3 capture or compare event generation, TIMERx(x=0..4,7) + \arg TIMER_EVENT_SRC_CMTG: channel commutation event generation, TIMERx(x=0,7) + \arg TIMER_EVENT_SRC_TRGG: trigger event generation, TIMERx(x=0..4,7,8,11) + \arg TIMER_EVENT_SRC_BRKG: break event generation, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_event_software_generate(uint32_t timer_periph, uint16_t event) +{ + TIMER_SWEVG(timer_periph) |= (uint32_t)event; +} + +/*! + \brief initialize TIMER break parameter struct with a default value + \param[in] breakpara: TIMER break parameter struct + \param[out] none + \retval none +*/ +void timer_break_struct_para_init(timer_break_parameter_struct* breakpara) +{ + /* initialize the break parameter struct member with the default value */ + breakpara->runoffstate = TIMER_ROS_STATE_DISABLE; + breakpara->ideloffstate = TIMER_IOS_STATE_DISABLE; + breakpara->deadtime = 0U; + breakpara->breakpolarity = TIMER_BREAK_POLARITY_LOW; + breakpara->outputautostate = TIMER_OUTAUTO_DISABLE; + breakpara->protectmode = TIMER_CCHP_PROT_OFF; + breakpara->breakstate = TIMER_BREAK_DISABLE; +} + +/*! + \brief configure TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] breakpara: TIMER break parameter struct + runoffstate: TIMER_ROS_STATE_ENABLE, TIMER_ROS_STATE_DISABLE + ideloffstate: TIMER_IOS_STATE_ENABLE, TIMER_IOS_STATE_DISABLE + deadtime: 0~255 + breakpolarity: TIMER_BREAK_POLARITY_LOW, TIMER_BREAK_POLARITY_HIGH + outputautostate: TIMER_OUTAUTO_ENABLE, TIMER_OUTAUTO_DISABLE + protectmode: TIMER_CCHP_PROT_OFF, TIMER_CCHP_PROT_0, TIMER_CCHP_PROT_1, TIMER_CCHP_PROT_2 + breakstate: TIMER_BREAK_ENABLE, TIMER_BREAK_DISABLE + \param[out] none + \retval none +*/ +void timer_break_config(uint32_t timer_periph, timer_break_parameter_struct* breakpara) +{ + TIMER_CCHP(timer_periph) = (uint32_t)(((uint32_t)(breakpara->runoffstate)) | + ((uint32_t)(breakpara->ideloffstate))| + ((uint32_t)(breakpara->deadtime)) | + ((uint32_t)(breakpara->breakpolarity)) | + ((uint32_t)(breakpara->outputautostate)) | + ((uint32_t)(breakpara->protectmode)) | + ((uint32_t)(breakpara->breakstate))); +} + +/*! + \brief enable TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_break_enable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_BRKEN; +} + +/*! + \brief disable TIMER break function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_break_disable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) &= ~(uint32_t)TIMER_CCHP_BRKEN; +} + +/*! + \brief enable TIMER output automatic function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_automatic_output_enable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_OAEN; +} + +/*! + \brief disable TIMER output automatic function + \param[in] timer_periph: TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_automatic_output_disable(uint32_t timer_periph) +{ + TIMER_CCHP(timer_periph) &= ~(uint32_t)TIMER_CCHP_OAEN; +} + +/*! + \brief enable or disable TIMER primary output function + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void timer_primary_output_config(uint32_t timer_periph, ControlStatus newvalue) +{ + if(ENABLE == newvalue){ + TIMER_CCHP(timer_periph) |= (uint32_t)TIMER_CCHP_POEN; + }else{ + TIMER_CCHP(timer_periph) &= (~(uint32_t)TIMER_CCHP_POEN); + } +} + +/*! + \brief enable or disable channel capture/compare control shadow register + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] newvalue: ENABLE or DISABLE + \param[out] none + \retval none +*/ +void timer_channel_control_shadow_config(uint32_t timer_periph, ControlStatus newvalue) +{ + if(ENABLE == newvalue){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_CCSE; + }else{ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_CCSE); + } +} + +/*! + \brief configure TIMER channel control shadow register update control + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] ccuctl: channel control shadow register update control + only one parameter can be selected which is shown as below: + \arg TIMER_UPDATECTL_CCU: the shadow registers update by when CMTG bit is set + \arg TIMER_UPDATECTL_CCUTRI: the shadow registers update by when CMTG bit is set or an rising edge of TRGI occurs + \param[out] none + \retval none +*/ +void timer_channel_control_shadow_update_config(uint32_t timer_periph, uint32_t ccuctl) +{ + if(TIMER_UPDATECTL_CCU == ccuctl){ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_CCUC); + }else if(TIMER_UPDATECTL_CCUTRI == ccuctl){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_CCUC; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief initialize TIMER channel output parameter struct with a default value + \param[in] ocpara: TIMER channel n output parameter struct + \param[out] none + \retval none +*/ +void timer_channel_output_struct_para_init(timer_oc_parameter_struct* ocpara) +{ + /* initialize the channel output parameter struct member with the default value */ + ocpara->outputstate = TIMER_CCX_DISABLE; + ocpara->outputnstate = TIMER_CCXN_DISABLE; + ocpara->ocpolarity = TIMER_OC_POLARITY_HIGH; + ocpara->ocnpolarity = TIMER_OCN_POLARITY_HIGH; + ocpara->ocidlestate = TIMER_OC_IDLE_STATE_LOW; + ocpara->ocnidlestate = TIMER_OCN_IDLE_STATE_LOW; +} + +/*! + \brief configure TIMER channel output function + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocpara: TIMER channel output parameter struct + outputstate: TIMER_CCX_ENABLE, TIMER_CCX_DISABLE + outputnstate: TIMER_CCXN_ENABLE, TIMER_CCXN_DISABLE + ocpolarity: TIMER_OC_POLARITY_HIGH, TIMER_OC_POLARITY_LOW + ocnpolarity: TIMER_OCN_POLARITY_HIGH, TIMER_OCN_POLARITY_LOW + ocidlestate: TIMER_OC_IDLE_STATE_LOW, TIMER_OC_IDLE_STATE_HIGH + ocnidlestate: TIMER_OCN_IDLE_STATE_LOW, TIMER_OCN_IDLE_STATE_HIGH + \param[out] none + \retval none +*/ +void timer_channel_output_config(uint32_t timer_periph, uint16_t channel, timer_oc_parameter_struct* ocpara) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->outputstate; + /* reset the CH0P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0P); + /* set the CH0P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->ocpolarity; + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH0NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NEN); + /* set the CH0NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->outputnstate; + /* reset the CH0NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NP); + /* set the CH0NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpara->ocnpolarity; + /* reset the ISO0 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO0); + /* set the ISO0 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)ocpara->ocidlestate; + /* reset the ISO0N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO0N); + /* set the ISO0N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)ocpara->ocnidlestate; + } + TIMER_CHCTL0(timer_periph) &= ~(uint32_t)TIMER_CHCTL0_CH0MS; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 4U); + /* reset the CH1P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1P); + /* set the CH1P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity) << 4U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH1NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NEN); + /* set the CH1NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputnstate) << 4U); + /* reset the CH1NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NP); + /* set the CH1NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnpolarity) << 4U); + /* reset the ISO1 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO1); + /* set the ISO1 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate) << 2U); + /* reset the ISO1N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO1N); + /* set the ISO1N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnidlestate) << 2U); + } + TIMER_CHCTL0(timer_periph) &= ~(uint32_t)TIMER_CHCTL0_CH1MS; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + /* reset the CH2EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + /* set the CH2EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 8U); + /* reset the CH2P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2P); + /* set the CH2P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity) << 8U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the CH2NEN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NEN); + /* set the CH2NEN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputnstate) << 8U); + /* reset the CH2NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NP); + /* set the CH2NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnpolarity) << 8U); + /* reset the ISO2 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO2); + /* set the ISO2 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate) << 4U); + /* reset the ISO2N bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO2N); + /* set the ISO2N bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocnidlestate) << 4U); + } + TIMER_CHCTL1(timer_periph) &= ~(uint32_t)TIMER_CHCTL1_CH2MS; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + /* reset the CH3EN bit */ + TIMER_CHCTL2(timer_periph) &=(~(uint32_t)TIMER_CHCTL2_CH3EN); + /* set the CH3EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->outputstate) << 12U); + /* reset the CH3P bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3P); + /* set the CH3P bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocpolarity) << 12U); + + if((TIMER0 == timer_periph) || (TIMER7 == timer_periph)){ + /* reset the ISO3 bit */ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_ISO3); + /* set the ISO3 bit */ + TIMER_CTL1(timer_periph) |= (uint32_t)((uint32_t)(ocpara->ocidlestate) << 6U); + } + TIMER_CHCTL1(timer_periph) &= ~(uint32_t)TIMER_CHCTL1_CH3MS; + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output compare mode + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocmode: channel output compare mode + only one parameter can be selected which is shown as below: + \arg TIMER_OC_MODE_TIMING: timing mode + \arg TIMER_OC_MODE_ACTIVE: active mode + \arg TIMER_OC_MODE_INACTIVE: inactive mode + \arg TIMER_OC_MODE_TOGGLE: toggle mode + \arg TIMER_OC_MODE_LOW: force low mode + \arg TIMER_OC_MODE_HIGH: force high mode + \arg TIMER_OC_MODE_PWM0: PWM mode 0 + \arg TIMER_OC_MODE_PWM1: PWM mode 1 + \param[out] none + \retval none +*/ +void timer_channel_output_mode_config(uint32_t timer_periph, uint16_t channel, uint16_t ocmode) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMCTL); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocmode; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMCTL); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(ocmode) << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMCTL); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocmode; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMCTL); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(ocmode) << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output pulse value + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] pulse: channel output pulse value + \param[out] none + \retval none +*/ +void timer_channel_output_pulse_value_config(uint32_t timer_periph, uint16_t channel, uint32_t pulse) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CH0CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CH1CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CH2CV(timer_periph) = (uint32_t)pulse; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CH3CV(timer_periph) = (uint32_t)pulse; + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output shadow function + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocshadow: channel output shadow state + only one parameter can be selected which is shown as below: + \arg TIMER_OC_SHADOW_ENABLE: channel output shadow state enable + \arg TIMER_OC_SHADOW_DISABLE: channel output shadow state disable + \param[out] none + \retval none +*/ +void timer_channel_output_shadow_config(uint32_t timer_periph, uint16_t channel, uint16_t ocshadow) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMSEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocshadow; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMSEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(ocshadow) << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMSEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocshadow; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMSEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(ocshadow) << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output fast function + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocfast: channel output fast function + only one parameter can be selected which is shown as below: + \arg TIMER_OC_FAST_ENABLE: channel output fast function enable + \arg TIMER_OC_FAST_DISABLE: channel output fast function disable + \param[out] none + \retval none +*/ +void timer_channel_output_fast_config(uint32_t timer_periph, uint16_t channel, uint16_t ocfast) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMFEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)ocfast; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMFEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)ocfast << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMFEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)ocfast; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMFEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)ocfast << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output clear function + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] occlear: channel output clear function + only one parameter can be selected which is shown as below: + \arg TIMER_OC_CLEAR_ENABLE: channel output clear function enable + \arg TIMER_OC_CLEAR_DISABLE: channel output clear function disable + \param[out] none + \retval none +*/ +void timer_channel_output_clear_config(uint32_t timer_periph, uint16_t channel, uint16_t occlear) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0COMCEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)occlear; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1COMCEN); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)occlear << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2COMCEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)occlear; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3COMCEN); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)occlear << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel output polarity + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] ocpolarity: channel output polarity + only one parameter can be selected which is shown as below: + \arg TIMER_OC_POLARITY_HIGH: channel output polarity is high + \arg TIMER_OC_POLARITY_LOW: channel output polarity is low + \param[out] none + \retval none +*/ +void timer_channel_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocpolarity) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocpolarity; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 8U); + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3P); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocpolarity << 12U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel complementary output polarity + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0,7)) + \param[in] ocnpolarity: channel complementary output polarity + only one parameter can be selected which is shown as below: + \arg TIMER_OCN_POLARITY_HIGH: channel complementary output polarity is high + \arg TIMER_OCN_POLARITY_LOW: channel complementary output polarity is low + \param[out] none + \retval none +*/ +void timer_channel_complementary_output_polarity_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnpolarity) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocnpolarity; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnpolarity << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NP); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnpolarity << 8U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel enable state + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] state: TIMER channel enable state + only one parameter can be selected which is shown as below: + \arg TIMER_CCX_ENABLE: channel enable + \arg TIMER_CCX_DISABLE: channel disable + \param[out] none + \retval none +*/ +void timer_channel_output_state_config(uint32_t timer_periph, uint16_t channel, uint32_t state) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)state; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 8U); + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3EN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)state << 12U); + break; + default: + break; + } +} + +/*! + \brief configure TIMER channel complementary output enable state + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0,7)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0,7)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0,7)) + \param[in] ocnstate: TIMER channel complementary output enable state + only one parameter can be selected which is shown as below: + \arg TIMER_CCXN_ENABLE: channel complementary enable + \arg TIMER_CCXN_DISABLE: channel complementary disable + \param[out] none + \retval none +*/ +void timer_channel_complementary_output_state_config(uint32_t timer_periph, uint16_t channel, uint16_t ocnstate) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)ocnstate; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnstate << 4U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2NEN); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)ocnstate << 8U); + break; + default: + break; + } +} + +/*! + \brief initialize TIMER channel input parameter struct with a default value + \param[in] icpara: TIMER channel input parameter struct + \param[out] none + \retval none +*/ +void timer_channel_input_struct_para_init(timer_ic_parameter_struct* icpara) +{ + /* initialize the channel input parameter struct member with the default value */ + icpara->icpolarity = TIMER_IC_POLARITY_RISING; + icpara->icselection = TIMER_IC_SELECTION_DIRECTTI; + icpara->icprescaler = TIMER_IC_PSC_DIV1; + icpara->icfilter = 0U; +} + +/*! + \brief configure TIMER input capture parameter + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] icpara: TIMER channel input parameter struct + icpolarity: TIMER_IC_POLARITY_RISING, TIMER_IC_POLARITY_FALLING, + TIMER_IC_POLARITY_BOTH_EDGE(only for TIMER8~TIMER13) + icselection: TIMER_IC_SELECTION_DIRECTTI, TIMER_IC_SELECTION_INDIRECTTI, + TIMER_IC_SELECTION_ITS + icprescaler: TIMER_IC_PSC_DIV1, TIMER_IC_PSC_DIV2, TIMER_IC_PSC_DIV4, + TIMER_IC_PSC_DIV8 + icfilter: 0~15 + \param[out] none + \retval none +*/ +void timer_input_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpara) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)(icpara->icpolarity); + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + TIMER_CHCTL0(timer_periph) |= (uint32_t)(icpara->icselection); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 4U); + + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + break; + + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection) << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 12U); + + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + /* reset the CH2EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH2EN); + + /* reset the CH2P and CH2NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH2P | TIMER_CHCTL2_CH2NP)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 8U); + + /* reset the CH2MS bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2MS); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection)); + + /* reset the CH2CAPFLT bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2CAPFLT); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 4U); + + /* set the CH2EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH2EN; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + /* reset the CH3EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH3EN); + + /* reset the CH3P bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH3P)); + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpara->icpolarity) << 12U); + + /* reset the CH3MS bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3MS); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icselection) << 8U); + + /* reset the CH3CAPFLT bit */ + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3CAPFLT); + TIMER_CHCTL1(timer_periph) |= (uint32_t)((uint32_t)(icpara->icfilter) << 12U); + + /* set the CH3EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH3EN; + break; + default: + break; + } + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, channel, (uint16_t)(icpara->icprescaler)); +} + +/*! + \brief configure TIMER channel input capture prescaler value + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[in] prescaler: channel input capture prescaler value + only one parameter can be selected which is shown as below: + \arg TIMER_IC_PSC_DIV1: no prescaler + \arg TIMER_IC_PSC_DIV2: divided by 2 + \arg TIMER_IC_PSC_DIV4: divided by 4 + \arg TIMER_IC_PSC_DIV8: divided by 8 + \param[out] none + \retval none +*/ +void timer_channel_input_capture_prescaler_config(uint32_t timer_periph, uint16_t channel, uint16_t prescaler) +{ + switch(channel){ + /* configure TIMER_CH_0 */ + case TIMER_CH_0: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPPSC); + TIMER_CHCTL0(timer_periph) |= (uint32_t)prescaler; + break; + /* configure TIMER_CH_1 */ + case TIMER_CH_1: + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPPSC); + TIMER_CHCTL0(timer_periph) |= ((uint32_t)prescaler << 8U); + break; + /* configure TIMER_CH_2 */ + case TIMER_CH_2: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH2CAPPSC); + TIMER_CHCTL1(timer_periph) |= (uint32_t)prescaler; + break; + /* configure TIMER_CH_3 */ + case TIMER_CH_3: + TIMER_CHCTL1(timer_periph) &= (~(uint32_t)TIMER_CHCTL1_CH3CAPPSC); + TIMER_CHCTL1(timer_periph) |= ((uint32_t)prescaler << 8U); + break; + default: + break; + } +} + +/*! + \brief read TIMER channel capture compare register value + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0(TIMERx(x=0..4,7..13)) + \arg TIMER_CH_1: TIMER channel 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_CH_2: TIMER channel 2(TIMERx(x=0..4,7)) + \arg TIMER_CH_3: TIMER channel 3(TIMERx(x=0..4,7)) + \param[out] none + \retval channel capture compare register value +*/ +uint32_t timer_channel_capture_value_register_read(uint32_t timer_periph, uint16_t channel) +{ + uint32_t count_value = 0U; + + switch(channel){ + case TIMER_CH_0: + /* read TIMER channel 0 capture compare register value */ + count_value = TIMER_CH0CV(timer_periph); + break; + case TIMER_CH_1: + /* read TIMER channel 1 capture compare register value */ + count_value = TIMER_CH1CV(timer_periph); + break; + case TIMER_CH_2: + /* read TIMER channel 2 capture compare register value */ + count_value = TIMER_CH2CV(timer_periph); + break; + case TIMER_CH_3: + /* read TIMER channel 3 capture compare register value */ + count_value = TIMER_CH3CV(timer_periph); + break; + default: + break; + } + return (count_value); +} + +/*! + \brief configure TIMER input pwm capture function + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] channel: + only one parameter can be selected which is shown as below: + \arg TIMER_CH_0: TIMER channel 0 + \arg TIMER_CH_1: TIMER channel 1 + \param[in] icpwm: TIMER channel input pwm parameter struct + icpolarity: TIMER_IC_POLARITY_RISING, TIMER_IC_POLARITY_FALLING + icselection: TIMER_IC_SELECTION_DIRECTTI, TIMER_IC_SELECTION_INDIRECTTI + icprescaler: TIMER_IC_PSC_DIV1, TIMER_IC_PSC_DIV2, TIMER_IC_PSC_DIV4, + TIMER_IC_PSC_DIV8 + icfilter: 0~15 + \param[out] none + \retval none +*/ +void timer_input_pwm_capture_config(uint32_t timer_periph, uint16_t channel, timer_ic_parameter_struct* icpwm) +{ + uint16_t icpolarity = 0x0U; + uint16_t icselection = 0x0U; + + /* Set channel input polarity */ + if(TIMER_IC_POLARITY_RISING == icpwm->icpolarity){ + icpolarity = TIMER_IC_POLARITY_FALLING; + }else{ + icpolarity = TIMER_IC_POLARITY_RISING; + } + /* Set channel input mode selection */ + if(TIMER_IC_SELECTION_DIRECTTI == icpwm->icselection){ + icselection = TIMER_IC_SELECTION_INDIRECTTI; + }else{ + icselection = TIMER_IC_SELECTION_DIRECTTI; + } + + if(TIMER_CH_0 == channel){ + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)(icpwm->icpolarity); + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(icpwm->icselection); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* set the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= ((uint32_t)(icpwm->icfilter) << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_0, (uint16_t)(icpwm->icprescaler)); + + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + /* set the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)icpolarity<< 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)icselection << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icfilter) << 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_1, (uint16_t)(icpwm->icprescaler)); + }else{ + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + /* set the CH1P and CH1NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icpolarity) << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icselection) << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)(icpwm->icfilter) << 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_1, (uint16_t)(icpwm->icprescaler)); + + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)icpolarity; + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)icselection; + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* set the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= ((uint32_t)(icpwm->icfilter) << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + /* configure TIMER channel input capture prescaler value */ + timer_channel_input_capture_prescaler_config(timer_periph, TIMER_CH_0, (uint16_t)(icpwm->icprescaler)); + } +} + +/*! + \brief configure TIMER hall sensor mode + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] hallmode: + only one parameter can be selected which is shown as below: + \arg TIMER_HALLINTERFACE_ENABLE: TIMER hall sensor mode enable + \arg TIMER_HALLINTERFACE_DISABLE: TIMER hall sensor mode disable + \param[out] none + \retval none +*/ +void timer_hall_mode_config(uint32_t timer_periph, uint32_t hallmode) +{ + if(TIMER_HALLINTERFACE_ENABLE == hallmode){ + TIMER_CTL1(timer_periph) |= (uint32_t)TIMER_CTL1_TI0S; + }else if(TIMER_HALLINTERFACE_DISABLE == hallmode){ + TIMER_CTL1(timer_periph) &= ~(uint32_t)TIMER_CTL1_TI0S; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief select TIMER input trigger source + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] intrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_ITI0: internal trigger 0(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ITI1: internal trigger 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ITI2: internal trigger 2(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ITI3: internal trigger 3(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_CI0F_ED: TI0 edge detector(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_CI0FE0: filtered TIMER input 0(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_CI1FE1: filtered TIMER input 1(TIMERx(x=0..4,7,8,11)) + \arg TIMER_SMCFG_TRGSEL_ETIFP: filtered external trigger input(TIMERx(x=0..4,7)) + \param[out] none + \retval none +*/ +void timer_input_trigger_source_select(uint32_t timer_periph, uint32_t intrigger) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_TRGS); + TIMER_SMCFG(timer_periph) |= (uint32_t)intrigger; +} + +/*! + \brief select TIMER master mode output trigger source + \param[in] timer_periph: TIMERx(x=0..7) + \param[in] outrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_TRI_OUT_SRC_RESET: the UPG bit as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_ENABLE: the counter enable signal TIMER_CTL0_CEN as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_UPDATE: update event as trigger output(TIMERx(x=0..7)) + \arg TIMER_TRI_OUT_SRC_CH0: a capture or a compare match occurred in channel 0 as trigger output TRGO(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O0CPRE: O0CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O1CPRE: O1CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O2CPRE: O2CPRE as trigger output(TIMERx(x=0..4,7)) + \arg TIMER_TRI_OUT_SRC_O3CPRE: O3CPRE as trigger output(TIMERx(x=0..4,7)) + \param[out] none + \retval none +*/ +void timer_master_output_trigger_source_select(uint32_t timer_periph, uint32_t outrigger) +{ + TIMER_CTL1(timer_periph) &= (~(uint32_t)TIMER_CTL1_MMC); + TIMER_CTL1(timer_periph) |= (uint32_t)outrigger; +} + +/*! + \brief select TIMER slave mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] slavemode: + only one parameter can be selected which is shown as below: + \arg TIMER_SLAVE_MODE_DISABLE: slave mode disable + \arg TIMER_QUAD_DECODER_MODE0: quadrature decoder mode 0 + \arg TIMER_QUAD_DECODER_MODE1: quadrature decoder mode 1 + \arg TIMER_QUAD_DECODER_MODE2: quadrature decoder mode 2 + \arg TIMER_SLAVE_MODE_RESTART: restart mode + \arg TIMER_SLAVE_MODE_PAUSE: pause mode + \arg TIMER_SLAVE_MODE_EVENT: event mode + \arg TIMER_SLAVE_MODE_EXTERNAL0: external clock mode 0 + \param[out] none + \retval none +*/ + +void timer_slave_mode_select(uint32_t timer_periph, uint32_t slavemode) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + TIMER_SMCFG(timer_periph) |= (uint32_t)slavemode; +} + +/*! + \brief configure TIMER master slave mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] masterslave: + only one parameter can be selected which is shown as below: + \arg TIMER_MASTER_SLAVE_MODE_ENABLE: master slave mode enable + \arg TIMER_MASTER_SLAVE_MODE_DISABLE: master slave mode disable + \param[out] none + \retval none +*/ +void timer_master_slave_mode_config(uint32_t timer_periph, uint32_t masterslave) +{ + if(TIMER_MASTER_SLAVE_MODE_ENABLE == masterslave){ + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SMCFG_MSM; + }else if(TIMER_MASTER_SLAVE_MODE_DISABLE == masterslave){ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_MSM; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER external trigger input + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_trigger_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint32_t extfilter) +{ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)(TIMER_SMCFG_ETP | TIMER_SMCFG_ETPSC | TIMER_SMCFG_ETFC)); + TIMER_SMCFG(timer_periph) |= (uint32_t)(extprescaler | extpolarity); + TIMER_SMCFG(timer_periph) |= (uint32_t)(extfilter << 8U); +} + +/*! + \brief configure TIMER quadrature decoder mode + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] decomode: + only one parameter can be selected which is shown as below: + \arg TIMER_QUAD_DECODER_MODE0: counter counts on CI0FE0 edge depending on CI1FE1 level + \arg TIMER_QUAD_DECODER_MODE1: counter counts on CI1FE1 edge depending on CI0FE0 level + \arg TIMER_QUAD_DECODER_MODE2: counter counts on both CI0FE0 and CI1FE1 edges depending on the level of the other input + \param[in] ic0polarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: capture rising edge + \arg TIMER_IC_POLARITY_FALLING: capture falling edge + \param[in] ic1polarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: capture rising edge + \arg TIMER_IC_POLARITY_FALLING: capture falling edge + \param[out] none + \retval none +*/ +void timer_quadrature_decoder_mode_config(uint32_t timer_periph, uint32_t decomode, uint16_t ic0polarity, uint16_t ic1polarity) +{ + /* configure the quadrature decoder mode */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + TIMER_SMCFG(timer_periph) |= (uint32_t)decomode; + /* configure input capture selection */ + TIMER_CHCTL0(timer_periph) &= (uint32_t)(((~(uint32_t)TIMER_CHCTL0_CH0MS)) & ((~(uint32_t)TIMER_CHCTL0_CH1MS))); + TIMER_CHCTL0(timer_periph) |= (uint32_t)(TIMER_IC_SELECTION_DIRECTTI | ((uint32_t)TIMER_IC_SELECTION_DIRECTTI << 8U)); + /* configure channel input capture polarity */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + TIMER_CHCTL2(timer_periph) |= ((uint32_t)ic0polarity | ((uint32_t)ic1polarity << 4U)); +} + +/*! + \brief configure TIMER internal clock mode + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[out] none + \retval none +*/ +void timer_internal_clock_config(uint32_t timer_periph) +{ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC; +} + +/*! + \brief configure TIMER the internal trigger as external clock input + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] intrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_ITI0: internal trigger 0 + \arg TIMER_SMCFG_TRGSEL_ITI1: internal trigger 1 + \arg TIMER_SMCFG_TRGSEL_ITI2: internal trigger 2 + \arg TIMER_SMCFG_TRGSEL_ITI3: internal trigger 3 + \param[out] none + \retval none +*/ +void timer_internal_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t intrigger) +{ + timer_input_trigger_source_select(timer_periph, intrigger); + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC; + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SLAVE_MODE_EXTERNAL0; +} + +/*! + \brief configure TIMER the external trigger as external clock input + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] extrigger: + only one parameter can be selected which is shown as below: + \arg TIMER_SMCFG_TRGSEL_CI0F_ED: TI0 edge detector + \arg TIMER_SMCFG_TRGSEL_CI0FE0: filtered TIMER input 0 + \arg TIMER_SMCFG_TRGSEL_CI1FE1: filtered TIMER input 1 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_IC_POLARITY_RISING: active low or falling edge active + \arg TIMER_IC_POLARITY_FALLING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_trigger_as_external_clock_config(uint32_t timer_periph, uint32_t extrigger, uint16_t extpolarity, uint32_t extfilter) +{ + if(TIMER_SMCFG_TRGSEL_CI1FE1 == extrigger){ + /* reset the CH1EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH1EN); + /* reset the CH1NP bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH1P | TIMER_CHCTL2_CH1NP)); + /* set the CH1NP bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)((uint32_t)extpolarity << 4U); + /* reset the CH1MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1MS); + /* set the CH1MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)((uint32_t)TIMER_IC_SELECTION_DIRECTTI << 8U); + /* reset the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH1CAPFLT); + /* set the CH1CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(extfilter << 12U); + /* set the CH1EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH1EN; + }else{ + /* reset the CH0EN bit */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)TIMER_CHCTL2_CH0EN); + /* reset the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) &= (~(uint32_t)(TIMER_CHCTL2_CH0P | TIMER_CHCTL2_CH0NP)); + /* set the CH0P and CH0NP bits */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)extpolarity; + /* reset the CH0MS bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0MS); + /* set the CH0MS bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)TIMER_IC_SELECTION_DIRECTTI; + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) &= (~(uint32_t)TIMER_CHCTL0_CH0CAPFLT); + /* reset the CH0CAPFLT bit */ + TIMER_CHCTL0(timer_periph) |= (uint32_t)(extfilter << 4U); + /* set the CH0EN bit */ + TIMER_CHCTL2(timer_periph) |= (uint32_t)TIMER_CHCTL2_CH0EN; + } + /* select TIMER input trigger source */ + timer_input_trigger_source_select(timer_periph, extrigger); + /* reset the SMC bit */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)TIMER_SMCFG_SMC); + /* set the SMC bit */ + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SLAVE_MODE_EXTERNAL0; +} + +/*! + \brief configure TIMER the external clock mode0 + \param[in] timer_periph: TIMERx(x=0..4,7,8,11) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_clock_mode0_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint32_t extfilter) +{ + /* configure TIMER external trigger input */ + timer_external_trigger_config(timer_periph, extprescaler, extpolarity, extfilter); + /* reset the SMC bit,TRGS bit */ + TIMER_SMCFG(timer_periph) &= (~(uint32_t)(TIMER_SMCFG_SMC | TIMER_SMCFG_TRGS)); + /* set the SMC bit,TRGS bit */ + TIMER_SMCFG(timer_periph) |= (uint32_t)(TIMER_SLAVE_MODE_EXTERNAL0 | TIMER_SMCFG_TRGSEL_ETIFP); +} + +/*! + \brief configure TIMER the external clock mode1 + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[in] extprescaler: + only one parameter can be selected which is shown as below: + \arg TIMER_EXT_TRI_PSC_OFF: no divided + \arg TIMER_EXT_TRI_PSC_DIV2: divided by 2 + \arg TIMER_EXT_TRI_PSC_DIV4: divided by 4 + \arg TIMER_EXT_TRI_PSC_DIV8: divided by 8 + \param[in] extpolarity: + only one parameter can be selected which is shown as below: + \arg TIMER_ETP_FALLING: active low or falling edge active + \arg TIMER_ETP_RISING: active high or rising edge active + \param[in] extfilter: a value between 0 and 15 + \param[out] none + \retval none +*/ +void timer_external_clock_mode1_config(uint32_t timer_periph, uint32_t extprescaler, uint32_t extpolarity, uint32_t extfilter) +{ + /* configure TIMER external trigger input */ + timer_external_trigger_config(timer_periph, extprescaler, extpolarity, extfilter); + TIMER_SMCFG(timer_periph) |= (uint32_t)TIMER_SMCFG_SMC1; +} + +/*! + \brief disable TIMER the external clock mode1 + \param[in] timer_periph: TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_external_clock_mode1_disable(uint32_t timer_periph) +{ + TIMER_SMCFG(timer_periph) &= ~(uint32_t)TIMER_SMCFG_SMC1; +} + +/*! + \brief configure TIMER write CHxVAL register selection + \param[in] timer_periph: TIMERx(x=0..4,7..13) + \param[in] ccsel: + only one parameter can be selected which is shown as below: + \arg TIMER_CHVSEL_DISABLE: no effect + \arg TIMER_CHVSEL_ENABLE: when write the CHxVAL register, if the write value is same as the CHxVAL value, the write access is ignored + \param[out] none + \retval none +*/ +void timer_write_chxval_register_config(uint32_t timer_periph, uint16_t ccsel) +{ + if(TIMER_CHVSEL_ENABLE == ccsel){ + TIMER_CFG(timer_periph) |= (uint32_t)TIMER_CFG_CHVSEL; + }else if(TIMER_CHVSEL_DISABLE == ccsel){ + TIMER_CFG(timer_periph) &= ~(uint32_t)TIMER_CFG_CHVSEL; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief configure TIMER output value selection + \param[in] timer_periph: TIMERx(x=0,7) + \param[in] outsel: + only one parameter can be selected which is shown as below: + \arg TIMER_OUTSEL_DISABLE: no effect + \arg TIMER_OUTSEL_ENABLE: if POEN and IOS is 0, the output disabled + \param[out] none + \retval none +*/ +void timer_output_value_selection_config(uint32_t timer_periph, uint16_t outsel) +{ + if(TIMER_OUTSEL_ENABLE == outsel){ + TIMER_CFG(timer_periph) |= (uint32_t)TIMER_CFG_OUTSEL; + }else if(TIMER_OUTSEL_DISABLE == outsel){ + TIMER_CFG(timer_periph) &= ~(uint32_t)TIMER_CFG_OUTSEL; + }else{ + /* illegal parameters */ + } +} + +/*! + \brief enable the TIMER interrupt + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: specify which interrupt to enable + one or more parameters can be selected which are shown as below: + \arg TIMER_INT_UP: update interrupt enable, TIMERx(x=0..13) + \arg TIMER_INT_CH0: channel 0 interrupt enable, TIMERx(x=0..4,7..13) + \arg TIMER_INT_CH1: channel 1 interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_CH2: channel 2 interrupt enable, TIMERx(x=0..4,7) + \arg TIMER_INT_CH3: channel 3 interrupt enable, TIMERx(x=0..4,7) + \arg TIMER_INT_CMT: commutation interrupt enable, TIMERx(x=0,7) + \arg TIMER_INT_TRG: trigger interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_BRK: break interrupt enable, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_enable(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_DMAINTEN(timer_periph) |= (uint32_t) interrupt; +} + +/*! + \brief disable the TIMER interrupt + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: specify which interrupt to disable + one or more parameters can be selected which are shown as below: + \arg TIMER_INT_UP: update interrupt enable, TIMERx(x=0..13) + \arg TIMER_INT_CH0: channel 0 interrupt enable, TIMERx(x=0..4,7..13) + \arg TIMER_INT_CH1: channel 1 interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_CH2: channel 2 interrupt enable, TIMERx(x=0..4,7) + \arg TIMER_INT_CH3: channel 3 interrupt enable , TIMERx(x=0..4,7) + \arg TIMER_INT_CMT: commutation interrupt enable, TIMERx(x=0,7) + \arg TIMER_INT_TRG: trigger interrupt enable, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_BRK: break interrupt enable, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_disable(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_DMAINTEN(timer_periph) &= (~(uint32_t)interrupt); +} + +/*! + \brief get timer interrupt flag + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: the timer interrupt bits + only one parameter can be selected which is shown as below: + \arg TIMER_INT_FLAG_UP: update interrupt flag, TIMERx(x=0..13) + \arg TIMER_INT_FLAG_CH0: channel 0 interrupt flag, TIMERx(x=0..4,7..13) + \arg TIMER_INT_FLAG_CH1: channel 1 interrupt flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_FLAG_CH2: channel 2 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CH3: channel 3 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CMT: channel commutation interrupt flag, TIMERx(x=0,7) + \arg TIMER_INT_FLAG_TRG: trigger interrupt flag, TIMERx(x=0,7,8,11) + \arg TIMER_INT_FLAG_BRK: break interrupt flag, TIMERx(x=0,7) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus timer_interrupt_flag_get(uint32_t timer_periph, uint32_t interrupt) +{ + uint32_t val; + val = (TIMER_DMAINTEN(timer_periph) & interrupt); + if((RESET != (TIMER_INTF(timer_periph) & interrupt)) && (RESET != val)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear TIMER interrupt flag + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] interrupt: the timer interrupt bits + one or more parameters can be selected which are shown as below: + \arg TIMER_INT_FLAG_UP: update interrupt flag, TIMERx(x=0..13) + \arg TIMER_INT_FLAG_CH0: channel 0 interrupt flag, TIMERx(x=0..4,7..13) + \arg TIMER_INT_FLAG_CH1: channel 1 interrupt flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_INT_FLAG_CH2: channel 2 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CH3: channel 3 interrupt flag, TIMERx(x=0..4,7) + \arg TIMER_INT_FLAG_CMT: channel commutation interrupt flag, TIMERx(x=0,7) + \arg TIMER_INT_FLAG_TRG: trigger interrupt flag, TIMERx(x=0,7,8,11) + \arg TIMER_INT_FLAG_BRK: break interrupt flag, TIMERx(x=0,7) + \param[out] none + \retval none +*/ +void timer_interrupt_flag_clear(uint32_t timer_periph, uint32_t interrupt) +{ + TIMER_INTF(timer_periph) = (~(uint32_t)interrupt); +} + +/*! + \brief get TIMER flags + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] flag: the timer interrupt flags + only one parameter can be selected which is shown as below: + \arg TIMER_FLAG_UP: update flag, TIMERx(x=0..13) + \arg TIMER_FLAG_CH0: channel 0 flag, TIMERx(x=0..4,7..13) + \arg TIMER_FLAG_CH1: channel 1 flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2: channel 2 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3: channel 3 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CMT: channel commutation flag, TIMERx(x=0,7) + \arg TIMER_FLAG_TRG: trigger flag, TIMERx(x=0,7,8,11) + \arg TIMER_FLAG_BRK: break flag, TIMERx(x=0,7) + \arg TIMER_FLAG_CH0O: channel 0 overcapture flag, TIMERx(x=0..4,7..11) + \arg TIMER_FLAG_CH1O: channel 1 overcapture flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2O: channel 2 overcapture flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3O: channel 3 overcapture flag, TIMERx(x=0..4,7) + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus timer_flag_get(uint32_t timer_periph, uint32_t flag) +{ + if(RESET != (TIMER_INTF(timer_periph) & flag)){ + return SET; + }else{ + return RESET; + } +} + +/*! + \brief clear TIMER flags + \param[in] timer_periph: TIMERx(x=0..13) + \param[in] flag: the timer interrupt flags + one or more parameters can be selected which are shown as below: + \arg TIMER_FLAG_UP: update flag, TIMERx(x=0..13) + \arg TIMER_FLAG_CH0: channel 0 flag, TIMERx(x=0..4,7..13) + \arg TIMER_FLAG_CH1: channel 1 flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2: channel 2 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3: channel 3 flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CMT: channel commutation flag, TIMERx(x=0,7) + \arg TIMER_FLAG_TRG: trigger flag, TIMERx(x=0,7,8,11) + \arg TIMER_FLAG_BRK: break flag, TIMERx(x=0,7) + \arg TIMER_FLAG_CH0O: channel 0 overcapture flag, TIMERx(x=0..4,7..11) + \arg TIMER_FLAG_CH1O: channel 1 overcapture flag, TIMERx(x=0..4,7,8,11) + \arg TIMER_FLAG_CH2O: channel 2 overcapture flag, TIMERx(x=0..4,7) + \arg TIMER_FLAG_CH3O: channel 3 overcapture flag, TIMERx(x=0..4,7) + \param[out] none + \retval none +*/ +void timer_flag_clear(uint32_t timer_periph, uint32_t flag) +{ + TIMER_INTF(timer_periph) = (~(uint32_t)flag); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c new file mode 100644 index 0000000..1abf091 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c @@ -0,0 +1,890 @@ +/*! + \file gd32c10x_usart.c + \brief USART driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_usart.h" + +/* USART register bit offset */ +#define GP_GUAT_OFFSET ((uint32_t)8U) /* bit offset of GUAT in USART_GP */ +#define CTL3_SCRTNUM_OFFSET ((uint32_t)1U) /* bit offset of SCRTNUM in USART_CTL3 */ +#define RT_BL_OFFSET ((uint32_t)24U) /* bit offset of BL in USART_RT */ + +/*! + \brief reset USART/UART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_deinit(uint32_t usart_periph) +{ + switch(usart_periph) { + case USART0: + /* reset USART0 */ + rcu_periph_reset_enable(RCU_USART0RST); + rcu_periph_reset_disable(RCU_USART0RST); + break; + case USART1: + /* reset USART1 */ + rcu_periph_reset_enable(RCU_USART1RST); + rcu_periph_reset_disable(RCU_USART1RST); + break; + case USART2: + /* reset USART2 */ + rcu_periph_reset_enable(RCU_USART2RST); + rcu_periph_reset_disable(RCU_USART2RST); + break; + case UART3: + /* reset UART3 */ + rcu_periph_reset_enable(RCU_UART3RST); + rcu_periph_reset_disable(RCU_UART3RST); + break; + case UART4: + /* reset UART4 */ + rcu_periph_reset_enable(RCU_UART4RST); + rcu_periph_reset_disable(RCU_UART4RST); + break; + default: + break; + } +} + +/*! + \brief configure USART baud rate value + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] baudval: baud rate value + \param[out] none + \retval none +*/ +void usart_baudrate_set(uint32_t usart_periph, uint32_t baudval) +{ + uint32_t uclk = 0U, intdiv = 0U, fradiv = 0U, udiv = 0U; + switch(usart_periph) { + /* get clock frequency */ + case USART0: + /* get USART0 clock */ + uclk = rcu_clock_freq_get(CK_APB2); + break; + case USART1: + /* get USART1 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + case USART2: + /* get USART2 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + case UART3: + /* get UART3 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + case UART4: + /* get UART4 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + default: + break; + } + /* oversampling by 16, configure the value of USART_BAUD */ + udiv = (uclk + baudval / 2U) / baudval; + intdiv = udiv & 0xfff0U; + fradiv = udiv & 0xfU; + USART_BAUD(usart_periph) = ((USART_BAUD_FRADIV | USART_BAUD_INTDIV) & (intdiv | fradiv)); +} + +/*! + \brief configure USART parity + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] paritycfg: configure USART parity + only one parameter can be selected which is shown as below: + \arg USART_PM_NONE: no parity + \arg USART_PM_ODD: odd parity + \arg USART_PM_EVEN: even parity + \param[out] none + \retval none +*/ +void usart_parity_config(uint32_t usart_periph, uint32_t paritycfg) +{ + /* clear USART_CTL0 PM,PCEN bits */ + USART_CTL0(usart_periph) &= ~(USART_CTL0_PM | USART_CTL0_PCEN); + /* configure USART parity mode */ + USART_CTL0(usart_periph) |= paritycfg; +} + +/*! + \brief configure USART word length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] wlen: USART word length configure + only one parameter can be selected which is shown as below: + \arg USART_WL_8BIT: 8 bits + \arg USART_WL_9BIT: 9 bits + \param[out] none + \retval none +*/ +void usart_word_length_set(uint32_t usart_periph, uint32_t wlen) +{ + /* clear USART_CTL0 WL bit */ + USART_CTL0(usart_periph) &= ~USART_CTL0_WL; + /* configure USART word length */ + USART_CTL0(usart_periph) |= wlen; +} + +/*! + \brief configure USART stop bit length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] stblen: USART stop bit configure + only one parameter can be selected which is shown as below: + \arg USART_STB_1BIT: 1 bit + \arg USART_STB_0_5BIT: 0.5 bit, not available for UARTx(x=3,4) + \arg USART_STB_2BIT: 2 bits + \arg USART_STB_1_5BIT: 1.5 bits, not available for UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_stop_bit_set(uint32_t usart_periph, uint32_t stblen) +{ + /* clear USART_CTL1 STB bits */ + USART_CTL1(usart_periph) &= ~USART_CTL1_STB; + /* configure USART stop bits */ + USART_CTL1(usart_periph) |= stblen; +} + +/*! + \brief enable USART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_enable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_UEN; +} + +/*! + \brief disable USART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_disable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_UEN); +} + +/*! + \brief configure USART transmitter + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] txconfig: enable or disable USART transmitter + only one parameter can be selected which is shown as below: + \arg USART_TRANSMIT_ENABLE: enable USART transmission + \arg USART_TRANSMIT_DISABLE: disable USART transmission + \param[out] none + \retval none +*/ +void usart_transmit_config(uint32_t usart_periph, uint32_t txconfig) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_TEN); + USART_CTL0(usart_periph) |= (USART_CTL0_TEN & txconfig); +} + +/*! + \brief configure USART receiver + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] rxconfig: enable or disable USART receiver + only one parameter can be selected which is shown as below: + \arg USART_RECEIVE_ENABLE: enable USART reception + \arg USART_RECEIVE_DISABLE: disable USART reception + \param[out] none + \retval none +*/ +void usart_receive_config(uint32_t usart_periph, uint32_t rxconfig) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_REN); + USART_CTL0(usart_periph) |= (USART_CTL0_REN & rxconfig); +} + +/*! + \brief data is transmitted/received with the LSB/MSB first + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] msbf: LSB/MSB + only one parameter can be selected which is shown as below: + \arg USART_MSBF_LSB: LSB first + \arg USART_MSBF_MSB: MSB first + \param[out] none + \retval none +*/ +void usart_data_first_config(uint32_t usart_periph, uint32_t msbf) +{ + USART_CTL3(usart_periph) &= ~(USART_CTL3_MSBF); + USART_CTL3(usart_periph) |= msbf; +} + +/*! + \brief configure USART inversion + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] invertpara: refer to enum usart_invert_enum + only one parameter can be selected which is shown as below: + \arg USART_DINV_ENABLE: data bit level inversion + \arg USART_DINV_DISABLE: data bit level not inversion + \arg USART_TXPIN_ENABLE: TX pin level inversion + \arg USART_TXPIN_DISABLE: TX pin level not inversion + \arg USART_RXPIN_ENABLE: RX pin level inversion + \arg USART_RXPIN_DISABLE: RX pin level not inversion + \param[out] none + \retval none +*/ +void usart_invert_config(uint32_t usart_periph, usart_invert_enum invertpara) +{ + /* inverted or not the specified signal */ + switch(invertpara) { + case USART_DINV_ENABLE: + /* data bit level inversion */ + USART_CTL3(usart_periph) |= USART_CTL3_DINV; + break; + case USART_TXPIN_ENABLE: + /* TX pin level inversion */ + USART_CTL3(usart_periph) |= USART_CTL3_TINV; + break; + case USART_RXPIN_ENABLE: + /* RX pin level inversion */ + USART_CTL3(usart_periph) |= USART_CTL3_RINV; + break; + case USART_DINV_DISABLE: + /* data bit level not inversion */ + USART_CTL3(usart_periph) &= ~(USART_CTL3_DINV); + break; + case USART_TXPIN_DISABLE: + /* TX pin level not inversion */ + USART_CTL3(usart_periph) &= ~(USART_CTL3_TINV); + break; + case USART_RXPIN_DISABLE: + /* RX pin level not inversion */ + USART_CTL3(usart_periph) &= ~(USART_CTL3_RINV); + break; + default: + break; + } +} + +/*! + \brief enable receiver timeout + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_receiver_timeout_enable(uint32_t usart_periph) +{ + USART_CTL3(usart_periph) |= USART_CTL3_RTEN; +} + +/*! + \brief disable receiver timeout + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_receiver_timeout_disable(uint32_t usart_periph) +{ + USART_CTL3(usart_periph) &= ~(USART_CTL3_RTEN); +} + +/*! + \brief configure receiver timeout threshold + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] rtimeout: 0-0xFFFFFF + \param[out] none + \retval none +*/ +void usart_receiver_timeout_threshold_config(uint32_t usart_periph, uint32_t rtimeout) +{ + USART_RT(usart_periph) &= ~(USART_RT_RT); + USART_RT(usart_periph) |= rtimeout; +} + +/*! + \brief USART transmit data function + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] data: data to be transmitted + \param[out] none + \retval none +*/ +void usart_data_transmit(uint32_t usart_periph, uint16_t data) +{ + USART_DATA(usart_periph) = USART_DATA_DATA & (uint32_t)data; +} + +/*! + \brief USART receive data function + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval data of received +*/ +uint16_t usart_data_receive(uint32_t usart_periph) +{ + return (uint16_t)(GET_BITS(USART_DATA(usart_periph), 0U, 8U)); +} + +/*! + \brief configure the address of the USART in wake up by address match mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] addr: address of USART/UART + \param[out] none + \retval none +*/ +void usart_address_config(uint32_t usart_periph, uint8_t addr) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_ADDR); + USART_CTL1(usart_periph) |= (USART_CTL1_ADDR & (uint32_t)addr); +} + +/*! + \brief enable mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_mute_mode_enable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_RWU; +} + +/*! + \brief disable mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_mute_mode_disable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_RWU); +} + +/*! + \brief configure wakeup method in mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] wmethod: two methods be used to enter or exit the mute mode + only one parameter can be selected which is shown as below: + \arg USART_WM_IDLE: idle line + \arg USART_WM_ADDR: address mask + \param[out] none + \retval none +*/ +void usart_mute_mode_wakeup_config(uint32_t usart_periph, uint32_t wmethod) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_WM); + USART_CTL0(usart_periph) |= wmethod; +} + +/*! + \brief enable LIN mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_lin_mode_enable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) |= USART_CTL1_LMEN; +} + +/*! + \brief disable LIN mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_lin_mode_disable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_LMEN); +} + +/*! + \brief configure lin break frame length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] lblen: lin break frame length + only one parameter can be selected which is shown as below: + \arg USART_LBLEN_10B: 10 bits + \arg USART_LBLEN_11B: 11 bits + \param[out] none + \retval none +*/ +void usart_lin_break_detection_length_config(uint32_t usart_periph, uint32_t lblen) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_LBLEN); + USART_CTL1(usart_periph) |= (USART_CTL1_LBLEN & lblen); +} + +/*! + \brief send break frame + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_send_break(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_SBKCMD; +} + +/*! + \brief enable half duplex mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_halfduplex_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_HDEN; +} + +/*! + \brief disable half duplex mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_halfduplex_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_HDEN); +} + +/*! + \brief enable CK pin in synchronous mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_synchronous_clock_enable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) |= USART_CTL1_CKEN; +} + +/*! + \brief disable CK pin in synchronous mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_synchronous_clock_disable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_CKEN); +} + +/*! + \brief configure USART synchronous mode parameters + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] clen: CK length + only one parameter can be selected which is shown as below: + \arg USART_CLEN_NONE: there are 7 CK pulses for an 8 bit frame and 8 CK pulses for a 9 bit frame + \arg USART_CLEN_EN: there are 8 CK pulses for an 8 bit frame and 9 CK pulses for a 9 bit frame + \param[in] cph: clock phase + only one parameter can be selected which is shown as below: + \arg USART_CPH_1CK: first clock transition is the first data capture edge + \arg USART_CPH_2CK: second clock transition is the first data capture edge + \param[in] cpl: clock polarity + only one parameter can be selected which is shown as below: + \arg USART_CPL_LOW: steady low value on CK pin + \arg USART_CPL_HIGH: steady high value on CK pin + \param[out] none + \retval none +*/ +void usart_synchronous_clock_config(uint32_t usart_periph, uint32_t clen, uint32_t cph, uint32_t cpl) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_CLEN | USART_CTL1_CPH | USART_CTL1_CPL); + USART_CTL1(usart_periph) |= (USART_CTL1_CLEN & clen) | (USART_CTL1_CPH & cph) | (USART_CTL1_CPL & cpl); +} + +/*! + \brief configure guard time value in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] guat: guard time value, 0-0xFF + \param[out] none + \retval none +*/ +void usart_guard_time_config(uint32_t usart_periph, uint8_t guat) +{ + USART_GP(usart_periph) &= ~(USART_GP_GUAT); + USART_GP(usart_periph) |= (USART_GP_GUAT & ((uint32_t)guat << GP_GUAT_OFFSET)); +} + +/*! + \brief enable smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_SCEN; +} + +/*! + \brief disable smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_SCEN); +} + +/*! + \brief enable NACK in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_nack_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_NKEN; +} + +/*! + \brief disable NACK in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_nack_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_NKEN); +} + +/*! + \brief configure smartcard auto-retry number + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] scrtnum: smartcard auto-retry number + \param[out] none + \retval none +*/ +void usart_smartcard_autoretry_config(uint32_t usart_periph, uint8_t scrtnum) +{ + USART_CTL3(usart_periph) &= ~(USART_CTL3_SCRTNUM); + USART_CTL3(usart_periph) |= (USART_CTL3_SCRTNUM & ((uint32_t)scrtnum << CTL3_SCRTNUM_OFFSET)); +} + +/*! + \brief configure block length + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] bl: block length + \param[out] none + \retval none +*/ +void usart_block_length_config(uint32_t usart_periph, uint8_t bl) +{ + USART_RT(usart_periph) &= ~(USART_RT_BL); + USART_RT(usart_periph) |= (USART_RT_BL & ((uint32_t)bl << RT_BL_OFFSET)); +} + +/*! + \brief enable IrDA mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_irda_mode_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_IREN; +} + +/*! + \brief disable IrDA mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_irda_mode_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_IREN); +} + +/*! + \brief configure the peripheral clock prescaler + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] psc: 0x00-0xFF + \param[out] none + \retval none +*/ +void usart_prescaler_config(uint32_t usart_periph, uint8_t psc) +{ + USART_GP(usart_periph) &= ~(USART_GP_PSC); + USART_GP(usart_periph) |= (uint32_t)psc; +} + +/*! + \brief configure IrDA low-power + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] irlp: IrDA low-power or normal + only one parameter can be selected which is shown as below: + \arg USART_IRLP_LOW: low-power + \arg USART_IRLP_NORMAL: normal + \param[out] none + \retval none +*/ +void usart_irda_lowpower_config(uint32_t usart_periph, uint32_t irlp) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_IRLP); + USART_CTL2(usart_periph) |= (USART_CTL2_IRLP & irlp); +} + +/*! + \brief configure hardware flow control RTS + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] rtsconfig: enable or disable RTS + only one parameter can be selected which is shown as below: + \arg USART_RTS_ENABLE: enable RTS + \arg USART_RTS_DISABLE: disable RTS + \param[out] none + \retval none +*/ +void usart_hardware_flow_rts_config(uint32_t usart_periph, uint32_t rtsconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_RTSEN); + USART_CTL2(usart_periph) |= (USART_CTL2_RTSEN & rtsconfig); +} + +/*! + \brief configure hardware flow control CTS + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] ctsconfig: enable or disable CTS + only one parameter can be selected which is shown as below: + \arg USART_CTS_ENABLE: enable CTS + \arg USART_CTS_DISABLE: disable CTS + \param[out] none + \retval none +*/ +void usart_hardware_flow_cts_config(uint32_t usart_periph, uint32_t ctsconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_CTSEN); + USART_CTL2(usart_periph) |= (USART_CTL2_CTSEN & ctsconfig); +} + +/*! + \brief configure USART DMA reception + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] dmaconfig: USART DMA mode + only one parameter can be selected which is shown as below: + \arg USART_RECEIVE_DMA_ENABLE: enable USART DMA for reception + \arg USART_RECEIVE_DMA_DISABLE: disable USART DMA for reception + \param[out] none + \retval none +*/ +void usart_dma_receive_config(uint32_t usart_periph, uint8_t dmaconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_DENR); + USART_CTL2(usart_periph) |= (USART_CTL2_DENR & dmaconfig); +} + +/*! + \brief configure USART DMA transmission + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] dmaconfig: USART DMA mode + only one parameter can be selected which is shown as below: + \arg USART_TRANSMIT_DMA_ENABLE: enable USART DMA for transmission + \arg USART_TRANSMIT_DMA_DISABLE: disable USART DMA for transmission + \param[out] none + \retval none +*/ +void usart_dma_transmit_config(uint32_t usart_periph, uint8_t dmaconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_DENT); + USART_CTL2(usart_periph) |= (USART_CTL2_DENT & dmaconfig); +} + +/*! + \brief configure hardware flow control coherence mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] hcm: + \arg USART_RTS_NONE_COHERENCE: nRTS signal equals to the rxne status register + \arg USART_RTS_COHERENCE: nRTS signal is set when the last data bit has been sampled + \param[out] none + \retval none +*/ +void usart_hardware_flow_coherence_config(uint32_t usart_periph, uint32_t hcm) +{ + USART_CHC(usart_periph) &= ~(USART_CHC_HCM); + USART_CHC(usart_periph) |= (USART_CHC_HCM & hcm); +} + +/*! + \brief get flag in STAT0/STAT1 register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] flag: USART flags, refer to usart_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_FLAG_CTS: CTS change flag + \arg USART_FLAG_LBD: LIN break detected flag + \arg USART_FLAG_TBE: transmit data buffer empty + \arg USART_FLAG_TC: transmission complete + \arg USART_FLAG_RBNE: read data buffer not empty + \arg USART_FLAG_IDLE: IDLE frame detected flag + \arg USART_FLAG_ORERR: overrun error + \arg USART_FLAG_NERR: noise error flag + \arg USART_FLAG_FERR: frame error flag + \arg USART_FLAG_PERR: parity error flag + \arg USART_FLAG_BSY: busy flag + \arg USART_FLAG_EB: end of block flag + \arg USART_FLAG_RT: receiver timeout flag + \arg USART_FLAG_EPERR: early parity error flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus usart_flag_get(uint32_t usart_periph, usart_flag_enum flag) +{ + if(RESET != (USART_REG_VAL(usart_periph, flag) & BIT(USART_BIT_POS(flag)))) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear flag in STAT0/STAT1 register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] flag: USART flags, refer to usart_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_FLAG_CTS: CTS change flag + \arg USART_FLAG_LBD: LIN break detected flag + \arg USART_FLAG_TC: transmission complete + \arg USART_FLAG_RBNE: read data buffer not empty + \arg USART_FLAG_EB: end of block flag + \arg USART_FLAG_RT: receiver timeout flag + \arg USART_FLAG_EPERR: early parity error flag + \param[out] none + \retval none +*/ +void usart_flag_clear(uint32_t usart_periph, usart_flag_enum flag) +{ + if(USART_FLAG_EPERR == flag) { + USART_REG_VAL(usart_periph, flag) &= ~BIT(USART_BIT_POS(flag)); + } else { + USART_REG_VAL(usart_periph, flag) = ~BIT(USART_BIT_POS(flag)); + } +} + +/*! + \brief enable USART interrupt + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] interrupt: USART interrupts, refer to usart_interrupt_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_PERR: parity error interrupt + \arg USART_INT_TBE: transmitter buffer empty interrupt + \arg USART_INT_TC: transmission complete interrupt + \arg USART_INT_RBNE: read data buffer not empty interrupt and overrun error interrupt + \arg USART_INT_IDLE: IDLE line detected interrupt + \arg USART_INT_LBD: LIN break detected interrupt + \arg USART_INT_ERR: error interrupt + \arg USART_INT_CTS: CTS interrupt + \arg USART_INT_RT: interrupt enable bit of receive timeout event + \arg USART_INT_EB: interrupt enable bit of end of block event + \param[out] none + \retval none +*/ +void usart_interrupt_enable(uint32_t usart_periph, usart_interrupt_enum interrupt) +{ + USART_REG_VAL(usart_periph, interrupt) |= BIT(USART_BIT_POS(interrupt)); +} + +/*! + \brief disable USART interrupt + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] interrupt: USART interrupts, refer to usart_interrupt_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_PERR: parity error interrupt + \arg USART_INT_TBE: transmitter buffer empty interrupt + \arg USART_INT_TC: transmission complete interrupt + \arg USART_INT_RBNE: read data buffer not empty interrupt and overrun error interrupt + \arg USART_INT_IDLE: IDLE line detected interrupt + \arg USART_INT_LBD: LIN break detected interrupt + \arg USART_INT_ERR: error interrupt + \arg USART_INT_CTS: CTS interrupt + \arg USART_INT_RT: interrupt enable bit of receive timeout event + \arg USART_INT_EB: interrupt enable bit of end of block event + \param[out] none + \retval none +*/ +void usart_interrupt_disable(uint32_t usart_periph, usart_interrupt_enum interrupt) +{ + USART_REG_VAL(usart_periph, interrupt) &= ~BIT(USART_BIT_POS(interrupt)); +} + +/*! + \brief get USART interrupt and flag status + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] int_flag: USART interrupt flags, refer to usart_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_FLAG_PERR: parity error interrupt and flag + \arg USART_INT_FLAG_TBE: transmitter buffer empty interrupt and flag + \arg USART_INT_FLAG_TC: transmission complete interrupt and flag + \arg USART_INT_FLAG_RBNE: read data buffer not empty interrupt and flag + \arg USART_INT_FLAG_RBNE_ORERR: read data buffer not empty interrupt and overrun error flag + \arg USART_INT_FLAG_IDLE: IDLE line detected interrupt and flag + \arg USART_INT_FLAG_LBD: LIN break detected interrupt and flag + \arg USART_INT_FLAG_CTS: CTS interrupt and flag + \arg USART_INT_FLAG_ERR_ORERR: error interrupt and overrun error + \arg USART_INT_FLAG_ERR_NERR: error interrupt and noise error flag + \arg USART_INT_FLAG_ERR_FERR: error interrupt and frame error flag + \arg USART_INT_FLAG_EB: interrupt enable bit of end of block event and flag + \arg USART_INT_FLAG_RT: interrupt enable bit of receive timeout event and flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus usart_interrupt_flag_get(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U; + /* get the interrupt enable bit status */ + intenable = (USART_REG_VAL(usart_periph, int_flag) & BIT(USART_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (USART_REG_VAL2(usart_periph, int_flag) & BIT(USART_BIT_POS2(int_flag))); + + if((0U != flagstatus) && (0U != intenable)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear USART interrupt flag in STAT0/STAT1 register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] int_flag: USART interrupt flags, refer to usart_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_FLAG_CTS: CTS change flag + \arg USART_INT_FLAG_LBD: LIN break detected flag + \arg USART_INT_FLAG_TC: transmission complete + \arg USART_INT_FLAG_RBNE: read data buffer not empty + \arg USART_INT_FLAG_EB: end of block flag + \arg USART_INT_FLAG_RT: receiver timeout flag + \param[out] none + \retval none +*/ +void usart_interrupt_flag_clear(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) +{ + USART_REG_VAL2(usart_periph, int_flag) = ~BIT(USART_BIT_POS2(int_flag)); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c.base@1.0.0 new file mode 100644 index 0000000..1abf091 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c.base@1.0.0 @@ -0,0 +1,890 @@ +/*! + \file gd32c10x_usart.c + \brief USART driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_usart.h" + +/* USART register bit offset */ +#define GP_GUAT_OFFSET ((uint32_t)8U) /* bit offset of GUAT in USART_GP */ +#define CTL3_SCRTNUM_OFFSET ((uint32_t)1U) /* bit offset of SCRTNUM in USART_CTL3 */ +#define RT_BL_OFFSET ((uint32_t)24U) /* bit offset of BL in USART_RT */ + +/*! + \brief reset USART/UART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_deinit(uint32_t usart_periph) +{ + switch(usart_periph) { + case USART0: + /* reset USART0 */ + rcu_periph_reset_enable(RCU_USART0RST); + rcu_periph_reset_disable(RCU_USART0RST); + break; + case USART1: + /* reset USART1 */ + rcu_periph_reset_enable(RCU_USART1RST); + rcu_periph_reset_disable(RCU_USART1RST); + break; + case USART2: + /* reset USART2 */ + rcu_periph_reset_enable(RCU_USART2RST); + rcu_periph_reset_disable(RCU_USART2RST); + break; + case UART3: + /* reset UART3 */ + rcu_periph_reset_enable(RCU_UART3RST); + rcu_periph_reset_disable(RCU_UART3RST); + break; + case UART4: + /* reset UART4 */ + rcu_periph_reset_enable(RCU_UART4RST); + rcu_periph_reset_disable(RCU_UART4RST); + break; + default: + break; + } +} + +/*! + \brief configure USART baud rate value + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] baudval: baud rate value + \param[out] none + \retval none +*/ +void usart_baudrate_set(uint32_t usart_periph, uint32_t baudval) +{ + uint32_t uclk = 0U, intdiv = 0U, fradiv = 0U, udiv = 0U; + switch(usart_periph) { + /* get clock frequency */ + case USART0: + /* get USART0 clock */ + uclk = rcu_clock_freq_get(CK_APB2); + break; + case USART1: + /* get USART1 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + case USART2: + /* get USART2 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + case UART3: + /* get UART3 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + case UART4: + /* get UART4 clock */ + uclk = rcu_clock_freq_get(CK_APB1); + break; + default: + break; + } + /* oversampling by 16, configure the value of USART_BAUD */ + udiv = (uclk + baudval / 2U) / baudval; + intdiv = udiv & 0xfff0U; + fradiv = udiv & 0xfU; + USART_BAUD(usart_periph) = ((USART_BAUD_FRADIV | USART_BAUD_INTDIV) & (intdiv | fradiv)); +} + +/*! + \brief configure USART parity + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] paritycfg: configure USART parity + only one parameter can be selected which is shown as below: + \arg USART_PM_NONE: no parity + \arg USART_PM_ODD: odd parity + \arg USART_PM_EVEN: even parity + \param[out] none + \retval none +*/ +void usart_parity_config(uint32_t usart_periph, uint32_t paritycfg) +{ + /* clear USART_CTL0 PM,PCEN bits */ + USART_CTL0(usart_periph) &= ~(USART_CTL0_PM | USART_CTL0_PCEN); + /* configure USART parity mode */ + USART_CTL0(usart_periph) |= paritycfg; +} + +/*! + \brief configure USART word length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] wlen: USART word length configure + only one parameter can be selected which is shown as below: + \arg USART_WL_8BIT: 8 bits + \arg USART_WL_9BIT: 9 bits + \param[out] none + \retval none +*/ +void usart_word_length_set(uint32_t usart_periph, uint32_t wlen) +{ + /* clear USART_CTL0 WL bit */ + USART_CTL0(usart_periph) &= ~USART_CTL0_WL; + /* configure USART word length */ + USART_CTL0(usart_periph) |= wlen; +} + +/*! + \brief configure USART stop bit length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] stblen: USART stop bit configure + only one parameter can be selected which is shown as below: + \arg USART_STB_1BIT: 1 bit + \arg USART_STB_0_5BIT: 0.5 bit, not available for UARTx(x=3,4) + \arg USART_STB_2BIT: 2 bits + \arg USART_STB_1_5BIT: 1.5 bits, not available for UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_stop_bit_set(uint32_t usart_periph, uint32_t stblen) +{ + /* clear USART_CTL1 STB bits */ + USART_CTL1(usart_periph) &= ~USART_CTL1_STB; + /* configure USART stop bits */ + USART_CTL1(usart_periph) |= stblen; +} + +/*! + \brief enable USART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_enable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_UEN; +} + +/*! + \brief disable USART + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_disable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_UEN); +} + +/*! + \brief configure USART transmitter + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] txconfig: enable or disable USART transmitter + only one parameter can be selected which is shown as below: + \arg USART_TRANSMIT_ENABLE: enable USART transmission + \arg USART_TRANSMIT_DISABLE: disable USART transmission + \param[out] none + \retval none +*/ +void usart_transmit_config(uint32_t usart_periph, uint32_t txconfig) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_TEN); + USART_CTL0(usart_periph) |= (USART_CTL0_TEN & txconfig); +} + +/*! + \brief configure USART receiver + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] rxconfig: enable or disable USART receiver + only one parameter can be selected which is shown as below: + \arg USART_RECEIVE_ENABLE: enable USART reception + \arg USART_RECEIVE_DISABLE: disable USART reception + \param[out] none + \retval none +*/ +void usart_receive_config(uint32_t usart_periph, uint32_t rxconfig) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_REN); + USART_CTL0(usart_periph) |= (USART_CTL0_REN & rxconfig); +} + +/*! + \brief data is transmitted/received with the LSB/MSB first + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] msbf: LSB/MSB + only one parameter can be selected which is shown as below: + \arg USART_MSBF_LSB: LSB first + \arg USART_MSBF_MSB: MSB first + \param[out] none + \retval none +*/ +void usart_data_first_config(uint32_t usart_periph, uint32_t msbf) +{ + USART_CTL3(usart_periph) &= ~(USART_CTL3_MSBF); + USART_CTL3(usart_periph) |= msbf; +} + +/*! + \brief configure USART inversion + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] invertpara: refer to enum usart_invert_enum + only one parameter can be selected which is shown as below: + \arg USART_DINV_ENABLE: data bit level inversion + \arg USART_DINV_DISABLE: data bit level not inversion + \arg USART_TXPIN_ENABLE: TX pin level inversion + \arg USART_TXPIN_DISABLE: TX pin level not inversion + \arg USART_RXPIN_ENABLE: RX pin level inversion + \arg USART_RXPIN_DISABLE: RX pin level not inversion + \param[out] none + \retval none +*/ +void usart_invert_config(uint32_t usart_periph, usart_invert_enum invertpara) +{ + /* inverted or not the specified signal */ + switch(invertpara) { + case USART_DINV_ENABLE: + /* data bit level inversion */ + USART_CTL3(usart_periph) |= USART_CTL3_DINV; + break; + case USART_TXPIN_ENABLE: + /* TX pin level inversion */ + USART_CTL3(usart_periph) |= USART_CTL3_TINV; + break; + case USART_RXPIN_ENABLE: + /* RX pin level inversion */ + USART_CTL3(usart_periph) |= USART_CTL3_RINV; + break; + case USART_DINV_DISABLE: + /* data bit level not inversion */ + USART_CTL3(usart_periph) &= ~(USART_CTL3_DINV); + break; + case USART_TXPIN_DISABLE: + /* TX pin level not inversion */ + USART_CTL3(usart_periph) &= ~(USART_CTL3_TINV); + break; + case USART_RXPIN_DISABLE: + /* RX pin level not inversion */ + USART_CTL3(usart_periph) &= ~(USART_CTL3_RINV); + break; + default: + break; + } +} + +/*! + \brief enable receiver timeout + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_receiver_timeout_enable(uint32_t usart_periph) +{ + USART_CTL3(usart_periph) |= USART_CTL3_RTEN; +} + +/*! + \brief disable receiver timeout + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_receiver_timeout_disable(uint32_t usart_periph) +{ + USART_CTL3(usart_periph) &= ~(USART_CTL3_RTEN); +} + +/*! + \brief configure receiver timeout threshold + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] rtimeout: 0-0xFFFFFF + \param[out] none + \retval none +*/ +void usart_receiver_timeout_threshold_config(uint32_t usart_periph, uint32_t rtimeout) +{ + USART_RT(usart_periph) &= ~(USART_RT_RT); + USART_RT(usart_periph) |= rtimeout; +} + +/*! + \brief USART transmit data function + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] data: data to be transmitted + \param[out] none + \retval none +*/ +void usart_data_transmit(uint32_t usart_periph, uint16_t data) +{ + USART_DATA(usart_periph) = USART_DATA_DATA & (uint32_t)data; +} + +/*! + \brief USART receive data function + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval data of received +*/ +uint16_t usart_data_receive(uint32_t usart_periph) +{ + return (uint16_t)(GET_BITS(USART_DATA(usart_periph), 0U, 8U)); +} + +/*! + \brief configure the address of the USART in wake up by address match mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] addr: address of USART/UART + \param[out] none + \retval none +*/ +void usart_address_config(uint32_t usart_periph, uint8_t addr) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_ADDR); + USART_CTL1(usart_periph) |= (USART_CTL1_ADDR & (uint32_t)addr); +} + +/*! + \brief enable mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_mute_mode_enable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_RWU; +} + +/*! + \brief disable mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_mute_mode_disable(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_RWU); +} + +/*! + \brief configure wakeup method in mute mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] wmethod: two methods be used to enter or exit the mute mode + only one parameter can be selected which is shown as below: + \arg USART_WM_IDLE: idle line + \arg USART_WM_ADDR: address mask + \param[out] none + \retval none +*/ +void usart_mute_mode_wakeup_config(uint32_t usart_periph, uint32_t wmethod) +{ + USART_CTL0(usart_periph) &= ~(USART_CTL0_WM); + USART_CTL0(usart_periph) |= wmethod; +} + +/*! + \brief enable LIN mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_lin_mode_enable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) |= USART_CTL1_LMEN; +} + +/*! + \brief disable LIN mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_lin_mode_disable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_LMEN); +} + +/*! + \brief configure lin break frame length + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] lblen: lin break frame length + only one parameter can be selected which is shown as below: + \arg USART_LBLEN_10B: 10 bits + \arg USART_LBLEN_11B: 11 bits + \param[out] none + \retval none +*/ +void usart_lin_break_detection_length_config(uint32_t usart_periph, uint32_t lblen) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_LBLEN); + USART_CTL1(usart_periph) |= (USART_CTL1_LBLEN & lblen); +} + +/*! + \brief send break frame + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_send_break(uint32_t usart_periph) +{ + USART_CTL0(usart_periph) |= USART_CTL0_SBKCMD; +} + +/*! + \brief enable half duplex mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_halfduplex_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_HDEN; +} + +/*! + \brief disable half duplex mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_halfduplex_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_HDEN); +} + +/*! + \brief enable CK pin in synchronous mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_synchronous_clock_enable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) |= USART_CTL1_CKEN; +} + +/*! + \brief disable CK pin in synchronous mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_synchronous_clock_disable(uint32_t usart_periph) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_CKEN); +} + +/*! + \brief configure USART synchronous mode parameters + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] clen: CK length + only one parameter can be selected which is shown as below: + \arg USART_CLEN_NONE: there are 7 CK pulses for an 8 bit frame and 8 CK pulses for a 9 bit frame + \arg USART_CLEN_EN: there are 8 CK pulses for an 8 bit frame and 9 CK pulses for a 9 bit frame + \param[in] cph: clock phase + only one parameter can be selected which is shown as below: + \arg USART_CPH_1CK: first clock transition is the first data capture edge + \arg USART_CPH_2CK: second clock transition is the first data capture edge + \param[in] cpl: clock polarity + only one parameter can be selected which is shown as below: + \arg USART_CPL_LOW: steady low value on CK pin + \arg USART_CPL_HIGH: steady high value on CK pin + \param[out] none + \retval none +*/ +void usart_synchronous_clock_config(uint32_t usart_periph, uint32_t clen, uint32_t cph, uint32_t cpl) +{ + USART_CTL1(usart_periph) &= ~(USART_CTL1_CLEN | USART_CTL1_CPH | USART_CTL1_CPL); + USART_CTL1(usart_periph) |= (USART_CTL1_CLEN & clen) | (USART_CTL1_CPH & cph) | (USART_CTL1_CPL & cpl); +} + +/*! + \brief configure guard time value in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] guat: guard time value, 0-0xFF + \param[out] none + \retval none +*/ +void usart_guard_time_config(uint32_t usart_periph, uint8_t guat) +{ + USART_GP(usart_periph) &= ~(USART_GP_GUAT); + USART_GP(usart_periph) |= (USART_GP_GUAT & ((uint32_t)guat << GP_GUAT_OFFSET)); +} + +/*! + \brief enable smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_SCEN; +} + +/*! + \brief disable smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_SCEN); +} + +/*! + \brief enable NACK in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_nack_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_NKEN; +} + +/*! + \brief disable NACK in smartcard mode + \param[in] usart_periph: USARTx(x=0,1,2) + \param[out] none + \retval none +*/ +void usart_smartcard_mode_nack_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_NKEN); +} + +/*! + \brief configure smartcard auto-retry number + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] scrtnum: smartcard auto-retry number + \param[out] none + \retval none +*/ +void usart_smartcard_autoretry_config(uint32_t usart_periph, uint8_t scrtnum) +{ + USART_CTL3(usart_periph) &= ~(USART_CTL3_SCRTNUM); + USART_CTL3(usart_periph) |= (USART_CTL3_SCRTNUM & ((uint32_t)scrtnum << CTL3_SCRTNUM_OFFSET)); +} + +/*! + \brief configure block length + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] bl: block length + \param[out] none + \retval none +*/ +void usart_block_length_config(uint32_t usart_periph, uint8_t bl) +{ + USART_RT(usart_periph) &= ~(USART_RT_BL); + USART_RT(usart_periph) |= (USART_RT_BL & ((uint32_t)bl << RT_BL_OFFSET)); +} + +/*! + \brief enable IrDA mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_irda_mode_enable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) |= USART_CTL2_IREN; +} + +/*! + \brief disable IrDA mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[out] none + \retval none +*/ +void usart_irda_mode_disable(uint32_t usart_periph) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_IREN); +} + +/*! + \brief configure the peripheral clock prescaler + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] psc: 0x00-0xFF + \param[out] none + \retval none +*/ +void usart_prescaler_config(uint32_t usart_periph, uint8_t psc) +{ + USART_GP(usart_periph) &= ~(USART_GP_PSC); + USART_GP(usart_periph) |= (uint32_t)psc; +} + +/*! + \brief configure IrDA low-power + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] irlp: IrDA low-power or normal + only one parameter can be selected which is shown as below: + \arg USART_IRLP_LOW: low-power + \arg USART_IRLP_NORMAL: normal + \param[out] none + \retval none +*/ +void usart_irda_lowpower_config(uint32_t usart_periph, uint32_t irlp) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_IRLP); + USART_CTL2(usart_periph) |= (USART_CTL2_IRLP & irlp); +} + +/*! + \brief configure hardware flow control RTS + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] rtsconfig: enable or disable RTS + only one parameter can be selected which is shown as below: + \arg USART_RTS_ENABLE: enable RTS + \arg USART_RTS_DISABLE: disable RTS + \param[out] none + \retval none +*/ +void usart_hardware_flow_rts_config(uint32_t usart_periph, uint32_t rtsconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_RTSEN); + USART_CTL2(usart_periph) |= (USART_CTL2_RTSEN & rtsconfig); +} + +/*! + \brief configure hardware flow control CTS + \param[in] usart_periph: USARTx(x=0,1,2) + \param[in] ctsconfig: enable or disable CTS + only one parameter can be selected which is shown as below: + \arg USART_CTS_ENABLE: enable CTS + \arg USART_CTS_DISABLE: disable CTS + \param[out] none + \retval none +*/ +void usart_hardware_flow_cts_config(uint32_t usart_periph, uint32_t ctsconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_CTSEN); + USART_CTL2(usart_periph) |= (USART_CTL2_CTSEN & ctsconfig); +} + +/*! + \brief configure USART DMA reception + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] dmaconfig: USART DMA mode + only one parameter can be selected which is shown as below: + \arg USART_RECEIVE_DMA_ENABLE: enable USART DMA for reception + \arg USART_RECEIVE_DMA_DISABLE: disable USART DMA for reception + \param[out] none + \retval none +*/ +void usart_dma_receive_config(uint32_t usart_periph, uint8_t dmaconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_DENR); + USART_CTL2(usart_periph) |= (USART_CTL2_DENR & dmaconfig); +} + +/*! + \brief configure USART DMA transmission + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] dmaconfig: USART DMA mode + only one parameter can be selected which is shown as below: + \arg USART_TRANSMIT_DMA_ENABLE: enable USART DMA for transmission + \arg USART_TRANSMIT_DMA_DISABLE: disable USART DMA for transmission + \param[out] none + \retval none +*/ +void usart_dma_transmit_config(uint32_t usart_periph, uint8_t dmaconfig) +{ + USART_CTL2(usart_periph) &= ~(USART_CTL2_DENT); + USART_CTL2(usart_periph) |= (USART_CTL2_DENT & dmaconfig); +} + +/*! + \brief configure hardware flow control coherence mode + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3) + \param[in] hcm: + \arg USART_RTS_NONE_COHERENCE: nRTS signal equals to the rxne status register + \arg USART_RTS_COHERENCE: nRTS signal is set when the last data bit has been sampled + \param[out] none + \retval none +*/ +void usart_hardware_flow_coherence_config(uint32_t usart_periph, uint32_t hcm) +{ + USART_CHC(usart_periph) &= ~(USART_CHC_HCM); + USART_CHC(usart_periph) |= (USART_CHC_HCM & hcm); +} + +/*! + \brief get flag in STAT0/STAT1 register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] flag: USART flags, refer to usart_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_FLAG_CTS: CTS change flag + \arg USART_FLAG_LBD: LIN break detected flag + \arg USART_FLAG_TBE: transmit data buffer empty + \arg USART_FLAG_TC: transmission complete + \arg USART_FLAG_RBNE: read data buffer not empty + \arg USART_FLAG_IDLE: IDLE frame detected flag + \arg USART_FLAG_ORERR: overrun error + \arg USART_FLAG_NERR: noise error flag + \arg USART_FLAG_FERR: frame error flag + \arg USART_FLAG_PERR: parity error flag + \arg USART_FLAG_BSY: busy flag + \arg USART_FLAG_EB: end of block flag + \arg USART_FLAG_RT: receiver timeout flag + \arg USART_FLAG_EPERR: early parity error flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus usart_flag_get(uint32_t usart_periph, usart_flag_enum flag) +{ + if(RESET != (USART_REG_VAL(usart_periph, flag) & BIT(USART_BIT_POS(flag)))) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear flag in STAT0/STAT1 register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] flag: USART flags, refer to usart_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_FLAG_CTS: CTS change flag + \arg USART_FLAG_LBD: LIN break detected flag + \arg USART_FLAG_TC: transmission complete + \arg USART_FLAG_RBNE: read data buffer not empty + \arg USART_FLAG_EB: end of block flag + \arg USART_FLAG_RT: receiver timeout flag + \arg USART_FLAG_EPERR: early parity error flag + \param[out] none + \retval none +*/ +void usart_flag_clear(uint32_t usart_periph, usart_flag_enum flag) +{ + if(USART_FLAG_EPERR == flag) { + USART_REG_VAL(usart_periph, flag) &= ~BIT(USART_BIT_POS(flag)); + } else { + USART_REG_VAL(usart_periph, flag) = ~BIT(USART_BIT_POS(flag)); + } +} + +/*! + \brief enable USART interrupt + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] interrupt: USART interrupts, refer to usart_interrupt_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_PERR: parity error interrupt + \arg USART_INT_TBE: transmitter buffer empty interrupt + \arg USART_INT_TC: transmission complete interrupt + \arg USART_INT_RBNE: read data buffer not empty interrupt and overrun error interrupt + \arg USART_INT_IDLE: IDLE line detected interrupt + \arg USART_INT_LBD: LIN break detected interrupt + \arg USART_INT_ERR: error interrupt + \arg USART_INT_CTS: CTS interrupt + \arg USART_INT_RT: interrupt enable bit of receive timeout event + \arg USART_INT_EB: interrupt enable bit of end of block event + \param[out] none + \retval none +*/ +void usart_interrupt_enable(uint32_t usart_periph, usart_interrupt_enum interrupt) +{ + USART_REG_VAL(usart_periph, interrupt) |= BIT(USART_BIT_POS(interrupt)); +} + +/*! + \brief disable USART interrupt + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] interrupt: USART interrupts, refer to usart_interrupt_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_PERR: parity error interrupt + \arg USART_INT_TBE: transmitter buffer empty interrupt + \arg USART_INT_TC: transmission complete interrupt + \arg USART_INT_RBNE: read data buffer not empty interrupt and overrun error interrupt + \arg USART_INT_IDLE: IDLE line detected interrupt + \arg USART_INT_LBD: LIN break detected interrupt + \arg USART_INT_ERR: error interrupt + \arg USART_INT_CTS: CTS interrupt + \arg USART_INT_RT: interrupt enable bit of receive timeout event + \arg USART_INT_EB: interrupt enable bit of end of block event + \param[out] none + \retval none +*/ +void usart_interrupt_disable(uint32_t usart_periph, usart_interrupt_enum interrupt) +{ + USART_REG_VAL(usart_periph, interrupt) &= ~BIT(USART_BIT_POS(interrupt)); +} + +/*! + \brief get USART interrupt and flag status + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] int_flag: USART interrupt flags, refer to usart_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_FLAG_PERR: parity error interrupt and flag + \arg USART_INT_FLAG_TBE: transmitter buffer empty interrupt and flag + \arg USART_INT_FLAG_TC: transmission complete interrupt and flag + \arg USART_INT_FLAG_RBNE: read data buffer not empty interrupt and flag + \arg USART_INT_FLAG_RBNE_ORERR: read data buffer not empty interrupt and overrun error flag + \arg USART_INT_FLAG_IDLE: IDLE line detected interrupt and flag + \arg USART_INT_FLAG_LBD: LIN break detected interrupt and flag + \arg USART_INT_FLAG_CTS: CTS interrupt and flag + \arg USART_INT_FLAG_ERR_ORERR: error interrupt and overrun error + \arg USART_INT_FLAG_ERR_NERR: error interrupt and noise error flag + \arg USART_INT_FLAG_ERR_FERR: error interrupt and frame error flag + \arg USART_INT_FLAG_EB: interrupt enable bit of end of block event and flag + \arg USART_INT_FLAG_RT: interrupt enable bit of receive timeout event and flag + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus usart_interrupt_flag_get(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) +{ + uint32_t intenable = 0U, flagstatus = 0U; + /* get the interrupt enable bit status */ + intenable = (USART_REG_VAL(usart_periph, int_flag) & BIT(USART_BIT_POS(int_flag))); + /* get the corresponding flag bit status */ + flagstatus = (USART_REG_VAL2(usart_periph, int_flag) & BIT(USART_BIT_POS2(int_flag))); + + if((0U != flagstatus) && (0U != intenable)) { + return SET; + } else { + return RESET; + } +} + +/*! + \brief clear USART interrupt flag in STAT0/STAT1 register + \param[in] usart_periph: USARTx(x=0,1,2)/UARTx(x=3,4) + \param[in] int_flag: USART interrupt flags, refer to usart_interrupt_flag_enum + only one parameter can be selected which is shown as below: + \arg USART_INT_FLAG_CTS: CTS change flag + \arg USART_INT_FLAG_LBD: LIN break detected flag + \arg USART_INT_FLAG_TC: transmission complete + \arg USART_INT_FLAG_RBNE: read data buffer not empty + \arg USART_INT_FLAG_EB: end of block flag + \arg USART_INT_FLAG_RT: receiver timeout flag + \param[out] none + \retval none +*/ +void usart_interrupt_flag_clear(uint32_t usart_periph, usart_interrupt_flag_enum int_flag) +{ + USART_REG_VAL2(usart_periph, int_flag) = ~BIT(USART_BIT_POS2(int_flag)); +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_wwdgt.c b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_wwdgt.c new file mode 100644 index 0000000..d93e778 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_wwdgt.c @@ -0,0 +1,125 @@ +/*! + \file gd32c10x_wwdgt.c + \brief WWDGT driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_wwdgt.h" + +/*! + \brief reset the window watchdog timer configuration + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_deinit(void) +{ + rcu_periph_reset_enable(RCU_WWDGTRST); + rcu_periph_reset_disable(RCU_WWDGTRST); +} + +/*! + \brief start the window watchdog timer counter + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_enable(void) +{ + WWDGT_CTL |= WWDGT_CTL_WDGTEN; +} + +/*! + \brief configure the window watchdog timer counter value + \param[in] counter_value: 0x00 - 0x7F + \param[out] none + \retval none +*/ +void wwdgt_counter_update(uint16_t counter_value) +{ + WWDGT_CTL = (uint32_t)(CTL_CNT(counter_value)); +} + +/*! + \brief configure counter value, window value, and prescaler divider value + \param[in] counter: 0x00 - 0x7F + \param[in] window: 0x00 - 0x7F + \param[in] prescaler: wwdgt prescaler value + only one parameter can be selected which is shown as below: + \arg WWDGT_CFG_PSC_DIV1: the time base of window watchdog counter = (PCLK1/4096)/1 + \arg WWDGT_CFG_PSC_DIV2: the time base of window watchdog counter = (PCLK1/4096)/2 + \arg WWDGT_CFG_PSC_DIV4: the time base of window watchdog counter = (PCLK1/4096)/4 + \arg WWDGT_CFG_PSC_DIV8: the time base of window watchdog counter = (PCLK1/4096)/8 + \param[out] none + \retval none +*/ +void wwdgt_config(uint16_t counter, uint16_t window, uint32_t prescaler) +{ + WWDGT_CTL = (uint32_t)(CTL_CNT(counter)); + WWDGT_CFG = (uint32_t)(CFG_WIN(window) | prescaler); +} + +/*! + \brief check early wakeup interrupt state of WWDGT + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus wwdgt_flag_get(void) +{ + if(RESET != (WWDGT_STAT & WWDGT_STAT_EWIF)) { + return SET; + } + + return RESET; +} + +/*! + \brief clear early wakeup interrupt state of WWDGT + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_flag_clear(void) +{ + WWDGT_STAT = (uint32_t)(RESET); +} + +/*! + \brief enable early wakeup interrupt of WWDGT + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_interrupt_enable(void) +{ + WWDGT_CFG |= WWDGT_CFG_EWIE; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_wwdgt.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_wwdgt.c.base@1.0.0 new file mode 100644 index 0000000..d93e778 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_wwdgt.c.base@1.0.0 @@ -0,0 +1,125 @@ +/*! + \file gd32c10x_wwdgt.c + \brief WWDGT driver + + \version 2025-08-07, V1.6.0, firmware for GD32C10x +*/ + +/* + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors + may be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +*/ + +#include "gd32c10x_wwdgt.h" + +/*! + \brief reset the window watchdog timer configuration + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_deinit(void) +{ + rcu_periph_reset_enable(RCU_WWDGTRST); + rcu_periph_reset_disable(RCU_WWDGTRST); +} + +/*! + \brief start the window watchdog timer counter + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_enable(void) +{ + WWDGT_CTL |= WWDGT_CTL_WDGTEN; +} + +/*! + \brief configure the window watchdog timer counter value + \param[in] counter_value: 0x00 - 0x7F + \param[out] none + \retval none +*/ +void wwdgt_counter_update(uint16_t counter_value) +{ + WWDGT_CTL = (uint32_t)(CTL_CNT(counter_value)); +} + +/*! + \brief configure counter value, window value, and prescaler divider value + \param[in] counter: 0x00 - 0x7F + \param[in] window: 0x00 - 0x7F + \param[in] prescaler: wwdgt prescaler value + only one parameter can be selected which is shown as below: + \arg WWDGT_CFG_PSC_DIV1: the time base of window watchdog counter = (PCLK1/4096)/1 + \arg WWDGT_CFG_PSC_DIV2: the time base of window watchdog counter = (PCLK1/4096)/2 + \arg WWDGT_CFG_PSC_DIV4: the time base of window watchdog counter = (PCLK1/4096)/4 + \arg WWDGT_CFG_PSC_DIV8: the time base of window watchdog counter = (PCLK1/4096)/8 + \param[out] none + \retval none +*/ +void wwdgt_config(uint16_t counter, uint16_t window, uint32_t prescaler) +{ + WWDGT_CTL = (uint32_t)(CTL_CNT(counter)); + WWDGT_CFG = (uint32_t)(CFG_WIN(window) | prescaler); +} + +/*! + \brief check early wakeup interrupt state of WWDGT + \param[in] none + \param[out] none + \retval FlagStatus: SET or RESET +*/ +FlagStatus wwdgt_flag_get(void) +{ + if(RESET != (WWDGT_STAT & WWDGT_STAT_EWIF)) { + return SET; + } + + return RESET; +} + +/*! + \brief clear early wakeup interrupt state of WWDGT + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_flag_clear(void) +{ + WWDGT_STAT = (uint32_t)(RESET); +} + +/*! + \brief enable early wakeup interrupt of WWDGT + \param[in] none + \param[out] none + \retval none +*/ +void wwdgt_interrupt_enable(void) +{ + WWDGT_CFG |= WWDGT_CFG_EWIE; +} diff --git a/Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h b/Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h new file mode 100644 index 0000000..89512d0 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h @@ -0,0 +1,101 @@ +#ifndef REGIONS_GD32C103CB_H +#define REGIONS_GD32C103CB_H + + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Auto-generated using information from packs +// Device Family Pack (DFP): GigaDevice::GD32C10x_DFP@1.0.1 + +// ROM Configuration +// ======================= +// __ROM0 (is rx memory: IROM1 from DFP) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. Default: 0x08000000 +// Contains Startup and Vector Table +#define __ROM0_BASE 0x08000000 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. Default: 0x00020000 +#define __ROM0_SIZE 0x00020000 +// + +// __ROM1 (unused) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. +#define __ROM1_BASE 0x0 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. +#define __ROM1_SIZE 0x0 +// + +// __ROM2 (unused) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. +#define __ROM2_BASE 0x0 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. +#define __ROM2_SIZE 0x0 +// + +// __ROM3 (unused) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. +#define __ROM3_BASE 0x0 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. +#define __ROM3_SIZE 0x0 +// + +// + +// RAM Configuration +// ======================= +// __RAM0 (is rwx memory: IRAM1 from DFP) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. Default: 0x20000000 +// Contains uninitialized RAM, Stack, and Heap +#define __RAM0_BASE 0x20000000 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. Default: 0x00008000 +#define __RAM0_SIZE 0x00008000 +// + +// __RAM1 (unused) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. +#define __RAM1_BASE 0x0 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. +#define __RAM1_SIZE 0x0 +// + +// __RAM2 (unused) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. +#define __RAM2_BASE 0x0 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. +#define __RAM2_SIZE 0x0 +// + +// __RAM3 (unused) +// Base address <0x0-0xFFFFFFFF:8> +// Defines base address of memory region. +#define __RAM3_BASE 0x0 +// Region size [bytes] <0x0-0xFFFFFFFF:8> +// Defines size of memory region. +#define __RAM3_SIZE 0x0 +// + +// + +// Stack / Heap Configuration +// Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +// Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +#define __STACK_SIZE 0x00000200 +#define __HEAP_SIZE 0x00000C00 +// + + +#endif /* REGIONS_GD32C103CB_H */ diff --git a/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s b/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s new file mode 100644 index 0000000..0d7f9aa --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s @@ -0,0 +1,383 @@ +;/*! +; \file startup_gd32c10x.s +; \brief start up file +; +; \version 2025-08-07, V1.6.0, firmware for GD32C10x +;*/ +; +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2025, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ + +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x0000800 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x00000800 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + +; /* reset Vector Mapped to at Address 0 */ + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + +; /* external interrupts handler */ + DCD WWDGT_IRQHandler ; 16:Window Watchdog Timer + DCD LVD_IRQHandler ; 17:LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; 18:Tamper through EXTI Line detect + DCD RTC_IRQHandler ; 19:RTC through EXTI Line + DCD FMC_IRQHandler ; 20:FMC + DCD RCU_CTC_IRQHandler ; 21:RCU and CTC + DCD EXTI0_IRQHandler ; 22:EXTI Line 0 + DCD EXTI1_IRQHandler ; 23:EXTI Line 1 + DCD EXTI2_IRQHandler ; 24:EXTI Line 2 + DCD EXTI3_IRQHandler ; 25:EXTI Line 3 + DCD EXTI4_IRQHandler ; 26:EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; 27:DMA0 Channel0 + DCD DMA0_Channel1_IRQHandler ; 28:DMA0 Channel1 + DCD DMA0_Channel2_IRQHandler ; 29:DMA0 Channel2 + DCD DMA0_Channel3_IRQHandler ; 30:DMA0 Channel3 + DCD DMA0_Channel4_IRQHandler ; 31:DMA0 Channel4 + DCD DMA0_Channel5_IRQHandler ; 32:DMA0 Channel5 + DCD DMA0_Channel6_IRQHandler ; 33:DMA0 Channel6 + DCD ADC0_1_IRQHandler ; 34:ADC0 and ADC1 + DCD CAN0_TX_IRQHandler ; 35:CAN0 TX + DCD CAN0_RX0_IRQHandler ; 36:CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; 37:CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; 38:CAN0 EWMC + DCD EXTI5_9_IRQHandler ; 39:EXTI5 to EXTI9 + DCD TIMER0_BRK_TIMER8_IRQHandler ; 40:TIMER0 Break and TIMER8 + DCD TIMER0_UP_TIMER9_IRQHandler ; 41:TIMER0 Update and TIMER9 + DCD TIMER0_TRG_CMT_TIMER10_IRQHandler ; 42:TIMER0 Trigger and Commutation and TIMER10 + DCD TIMER0_Channel_IRQHandler ; 43:TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; 44:TIMER1 + DCD TIMER2_IRQHandler ; 45:TIMER2 + DCD TIMER3_IRQHandler ; 46:TIMER3 + DCD I2C0_EV_IRQHandler ; 47:I2C0 Event + DCD I2C0_ER_IRQHandler ; 48:I2C0 Error + DCD I2C1_EV_IRQHandler ; 49:I2C1 Event + DCD I2C1_ER_IRQHandler ; 50:I2C1 Error + DCD SPI0_IRQHandler ; 51:SPI0 + DCD SPI1_IRQHandler ; 52:SPI1 + DCD USART0_IRQHandler ; 53:USART0 + DCD USART1_IRQHandler ; 54:USART1 + DCD USART2_IRQHandler ; 55:USART2 + DCD EXTI10_15_IRQHandler ; 56:EXTI10 to EXTI15 + DCD RTC_Alarm_IRQHandler ; 57:RTC Alarm + DCD USBFS_WKUP_IRQHandler ; 58:USBFS Wakeup + DCD TIMER7_BRK_TIMER11_IRQHandler ; 59:TIMER7 Break and TIMER11 + DCD TIMER7_UP_TIMER12_IRQHandler ; 60:TIMER7 Update and TIMER12 + DCD TIMER7_TRG_CMT_TIMER13_IRQHandler ; 61:TIMER7 Trigger and Commutation and TIMER13 + DCD TIMER7_Channel_IRQHandler ; 62:TIMER7 Channel Capture Compare + DCD 0 ; 63:Reserved + DCD EXMC_IRQHandler ; 64:EXMC + DCD 0 ; 65:Reserved + DCD TIMER4_IRQHandler ; 66:TIMER4 + DCD SPI2_IRQHandler ; 67:SPI2 + DCD UART3_IRQHandler ; 68:UART3 + DCD UART4_IRQHandler ; 69:UART4 + DCD TIMER5_IRQHandler ; 70:TIMER5 + DCD TIMER6_IRQHandler ; 71:TIMER6 + DCD DMA1_Channel0_IRQHandler ; 72:DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; 73:DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; 74:DMA1 Channel2 + DCD DMA1_Channel3_IRQHandler ; 75:DMA1 Channel3 + DCD DMA1_Channel4_IRQHandler ; 76:DMA1 Channel4 + DCD 0 ; 77:Reserved + DCD 0 ; 78:Reserved + DCD CAN1_TX_IRQHandler ; 79:CAN1 TX + DCD CAN1_RX0_IRQHandler ; 80:CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; 81:CAN1 RX1 + DCD CAN1_EWMC_IRQHandler ; 82:CAN1 EWMC + DCD USBFS_IRQHandler ; 83:USBFS + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +;/* reset Handler */ +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +;/* dummy Exception Handlers */ +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler\ + PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler\ + PROC + EXPORT SysTick_Handler [WEAK] + IMPORT delay_decrement + LDR R0, =delay_decrement + BX R0 + ENDP + +Default_Handler PROC +; /* external interrupts handler */ + EXPORT WWDGT_IRQHandler [WEAK] + EXPORT LVD_IRQHandler [WEAK] + EXPORT TAMPER_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT FMC_IRQHandler [WEAK] + EXPORT RCU_CTC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA0_Channel0_IRQHandler [WEAK] + EXPORT DMA0_Channel1_IRQHandler [WEAK] + EXPORT DMA0_Channel2_IRQHandler [WEAK] + EXPORT DMA0_Channel3_IRQHandler [WEAK] + EXPORT DMA0_Channel4_IRQHandler [WEAK] + EXPORT DMA0_Channel5_IRQHandler [WEAK] + EXPORT DMA0_Channel6_IRQHandler [WEAK] + EXPORT ADC0_1_IRQHandler [WEAK] + EXPORT CAN0_TX_IRQHandler [WEAK] + EXPORT CAN0_RX0_IRQHandler [WEAK] + EXPORT CAN0_RX1_IRQHandler [WEAK] + EXPORT CAN0_EWMC_IRQHandler [WEAK] + EXPORT EXTI5_9_IRQHandler [WEAK] + EXPORT TIMER0_BRK_TIMER8_IRQHandler [WEAK] + EXPORT TIMER0_UP_TIMER9_IRQHandler [WEAK] + EXPORT TIMER0_TRG_CMT_TIMER10_IRQHandler [WEAK] + EXPORT TIMER0_Channel_IRQHandler [WEAK] + EXPORT TIMER1_IRQHandler [WEAK] + EXPORT TIMER2_IRQHandler [WEAK] + EXPORT TIMER3_IRQHandler [WEAK] + EXPORT I2C0_EV_IRQHandler [WEAK] + EXPORT I2C0_ER_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT SPI0_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT EXTI10_15_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT USBFS_WKUP_IRQHandler [WEAK] + EXPORT TIMER7_BRK_TIMER11_IRQHandler [WEAK] + EXPORT TIMER7_UP_TIMER12_IRQHandler [WEAK] + EXPORT TIMER7_TRG_CMT_TIMER13_IRQHandler [WEAK] + EXPORT TIMER7_Channel_IRQHandler [WEAK] + EXPORT EXMC_IRQHandler [WEAK] + EXPORT TIMER4_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT UART3_IRQHandler [WEAK] + EXPORT UART4_IRQHandler [WEAK] + EXPORT TIMER5_IRQHandler [WEAK] + EXPORT TIMER6_IRQHandler [WEAK] + EXPORT DMA1_Channel0_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_EWMC_IRQHandler [WEAK] + EXPORT USBFS_IRQHandler [WEAK] + +;/* external interrupts handler */ +WWDGT_IRQHandler +LVD_IRQHandler +TAMPER_IRQHandler +RTC_IRQHandler +FMC_IRQHandler +RCU_CTC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA0_Channel0_IRQHandler +DMA0_Channel1_IRQHandler +DMA0_Channel2_IRQHandler +DMA0_Channel3_IRQHandler +DMA0_Channel4_IRQHandler +DMA0_Channel5_IRQHandler +DMA0_Channel6_IRQHandler +ADC0_1_IRQHandler +CAN0_TX_IRQHandler +CAN0_RX0_IRQHandler +CAN0_RX1_IRQHandler +CAN0_EWMC_IRQHandler +EXTI5_9_IRQHandler +TIMER0_BRK_TIMER8_IRQHandler +TIMER0_UP_TIMER9_IRQHandler +TIMER0_TRG_CMT_TIMER10_IRQHandler +TIMER0_Channel_IRQHandler +TIMER1_IRQHandler +TIMER2_IRQHandler +TIMER3_IRQHandler +I2C0_EV_IRQHandler +I2C0_ER_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +SPI0_IRQHandler +SPI1_IRQHandler +USART0_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +EXTI10_15_IRQHandler +RTC_Alarm_IRQHandler +USBFS_WKUP_IRQHandler +TIMER7_BRK_TIMER11_IRQHandler +TIMER7_UP_TIMER12_IRQHandler +TIMER7_TRG_CMT_TIMER13_IRQHandler +TIMER7_Channel_IRQHandler +EXMC_IRQHandler +TIMER4_IRQHandler +SPI2_IRQHandler +UART3_IRQHandler +UART4_IRQHandler +TIMER5_IRQHandler +TIMER6_IRQHandler +DMA1_Channel0_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_EWMC_IRQHandler +USBFS_IRQHandler + + B . + ENDP + + ALIGN + +; user Initial Stack & Heap + + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap PROC + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + ENDP + + ALIGN + + ENDIF + + END diff --git a/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s.base@1.0.0 new file mode 100644 index 0000000..a676bf3 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s.base@1.0.0 @@ -0,0 +1,381 @@ +;/*! +; \file startup_gd32c10x.s +; \brief start up file +; +; \version 2025-08-07, V1.6.0, firmware for GD32C10x +;*/ +; +;/* Copyright (c) 2011 - 2012 ARM LIMITED +; Copyright (c) 2025, GigaDevice Semiconductor Inc. +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +;*/ + +;/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x0000800 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x00000800 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + +; /* reset Vector Mapped to at Address 0 */ + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + +; /* external interrupts handler */ + DCD WWDGT_IRQHandler ; 16:Window Watchdog Timer + DCD LVD_IRQHandler ; 17:LVD through EXTI Line detect + DCD TAMPER_IRQHandler ; 18:Tamper through EXTI Line detect + DCD RTC_IRQHandler ; 19:RTC through EXTI Line + DCD FMC_IRQHandler ; 20:FMC + DCD RCU_CTC_IRQHandler ; 21:RCU and CTC + DCD EXTI0_IRQHandler ; 22:EXTI Line 0 + DCD EXTI1_IRQHandler ; 23:EXTI Line 1 + DCD EXTI2_IRQHandler ; 24:EXTI Line 2 + DCD EXTI3_IRQHandler ; 25:EXTI Line 3 + DCD EXTI4_IRQHandler ; 26:EXTI Line 4 + DCD DMA0_Channel0_IRQHandler ; 27:DMA0 Channel0 + DCD DMA0_Channel1_IRQHandler ; 28:DMA0 Channel1 + DCD DMA0_Channel2_IRQHandler ; 29:DMA0 Channel2 + DCD DMA0_Channel3_IRQHandler ; 30:DMA0 Channel3 + DCD DMA0_Channel4_IRQHandler ; 31:DMA0 Channel4 + DCD DMA0_Channel5_IRQHandler ; 32:DMA0 Channel5 + DCD DMA0_Channel6_IRQHandler ; 33:DMA0 Channel6 + DCD ADC0_1_IRQHandler ; 34:ADC0 and ADC1 + DCD CAN0_TX_IRQHandler ; 35:CAN0 TX + DCD CAN0_RX0_IRQHandler ; 36:CAN0 RX0 + DCD CAN0_RX1_IRQHandler ; 37:CAN0 RX1 + DCD CAN0_EWMC_IRQHandler ; 38:CAN0 EWMC + DCD EXTI5_9_IRQHandler ; 39:EXTI5 to EXTI9 + DCD TIMER0_BRK_TIMER8_IRQHandler ; 40:TIMER0 Break and TIMER8 + DCD TIMER0_UP_TIMER9_IRQHandler ; 41:TIMER0 Update and TIMER9 + DCD TIMER0_TRG_CMT_TIMER10_IRQHandler ; 42:TIMER0 Trigger and Commutation and TIMER10 + DCD TIMER0_Channel_IRQHandler ; 43:TIMER0 Channel Capture Compare + DCD TIMER1_IRQHandler ; 44:TIMER1 + DCD TIMER2_IRQHandler ; 45:TIMER2 + DCD TIMER3_IRQHandler ; 46:TIMER3 + DCD I2C0_EV_IRQHandler ; 47:I2C0 Event + DCD I2C0_ER_IRQHandler ; 48:I2C0 Error + DCD I2C1_EV_IRQHandler ; 49:I2C1 Event + DCD I2C1_ER_IRQHandler ; 50:I2C1 Error + DCD SPI0_IRQHandler ; 51:SPI0 + DCD SPI1_IRQHandler ; 52:SPI1 + DCD USART0_IRQHandler ; 53:USART0 + DCD USART1_IRQHandler ; 54:USART1 + DCD USART2_IRQHandler ; 55:USART2 + DCD EXTI10_15_IRQHandler ; 56:EXTI10 to EXTI15 + DCD RTC_Alarm_IRQHandler ; 57:RTC Alarm + DCD USBFS_WKUP_IRQHandler ; 58:USBFS Wakeup + DCD TIMER7_BRK_TIMER11_IRQHandler ; 59:TIMER7 Break and TIMER11 + DCD TIMER7_UP_TIMER12_IRQHandler ; 60:TIMER7 Update and TIMER12 + DCD TIMER7_TRG_CMT_TIMER13_IRQHandler ; 61:TIMER7 Trigger and Commutation and TIMER13 + DCD TIMER7_Channel_IRQHandler ; 62:TIMER7 Channel Capture Compare + DCD 0 ; 63:Reserved + DCD EXMC_IRQHandler ; 64:EXMC + DCD 0 ; 65:Reserved + DCD TIMER4_IRQHandler ; 66:TIMER4 + DCD SPI2_IRQHandler ; 67:SPI2 + DCD UART3_IRQHandler ; 68:UART3 + DCD UART4_IRQHandler ; 69:UART4 + DCD TIMER5_IRQHandler ; 70:TIMER5 + DCD TIMER6_IRQHandler ; 71:TIMER6 + DCD DMA1_Channel0_IRQHandler ; 72:DMA1 Channel0 + DCD DMA1_Channel1_IRQHandler ; 73:DMA1 Channel1 + DCD DMA1_Channel2_IRQHandler ; 74:DMA1 Channel2 + DCD DMA1_Channel3_IRQHandler ; 75:DMA1 Channel3 + DCD DMA1_Channel4_IRQHandler ; 76:DMA1 Channel4 + DCD 0 ; 77:Reserved + DCD 0 ; 78:Reserved + DCD CAN1_TX_IRQHandler ; 79:CAN1 TX + DCD CAN1_RX0_IRQHandler ; 80:CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; 81:CAN1 RX1 + DCD CAN1_EWMC_IRQHandler ; 82:CAN1 EWMC + DCD USBFS_IRQHandler ; 83:USBFS + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +;/* reset Handler */ +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +;/* dummy Exception Handlers */ +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler\ + PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler\ + PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC +; /* external interrupts handler */ + EXPORT WWDGT_IRQHandler [WEAK] + EXPORT LVD_IRQHandler [WEAK] + EXPORT TAMPER_IRQHandler [WEAK] + EXPORT RTC_IRQHandler [WEAK] + EXPORT FMC_IRQHandler [WEAK] + EXPORT RCU_CTC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA0_Channel0_IRQHandler [WEAK] + EXPORT DMA0_Channel1_IRQHandler [WEAK] + EXPORT DMA0_Channel2_IRQHandler [WEAK] + EXPORT DMA0_Channel3_IRQHandler [WEAK] + EXPORT DMA0_Channel4_IRQHandler [WEAK] + EXPORT DMA0_Channel5_IRQHandler [WEAK] + EXPORT DMA0_Channel6_IRQHandler [WEAK] + EXPORT ADC0_1_IRQHandler [WEAK] + EXPORT CAN0_TX_IRQHandler [WEAK] + EXPORT CAN0_RX0_IRQHandler [WEAK] + EXPORT CAN0_RX1_IRQHandler [WEAK] + EXPORT CAN0_EWMC_IRQHandler [WEAK] + EXPORT EXTI5_9_IRQHandler [WEAK] + EXPORT TIMER0_BRK_TIMER8_IRQHandler [WEAK] + EXPORT TIMER0_UP_TIMER9_IRQHandler [WEAK] + EXPORT TIMER0_TRG_CMT_TIMER10_IRQHandler [WEAK] + EXPORT TIMER0_Channel_IRQHandler [WEAK] + EXPORT TIMER1_IRQHandler [WEAK] + EXPORT TIMER2_IRQHandler [WEAK] + EXPORT TIMER3_IRQHandler [WEAK] + EXPORT I2C0_EV_IRQHandler [WEAK] + EXPORT I2C0_ER_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT SPI0_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT USART0_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT EXTI10_15_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT USBFS_WKUP_IRQHandler [WEAK] + EXPORT TIMER7_BRK_TIMER11_IRQHandler [WEAK] + EXPORT TIMER7_UP_TIMER12_IRQHandler [WEAK] + EXPORT TIMER7_TRG_CMT_TIMER13_IRQHandler [WEAK] + EXPORT TIMER7_Channel_IRQHandler [WEAK] + EXPORT EXMC_IRQHandler [WEAK] + EXPORT TIMER4_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT UART3_IRQHandler [WEAK] + EXPORT UART4_IRQHandler [WEAK] + EXPORT TIMER5_IRQHandler [WEAK] + EXPORT TIMER6_IRQHandler [WEAK] + EXPORT DMA1_Channel0_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_EWMC_IRQHandler [WEAK] + EXPORT USBFS_IRQHandler [WEAK] + +;/* external interrupts handler */ +WWDGT_IRQHandler +LVD_IRQHandler +TAMPER_IRQHandler +RTC_IRQHandler +FMC_IRQHandler +RCU_CTC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA0_Channel0_IRQHandler +DMA0_Channel1_IRQHandler +DMA0_Channel2_IRQHandler +DMA0_Channel3_IRQHandler +DMA0_Channel4_IRQHandler +DMA0_Channel5_IRQHandler +DMA0_Channel6_IRQHandler +ADC0_1_IRQHandler +CAN0_TX_IRQHandler +CAN0_RX0_IRQHandler +CAN0_RX1_IRQHandler +CAN0_EWMC_IRQHandler +EXTI5_9_IRQHandler +TIMER0_BRK_TIMER8_IRQHandler +TIMER0_UP_TIMER9_IRQHandler +TIMER0_TRG_CMT_TIMER10_IRQHandler +TIMER0_Channel_IRQHandler +TIMER1_IRQHandler +TIMER2_IRQHandler +TIMER3_IRQHandler +I2C0_EV_IRQHandler +I2C0_ER_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +SPI0_IRQHandler +SPI1_IRQHandler +USART0_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +EXTI10_15_IRQHandler +RTC_Alarm_IRQHandler +USBFS_WKUP_IRQHandler +TIMER7_BRK_TIMER11_IRQHandler +TIMER7_UP_TIMER12_IRQHandler +TIMER7_TRG_CMT_TIMER13_IRQHandler +TIMER7_Channel_IRQHandler +EXMC_IRQHandler +TIMER4_IRQHandler +SPI2_IRQHandler +UART3_IRQHandler +UART4_IRQHandler +TIMER5_IRQHandler +TIMER6_IRQHandler +DMA1_Channel0_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_EWMC_IRQHandler +USBFS_IRQHandler + + B . + ENDP + + ALIGN + +; user Initial Stack & Heap + + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap PROC + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + ENDP + + ALIGN + + ENDIF + + END diff --git a/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c b/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c new file mode 100644 index 0000000..225ed31 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c @@ -0,0 +1,947 @@ +/*! + \file system_gd32c10x.c + \brief CMSIS Cortex-M4 Device Peripheral Access Layer Source File for + GD32C10x Device Series +*/ + +/* Copyright (c) 2009 - 2014 ARM LIMITED + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32c10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* Vector Table base offset */ +#define VECT_TAB_OFFSET 0x00 /* This value must be a multiple of 0x200. */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +// #define __SYSTEM_CLOCK_IRC8M (uint32_t)(__IRC8M) +// #define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) +// #define __SYSTEM_CLOCK_120M_PLL_IRC8M (uint32_t)(120000000) + +/* use HXTAL(CK_HXTAL = 8M) */ +// #define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +// #define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) +#define __SYSTEM_CLOCK_120M_PLL_HXTAL (uint32_t)(120000000) + +/* The following is to prevent Vcore fluctuations caused by frequency switching. + It is strongly recommended to include it to avoid issues caused by self-removal. */ +#define RCU_MODIFY_4(__delay) do{ \ + volatile uint32_t i, reg; \ + if(0 != __delay){ \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV2; \ + /* AHB = SYSCLK/2 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV4; \ + /* AHB = SYSCLK/4 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV8; \ + /* AHB = SYSCLK/8 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV16; \ + /* AHB = SYSCLK/16 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + } \ + }while(0) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_IRC8M; +static void system_clock_8m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_120M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_120M_PLL_IRC8M; +static void system_clock_120m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_120M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_120M_PLL_HXTAL; +static void system_clock_120m_hxtal(void); +#endif /* __SYSTEM_CLOCK_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/* software delay to prevent the impact of Vcore fluctuations. + It is strongly recommended to include it to avoid issues caused by self-removal. */ +static void _soft_delay_(uint32_t time) +{ + __IO uint32_t i; + for(i=0; iCPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ +#endif + /* reset the RCU clock configuration to the default reset state */ + /* Set IRC8MEN bit */ + RCU_CTL |= RCU_CTL_IRC8MEN; + while(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)) { + } + if(((RCU_CFG0 & RCU_CFG0_SCSS) == RCU_SCSS_PLL)){ + RCU_MODIFY_4(0x50); + } + + RCU_CFG0 &= ~RCU_CFG0_SCS; + _soft_delay_(200); + + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN |RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00ff0000U; + + /* Reset CFG0 and CFG1 registers */ + RCU_CFG0 = 0x00000000U; + RCU_CFG1 = 0x00000000U; + + /* reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* configure the system clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); + +#ifdef VECT_TAB_SRAM + nvic_vector_table_set(NVIC_VECTTAB_RAM,VECT_TAB_OFFSET); +#else + nvic_vector_table_set(NVIC_VECTTAB_FLASH,VECT_TAB_OFFSET); +#endif +} + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_IRC8M + system_clock_8m_irc8m(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#elif defined (__SYSTEM_CLOCK_120M_PLL_IRC8M) + system_clock_120m_irc8m(); + +#elif defined (__SYSTEM_CLOCK_HXTAL) + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); +#elif defined (__SYSTEM_CLOCK_120M_PLL_HXTAL) + system_clock_120m_hxtal(); +#endif /* __SYSTEM_CLOCK_IRC8M */ +} + +#ifdef __SYSTEM_CLOCK_IRC8M +/*! + \brief configure the system clock to 8M by IRC8M + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_8m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + reg_temp = RCU_CFG0; + /* select IRC8M as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_IRC8M; + RCU_CFG0 = reg_temp; + + /* wait until IRC8M is selected as system clock */ + while(0U != (RCU_CFG0 & RCU_SCSS_IRC8M)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_1; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + }while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_2; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + }while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_120M_PLL_IRC8M) +/*! + \brief configure the system clock to 120M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_120m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + }while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 30 = 120 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL30; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_HXTAL) +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + reg_temp = RCU_CFG0; + /* select HXTAL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_HXTAL; + RCU_CFG0 = reg_temp; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_1; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL12); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_2; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL18); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL27); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_120M_PLL_HXTAL) +/*! + \brief configure the system clock to 120M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_120m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 30 = 120 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL30); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0U){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} +#endif /* __SYSTEM_CLOCK_IRC8M */ + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate (void) +{ + uint32_t sws = 0U; + uint32_t pllsel = 0U, pllpresel = 0U, predv0sel = 0U, pllmf,ck_src = 0U; + uint32_t predv0 = 0U, predv1 = 0U, pll1mf = 0U,idx = 0U,clk_exp = 0U; + /* exponent of AHB clock divider */ + const uint8_t ahb_exp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + + sws = GET_BITS(RCU_CFG0, 2, 3); + switch(sws){ + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL, IRC48M or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + if(RCU_PLLSRC_HXTAL_IRC48M == pllsel){ + /* PLL clock source is HXTAL or IRC48M */ + pllpresel = (RCU_CFG1 & RCU_CFG1_PLLPRESEL); + + if(RCU_PLLPRESRC_HXTAL == pllpresel){ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + }else{ + /* PLL clock source is IRC48 */ + ck_src = IRC48M_VALUE; + } + + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src/predv1)*pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; + }else{ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE/2U; + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + if(pllmf < 15U){ + pllmf += 2U; + }else{ + pllmf += 1U; + } + SystemCoreClock = ck_src*pllmf; + if(15U == pllmf){ + SystemCoreClock = ck_src*6U + ck_src/2U; + } + + break; + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } + /* calculate AHB clock frequency */ + idx = GET_BITS(RCU_CFG0, 4, 7); + clk_exp = ahb_exp[idx]; + SystemCoreClock >>= clk_exp; +} + +#ifdef __FIRMWARE_VERSION_DEFINE +/*! + \brief get firmware version + \param[in] none + \param[out] none + \retval firmware version +*/ +uint32_t gd32c10x_firmware_version_get(void) +{ + return __GD32C10X_STDPERIPH_VERSION; +} +#endif /* __FIRMWARE_VERSION_DEFINE */ diff --git a/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c.base@1.0.0 b/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c.base@1.0.0 new file mode 100644 index 0000000..11a3a71 --- /dev/null +++ b/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c.base@1.0.0 @@ -0,0 +1,947 @@ +/*! + \file system_gd32c10x.c + \brief CMSIS Cortex-M4 Device Peripheral Access Layer Source File for + GD32C10x Device Series +*/ + +/* Copyright (c) 2009 - 2014 ARM LIMITED + Copyright (c) 2025, GigaDevice Semiconductor Inc. + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ + +/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */ + +#include "gd32c10x.h" + +/* system frequency define */ +#define __IRC8M (IRC8M_VALUE) /* internal 8 MHz RC oscillator frequency */ +#define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ +#define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ + +/* Vector Table base offset */ +#define VECT_TAB_OFFSET 0x00 /* This value must be a multiple of 0x200. */ + +/* select a system clock by uncommenting the following line */ +/* use IRC8M */ +//#define __SYSTEM_CLOCK_IRC8M (uint32_t)(__IRC8M) +//#define __SYSTEM_CLOCK_48M_PLL_IRC8M (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_IRC8M (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_IRC8M (uint32_t)(108000000) +//#define __SYSTEM_CLOCK_120M_PLL_IRC8M (uint32_t)(120000000) + +/* use HXTAL(CK_HXTAL = 8M) */ +//#define __SYSTEM_CLOCK_HXTAL (uint32_t)(__HXTAL) +//#define __SYSTEM_CLOCK_48M_PLL_HXTAL (uint32_t)(48000000) +//#define __SYSTEM_CLOCK_72M_PLL_HXTAL (uint32_t)(72000000) +//#define __SYSTEM_CLOCK_108M_PLL_HXTAL (uint32_t)(108000000) +#define __SYSTEM_CLOCK_120M_PLL_HXTAL (uint32_t)(120000000) + +/* The following is to prevent Vcore fluctuations caused by frequency switching. + It is strongly recommended to include it to avoid issues caused by self-removal. */ +#define RCU_MODIFY_4(__delay) do{ \ + volatile uint32_t i, reg; \ + if(0 != __delay){ \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV2; \ + /* AHB = SYSCLK/2 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV4; \ + /* AHB = SYSCLK/4 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV8; \ + /* AHB = SYSCLK/8 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + reg = RCU_CFG0; \ + reg &= ~(RCU_CFG0_AHBPSC); \ + reg |= RCU_AHB_CKSYS_DIV16; \ + /* AHB = SYSCLK/16 */ \ + RCU_CFG0 = reg; \ + /* Insert a software delay */ \ + for(i=0; i<__delay; i++){ \ + } \ + } \ + }while(0) + +#define SEL_IRC8M 0x00U +#define SEL_HXTAL 0x01U +#define SEL_PLL 0x02U + +/* set the system clock frequency and declare the system clock configuration function */ +#ifdef __SYSTEM_CLOCK_IRC8M +uint32_t SystemCoreClock = __SYSTEM_CLOCK_IRC8M; +static void system_clock_8m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_IRC8M; +static void system_clock_48m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_IRC8M; +static void system_clock_72m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_IRC8M; +static void system_clock_108m_irc8m(void); +#elif defined (__SYSTEM_CLOCK_120M_PLL_IRC8M) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_120M_PLL_IRC8M; +static void system_clock_120m_irc8m(void); + +#elif defined (__SYSTEM_CLOCK_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_HXTAL; +static void system_clock_hxtal(void); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_48M_PLL_HXTAL; +static void system_clock_48m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_72M_PLL_HXTAL; +static void system_clock_72m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_108M_PLL_HXTAL; +static void system_clock_108m_hxtal(void); +#elif defined (__SYSTEM_CLOCK_120M_PLL_HXTAL) +uint32_t SystemCoreClock = __SYSTEM_CLOCK_120M_PLL_HXTAL; +static void system_clock_120m_hxtal(void); +#endif /* __SYSTEM_CLOCK_IRC8M */ + +/* configure the system clock */ +static void system_clock_config(void); + +/* software delay to prevent the impact of Vcore fluctuations. + It is strongly recommended to include it to avoid issues caused by self-removal. */ +static void _soft_delay_(uint32_t time) +{ + __IO uint32_t i; + for(i=0; iCPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ +#endif + /* reset the RCU clock configuration to the default reset state */ + /* Set IRC8MEN bit */ + RCU_CTL |= RCU_CTL_IRC8MEN; + while(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)) { + } + if(((RCU_CFG0 & RCU_CFG0_SCSS) == RCU_SCSS_PLL)){ + RCU_MODIFY_4(0x50); + } + + RCU_CFG0 &= ~RCU_CFG0_SCS; + _soft_delay_(200); + + /* Reset HXTALEN, CKMEN, PLLEN, PLL1EN and PLL2EN bits */ + RCU_CTL &= ~(RCU_CTL_PLLEN |RCU_CTL_PLL1EN | RCU_CTL_PLL2EN | RCU_CTL_CKMEN | RCU_CTL_HXTALEN); + /* disable all interrupts */ + RCU_INT = 0x00ff0000U; + + /* Reset CFG0 and CFG1 registers */ + RCU_CFG0 = 0x00000000U; + RCU_CFG1 = 0x00000000U; + + /* reset HXTALBPS bit */ + RCU_CTL &= ~(RCU_CTL_HXTALBPS); + + /* configure the system clock source, PLL Multiplier, AHB/APBx prescalers and Flash settings */ + system_clock_config(); + +#ifdef VECT_TAB_SRAM + nvic_vector_table_set(NVIC_VECTTAB_RAM,VECT_TAB_OFFSET); +#else + nvic_vector_table_set(NVIC_VECTTAB_FLASH,VECT_TAB_OFFSET); +#endif +} + +/*! + \brief configure the system clock + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_config(void) +{ +#ifdef __SYSTEM_CLOCK_IRC8M + system_clock_8m_irc8m(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) + system_clock_48m_irc8m(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) + system_clock_72m_irc8m(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) + system_clock_108m_irc8m(); +#elif defined (__SYSTEM_CLOCK_120M_PLL_IRC8M) + system_clock_120m_irc8m(); + +#elif defined (__SYSTEM_CLOCK_HXTAL) + system_clock_hxtal(); +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) + system_clock_48m_hxtal(); +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) + system_clock_72m_hxtal(); +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) + system_clock_108m_hxtal(); +#elif defined (__SYSTEM_CLOCK_120M_PLL_HXTAL) + system_clock_120m_hxtal(); +#endif /* __SYSTEM_CLOCK_IRC8M */ +} + +#ifdef __SYSTEM_CLOCK_IRC8M +/*! + \brief configure the system clock to 8M by IRC8M + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_8m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + reg_temp = RCU_CFG0; + /* select IRC8M as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_IRC8M; + RCU_CFG0 = reg_temp; + + /* wait until IRC8M is selected as system clock */ + while(0U != (RCU_CFG0 & RCU_SCSS_IRC8M)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_IRC8M) +/*! + \brief configure the system clock to 48M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + } + while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_1; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL12; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_72M_PLL_IRC8M) +/*! + \brief configure the system clock to 72M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + }while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_2; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL18; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_IRC8M) +/*! + \brief configure the system clock to 108M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + }while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL27; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_120M_PLL_IRC8M) +/*! + \brief configure the system clock to 120M by PLL which selects IRC8M as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_120m_irc8m(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable IRC8M */ + RCU_CTL |= RCU_CTL_IRC8MEN; + + /* wait until IRC8M is stable or the startup time is longer than IRC8M_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_IRC8MSTB); + }while((0U == stab_flag) && (IRC8M_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_IRC8MSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* IRC8M is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_IRC8M/2) * 30 = 120 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= RCU_PLL_MUL30; + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_HXTAL) +/*! + \brief configure the system clock to HXTAL + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + reg_temp = RCU_CFG0; + /* select HXTAL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_HXTAL; + RCU_CFG0 = reg_temp; + + /* wait until HXTAL is selected as system clock */ + while(0 == (RCU_CFG0 & RCU_SCSS_HXTAL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_48M_PLL_HXTAL) +/*! + \brief configure the system clock to 48M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_48m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_1; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 12 = 48 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL12); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} +#elif defined (__SYSTEM_CLOCK_72M_PLL_HXTAL) +/*! + \brief configure the system clock to 72M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_72m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_2; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 18 = 72 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL18); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_108M_PLL_HXTAL) +/*! + \brief configure the system clock to 108M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_108m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 27 = 108 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL27); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} + +#elif defined (__SYSTEM_CLOCK_120M_PLL_HXTAL) +/*! + \brief configure the system clock to 120M by PLL which selects HXTAL(8M) as its clock source + \param[in] none + \param[out] none + \retval none +*/ +static void system_clock_120m_hxtal(void) +{ + uint32_t timeout = 0U; + uint32_t stab_flag = 0U; + __IO uint32_t reg_temp; + + /* enable HXTAL */ + RCU_CTL |= RCU_CTL_HXTALEN; + + /* wait until HXTAL is stable or the startup time is longer than HXTAL_STARTUP_TIMEOUT */ + do{ + timeout++; + stab_flag = (RCU_CTL & RCU_CTL_HXTALSTB); + }while((0U == stab_flag) && (HXTAL_STARTUP_TIMEOUT != timeout)); + + /* if fail */ + if(0U == (RCU_CTL & RCU_CTL_HXTALSTB)){ + while(1){ + } + } + + FMC_WS = (FMC_WS & (~FMC_WS_WSCNT)) | FMC_WAIT_STATE_3; + + /* HXTAL is stable */ + /* AHB = SYSCLK */ + RCU_CFG0 |= RCU_AHB_CKSYS_DIV1; + /* APB2 = AHB/1 */ + RCU_CFG0 |= RCU_APB2_CKAHB_DIV1; + /* APB1 = AHB/2 */ + RCU_CFG0 |= RCU_APB1_CKAHB_DIV2; + + /* CK_PLL = (CK_PREDIV0) * 30 = 120 MHz */ + RCU_CFG0 &= ~(RCU_CFG0_PLLMF | RCU_CFG0_PLLMF_4); + RCU_CFG0 |= (RCU_PLLSRC_HXTAL_IRC48M | RCU_PLL_MUL30); + + RCU_CFG1 &= ~(RCU_CFG1_PLLPRESEL | RCU_CFG1_PREDV0SEL | RCU_CFG1_PLL1MF | RCU_CFG1_PREDV1 | RCU_CFG1_PREDV0); + + /* CK_PREDIV0 = (CK_HXTAL)/2 *10 /10 = 4 MHz */ + RCU_CFG1 |= (RCU_PLLPRESRC_HXTAL | RCU_PREDV0SRC_CKPLL1 | RCU_PLL1_MUL10 | RCU_PREDV1_DIV2 | RCU_PREDV0_DIV10); + + /* enable PLL1 */ + RCU_CTL |= RCU_CTL_PLL1EN; + /* wait till PLL1 is ready */ + while((RCU_CTL & RCU_CTL_PLL1STB) == 0U){ + } + + /* enable PLL */ + RCU_CTL |= RCU_CTL_PLLEN; + + /* wait until PLL is stable */ + while(0U == (RCU_CTL & RCU_CTL_PLLSTB)){ + } + + reg_temp = RCU_CFG0; + /* select PLL as system clock */ + reg_temp &= ~RCU_CFG0_SCS; + reg_temp |= RCU_CKSYSSRC_PLL; + RCU_CFG0 = reg_temp; + + /* wait until PLL is selected as system clock */ + while(0U == (RCU_CFG0 & RCU_SCSS_PLL)){ + } +} +#endif /* __SYSTEM_CLOCK_IRC8M */ + +/*! + \brief update the SystemCoreClock with current core clock retrieved from cpu registers + \param[in] none + \param[out] none + \retval none +*/ +void SystemCoreClockUpdate (void) +{ + uint32_t sws = 0U; + uint32_t pllsel = 0U, pllpresel = 0U, predv0sel = 0U, pllmf,ck_src = 0U; + uint32_t predv0 = 0U, predv1 = 0U, pll1mf = 0U,idx = 0U,clk_exp = 0U; + /* exponent of AHB clock divider */ + const uint8_t ahb_exp[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; + + sws = GET_BITS(RCU_CFG0, 2, 3); + switch(sws){ + /* IRC8M is selected as CK_SYS */ + case SEL_IRC8M: + SystemCoreClock = IRC8M_VALUE; + break; + /* HXTAL is selected as CK_SYS */ + case SEL_HXTAL: + SystemCoreClock = HXTAL_VALUE; + break; + /* PLL is selected as CK_SYS */ + case SEL_PLL: + /* PLL clock source selection, HXTAL, IRC48M or IRC8M/2 */ + pllsel = (RCU_CFG0 & RCU_CFG0_PLLSEL); + + if(RCU_PLLSRC_HXTAL_IRC48M == pllsel){ + /* PLL clock source is HXTAL or IRC48M */ + pllpresel = (RCU_CFG1 & RCU_CFG1_PLLPRESEL); + + if(RCU_PLLPRESRC_HXTAL == pllpresel){ + /* PLL clock source is HXTAL */ + ck_src = HXTAL_VALUE; + }else{ + /* PLL clock source is IRC48 */ + ck_src = IRC48M_VALUE; + } + + predv0sel = (RCU_CFG1 & RCU_CFG1_PREDV0SEL); + /* source clock use PLL1 */ + if(RCU_PREDV0SRC_CKPLL1 == predv0sel){ + predv1 = ((RCU_CFG1 & RCU_CFG1_PREDV1) >> 4) + 1U; + pll1mf = ((RCU_CFG1 & RCU_CFG1_PLL1MF) >> 8) + 2U; + if(17U == pll1mf){ + pll1mf = 20U; + } + ck_src = (ck_src/predv1)*pll1mf; + } + predv0 = (RCU_CFG1 & RCU_CFG1_PREDV0) + 1U; + ck_src /= predv0; + }else{ + /* PLL clock source is IRC8M/2 */ + ck_src = IRC8M_VALUE/2U; + } + + /* PLL multiplication factor */ + pllmf = GET_BITS(RCU_CFG0, 18, 21); + if((RCU_CFG0 & RCU_CFG0_PLLMF_4)){ + pllmf |= 0x10U; + } + if(pllmf < 15U){ + pllmf += 2U; + }else{ + pllmf += 1U; + } + SystemCoreClock = ck_src*pllmf; + if(15U == pllmf){ + SystemCoreClock = ck_src*6U + ck_src/2U; + } + + break; + /* IRC8M is selected as CK_SYS */ + default: + SystemCoreClock = IRC8M_VALUE; + break; + } + /* calculate AHB clock frequency */ + idx = GET_BITS(RCU_CFG0, 4, 7); + clk_exp = ahb_exp[idx]; + SystemCoreClock >>= clk_exp; +} + +#ifdef __FIRMWARE_VERSION_DEFINE +/*! + \brief get firmware version + \param[in] none + \param[out] none + \retval firmware version +*/ +uint32_t gd32c10x_firmware_version_get(void) +{ + return __GD32C10X_STDPERIPH_VERSION; +} +#endif /* __FIRMWARE_VERSION_DEFINE */ diff --git a/Robot_V2/RTE/_Debug_GD32C103CB/RTE_Components.h b/Robot_V2/RTE/_Debug_GD32C103CB/RTE_Components.h new file mode 100644 index 0000000..5734403 --- /dev/null +++ b/Robot_V2/RTE/_Debug_GD32C103CB/RTE_Components.h @@ -0,0 +1,50 @@ +/* + * CSOLUTION generated file: DO NOT EDIT! + * Generated by: csolution version 2.11.0 + * + * Project: 'Robot_V2.Debug+GD32C103CB' + * Target: 'Debug+GD32C103CB' + */ + +#ifndef RTE_COMPONENTS_H +#define RTE_COMPONENTS_H + + +/* + * Define the Device Header File: + */ +#define CMSIS_device_header "gd32c10x.h" + +/* GigaDevice::Device:GD32C10x_StdPeripherals:ADC@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_ADC +/* GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_CAN +/* GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_DBG +/* GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_DMA +/* GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_EXTI +/* GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_FMC +/* GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_FWDGT +/* GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_GPIO +/* GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_MISC +/* GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_PMU +/* GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_RCU +/* GigaDevice::Device:GD32C10x_StdPeripherals:SPI_I2S@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_SPI +/* GigaDevice::Device:GD32C10x_StdPeripherals:TIMER@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_TIMER +/* GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_USART +/* GigaDevice::Device:GD32C10x_StdPeripherals:WWDGT@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_WWDGT + + +#endif /* RTE_COMPONENTS_H */ diff --git a/Robot_V2/RTE/_Release_GD32C103CB/RTE_Components.h b/Robot_V2/RTE/_Release_GD32C103CB/RTE_Components.h new file mode 100644 index 0000000..b9d9195 --- /dev/null +++ b/Robot_V2/RTE/_Release_GD32C103CB/RTE_Components.h @@ -0,0 +1,46 @@ +/* + * CSOLUTION generated file: DO NOT EDIT! + * Generated by: csolution version 2.12.0+p41-gfeadfc5e + * + * Project: 'Robot_V2.Release+GD32C103CB' + * Target: 'Release+GD32C103CB' + */ + +#ifndef RTE_COMPONENTS_H +#define RTE_COMPONENTS_H + + +/* + * Define the Device Header File: + */ +#define CMSIS_device_header "gd32c10x.h" + +/* GigaDevice::Device:GD32C10x_StdPeripherals:BKP@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_BKP +/* GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_CAN +/* GigaDevice::Device:GD32C10x_StdPeripherals:CRC@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_CRC +/* GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_DBG +/* GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_DMA +/* GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_EXTI +/* GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_FMC +/* GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_FWDGT +/* GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_GPIO +/* GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_MISC +/* GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_PMU +/* GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_RCU +/* GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 */ +#define RTE_DEVICE_STDPERIPHERALS_USART + + +#endif /* RTE_COMPONENTS_H */ diff --git a/Robot_V2/Robot_V2.cproject.yml b/Robot_V2/Robot_V2.cproject.yml new file mode 100644 index 0000000..2f4b28b --- /dev/null +++ b/Robot_V2/Robot_V2.cproject.yml @@ -0,0 +1,62 @@ +project: + groups: + - group: Source Files + files: + - file: main.h + - file: main.cpp + - group: sys + files: + - file: sys/systick.cpp + - file: sys/systick.h + - file: sys/initial.cpp + - file: sys/initial.h + - file: sys/flash.h + - file: sys/flash.cpp + - file: sys/OTA.h + - file: sys/OTA.cpp + - file: sys/config.h + - group: device + files: + - file: device/Can.cpp + - file: device/Can.h + components: + - component: ARM::CMSIS:CORE + - component: Device:Startup + - component: Device:GD32C10x_StdPeripherals:CAN + - component: Device:GD32C10x_StdPeripherals:DMA + - component: Device:GD32C10x_StdPeripherals:EXTI + - component: Device:GD32C10x_StdPeripherals:FMC + - component: Device:GD32C10x_StdPeripherals:GPIO + - component: Device:GD32C10x_StdPeripherals:MISC + - component: Device:GD32C10x_StdPeripherals:PMU + - component: Device:GD32C10x_StdPeripherals:RCU + - component: Device:GD32C10x_StdPeripherals:USART + - component: Device:GD32C10x_libopt + - component: Device:GD32C10x_StdPeripherals:DBG + - component: Device:EVAL:GD32C10x + - component: Device:GD32C10x_StdPeripherals:FWDGT + - component: Device:GD32C10x_StdPeripherals:BKP + - component: Device:GD32C10x_StdPeripherals:CRC + output: + type: + - elf + - hex + - map + packs: + - pack: ARM::CMSIS + - pack: GigaDevice::GD32C10x_DFP + misc: + - for-compiler: AC6 + C-CPP: + - -fshort-enums + - -fshort-wchar + - -D__MICROLIB + - -Wno-register + C: + - -D__packed=packed + ASM: + - -D__packed=packed + - -D__MICROLIB + Link: + - --library_type=microlib + - --entry=Reset_Handler diff --git a/Robot_V2/device/ADC.cpp b/Robot_V2/device/ADC.cpp new file mode 100644 index 0000000..afa3e72 --- /dev/null +++ b/Robot_V2/device/ADC.cpp @@ -0,0 +1,274 @@ +#include "adc.h" +#include "Can.h" +#include "DengFOC.h" +#include "Filter.h" +#include "math.h" +#include +#include +#include +#include "systick.h" + +constexpr float ERROR_ADC_VAL = 255.0f; +constexpr float ADC_SCALE = 3.3f / 4096.0f; +constexpr float TEMP_FACTOR = 1000.0f / 4.3f; +constexpr float VCC_FACTOR = 11.0f; +constexpr float CURRENT_OFFSET = -1.60f; +constexpr float CURRENT_FACTOR = + 1.0f / 50.0f * 100.0f; // 50倍放大,100倍电流采样电阻, 单位mA +constexpr float MAX_TEMP = 150.0f; +constexpr float MIN_TEMP = -40.0f; +constexpr float MAX_CURRENT = 40.0f; +constexpr float MIN_CURRENT = -40.0f; +constexpr float MAX_VCC = 65.0f; +constexpr float MIN_VCC = -0.1f; +extern CAN_transmiter CAN0_transmiter; +extern FOC_Controlroller FOC; +sampler sampler; // 采样器初始化 +u16 adc_value[6] = {0}; // 显式初始化数组元素为0 +/*! + \brief configure the DMA peripheral + \param[in] none + \param[out] none + \retval none +*/ +void dma_config(void) { + /* enable DMA0 clock */ + rcu_periph_clock_enable(RCU_DMA0); + /* ADC_DMA_channel configuration */ + dma_parameter_struct dma_data_parameter; + + /* ADC DMA_channel configuration */ + dma_deinit(DMA0, DMA_CH0); + + /* initialize DMA single data mode */ + dma_data_parameter.periph_addr = (uint32_t)(&ADC_RDATA(ADC0)); + dma_data_parameter.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_data_parameter.memory_addr = (uint32_t)(adc_value); + dma_data_parameter.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_data_parameter.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_data_parameter.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_data_parameter.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_data_parameter.number = 6; + dma_data_parameter.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH0, &dma_data_parameter); + + dma_circulation_enable(DMA0, DMA_CH0); + + /* enable DMA channel */ + dma_channel_enable(DMA0, DMA_CH0); +} + +/*! + \brief configure the ADC peripheral + \param[in] none + \param[out] none + \retval none +*/ +void adc_config(void) { + /* enable ADC clock */ + rcu_periph_clock_enable(RCU_ADC0); + /* config ADC clock */ + rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV4); + + /* 复位ADC */ + adc_deinit(ADC0); + /* ADC模式配置 */ + adc_mode_config(ADC_MODE_FREE); + /* 使能ADC连续转换功能 */ + adc_special_function_config(ADC0, ADC_CONTINUOUS_MODE, ENABLE); + /* 使能ADC扫描模式 */ + adc_special_function_config(ADC0, ADC_SCAN_MODE, ENABLE); + /* ADC数据右对齐配置 */ + adc_data_alignment_config(ADC0, ADC_DATAALIGN_RIGHT); + /* 使能ADC温度传感器和内部参考电压 */ + adc_tempsensor_vrefint_enable(); + + /* 配置ADC通道长度 */ + adc_channel_length_config(ADC0, ADC_REGULAR_CHANNEL, 6); + /* 配置ADC规则通道 */ + adc_regular_channel_config(ADC0, 0, ADC_CHANNEL_16, + ADC_SAMPLETIME_239POINT5); + adc_regular_channel_config(ADC0, 1, ADC_CHANNEL_9, ADC_SAMPLETIME_28POINT5); + adc_regular_channel_config(ADC0, 2, ADC_CHANNEL_3, ADC_SAMPLETIME_28POINT5); + adc_regular_channel_config(ADC0, 3, ADC_CHANNEL_4, ADC_SAMPLETIME_28POINT5); + adc_regular_channel_config(ADC0, 4, ADC_CHANNEL_5, ADC_SAMPLETIME_28POINT5); + adc_regular_channel_config(ADC0, 5, ADC_CHANNEL_6, ADC_SAMPLETIME_28POINT5); + + /* ADC触发配置 */ + adc_external_trigger_source_config(ADC0, ADC_REGULAR_CHANNEL, + ADC0_1_EXTTRIG_REGULAR_NONE); + adc_external_trigger_config(ADC0, ADC_REGULAR_CHANNEL, ENABLE); + + /* 使能ADC接口 */ + adc_enable(ADC0); + /* ADC校准 */ + adc_calibration_enable(ADC0); + /* 使能ADC DMA功能 */ + adc_dma_mode_enable(ADC0); + /* 使能ADC软件触发 */ + adc_software_trigger_enable(ADC0, ADC_REGULAR_CHANNEL); +} +/** + * @brief 采样类初始化 + */ +u8 sampler::init() { + dma_config(); // DMA采样ADC初始化 + adc_config(); // ADC初始化 + delay_1ms(1); + // 初始采样 + for (int i = 0; i < FILTER_SIZE + 1; i++) { + mcu_temp_samples[i] = + (1.43f - adc_value[0] * ADC_SCALE) * TEMP_FACTOR + 35.0f; + + currU_samples[i] = + (adc_value[2] * ADC_SCALE + CURRENT_OFFSET) * CURRENT_FACTOR; + currV_samples[i] = + (adc_value[3] * ADC_SCALE + CURRENT_OFFSET) * CURRENT_FACTOR; + currW_samples[i] = + (adc_value[4] * ADC_SCALE + CURRENT_OFFSET) * CURRENT_FACTOR; + + vbus_samples[i] = adc_value[5] * ADC_SCALE * VCC_FACTOR; + + float R_now = (float)adc_value[1] / (4096 - (float)adc_value[1]) * 4700; + drv_temp_samples[i] = + 1.0f / (0.00335f + 0.00025f * log(R_now / 10000.0f)) - 273.15f; + delay_1ms(1); + } + return 0; +} +/** + * @brief 获取MCU温度 + * @return float + * 温度值,单位为摄氏度,范围应在-40到145之间,如果读取失败则返回0.0f + */ +float sampler::get_mcu_temp() { + tempora_sample = medium_filter(mcu_temp_samples, FILTER_SIZE + 1); + // 检查温度读数是否在有效范围内 + if (tempora_sample < MIN_TEMP or tempora_sample > MAX_TEMP) { + return ERROR_ADC_VAL; + } + return tempora_sample; +} + +/** + * @brief 获取电机驱动温度 + * @return float 温度值,单位为摄氏度 + * + * 通过热敏电阻分压电路计算温度值,使用Steinhart-Hart方程进行温度转换。 + * 如果计算结果超出有效范围(-40到255摄氏度),则重新采样计算。 + */ +float sampler::get_drv_temp() { + tempora_sample = medium_filter(drv_temp_samples, FILTER_SIZE + 1); + // 检查温度读数是否在有效范围内 + if (tempora_sample < MIN_TEMP || tempora_sample > MAX_TEMP) { + return ERROR_ADC_VAL; + } + return tempora_sample; +} + +/** + * @brief 获取电流值 + * @param type 电流类型,'U'表示U相电流,'V'表示V相电流,'W'表示W相电流 + * @return float 电流值,单位为安培 + * + * 通过ADC采样计算各相电流值 + */ +float sampler::get_current(char type) { + switch (type) { + case 'U': { + // return currU_samples[current_sample_index]; + tempora_sample = medium_filter(currU_samples, FILTER_SIZE + 1); + break; + } + case 'V': { + // return currV_samples[current_sample_index]; + tempora_sample = medium_filter(currV_samples, FILTER_SIZE + 1); + break; + } + case 'W': { + // return currW_samples[current_sample_index]; + tempora_sample = medium_filter(currW_samples, FILTER_SIZE + 1); + break; + } + default: { + return ERROR_ADC_VAL; + } + } + if (tempora_sample < MIN_CURRENT or tempora_sample > MAX_CURRENT) { + return ERROR_ADC_VAL; + } + + return tempora_sample; +} + +/** + * @brief 获取供电电压 + * @return float 电压值,单位为伏特 + * + * 通过ADC采样计算供电电压值,使用迭代方式确保获取有效的电压读数。 + * 如果计算结果超出有效范围(-40到255伏特),则重新采样计算。 + */ +float sampler::get_vbus_voltage() { + tempora_sample = medium_filter(vbus_samples, FILTER_SIZE + 1); + // 检查电压读数是否在有效范围内 + if (vbus_samples[FILTER_SIZE / 2] > MAX_VCC or + vbus_samples[FILTER_SIZE / 2] < MIN_VCC) { + return ERROR_ADC_VAL; + } + return tempora_sample; +} + +/** + * @brief 更新MCU温度 + * + * 通过ADC采样计算MCU温度值,使用Steinhart-Hart方程进行温度转换。 + * 如果计算结果超出有效范围(-40到255摄氏度),则重新采样计算。 + */ +void sampler::update_mcu_temp() { + memmove(mcu_temp_samples, mcu_temp_samples + 1, + FILTER_SIZE * sizeof(float)); + mcu_temp_samples[FILTER_SIZE] = + (1.43f - adc_value[0] * ADC_SCALE) * TEMP_FACTOR + 35.0f; +} + +/** + * @brief 更新MCU温度 + */ +void sampler::update_drv_temp() { + memmove(drv_temp_samples, drv_temp_samples + 1, + FILTER_SIZE * sizeof(float)); + float R_now = (float)adc_value[1] / (4096 - (float)adc_value[1]) * 4700; + drv_temp_samples[FILTER_SIZE] = + 1.0f / (0.00335f + 0.00025f * log(R_now / 10000.0f)) - 273.15f; +} + +/** + * @brief 更新相电流 + */ +void sampler::update_current() { + u8 idx = current_sample_index; + extern FOC_Controlroller FOC; + // 优化计算 + const float scale = ADC_SCALE * CURRENT_FACTOR; + const float offset = CURRENT_OFFSET * CURRENT_FACTOR; + + currU_samples[idx] = adc_value[2] * scale + offset; + currV_samples[idx] = adc_value[3] * scale + offset; + currW_samples[idx] = adc_value[4] * scale + offset; + + // 更新索引 + current_sample_index++; + if (current_sample_index >= FILTER_SIZE - 1) { + current_sample_index = 0; + } + // 卡尔曼滤波更新 + float voltage = FOC.voltage_power_supply; +} + +/** + * @brief 更新供电电压 + */ +void sampler::update_vbus_voltage() { + memmove(vbus_samples, vbus_samples + 1, FILTER_SIZE * sizeof(float)); + vbus_samples[FILTER_SIZE] = adc_value[5] * ADC_SCALE * VCC_FACTOR; +} \ No newline at end of file diff --git a/Robot_V2/device/Can.cpp b/Robot_V2/device/Can.cpp new file mode 100644 index 0000000..a96e089 --- /dev/null +++ b/Robot_V2/device/Can.cpp @@ -0,0 +1,697 @@ +#include "Can.h" +#include "flash.h" +#include "gd32c10x.h" +#include "gd32c10x_can.h" +#include "gd32c10x_dma.h" +#include "gd32c10x_gpio.h" +#include "systick.h" +#include +#include +#include +#include +#include +#include +#include + +constexpr u16 CANX = CAN0; +constexpr u16 DEV_CAN0_ID = 0x0000; +constexpr u16 DEV_CAN0_MASK = 0x0000; +constexpr u16 DEV_CAN_LOOPBACK_ID = 0x0000; +constexpr float ANGLE_FACTOR = 25.0f / 360.0f * 2.0f * 3.14159265358979323846f; + +CAN_transmiter CAN0_transmiter; // CAN初始化 +extern FlashEEPROM flashEEP; + +// 添加DMA相关变量 +dma_parameter_struct dma_rx_parameter; +dma_parameter_struct dma_tx_parameter; +uint8_t can_rx_buffer[8]; // CAN接收缓冲区 +uint8_t can_tx_buffer[8]; // CAN发送缓冲区 + +/*! + \brief initialize CAN GPIO + \param[in] none + \param[out] none + \retval ErrStatus: SUCCESS or ERROR +*/ +u8 can_gpio_init() { + /* enable CAN clock */ + rcu_periph_clock_enable(RCU_CAN0); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_AF); + + /* configure CAN0 GPIO */ + gpio_init(GPIOB, GPIO_MODE_IPU, GPIO_OSPEED_50MHZ, GPIO_PIN_8); // rx + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_9); // tx + gpio_pin_remap_config(GPIO_CAN0_PARTIAL_REMAP, ENABLE); + /* enable the EN GPIO clock */ + gpio_init(GPIOB, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_13); + gpio_bit_reset(GPIOB, GPIO_PIN_13); + return 0; +} + +/*! + \brief 初始化CAN DMA + \param[in] none + \param[out] none + \retval none +*/ +void can_dma_init(void) { + // 使能DMA时钟 + rcu_periph_clock_enable(RCU_DMA0); + + // 配置接收DMA + dma_struct_para_init(&dma_rx_parameter); + dma_rx_parameter.periph_addr = + (uint32_t)(&CAN_RFIFOMDATA0(CAN0, CAN_FIFO0)); // CAN接收数据寄存器地址 + dma_rx_parameter.memory_addr = (uint32_t)can_rx_buffer; // 接收缓冲区地址 + dma_rx_parameter.direction = DMA_PERIPHERAL_TO_MEMORY; // 外设到内存 + dma_rx_parameter.memory_width = DMA_MEMORY_WIDTH_8BIT; // 内存宽度8位 + dma_rx_parameter.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; // 外设宽度8位 + dma_rx_parameter.priority = DMA_PRIORITY_HIGH; // 高优先级 + dma_rx_parameter.number = 8; // 传输字节数 + dma_rx_parameter.periph_inc = DMA_PERIPH_INCREASE_DISABLE; // 外设地址不递增 + dma_rx_parameter.memory_inc = DMA_MEMORY_INCREASE_ENABLE; // 内存地址递增 + dma_init(DMA0, DMA_CH4, &dma_rx_parameter); // 使用DMA通道4 + + // 配置发送DMA + dma_struct_para_init(&dma_tx_parameter); + dma_tx_parameter.periph_addr = + (uint32_t)(&CAN_TMI0(CAN0)); // CAN发送数据寄存器地址 + dma_tx_parameter.memory_addr = (uint32_t)can_tx_buffer; // 发送缓冲区地址 + dma_tx_parameter.direction = DMA_MEMORY_TO_PERIPHERAL; // 内存到外设 + dma_tx_parameter.memory_width = DMA_MEMORY_WIDTH_8BIT; // 内存宽度8位 + dma_tx_parameter.periph_width = DMA_PERIPHERAL_WIDTH_8BIT; // 外设宽度8位 + dma_tx_parameter.priority = DMA_PRIORITY_HIGH; // 高优先级 + dma_tx_parameter.number = 8; // 传输字节数 + dma_tx_parameter.periph_inc = DMA_PERIPH_INCREASE_DISABLE; // 外设地址不递增 + dma_tx_parameter.memory_inc = DMA_MEMORY_INCREASE_ENABLE; // 内存地址递增 + dma_init(DMA0, DMA_CH5, &dma_tx_parameter); // 使用DMA通道5 + + // 使能DMA通道 + dma_channel_enable(DMA0, DMA_CH4); + dma_channel_enable(DMA0, DMA_CH5); + + // 使能CAN接收DMA + // can_dma_enable(CAN0, CAN_DMA_RECEIVE); +} + +/*! + \brief 初始化CAN0 2.0B 模式 + \param[in] none + \param[out] none + \retval none +*/ +void can_config(void) { + can_gpio_init(); + can_dma_init(); // 初始化DMA + can_parameter_struct can_parameter; + can_filter_parameter_struct can_filter; + + can_struct_para_init(CAN_INIT_STRUCT, &can_parameter); + /* initialize CAN register */ + can_deinit(CAN0); + + /* initialize CAN parameters */ + can_parameter.time_triggered = DISABLE; + can_parameter.auto_bus_off_recovery = DISABLE; + can_parameter.auto_wake_up = DISABLE; + can_parameter.auto_retrans = DISABLE; + can_parameter.rec_fifo_overwrite = DISABLE; + can_parameter.trans_fifo_order = DISABLE; + can_parameter.working_mode = CAN_NORMAL_MODE; + /* configure CAN0 baud rate 1MBps, sample point at 80% */ + can_parameter.resync_jump_width = CAN_BT_SJW_1TQ; + can_parameter.time_segment_1 = CAN_BT_BS1_7TQ; + can_parameter.time_segment_2 = CAN_BT_BS2_2TQ; + can_parameter.prescaler = 6; + /* initialize CAN */ + if (can_init(CAN0, &can_parameter) != SUCCESS) { + while (1) + printf("can init error \r\n"); + } + + /* initialize filter */ + /* configure filter mode */ + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + /* configure filter mask */ + can_filter.filter_mask_high = 0x0000; + can_filter.filter_mask_low = 0x0000; + /* select receiver fifo */ + can_filter.filter_fifo_number = CAN_FIFO0; + can_filter.filter_enable = ENABLE; + /* configure filter number */ + can_filter.filter_number = 0; + can_filter_init(&can_filter); + + /* configure CAN0 NVIC */ + nvic_irq_enable(CAN0_RX0_IRQn, 1, 0); + /* enable can receive FIFO0 not empty interrupt */ + can_interrupt_enable(CAN0, CAN_INTEN_RFNEIE0); + + // 使能DMA中断 + nvic_irq_enable(DMA0_Channel4_IRQn, 1, 1); + dma_interrupt_enable(DMA0, DMA_CH4, DMA_INT_FTF); +} + +/*! + \brief 初始化CAN0 CANFD模式 + \param[in] none + \param[out] none + \retval none +*/ +void canfd_config(void) { + can_gpio_init(); + can_parameter_struct can_parameter; + can_fdframe_struct can_fd_parameter; + can_fd_tdc_struct can_fd_tdc_parameter; + can_filter_parameter_struct can_filter; + + /* initialize CAN register */ + can_deinit(CAN0); + + /* initialize CAN */ + can_parameter.time_triggered = DISABLE; + can_parameter.auto_bus_off_recovery = DISABLE; + can_parameter.auto_wake_up = DISABLE; + can_parameter.auto_retrans = ENABLE; + can_parameter.rec_fifo_overwrite = ENABLE; + can_parameter.trans_fifo_order = ENABLE; + can_parameter.working_mode = CAN_NORMAL_MODE; + /* baudrate 1Mbps, sample piont at 80% */ + can_parameter.resync_jump_width = CAN_BT_SJW_1TQ; + can_parameter.time_segment_1 = CAN_BT_BS1_7TQ; + can_parameter.time_segment_2 = CAN_BT_BS2_2TQ; + can_parameter.prescaler = 6; + can_init(CAN0, &can_parameter); + + can_struct_para_init(CAN_FD_FRAME_STRUCT, &can_fd_parameter); + can_fd_parameter.fd_frame = ENABLE; + can_fd_parameter.excp_event_detect = ENABLE; + can_fd_parameter.delay_compensation = ENABLE; + can_fd_tdc_parameter.tdc_filter = 0x04; + can_fd_tdc_parameter.tdc_mode = CAN_TDCMOD_CALC_AND_OFFSET; + can_fd_tdc_parameter.tdc_offset = 0x04; + can_fd_parameter.p_delay_compensation = &can_fd_tdc_parameter; + can_fd_parameter.iso_bosch = CAN_FDMOD_ISO; + can_fd_parameter.esi_mode = CAN_ESIMOD_HARDWARE; + /* FD mode data baudrate 2Mbps, sample piont at 80% */ + can_fd_parameter.data_resync_jump_width = CAN_BT_SJW_1TQ; + can_fd_parameter.data_time_segment_1 = CAN_BT_BS1_3TQ; + can_fd_parameter.data_time_segment_2 = CAN_BT_BS2_1TQ; + /* CAN-FD data segement prescaler should be the same as non-data segement + * prescaler */ + can_fd_parameter.data_prescaler = 6; + can_fd_init(CAN0, &can_fd_parameter); + + /* initialize filter */ + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + /* configure filter ID */ + can_filter.filter_list_high = 0x0000; + can_filter.filter_list_low = 0x0000; + /* configure filter mask */ + can_filter.filter_mask_high = 0x0000; + can_filter.filter_mask_low = 0x0000; + /* select receiver fifo */ + can_filter.filter_fifo_number = CAN_FIFO0; + can_filter.filter_enable = ENABLE; + /* configure filter number */ + can_filter.filter_number = 0; + can_filter_init(&can_filter); + + /* configure CAN0 NVIC */ + nvic_irq_enable(CAN0_RX0_IRQn, 1, 0); + /* enable can receive FIFO0 not empty interrupt */ + can_interrupt_enable(CAN0, CAN_INTEN_RFNEIE0); +} + +/*! + \brief 初始化CAN0回环测试 + \param[in] none + \param[out] none + \retval none +*/ +void can_loopback_init(void) { + can_gpio_init(); + can_parameter_struct can_parameter; + can_filter_parameter_struct can_filter; + /* initialize CAN register */ + can_deinit(CANX); + + /* initialize CAN */ + can_parameter.time_triggered = DISABLE; + can_parameter.auto_bus_off_recovery = DISABLE; + can_parameter.auto_wake_up = DISABLE; + can_parameter.auto_retrans = DISABLE; + can_parameter.rec_fifo_overwrite = DISABLE; + can_parameter.trans_fifo_order = DISABLE; + can_parameter.working_mode = CAN_NORMAL_MODE; + /* baudrate 1Mbps, sample piont at 80% */ + can_parameter.resync_jump_width = CAN_BT_SJW_1TQ; + can_parameter.time_segment_1 = CAN_BT_BS1_7TQ; + can_parameter.time_segment_2 = CAN_BT_BS2_2TQ; + can_parameter.prescaler = 6; + if (can_init(CANX, &can_parameter) != SUCCESS) { + u16 i = 200; + while (--i > 0) { + delay_1ms(10); + printf("can init error \r\n"); + } + system_soft_reset(); + } + + /* initialize filter */ + /* configure filter mode */ + can_filter.filter_mode = CAN_FILTERMODE_MASK; + can_filter.filter_bits = CAN_FILTERBITS_32BIT; + /* configure filter ID */ + can_filter.filter_list_high = (uint16_t)(DEV_CAN_LOOPBACK_ID >> 13U); + can_filter.filter_list_low = + ((uint16_t)(DEV_CAN_LOOPBACK_ID)) << 3U | (1U << 2); + /* configure filter mask */ + can_filter.filter_mask_high = 0x0000; + can_filter.filter_mask_low = 0x0000; + /* select receiver fifo */ + can_filter.filter_fifo_number = CAN_FIFO0; + can_filter.filter_enable = ENABLE; + /* configure filter number */ + can_filter.filter_number = 0; + can_filter_init(&can_filter); +} + +/*! + \brief CAN0 FD回环测试 + \param[in] none + \param[out] none + \retval ErrStatus +*/ +void canfd_loopback_test(void) { + can_trasnmit_message_struct transmit_message; + can_receive_message_struct receive_message; + uint32_t timeout = 0xFFFF; + uint8_t transmit_mailbox = 0; + + std::mt19937 gen; + std::uniform_int_distribution dis(0, 255); + + can_struct_para_init(CAN_FD_FRAME_STRUCT, &transmit_message); + transmit_message.tx_sfid = DEV_CAN_LOOPBACK_ID; + transmit_message.tx_efid = 0x00; + transmit_message.tx_ft = CAN_FT_DATA; + transmit_message.tx_ff = CAN_FF_EXTENDED; + transmit_message.tx_dlen = 7; + transmit_message.fd_flag = 1; + transmit_message.fd_brs = 1; + transmit_message.fd_esi = 0; + + int i = 0; + while (i++ < transmit_message.tx_dlen) { + transmit_message.tx_data[i] = dis(gen); + std::printf("%x\n", transmit_message.tx_data[i]); + } + + /* transmit message */ + transmit_mailbox = can_message_transmit(CAN0, &transmit_message); + /* waiting for transmit completed */ + while ((CAN_TRANSMIT_OK != can_transmit_states(CAN0, transmit_mailbox)) && + (0 != timeout)) { + timeout--; + } + timeout = 0xFFFF; + /* waiting for receive completed */ + while ((can_receive_message_length_get(CAN0, CAN_FIFO0) < 1) && + (0 != timeout)) { + timeout--; + } + can_struct_para_init(CAN_RX_MESSAGE_STRUCT, &receive_message); + can_message_receive(CAN0, CAN_FIFO0, &receive_message); + + /* check the receive message */ + if ((transmit_message.tx_sfid == receive_message.rx_sfid) && + (transmit_message.tx_ff == receive_message.rx_ff) && + (transmit_message.tx_dlen == receive_message.rx_dlen)) { + /* loopback test is success */ + std::printf("CAN LO0PBACK SUCCESS\r\n"); + } else { + /* loopback test is failed */ + std::printf("CAN LO0PBACK FAIL\r\n"); + } +} + +/** + \brief CAN0 回环测试 + \param[in] none + \param[out] none + \retval none +*/ +void can_loopback_test(void) { + can_trasnmit_message_struct transmit_message; + can_receive_message_struct receive_message; + uint32_t timeout = 0xFF; + uint8_t transmit_mailbox = 0; + + std::mt19937 gen(rand()); // 使用随机设备生成的种子 + std::uniform_int_distribution dis(0, 0xff); + + can_struct_para_init(CAN_TX_MESSAGE_STRUCT, &transmit_message); + /* initialize transmit message */ + transmit_message.tx_sfid = DEV_CAN_LOOPBACK_ID; + transmit_message.tx_ft = CAN_FT_DATA; + transmit_message.tx_ff = CAN_FF_STANDARD; + transmit_message.tx_dlen = 7; + int i = 0; + while (i++ < transmit_message.tx_dlen) { + // transmit_message.tx_data[i] = dis(gen); + transmit_message.tx_data[i] = i; + } + /* transmit message */ + transmit_mailbox = can_message_transmit(CANX, &transmit_message); + /* waiting for transmit completed */ + while ((CAN_TRANSMIT_OK != can_transmit_states(CANX, transmit_mailbox)) && + (0 != timeout)) { + printf("sending:%x...\n", can_transmit_states(CANX, transmit_mailbox)); + timeout--; + } + timeout = 0xFF; + /* waiting for receive completed */ + while ((can_receive_message_length_get(CANX, CAN_FIFO0) < 1) && + (0 != timeout)) { + timeout--; + } + can_struct_para_init(CAN_RX_MESSAGE_STRUCT, &receive_message); + can_message_receive(CANX, CAN_FIFO0, &receive_message); + /* check the receive message */ + if ((DEV_CAN_LOOPBACK_ID == receive_message.rx_sfid) && + (CAN_FF_STANDARD == receive_message.rx_ff) && + (transmit_message.tx_dlen == receive_message.rx_dlen)) { + i = transmit_message.tx_dlen; + while (i-- > 0) { + std::printf("rx %d:%x:%x\n", i, transmit_message.tx_data[i], + receive_message.rx_data[i]); + } + if (std::memcmp(receive_message.rx_data, transmit_message.tx_data, + transmit_message.tx_dlen) == 0) { + /* loopback test is success */ + std::printf("loopback success\n"); + } else { + std::printf("loopback failed\n"); + } + } else { + /* loopback test is failed */ + std::printf("loopback failed\n"); + } +} + +/*! + \brief CAN_transmiter构造函数 + \note 初始化CAN通信相关参数和硬件配置 +*/ +u8 CAN_transmiter::init() { + // 初始化CAN硬件 + // can_config(); + canfd_config(); + + // 初始化发送消息结构体 + can_struct_para_init(CAN_TX_MESSAGE_STRUCT, &transmit_message); + /* initialize receive message */ + can_struct_para_init(CAN_RX_MESSAGE_STRUCT, &receive_message); + + // 初始化DMA缓冲区 + memset(can_rx_buffer, 0, sizeof(can_rx_buffer)); + memset(can_tx_buffer, 0, sizeof(can_tx_buffer)); + return 0; +} + +/*! + \brief CAN 数据发送 + \param id CAN ID + \param length 数据长度 + \param data 数据 +*/ +u8 CAN_transmiter::CAN_Send(u32 id, u8 length, u8 *data) { + // 检查数据长度是否符合CAN规范 + if (length > 8) { + printf("CAN data length exceeds maximum of 8 bytes\r\n"); + return 0; + } + + // 检查数据指针是否有效 + if (data == nullptr) { + printf("Invalid data pointer\r\n"); + return 0; + } + + /* 配置发送消息参数 */ + transmit_message.tx_ft = CAN_FT_DATA; // 数据帧 + transmit_message.tx_ff = CAN_FF_STANDARD; // 标准帧格式 + transmit_message.tx_sfid = id; // 设置帧ID + transmit_message.tx_dlen = length; // 设置数据长度 + + // 复制数据到发送缓冲区 + for (int i = 0; i < length && i < 8; i++) { + transmit_message.tx_data[i] = *(data + i); + } + + // 将数据复制到DMA缓冲区 + memcpy(can_tx_buffer, data, length); + + // 配置DMA发送参数 + dma_tx_parameter.number = length; + dma_init(DMA0, DMA_CH5, &dma_tx_parameter); + + // 启动DMA传输 + dma_channel_enable(DMA0, DMA_CH5); + + // 自动选择空闲mailbox发送消息,不需要人为指定 + transmit_mailbox = can_message_transmit(CAN0, &transmit_message); + + // 检查是否成功获取mailbox + if (CAN_NOMAILBOX == transmit_mailbox) { + // 没有可用的mailbox,可能所有mailbox都在使用中 + printf("No available mailbox for CAN transmission\r\n"); + return 0; + } + return 1; +} + +/*! + \brief CANFD 数据发送 + \param id CAN消息ID + \param length CAN消息长度 + \param data CAN消息数据 +*/ +u8 CAN_transmiter::CANFD_Send(u32 id, u8 length, u8 *data) { + // 检查CANFD模式是否启用 + if (!(CAN_CTL(CAN0) & CAN_CTL_DFZ)) { + printf("CANFD mode not enabled\r\n"); + return 0; + } + + // 检查数据指针是否有效 + if (data == nullptr) { + printf("Invalid data pointer\r\n"); + return 0; + } + + // 检查数据长度是否符合CANFD规范 + if (length > 64) { + printf("CANFD data length exceeds maximum of 64 bytes\r\n"); + return 0; + } + + /* 配置发送消息参数 */ + transmit_message.tx_ft = CAN_FT_DATA; // 数据帧 + transmit_message.tx_ff = CAN_FF_EXTENDED; // 扩展帧格式 + // transmit_message.tx_sfid = id; // 设置帧ID + transmit_message.tx_efid = id; // 扩展帧ID + transmit_message.tx_dlen = length; // 设置数据长度 + + // 设置CANFD特定参数 + transmit_message.fd_flag = CAN_FDF_FDFRAME; // CANFD帧格式 + transmit_message.fd_brs = ENABLE; // 使能比特率切换 + transmit_message.fd_esi = DISABLE; // 错误状态指示 + + // 复制数据到发送缓冲区 + for (int i = 0; i < length && i < 64; i++) { + transmit_message.tx_data[i] = *(data + i); + } + + // 将数据复制到DMA缓冲区 + memcpy(can_tx_buffer, data, length); + + // 配置DMA发送参数 + dma_tx_parameter.number = length; + dma_init(DMA0, DMA_CH5, &dma_tx_parameter); + + // 启动DMA传输 + dma_channel_enable(DMA0, DMA_CH5); + + // 自动选择空闲mailbox发送消息,不需要人为指定 + transmit_mailbox = can_message_transmit(CAN0, &transmit_message); + + // 检查是否成功获取mailbox + if (CAN_NOMAILBOX == transmit_mailbox) { + static u32 count = 0; + // 没有可用的mailbox,可能所有mailbox都在使用中 + count++; + // printf("No available mailbox for CANFD transmission\r\n"); + if (count > 0xff and !is_sleep) { + printf("No available mailbox for CANFD transmission\r\n"); + init(); + count = 0; + } + return 0; + } + return 1; +} + +/** + * @brief CANFD发送函数 + * @retval 0: 发送失败 + * 1: 发送成功 + */ +u8 CAN_transmiter::CANFD_all_Send() { + u32 success_flag = 0; + + constexpr u32 STATUS_ID = 0x00010100; + constexpr u32 CONFIG_ID = 0x00010101; + + // 打包status数据 - 只清零实际使用的32字节 + memset(transmit_data, 0, 32); + + success_flag += CANFD_Send(STATUS_ID, 32, transmit_data); + + return success_flag; +} + +/** + * @brief CAN通信检查函数 + * @retval 0: 无新消息 + * 1: 有新消息 + */ +void CAN_transmiter::communication_check() { + // CAN0 发送数据标志 + if (SET == can0_send_flag) { + // printf("\r\n can0 %X receive data:", receive_message.rx_efid); + // CAN0_transmiter.CAN_all_Send(); + CANFD_all_Send(); + can0_send_flag = RESET; + } + + // CAN0 接收数据标志 + if (SET == can0_receive_flag) { + // printf("\r\n can0 %X receive data:", receive_message.rx_efid); + // for (i = 0; i < receive_message.rx_dlen; i++) { + // printf(" %02x", receive_message.rx_data[i]); + // } + if (receive_message.rx_efid == 0x00010200) { + ; + } else if (receive_message.rx_efid == 0x00010301) { + ; + } else { + printf("Unknown CAN ID: %X\n", receive_message.rx_efid); + } + can0_receive_flag = RESET; + } +} + +u8 CAN_transmiter::sendACK(u32 CANFD_OTA_ACK_ID, u32 packet_num) { + u32_union_t pack_data; + pack_data.u = packet_num; + memset(transmit_data, 0, 4); + pack_u32_to_bytes(transmit_data, 3, pack_data); + + return CANFD_Send(CANFD_OTA_ACK_ID, 4, transmit_data); +} + +/** + * @brief CAN睡眠 + * @param None + * @retval None + */ +u8 CAN_transmiter::CAN_Sleep() { + gpio_bit_set(GPIOB, GPIO_PIN_13); + is_sleep = true; + return 0; +} + +/** + * @brief CAN唤醒 + * @param None + * @retval None + */ +u8 CAN_transmiter::CAN_Wakeup() { + printf("can wake\r\n"); + is_sleep = false; + canfd_config(); + + return 0; +} + +/** + * @brief CAN0中断服务程序 + * @retval 无 + */ +void CAN0_RX0_IRQHandler(void) { + // 检查是否是FIFO0消息挂起中断 + if (can_interrupt_flag_get(CAN0, CAN_INT_FLAG_RFL0) != RESET) { + // 清除中断标志 + can_interrupt_flag_clear(CAN0, CAN_INT_FLAG_RFL0); + + // 使用DMA读取接收到的数据 + dma_channel_disable(DMA0, DMA_CH4); + dma_rx_parameter.number = + can_receive_message_length_get(CAN0, CAN_FIFO0); + dma_init(DMA0, DMA_CH4, &dma_rx_parameter); + dma_channel_enable(DMA0, DMA_CH4); + + // 读取接收到的数据 + can_message_receive(CAN0, CAN_FIFO0, &CAN0_transmiter.receive_message); + + // 接收标志位置1 + CAN0_transmiter.can0_receive_flag = SET; + } + + // 检查其他可能的中断源 + if (can_interrupt_flag_get(CAN0, CAN_INT_FLAG_RFF0) != RESET) { + // FIFO0满中断 + can_interrupt_flag_clear(CAN0, CAN_INT_FLAG_RFF0); + printf("CAN FIFO0 full\n"); + } + + if (can_interrupt_flag_get(CAN0, CAN_INT_FLAG_RFO0) != RESET) { + // FIFO0溢出中断 + can_interrupt_flag_clear(CAN0, CAN_INT_FLAG_RFO0); + printf("CAN FIFO0 overflow\n"); + } +} + +/** + * @brief DMA通道4中断服务程序(CAN接收DMA) + * @retval 无 + */ +void DMA0_Channel4_IRQHandler(void) { + if (dma_interrupt_flag_get(DMA0, DMA_CH4, DMA_INT_FLAG_FTF)) { + // 清除DMA传输完成中断标志 + dma_interrupt_flag_clear(DMA0, DMA_CH4, DMA_INT_FLAG_G); + + // 将DMA缓冲区的数据复制到接收消息结构体 + for (int i = 0; i < CAN0_transmiter.receive_message.rx_dlen && i < 8; + i++) { + CAN0_transmiter.receive_message.rx_data[i] = can_rx_buffer[i]; + } + } +} + +/** + * @brief DMA通道5中断服务程序(CAN/CANFD发送DMA) + * @retval 无 + */ +void DMA0_Channel5_IRQHandler(void) { + if (dma_interrupt_flag_get(DMA0, DMA_CH5, DMA_INT_FLAG_FTF)) { + // 清除DMA传输完成中断标志 + dma_interrupt_flag_clear(DMA0, DMA_CH5, DMA_INT_FLAG_G); + } +} diff --git a/Robot_V2/device/Can.h b/Robot_V2/device/Can.h new file mode 100644 index 0000000..f5a7f65 --- /dev/null +++ b/Robot_V2/device/Can.h @@ -0,0 +1,109 @@ +#ifndef _CAN_H +#define _CAN_H + +#include +#ifdef __cplusplus +extern "C" { +#endif + +#include "gd32c10x_can.h" +#include "stdint.h" +#include + +// 定义一个联合体类型用于float和byte数组之间的转换 +typedef union { + u32 u; + u8 b[4]; +} u32_union_t; + +// 添加辅助函数用于将u16类型数据打包到u8数组中 +static inline void pack_u16_to_bytes(u8 *buffer, u16 offset, u16 value) { + buffer[offset] = (u8)(value & 0xFF); + buffer[offset + 1] = (u8)((value >> 8) & 0xFF); +} + +// 添加辅助函数用于将float类型数据打包到u8数组中 +static inline void pack_u32_to_bytes(u8 *buffer, u16 offset, + u32_union_t &u32_union) { + buffer[offset] = u32_union.b[0]; + buffer[offset + 1] = u32_union.b[1]; + buffer[offset + 2] = u32_union.b[2]; + buffer[offset + 3] = u32_union.b[3]; +} + +// 添加辅助函数用于从u8数组中解包short类型数据 +static inline short unpack_bytes_to_short(u8 *buffer, u16 offset) { + short value = (short)(buffer[offset] | (buffer[offset + 1] << 8)); + return value; +} + +// 添加辅助函数用于从u8数组中解包u16类型数据 +static inline u16 unpack_bytes_to_u16(u8 *buffer, u16 offset) { + u16 value = (u16)(buffer[offset] | (buffer[offset + 1] << 8)); + return value; +} + +// 添加辅助函数用于从u8数组中解包float类型数据 +static inline u32_union_t unpack_bytes_to_float(u8 *buffer, u16 offset) { + u32_union_t u32_union; + u32_union.b[0] = buffer[offset]; + u32_union.b[1] = buffer[offset + 1]; + u32_union.b[2] = buffer[offset + 2]; + u32_union.b[3] = buffer[offset + 3]; + return u32_union; +} + +u8 can_gpio_init(void); // CAN引脚初始化 +void can_config(void); // CAN初始化 +void canfd_config(void); // CANFD初始化 +void can_dma_init(void); // CAN DMA初始化 +void CAN0_RX0_IRQHandler(void); // CAN接收中断处理函数 +void DMA0_Channel4_IRQHandler(void); // DMA通道4中断处理函数(CAN接收) +void DMA0_Channel5_IRQHandler(void); // DMA通道5中断处理函数(CAN发送) + +void can_loopback_init(void); +void can_loopback_test(void); + +/*! + \brief CAN通信类 + \note 封装CAN发送和接收功能 +*/ +class CAN_transmiter { + + private: + bool is_sleep = false; // 是否休眠 + + can_trasnmit_message_struct transmit_message; // 发送消息结构体 + u8 transmit_mailbox = CAN_NOMAILBOX; // 初始化为无mailbox状态 + u8 transmit_data[64]; // CANFD最大64字节 + + void update(); // 更新数据 + u8 CAN_Receive(); // CAN接收 + u8 CANFD_Receive(); // CANFD接收 + u8 CAN_all_Send(); // CAN发送 + u8 CANFD_all_Send(); // CANFD发送 + + public: + // 添加构造函数声明 + u8 init(void); + + can_receive_message_struct receive_message; // 接收消息结构体 + FlagStatus can0_receive_flag; // CAN0接收标志 + FlagStatus can0_send_flag; // CAN0发送标志 + u32_union_t testfloat_union = {0}; // 测试用 + + bool MagStatus = 0; // 磁状态码 + bool ThermalStatus = 0; // 热能状态码 + void communication_check(); // 通信检查 + u8 CAN_Sleep(); // CAN进入睡眠 + u8 CAN_Wakeup(); // CAN进入睡眠 + u8 CAN_Send(u32 ID, u8 length, u8 *data); // CAN发送 + u8 CANFD_Send(u32 ID, u8 length, u8 *data); // CANFD发送 + u8 sendACK(u32 CANFD_OTA_ACK_ID, u32 packet_num); +}; + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/Robot_V2/device/Timer.cpp b/Robot_V2/device/Timer.cpp new file mode 100644 index 0000000..34c1b89 --- /dev/null +++ b/Robot_V2/device/Timer.cpp @@ -0,0 +1,109 @@ +#include "Timer.h" +#include "Can.h" +#include "Timer.h" +#include "gd32c10x.h" +#include "gd32c10x_gpio.h" +#include "gd32c10x_misc.h" +#include "gd32c10x_rcu.h" +#include "gd32c10x_timer.h" +#include +#include +#include + +constexpr int TIMER2_PRESCALER = 119; // 120MHz / 120 = 1MHz +constexpr int TIMER2_PERIOD = 99; // 1MHz / 100 = 100us + +constexpr int TIMER1_PRESCALER = 0; // 不分频,计数器时钟为120MHz +constexpr int TIMER1_PERIOD = 5999; // 120MHz / (0+1) / (5999+1) = 20kHz +constexpr int TIMER1_CH0_PULSE = 0; +constexpr int TIMER1_CH1_PULSE = 0; +constexpr int TIMER1_CH2_PULSE = 0; +constexpr int TIMER1_CH3_COMPARE_VALUE = + (TIMER1_PERIOD + 1) * 0.5 - 1; // PWM周期50%位置触发中断 + +volatile u32 total_us100_counter = 0; // 总计数器,每100微秒增加1 +extern u16 adc_value[7]; +extern CAN_transmiter CAN0_transmiter; +// 添加系统运行时间计数器 +extern u32 cnt_test; + +/** + * @brief 设置引脚中断优先级 + * @return void + * + *设置引脚中断优先级 + */ +void nvic_config(void) { + /* 设置NVIC优先级分组,1位抢占优先级,3位响应优先级 */ + nvic_priority_group_set(NVIC_PRIGROUP_PRE2_SUB2); + /* 使能TIMER2中断,设置抢占优先级为1,子优先级为1 */ + nvic_irq_enable(TIMER2_IRQn, 0, 1); + nvic_irq_enable(TIMER1_IRQn, 0, 2); +} + +/** + * @brief 配置定时器2 + * @return void + * + *配置定时器2,用于定时执行FOC控制、采样、CAN发送等任务 + */ +void TIMER2_config(void) { + /* ---------------------------------------------------------------------------- + TIMER2 Configuration: + TIMER2CLK = SystemCoreClock/120 = 1MHz, the period is 100us(100/1000000 = + 100us). + ---------------------------------------------------------------------------- + */ + timer_parameter_struct timer_struct; + + /* 使能TIMER2时钟 */ + rcu_periph_clock_enable(RCU_TIMER2); + + /* 复位TIMER2外设到默认状态 */ + timer_deinit(TIMER2); + /* 初始化TIMER初始化参数结构体 */ + timer_struct_para_init(&timer_struct); + /* TIMER2配置参数设置 */ + timer_struct.prescaler = + TIMER2_PRESCALER; /* 预分频值:120分频(从0开始计数) */ + timer_struct.alignedmode = TIMER_COUNTER_EDGE; /* 边沿对齐模式 */ + timer_struct.counterdirection = TIMER_COUNTER_UP; /* 向上计数模式 */ + timer_struct.period = + TIMER2_PERIOD; /* 自动重装载值:100次计数(从0开始计数) */ + timer_struct.clockdivision = TIMER_CKDIV_DIV1; /* 时钟分频值:1分频 */ + timer_init(TIMER2, &timer_struct); + + /* 清除更新中断标志位 */ + timer_interrupt_flag_clear(TIMER2, TIMER_INT_FLAG_UP); + /* 使能更新中断 */ + timer_interrupt_enable(TIMER2, TIMER_INT_UP); + + /* 使能TIMER2 */ + timer_enable(TIMER2); +} + +/** + * @brief 配置TIMER2中断 + * @return void + */ +void User_timer_init(void) { + /* 配置TIMER2 */ + TIMER2_config(); + /* 配置TIMER2中断 */ + nvic_config(); +} + +/** + * @brief TIMER2中断处理函数 + * @return void + */ +void TIMER2_IRQHandler(void) { + // 检查更新中断标志并处理 + if (timer_interrupt_flag_get(TIMER2, TIMER_INT_UP) != RESET) { + // 清除更新中断标志 + timer_interrupt_flag_clear(TIMER2, TIMER_INT_UP); + // 每100us执行一次的操作 + + + } +} diff --git a/Robot_V2/device/Timer.h b/Robot_V2/device/Timer.h new file mode 100644 index 0000000..ed220de --- /dev/null +++ b/Robot_V2/device/Timer.h @@ -0,0 +1,27 @@ +#ifndef _TIMER_H +#define _TIMER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +void User_timer_init(void); +void Set_Pwm(uint16_t channel, float duty_cycle); +void Set_3Pwm(float duty_cycle0, float duty_cycle1,float duty_cycle2); +void TIMER2_IRQHandler(void); + +void timer1_pwm_config(void); +void timer1_gpio_config(void); +void TIMER1_IRQHandler(void); // 添加TIMER1中断处理函数声明 + +/* 获取系统运行时间 */ +uint64_t get_system_runtime_us(void); + + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/Robot_V2/device/adc.h b/Robot_V2/device/adc.h new file mode 100644 index 0000000..3a65951 --- /dev/null +++ b/Robot_V2/device/adc.h @@ -0,0 +1,40 @@ +#ifndef _ADC_H +#define _ADC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "stdint.h" +constexpr u8 FILTER_SIZE = 6; +constexpr u8 BLOCK_SIZE = FILTER_SIZE * sizeof(float); +class sampler { + private: + float vbus_samples[FILTER_SIZE + 1]; + float currU_samples[FILTER_SIZE + 1]; + float currV_samples[FILTER_SIZE + 1]; + float currW_samples[FILTER_SIZE + 1]; + float mcu_temp_samples[FILTER_SIZE + 1]; + float drv_temp_samples[FILTER_SIZE + 1]; + u8 current_sample_index; + + float tempora_sample; + + public: + u8 init(void); + void update_mcu_temp(void); + void update_drv_temp(void); + void update_vbus_voltage(void); + void update_current(void); + + float get_mcu_temp(void); + float get_drv_temp(void); + float get_vbus_voltage(void); + float get_current(char); +}; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Robot_V2/device/ang_sensor.cpp b/Robot_V2/device/ang_sensor.cpp new file mode 100644 index 0000000..6b8467e --- /dev/null +++ b/Robot_V2/device/ang_sensor.cpp @@ -0,0 +1,306 @@ +#include "ang_sensor.h" +#include "Filter.h" +#include "core_cmFunc.h" +#include "gd32c10x_can.h" +#include "gd32c10x_dma.h" +#include "gd32c10x_gpio.h" +#include "gd32c10x_spi.h" +#include "initial.h" +#include "flash.h" +#include +#include +#include "Can.h" +#include + +#define ANG_SPI_CS_ENABLE() gpio_bit_reset(GPIOA, GPIO_PIN_15) +#define ANG_SPI_CS_DISABLE() gpio_bit_set(GPIOA, GPIO_PIN_15) +#define DRV_SPI_CS_ENABLE() gpio_bit_reset(GPIOB, GPIO_PIN_14) +#define DRV_SPI_CS_DISABLE() gpio_bit_set(GPIOB, GPIO_PIN_14) + +constexpr float ANGLE_FACTOR = 1.0f / 65536.0f * 360.0f; +constexpr float RAD_FACTOR = 1.0f / 65536.0f * 2.0f * 3.14159265358979323846f; +constexpr u16 DEFAULT_COMMAND = 0x0000; +constexpr u16 FAULT_RECEIVE = 0xFFFF; +constexpr float VELOCITY_SCALE = 1e4f; +constexpr float ANGLE_WRAP_THRESHOLD = 300.0f; +constexpr float ANGLE_WRAP_VALUE = 360.0f; +constexpr u8 SIZE_FLOAT = sizeof(float); + +// DMA传输完成标志 +volatile bool spi_dma_tx_complete = false; +volatile bool spi_dma_rx_complete = false; + +angle_sensor KTH7823; // 角度传感器初始化 +extern FlashEEPROM flashEEP; +extern EncoderAngleKalman Angle_kalman; +extern EncoderVelocityKalman Vel_kalman; + extern CAN_transmiter CAN0_transmiter; // CAN初始化 + +/** + * @brief SPI DMA initialization + */ +void spi_dma_init(void) { + dma_parameter_struct dma_init_struct; + + // 使能DMA时钟 + rcu_periph_clock_enable(RCU_DMA0); + + // 初始化发送DMA通道 + dma_deinit(DMA0, DMA_CH2); + dma_struct_para_init(&dma_init_struct); + dma_init_struct.direction = DMA_MEMORY_TO_PERIPHERAL; + dma_init_struct.memory_addr = (uint32_t)0; // 实际地址将在传输时设置 + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_init_struct.number = 1; + dma_init_struct.periph_addr = (uint32_t)(&SPI_DATA(SPI0)); + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_init_struct.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH2, &dma_init_struct); + + // 初始化接收DMA通道 + dma_deinit(DMA0, DMA_CH1); + dma_struct_para_init(&dma_init_struct); + dma_init_struct.direction = DMA_PERIPHERAL_TO_MEMORY; + dma_init_struct.memory_addr = (uint32_t)0; // 实际地址将在传输时设置 + dma_init_struct.memory_inc = DMA_MEMORY_INCREASE_ENABLE; + dma_init_struct.memory_width = DMA_MEMORY_WIDTH_16BIT; + dma_init_struct.number = 1; + dma_init_struct.periph_addr = (uint32_t)(&SPI_DATA(SPI0)); + dma_init_struct.periph_inc = DMA_PERIPH_INCREASE_DISABLE; + dma_init_struct.periph_width = DMA_PERIPHERAL_WIDTH_16BIT; + dma_init_struct.priority = DMA_PRIORITY_HIGH; + dma_init(DMA0, DMA_CH1, &dma_init_struct); + + // 使能SPI的DMA发送和接收功能 + spi_dma_enable(SPI0, SPI_DMA_TRANSMIT); + spi_dma_enable(SPI0, SPI_DMA_RECEIVE); + + // 配置DMA中断 + nvic_irq_enable(DMA0_Channel2_IRQn, 0, 1); + nvic_irq_enable(DMA0_Channel1_IRQn, 0, 1); + + // 使能DMA传输完成中断 + dma_interrupt_enable(DMA0, DMA_CH2, DMA_INT_FTF); + dma_interrupt_enable(DMA0, DMA_CH1, DMA_INT_FTF); +} + +/** + * @brief Send or read half word through SPI using DMA + * + * @param[in] spi_periph SPI peripheral + * @param[in] tx_data Data to transmit + * @param[out] rx_data Pointer to store received data + * @return 0 if success, -1 if error + */ +int spi_rw_half_word_dma(uint32_t spi_periph, uint16_t tx_data, + uint16_t *rx_data) { + // 重置完成标志 + spi_dma_tx_complete = false; + spi_dma_rx_complete = false; + + // 配置发送DMA + dma_channel_disable(DMA0, DMA_CH2); + dma_memory_address_config(DMA0, DMA_CH2, (uint32_t)&tx_data); + dma_transfer_number_config(DMA0, DMA_CH2, 1); + dma_channel_enable(DMA0, DMA_CH2); + + // 配置接收DMA + dma_channel_disable(DMA0, DMA_CH1); + dma_memory_address_config(DMA0, DMA_CH1, (uint32_t)rx_data); + dma_transfer_number_config(DMA0, DMA_CH1, 1); + dma_channel_enable(DMA0, DMA_CH1); + + // 等待传输完成,超时时间为100个循环 + uint32_t timeout = 100; + while ((!spi_dma_tx_complete || !spi_dma_rx_complete) && --timeout) { + // 空循环等待DMA传输完成 + } + + // 检查是否超时 + if (timeout == 0) { + // 禁用DMA通道 + dma_channel_disable(DMA0, DMA_CH2); + dma_channel_disable(DMA0, DMA_CH1); + printf("SPI DMA transfer timeout\r\n"); + return -1; + } + + return 0; +} + +/** + * @brief DMA0_Channel2中断处理函数 + * @param 无 + */ +extern "C" void DMA0_Channel2_IRQHandler(void) { + if (dma_interrupt_flag_get(DMA0, DMA_CH2, DMA_INT_FLAG_FTF)) { + dma_interrupt_flag_clear(DMA0, DMA_CH2, DMA_INT_FLAG_FTF); + spi_dma_tx_complete = true; + } +} + +/** + * @brief DMA0_Channel1中断处理函数 + * @param 无 + */ +extern "C" void DMA0_Channel1_IRQHandler(void) { + if (dma_interrupt_flag_get(DMA0, DMA_CH1, DMA_INT_FLAG_FTF)) { + dma_interrupt_flag_clear(DMA0, DMA_CH1, DMA_INT_FLAG_FTF); + spi_dma_rx_complete = true; + } +} +/** + * @brief 角度传感器初始化 + * @param 无 + */ +void KTH7823_gpio_init(void) { + rcu_periph_clock_enable(RCU_GPIOA); + rcu_periph_clock_enable(RCU_GPIOB); + rcu_periph_clock_enable(RCU_SPI0); + rcu_periph_clock_enable(RCU_AF); + /* 关闭 JTAG,仅保留 SWD(释放 PA15、PB3、PB4) */ + gpio_pin_remap_config(GPIO_SWJ_SWDPENABLE_REMAP, ENABLE); + + /* -------- SPI0 全 remap:PB3/4/5 + PA15 -------- */ + gpio_pin_remap_config(GPIO_SPI0_REMAP, ENABLE); + /* PA15 → NSS, 推挽输出 */ + gpio_init(GPIOA, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_15); + /* PB3 → SCK, PB5 → MOSI, 推挽输出 */ + gpio_init(GPIOB, GPIO_MODE_AF_PP, GPIO_OSPEED_50MHZ, + GPIO_PIN_3 | GPIO_PIN_5); + /* PB4 → MISO, 浮空输入 */ + gpio_init(GPIOB, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, + GPIO_PIN_4 | GPIO_PIN_10 | GPIO_PIN_11); +} + +/** + * @brief SPI 初始化 + * + * @details Configures SPI hardware and initializes necessary settings + */ +void KTH7823_spi_init(void) { + spi_parameter_struct spi_init_str; + spi_struct_para_init(&spi_init_str); + + /* SPI参数:16bit, 主机, 全双工, CPOL=1 CPHA=1, MSB first */ + spi_init_str.device_mode = SPI_MASTER; + spi_init_str.trans_mode = SPI_TRANSMODE_FULLDUPLEX; + spi_init_str.frame_size = SPI_FRAMESIZE_16BIT; + spi_init_str.clock_polarity_phase = SPI_CK_PL_HIGH_PH_2EDGE; + spi_init_str.nss = SPI_NSS_SOFT; + spi_init_str.endian = SPI_ENDIAN_MSB; + + spi_init_str.prescale = 24; /* 5MHz @ 120MHz */ + spi_init(SPI0, &spi_init_str); + spi_nss_output_enable(SPI0); + spi_nssp_mode_enable(SPI0); + spi_enable(SPI0); +} + + +/** +* @ 角度传感器类 初始化 +* @return 0:初始化成功 1:初始化失败 + */ +u8 angle_sensor::init(void) { + KTH7823_gpio_init(); // GPIO初始化 + KTH7823_spi_init(); // SPI初始化 + spi_dma_init(); // DMA初始化 + return 0; +} +/** +* @ 角度传感器类 设置当前角度 +* @param angle 输出级角度值 +* @return 0成功/1失败 + */ +u8 angle_sensor::angle_set(float angle){ + m_cumulativeAngle = angle*REDUCTION_RATIO; // 从Flash读取上次保存的角度 + m_firstUpdate = true; + return 0; +} + + +/** + * @brief 读取传感器数据 + * @return 传感器数据 + */ +inline float angle_sensor::read_sensorAngle(void) { + uint16_t raw_data; + + ANG_SPI_CS_ENABLE(); + u8 result = spi_rw_half_word_dma(SPI0, DEFAULT_COMMAND, &raw_data); + ANG_SPI_CS_DISABLE(); + + if (result == 0) { + // 单次浮点乘法优化:只计算一次度数,然后转换为弧度 + float angle_deg = (float)raw_data * ANGLE_FACTOR; + current_angle_deg = angle_deg; + current_angle_rad = angle_deg * DEG2RAD; // M_PI/180.0f + return angle_deg; + } + +#ifdef DEBUG + // 仅在调试模式下输出错误,避免发布版本中的I/O开销 + if (result != 0) { + // 使用更高效的串口输出替代printf(如果可用) + printf("Error reading angle from sensor.\n"); + } +#endif + + return (float)FAULT_RECEIVE; +} +/** + * @brief 更新传感器角度(输出级) + * @return 累积角度值 + */ +float angle_sensor::update(void) { + read_sensorAngle(); + + if (m_firstUpdate) { + m_lastAngle = current_angle_deg; + m_firstUpdate = false; + return m_cumulativeAngle; + } + + // 计算角度变化 + float delta = current_angle_deg - m_lastAngle; + + // 处理角度绕回情况(0度和360度之间的跳变) + // 如果变化超过180度,说明发生了绕回 + if (delta > ANGLE_WRAP_THRESHOLD) { + // 从接近360度绕回到接近0度 + delta -= ANGLE_WRAP_VALUE; + } else if (delta < -ANGLE_WRAP_THRESHOLD) { + // 从接近0度绕到接近360度 + delta += ANGLE_WRAP_VALUE; + } + + m_cumulativeAngle += delta; + m_lastAngle = current_angle_deg; + + return m_cumulativeAngle; +} + +/** + * @brief 获取累积角度值(输出级) + * @return 累积角度值 + */ +float angle_sensor::getAngle(void) const { + return m_cumulativeAngle / REDUCTION_RATIO; +} + +/** + * @brief 获取累积角度值(原始级) + * @return 累积角度值 + */ +float angle_sensor::getRawAngle(void) const { return m_cumulativeAngle; } + +/** + * @brief 获取角度值(原始级) + * @return 角度值(原始级) + */ +float angle_sensor::getcurrent_sensorangle(void) const { + return current_angle_deg; +} diff --git a/Robot_V2/device/ang_sensor.h b/Robot_V2/device/ang_sensor.h new file mode 100644 index 0000000..b2501c0 --- /dev/null +++ b/Robot_V2/device/ang_sensor.h @@ -0,0 +1,40 @@ +#ifndef _angsensor_H +#define _angsensor_H +#ifdef __cplusplus +extern "C" { +#endif +#include "gd32c10x_eval.h" +#include "stdio.h" + +u16 spi_rw_half_word(u32 spi_periph, const u16 i_HalfWord); +int spi_rw_half_word_dma(uint32_t spi_periph, uint16_t tx_data, + uint16_t *rx_data); + +constexpr u16 VEL_FILTER_SIZE = 4; + +class angle_sensor { + public: + u8 init(void); + float read_sensorAngle(void); + float update(void); + void reset(void); + float getAngle(void) const; + float getRawAngle(void) const; + float getcurrent_sensorangle(void) const; + u8 angle_set(float angle); + + protected: + float m_cumulativeAngle; + float current_angle_deg; + float current_angle_rad; + bool m_firstUpdate; + float m_lastAngle; + float m_lastcumulativeAngle; + float velocity[VEL_FILTER_SIZE] = {0.0f}; +}; + +#ifdef __cplusplus +} +#endif + +#endif \ No newline at end of file diff --git a/Robot_V2/device/motor.cpp b/Robot_V2/device/motor.cpp new file mode 100644 index 0000000..083740e --- /dev/null +++ b/Robot_V2/device/motor.cpp @@ -0,0 +1,38 @@ +#include "motor.h" +#include "Timer.h" +#include "gd32c10x_eval.h" +#include + +/** + * @brief driver输出初始化 + */ +void motor_init(void) { + timer1_gpio_config(); + timer1_pwm_config(); + // 使能GPIOB时钟 + rcu_periph_clock_enable(RCU_GPIOB); + // 配置PB2为输入引脚,用于读取电机状态 + gpio_init(GPIOB, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_2); + /* 配置GPIOB的PB14为推挽输出 SPICS */ + gpio_init(GPIOB, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ, + GPIO_PIN_14 | GPIO_PIN_12); +} + +/** + * @brief 电机复位 + */ +void motor_reset(void) { + motor_sleep(); + printf("motor reseting...\r\n"); + motor_resume(); +} + +/** + * @brief 电机休眠 + */ +void motor_sleep(void) { gpio_bit_reset(GPIOB, GPIO_PIN_12); } + +/** + * @brief 电机启动 + */ +void motor_resume(void) { gpio_bit_set(GPIOB, GPIO_PIN_12); } \ No newline at end of file diff --git a/Robot_V2/device/motor.h b/Robot_V2/device/motor.h new file mode 100644 index 0000000..dc198a3 --- /dev/null +++ b/Robot_V2/device/motor.h @@ -0,0 +1,11 @@ +#ifndef _MOTOR_H +#define _MOTOR_H + + +void motor_init(void); +void motor_reset(void); +void motor_resume(void); +void motor_sleep(void); + + +#endif \ No newline at end of file diff --git a/Robot_V2/device/test.cpp b/Robot_V2/device/test.cpp new file mode 100644 index 0000000..9ce9a99 --- /dev/null +++ b/Robot_V2/device/test.cpp @@ -0,0 +1,25 @@ +#include "adc.h" +#include + +constexpr int status_print = 0; +extern sampler sampler; +void test_1111() { + // 初始化CAN回环测试 + // can_loopback_init(); + // can_config(); + if (status_print) { + /* value print */ + printf(" the temperature data is %2.2f degrees Celsius\r\n", + sampler.get_mcu_temp()); + printf(" the drv_temperature data is %2.2f degrees Celsius\r\n", + sampler.get_drv_temp()); + printf(" the U current data is %2.2f mA\r\n", sampler.get_current('U')); + printf(" the V current data is %2.2f mA\r\n", sampler.get_current('V')); + printf(" the W current data is %2.2f mA\r\n", sampler.get_current('W')); + printf(" the VBUS is %2.2f V\r\n", sampler.get_vbus_voltage()); + // printf(" the angle is %2.2f\r\n", tle5012b_read()); + + printf("\n----------------------------------------------------\n"); + } + // can_loopback_test(); +} \ No newline at end of file diff --git a/Robot_V2/main.cpp b/Robot_V2/main.cpp new file mode 100644 index 0000000..a702405 --- /dev/null +++ b/Robot_V2/main.cpp @@ -0,0 +1,43 @@ +#include "Can.h" +#include "gd32c10x.h" +#include "gd32c10x_can.h" +#include "sys/OTA.h" +#include "sys/config.h" +#include "sys/systick.h" + +class BootloaderSystem { + private: + OTAHandler ota; + + public: + void initHardware() { + extern CAN_transmiter CAN0_transmiter; // CAN初始化 + systick_config(); // 系统时钟初始化 + SystemCoreClockUpdate(); // 更新系统时钟变量 + CAN0_transmiter.init(); + } + + void run() { + // 检查是否触发OTA模式 + if (1) { + // OTA模式 + while (1) { + ota.process(); + for (volatile int i = 0; i < 500000; i++) + ; // 简单延时 + } + } else { + // 正常模式:跳转到APP + ota.jumpToApplication(); + } + } +}; + +int main(void) { + BootloaderSystem sys; + sys.initHardware(); + sys.run(); + + while (1) + ; // 不应该执行到这里 +} \ No newline at end of file diff --git a/Robot_V2/main.h b/Robot_V2/main.h new file mode 100644 index 0000000..a8426d5 --- /dev/null +++ b/Robot_V2/main.h @@ -0,0 +1,41 @@ +/*! + \file main.h + \brief the header file of main + + \version 2025-06-20, V1.5.1, firmware for GD32C10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from this +software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef MAIN_H +#define MAIN_H +#include "stdint.h" + +void do_task(u32 currentTasks); + +#endif /* MAIN_H */ diff --git a/Robot_V2/sys/OTA.cpp b/Robot_V2/sys/OTA.cpp new file mode 100644 index 0000000..faa6893 --- /dev/null +++ b/Robot_V2/sys/OTA.cpp @@ -0,0 +1,120 @@ +#include "OTA.h" +#include "gd32c10x_fmc.h" +#include + +extern CAN_transmiter CAN0_transmiter; // CAN初始化 +extern "C" { +void canfd_rx_irq_handler(void); +} + +OTAHandler::OTAHandler() : ota_active(false), received_size(0) {} + +void OTAHandler::init() { + // 初始化CANFD接收中断 + nvic_irq_enable(CAN0_RX0_IRQn, 1, 1); +} + +void OTAHandler::process() { + if (!ota_active) + return; + + // 这里可以添加超时处理逻辑 + // 例如:10秒无数据则退出OTA模式 +} + +bool OTAHandler::validateApplication() { + uint32_t *app_vector = (uint32_t *)APP_START_ADDR; + uint32_t stack_ptr = app_vector[0]; + uint32_t reset_handler = app_vector[1]; + + // 简单验证:检查栈指针是否在SRAM范围内 + return (stack_ptr >= 0x20000000 && stack_ptr < 0x20008000) && + (reset_handler >= APP_START_ADDR && + reset_handler < (APP_START_ADDR + APP_MAX_SIZE)); +} + +void OTAHandler::jumpToApplication() { + if (!validateApplication()) { + // 无效APP,停留在bootloader + return; + } + + // 关闭所有中断 + __disable_irq(); + + // 设置主栈指针 + uint32_t msp_value = *(__IO uint32_t *)APP_START_ADDR; + __set_MSP(msp_value); + + // 获取复位地址 + uint32_t reset_handler = *(__IO uint32_t *)(APP_START_ADDR + 4); + typedef void (*AppEntryFunc)(void); + AppEntryFunc app_entry = (AppEntryFunc)reset_handler; + + // 跳转 + app_entry(); +} + +void OTAHandler::eraseApplicationArea() { + // 擦除APP区域 + fmc_unlock(); + for (uint32_t addr = APP_START_ADDR; addr < (APP_START_ADDR + APP_MAX_SIZE); + addr += FMC_PAGE_SIZE) { + fmc_page_erase(addr); + } + fmc_lock(); +} + +void OTAHandler::writeApplicationData(uint32_t offset, uint8_t *data, + uint32_t size) { + fmc_unlock(); + uint32_t write_addr = APP_START_ADDR + offset; + + // 32位对齐写入 + for (uint32_t i = 0; i < size; i += 4) { + uint32_t word = 0; + memcpy(&word, &data[i], 4); + fmc_word_program(write_addr + i, word); + } + + fmc_lock(); +} + +void OTAHandler::handleOTAMessage(uint32_t id, uint8_t *data, uint8_t len) { + if (id == CANFD_OTA_REQ_ID) { + // OTA请求包 + uint32_t new_size = *(uint32_t *)data; + if (new_size <= APP_MAX_SIZE) { + expected_size = new_size; + received_size = 0; + eraseApplicationArea(); + ota_active = true; + sendACK(0xFFFFFFFF); // 确认开始 + } + } else if (id == CANFD_OTA_DATA_ID && ota_active) { + // 数据包格式:[4字节包序号][实际数据] + if (len >= 4) { + uint32_t packet_num = *(uint32_t *)data; + uint32_t offset = packet_num * (len - 4); + + if (offset < expected_size) { + writeApplicationData(offset, &data[4], len - 4); + received_size += (len - 4); + sendACK(packet_num); + + // 检查是否完成 + if (received_size >= expected_size) { + ota_active = false; + // 跳转前延时让ACK发出 + for (volatile int i = 0; i < 100000; i++) + ; + jumpToApplication(); + } + } + } + } +} + +void OTAHandler::sendACK(uint32_t packet_num) { + CAN0_transmiter.sendACK(CANFD_OTA_ACK_ID, packet_num); +} \ No newline at end of file diff --git a/Robot_V2/sys/OTA.h b/Robot_V2/sys/OTA.h new file mode 100644 index 0000000..fabc3b8 --- /dev/null +++ b/Robot_V2/sys/OTA.h @@ -0,0 +1,28 @@ +#ifndef __OTA_H +#define __OTA_H + +#include "Can.h" +#include "config.h" +#include "gd32c10x.h" + +class OTAHandler { + public: + bool ota_active; + uint32_t received_size; + uint32_t expected_size; + + OTAHandler(); + void init(); + void process(); + bool isActive() const { return ota_active; } + + void handleOTAMessage(uint32_t id, uint8_t *data, uint8_t len); + void jumpToApplication(); + + private: + bool validateApplication(); + void eraseApplicationArea(); + void writeApplicationData(uint32_t offset, uint8_t *data, uint32_t size); + void sendACK(uint32_t packet_num); +}; +#endif \ No newline at end of file diff --git a/Robot_V2/sys/config.h b/Robot_V2/sys/config.h new file mode 100644 index 0000000..4610e9e --- /dev/null +++ b/Robot_V2/sys/config.h @@ -0,0 +1,21 @@ +#pragma once +#include "stdint.h" + +// Flash分区配置 +constexpr uint32_t BOOTLOADER_SIZE = 0x4000; // 16KB +constexpr uint32_t APP_START_ADDR = 0x08004000; // APP起始地址 +constexpr uint32_t APP_MAX_SIZE = 0x0001C000; // 112KB +constexpr uint32_t FMC_PAGE_SIZE = 0x400; + +// CANFD配置 +constexpr uint32_t CANFD_OTA_REQ_ID = 0x00000100; +constexpr uint32_t CANFD_OTA_DATA_ID = 0x00000101; +constexpr uint32_t CANFD_OTA_ACK_ID = 0x00000102; + +// CANFD数据段最大64字节,我们用32字节数据 + 4字节头部 +constexpr uint32_t OTA_PACKET_SIZE = 32; +typedef struct { + uint32_t packet_num; // 包序号 + uint8_t data[OTA_PACKET_SIZE]; // 32字节有效数据 + uint32_t crc32; // 简单校验 +} canfd_ota_packet_t; \ No newline at end of file diff --git a/Robot_V2/sys/flash.cpp b/Robot_V2/sys/flash.cpp new file mode 100644 index 0000000..cccbc44 --- /dev/null +++ b/Robot_V2/sys/flash.cpp @@ -0,0 +1,453 @@ +#include "flash.h" +#include "gd32c10x.h" +#include "gd32c10x_crc.h" +#include "gd32c10x_fmc.h" +#include "math.h" +#include +#include +#include +#include +#include + +FlashEEPROM flashEEP = FlashEEPROM(); +extern CAN_transmiter CAN0_transmiter; +constexpr u8 SIZE_U32 = sizeof(uint32_t); +constexpr u8 SIZE_FLOAT = sizeof(float); +constexpr u8 DEFAULT_VALUE = 0; +constexpr u8 NUM_SAVED = 6; +#define EEPDEBUG 0 + +// FlashEEPROM类实现 +FlashEEPROM::FlashEEPROM() { + // 构造函数可以为空,或者做一些初始化工作 +} + +/** + * @brief 初始化Flash EEPROM模拟 + * @param None + * @retval None + */ +u8 FlashEEPROM::init() { + rcu_periph_clock_enable(RCU_CRC); + crc_deinit(); // 初始化CRC模块 + + FlashEepromStatus status = FLASH_EEPROM_OK; + // 读取系统配置 + read_saved_system_config(); + + if (EEPROMStatus == FLASH_EEPROM_OK) { + return FLASH_EEPROM_OK; + } else { + return FLASH_EEPROM_READ_ERROR; + } + return 1; // 正常不会返回这个,未预料的异常情况返回 +} + +/** + * @brief 读取EEPROM数据 + * @param virtualAddr: 虚拟地址 + * @param data: 存储读取数据的指针 + * @retval EEPROMStatus: 是否成功 + */ +u8 FlashEEPROM::read_saved_system_config(void) { + // 读取保存的参数 + u32 CRC_NUM = 0x0000; + FlashEepromStatus status_read[NUM_SAVED + 1] = {FLASH_EEPROM_OK}; + float data[NUM_SAVED] = {0.0f}; + // 尝试从Flash读取参数,如果不存在则使用默认值 + status_read[1] = readFloat(ADDR_CONTROL_MODE, &data[0]); + status_read[2] = readFloat(ADDR_VOLTAGE_LIMIT, &data[1]); + status_read[3] = readFloat(ADDR_VEL_LIMIT, &data[2]); + status_read[4] = readFloat(ADDR_ANGLE, &data[3]); + status_read[5] = readFloat(ADDR_TARGET_ANGLE, &data[4]); + status_read[6] = readFloat(ADDR_TARGET_VEL, &data[5]); + + // 读取失败则使用默认值 + for (u8 i = 1; i < NUM_SAVED + 1; i++) { + if (status_read[i] == + FLASH_EEPROM_DATA_NOT_FOUND) { // 首次读取,不保存报错 + data[i - 1] = DEFAULT_VALUE; + } else if (status_read[i] != FLASH_EEPROM_OK) { // 其余错误,保存报错 + data[i - 1] = DEFAULT_VALUE; + status_read[0] = status_read[i]; + } + } + // 读取到全部数据 + if (status_read[0] == FLASH_EEPROM_OK) { + u32 next_address = EEPROM_END_ADDRESS; + // 遍历Flash页面寻找下一个可写入位置 + for (u32 address = EEPROM_DATA_START_ADDRESS - SIZE_U32; + address > EEPROM_START_ADDRESS; address -= SIZE_U32) { + // 安全读取Flash数据 + volatile u32 *flash_ptr = (volatile u32 *)address; + u32 data_word = *flash_ptr; + // 找到空位置 + if (data_word == 0xFFFFFFFF) { + next_address = address + SIZE_U32; // 上一个位置为有效存储的数据 + break; + } + // 更新下一个可能的写入位置(如果需要格式化) + next_address = address - SIZE_U32; + } + if (next_address == EEPROM_DATA_START_ADDRESS) { + // 从来没有存储过,直接返回 + return FLASH_EEPROM_OK; + } + + crc_data_register_reset(); // 确保CRC计算从初始状态开始 + CRC_NUM = crc_block_data_calculate((uint32_t *)data, NUM_SAVED); + +#if EEPDEBUG + printf("CRC cmp1,0x%X_0x%x \r\n", CRC_NUM, *((u32 *)next_address)); +#endif + if (CRC_NUM != *((u32 *)next_address)) { // CRC错误 + for (u8 i = 0; i < NUM_SAVED; i++) { + data[i] = DEFAULT_VALUE; + } + EEPROMStatus = FLASH_EEPROM_CRC_ERROR; + } else { // CRC正确 + EEPROMStatus = FLASH_EEPROM_OK; + } + } else { + // 读取失败,报错 + EEPROMStatus = status_read[0]; + } + + return EEPROMStatus; +} + +/** + * @brief 从Flash EEPROM读取数据 + * @param virtualAddr: 虚拟地址 + * @param data: 指向存储读取数据的指针 + * @retval FlashEepromStatus: 操作状态 + */ +FlashEepromStatus FlashEEPROM::read(u8 virtualAddr, u16 *data) const { + // 参数检查 + if (data == nullptr) { + return FLASH_EEPROM_INVALID_ADDR; + } + + // 从Flash末尾开始向前搜索,找到最新的数据 + for (u32 address = EEPROM_END_ADDRESS - SIZE_U32; + address >= EEPROM_START_ADDRESS; address -= SIZE_U32) { + u32 data_word = *((u32 *)address); + // 检查是否是有效数据(非擦除状态) + if (data_word != 0xFFFFFFFF) { + u8 addr = (u8)(data_word & DATA_ADDR_MASK); + // 找到匹配的虚拟地址 + if (addr == virtualAddr) { + *data = (u16)(data_word & DATA_U16_MASK); + return FLASH_EEPROM_OK; + } + } + } + return FLASH_EEPROM_DATA_NOT_FOUND; +} + +/** + * @brief 从Flash EEPROM读取float数据 + * @param virtualAddr: 虚拟地址 + * @param data: 指向存储读取数据的指针 + * @retval FlashEepromStatus: 操作状态 + */ +FlashEepromStatus FlashEEPROM::readFloat(u8 virtualAddr, float *data) const { + // 检查参数有效性 + if (data == nullptr) { + return FLASH_EEPROM_INVALID_ADDR; + } + + // 从Flash末尾开始向前搜索,找到最新的数据 + for (u32 address = EEPROM_END_ADDRESS - SIZE_U32; + address >= EEPROM_START_ADDRESS; address -= SIZE_U32) { + // 使用volatile确保每次都从内存读取,防止编译器优化 + volatile u32 *flash_ptr = (volatile u32 *)address; + u32 data_word = *flash_ptr; + + // 检查是否是有效数据(非擦除状态) + if (data_word != 0xFFFFFFFF) { + u8 addr = (u8)(data_word & DATA_ADDR_MASK); + // 找到匹配的虚拟地址 + if (addr == virtualAddr) { + // 清除最低的8位地址信息,保留高24位数据 + u32 float_data = data_word & DATA_FLOAT_MASK; + // 使用内存拷贝将处理后的数据解释为float + memcpy(data, &float_data, SIZE_FLOAT); +#if EEPDEBUG + printf("read:0x%x=%f\r\n", address, *data); +#endif + return FLASH_EEPROM_OK; + } + } + } + // 未找到指定虚拟地址的数据 + return FLASH_EEPROM_DATA_NOT_FOUND; +} + +/** + * @brief 向Flash EEPROM写入数据 + * @param virtualAddr: 虚拟地址 + * @param data: 要写入的数据 + * @retval FlashEepromStatus: 操作状态 + */ +FlashEepromStatus FlashEEPROM::write(u8 virtualAddr, u16 data) { + // 查找下一个可写入的位置 + u32 next_address = EEPROM_START_ADDRESS; + u32 data_read; + // 插入虚拟地址到低8位 格式: [data:16bit][reserved:8bit][addr:8bit] + data = (data & DATA_U16_MASK) | (u32)virtualAddr; + + for (u32 address = EEPROM_END_ADDRESS - SIZE_U32; + address >= EEPROM_DATA_START_ADDRESS; address -= SIZE_U32) { + // 安全读取Flash数据 + volatile u32 *flash_ptr = (volatile u32 *)address; + data_read = *flash_ptr; + + if ((data_read & DATA_ADDR_MASK) == (u32)virtualAddr) { // 虚拟地址相同 + if ((data_read & DATA_U16_MASK) == + (data & DATA_U16_MASK)) { // 数据相同 +#if EEPDEBUG + data_read = data_read & DATA_U16_MASK; + u16 float_data_read = *((u16 *)&data_read); + printf("Found data in:0x%x=%u\r\n", address, data_read); +#endif + return FLASH_EEPROM_OK; + } else { + break; + } + } + } + + // 遍历Flash页面寻找下一个可写入位置 + for (u32 address = EEPROM_DATA_START_ADDRESS; address < EEPROM_END_ADDRESS; + address += SIZE_U32) { + // 安全读取Flash数据 + volatile u32 *flash_ptr = (volatile u32 *)address; + u32 data_word = *flash_ptr; + // 找到空位置 + if (data_word == 0xFFFFFFFF) { + next_address = address; + break; + } + // 更新下一个可能的写入位置(如果需要格式化) + next_address = address + SIZE_U32; + } + + // 如果有足够空间,直接写入 + if (next_address < EEPROM_END_ADDRESS) { + u32 data_word = ((u32)data << 16) | (u32)virtualAddr; + + // 使用GD32库函数进行安全编程 + fmc_unlock(); + fmc_flag_clear(FMC_FLAG_PGERR | FMC_FLAG_PGAERR | FMC_FLAG_WPERR); + fmc_state_enum fmc_status = + fmc_word_program(next_address, data_word); // 写入数据 + fmc_lock(); + + if (fmc_status != FMC_READY) { + return FLASH_EEPROM_WRITE_ERROR; + } + return FLASH_EEPROM_OK; + } else { // 空间不足,需要格式化页面 +#if EEPDEBUG + printf("no enough space\r\n"); +#endif + FlashEepromStatus status = format(); + if (status == FLASH_EEPROM_OK) { + return status; + } else { + return FLASH_EEPROM_ERASE_ERROR; + } + } +} + +/** + * @brief 向Flash EEPROM写入float数据 + * @param virtualAddr: 虚拟地址 + * @param data: 要写入的数据 + * @retval FlashEepromStatus: 操作状态 + */ +FlashEepromStatus FlashEEPROM::writeFloat(u8 virtualAddr, float data) { + // 查找下一个可写入的位置 + u32 next_address = EEPROM_START_ADDRESS; + u32 data_word; + + // 将完整的float数据复制到32位变量中 + memcpy(&data_word, &data, SIZE_FLOAT); + // 插入虚拟地址到低8位 格式: [data:24bit][addr:8bit] + data_word = (data_word & DATA_FLOAT_MASK) | (u32)virtualAddr; + + // 从Flash末尾开始向前搜索,找到最新的数据 + for (u32 address = EEPROM_END_ADDRESS - SIZE_U32; + address >= EEPROM_DATA_START_ADDRESS; address -= SIZE_U32) { + // 安全读取Flash数据 + volatile u32 *flash_ptr = (volatile u32 *)address; + u32 data_word_read = *flash_ptr; + + if ((data_word_read & DATA_ADDR_MASK) == + (u32)virtualAddr) { // 虚拟地址相同 + if ((data_word_read & DATA_FLOAT_MASK) == + (data_word & DATA_FLOAT_MASK)) { // 数据相同 +#if EEPDEBUG + data_word_read = data_word_read & DATA_FLOAT_MASK; + float float_data_read = *((float *)&data_word_read); + printf("Found data in:0x%x=%f\r\n", address, float_data_read); +#endif + return FLASH_EEPROM_OK; + } else { + break; // 找到相同地址但数据不同,需要更新 + } + } + } + + // 遍历Flash页面寻找下一个可写入位置 + for (u32 address = EEPROM_DATA_START_ADDRESS; address < EEPROM_END_ADDRESS; + address += SIZE_U32) { + // 安全读取Flash数据 + volatile u32 *flash_ptr = (volatile u32 *)address; + u32 data_word_read = *flash_ptr; + // 找到空位置 + if (data_word_read == 0xFFFFFFFF) { + next_address = address; + break; + } + // 更新下一个可能的写入位置(如果需要格式化) + next_address = address + SIZE_U32; + } + + // 如果有足够空间,直接写入 + if (next_address < EEPROM_END_ADDRESS) { + // 使用GD32库函数进行安全编程 + fmc_unlock(); + fmc_flag_clear(FMC_FLAG_PGERR | FMC_FLAG_PGAERR | FMC_FLAG_WPERR); + + // 确保使用对齐地址 + fmc_state_enum fmc_status = fmc_word_program(next_address, data_word); + + fmc_lock(); +#if EEPDEBUG + u32 data_word_c = *((u32 *)next_address); + data_word_c = data_word_c & DATA_FLOAT_MASK; + float float_data = *((float *)&data_word_c); + printf("save:0x%x=%f\r\n", next_address, float_data); +#endif + if (fmc_status != FMC_READY) { + return FLASH_EEPROM_WRITE_ERROR; + } + return FLASH_EEPROM_OK; + } else { + // 空间不足,需要格式化页面 +#if EEPDEBUG + printf("no enough space\r\n"); +#endif + FlashEepromStatus status = format(); + if (status == FLASH_EEPROM_OK) { + return status; + } else { + return FLASH_EEPROM_ERASE_ERROR; + } + } +} + +/** + * @brief 格式化Flash EEPROM页面 + * @param None + * @retval FlashEepromStatus: 操作状态 + */ +FlashEepromStatus FlashEEPROM::format() { + fmc_state_enum fmc_status; +#if EEPDEBUG + printf("擦除页面\r\n"); +#endif + + fmc_unlock(); + fmc_status = fmc_page_erase(EEPROM_START_ADDRESS); // 擦除第一页 + if (fmc_status != FMC_READY) { + fmc_lock(); + return FLASH_EEPROM_ERASE_ERROR; + } + fmc_status = fmc_page_erase(EEPROM_DATA_PAGE2_ADDRESS); // 擦除第二页 + if (fmc_status != FMC_READY) { + fmc_lock(); + return FLASH_EEPROM_ERASE_ERROR; + } + fmc_lock(); + return FLASH_EEPROM_OK; +} + +/** + * @brief 读取角度数据从Flash + * @return float: 角度数据 + */ +float FlashEEPROM::read_angle() { + float angle = DEFAULT_VALUE; + if (readFloat(ADDR_ANGLE, &angle) != FLASH_EEPROM_OK) { + angle = DEFAULT_VALUE; + } + return angle; +} + +/** + * @brief 保存CRC数据到Flash + * @param saved: 是否一次性保存 + * @return FlashEepromStatus: 状态 + */ +FlashEepromStatus FlashEEPROM::writeCRC(u32 CRC_NUM, bool saved) { + static u32 next_address; + // 遍历Flash页面寻找下一个可写入crc的位置 + for (u32 address = EEPROM_DATA_START_ADDRESS - SIZE_U32; + address > EEPROM_START_ADDRESS; address -= SIZE_U32) { + // 安全读取Flash数据 + volatile u32 *flash_ptr = (volatile u32 *)address; + u32 data_word = *flash_ptr; + // 找到空位置 + if (data_word == 0xFFFFFFFF) { + next_address = address; + break; + } + // 更新下一个可能的写入位置(如果需要格式化) + next_address = address - SIZE_U32; + } + + // 如果当前CRC与现在的crc值不同,则写入 + if (*((u32 *)next_address) != CRC_NUM) { + // 如果有足够空间,直接写入crc值 + if (next_address > EEPROM_START_ADDRESS) { + fmc_unlock(); + fmc_flag_clear(FMC_FLAG_PGERR | FMC_FLAG_PGAERR | FMC_FLAG_WPERR); + fmc_state_enum fmc_status = fmc_word_program(next_address, CRC_NUM); + fmc_lock(); +#if EEPDEBUG + printf("CRC cmp1,0x%X_0x%x \r\n", CRC_NUM, *((u32 *)next_address)); +#endif + + // 检查写入是否成功 + if (fmc_status != FMC_READY) { + EEPROMStatus = fmc_status; + return FLASH_EEPROM_WRITE_ERROR; + } + } else { + // 空间不足,需要格式化页面 +#if EEPDEBUG + printf("no enough space\r\n"); +#endif + FlashEepromStatus status = format(); + if (status == FLASH_EEPROM_OK) { + return status; + } else { + EEPROMStatus = FLASH_EEPROM_ERASE_ERROR; + return FLASH_EEPROM_ERASE_ERROR; + } + } + } + + // 重新读取CRC校验 + if (CRC_NUM == *((u32 *)next_address)) { + system_config_saved = saved; // 标记已保存过 + EEPROMStatus = FLASH_EEPROM_OK; // 设置EEPROM状态 + return FLASH_EEPROM_OK; + } else { + EEPROMStatus = FLASH_EEPROM_CRC_ERROR; // 设置EEPROM错误状态 + return FLASH_EEPROM_CRC_ERROR; + } +} \ No newline at end of file diff --git a/Robot_V2/sys/flash.h b/Robot_V2/sys/flash.h new file mode 100644 index 0000000..aff3aca --- /dev/null +++ b/Robot_V2/sys/flash.h @@ -0,0 +1,71 @@ +#ifndef __FLASH_H +#define __FLASH_H + +#include +// 修改后 - 强制4字节对齐 +#define ALIGN_4BYTE(addr) ((addr) & 0xFFFFFFFC) // 4字节对齐 + +// EEPROM操作状态 +typedef enum { + FLASH_EEPROM_OK = 0, // 操作成功 + FLASH_EEPROM_WRITE_ERROR, // 写入错误 + FLASH_EEPROM_READ_ERROR, // 读取错误 + FLASH_EEPROM_ERASE_ERROR, // 擦除错误 + FLASH_EEPROM_INVALID_ADDR, // 无效地址 + FLASH_EEPROM_DATA_NOT_FOUND, // 找不到数据 + FLASH_EEPROM_CRC_ERROR, // CRC错误 + FLASH_EEPROM_ALIGNMENT_ERROR, // 对齐错误 +} FlashEepromStatus; + +// Flash EEPROM类 +class FlashEEPROM { + public: + // EEPROM emulation constants + static constexpr u32 EEPROM_START_ADDRESS = 0x0801F800; // 第一页(1KB) + static constexpr u32 EEPROM_DATA_PAGE2_ADDRESS = 0x801FC00; // 第二页(1KB) + static constexpr u32 EEPROM_END_ADDRESS = 0x08020000; // Flash结束地址 + static constexpr u32 EEPROM_MAX_SIZE = 0x800; // EEPROM最大容量 + static constexpr u32 EEPROM_DATA_START_ADDRESS = + 0x0801F900; // DATA段开始地址 + static constexpr u32 DATA_FLOAT_MASK = 0xFFFFFF00; // float存储地址掩码 + static constexpr u32 DATA_U16_MASK = 0xFFFF0000; // u16存储地址掩码 + static constexpr u32 DATA_ADDR_MASK = 0x000000FF; // 虚拟地址掩码 + + // 定义用户自定义的虚拟地址 + static constexpr u8 ADDR_CONTROL_MODE = 0x0; // 控制模式 + static constexpr u8 ADDR_ANGLE = 0x01; // 角度数据存储地址 + static constexpr u8 ADDR_TARGET_ANGLE = 0x02; // 角度命令数据存储地址 + static constexpr u8 ADDR_TARGET_VEL = 0x03; // 速度命令数据存储地址 + static constexpr u8 ADDR_VOLTAGE_LIMIT = 0x4; // 电压限制 + static constexpr u8 ADDR_VEL_LIMIT = 0x05; // 角度数据存储地址 + + bool angle_saved = false; + bool system_config_saved = false; + u8 EEPROMStatus; + // 构造函数 + FlashEEPROM(); + + // 初始化Flash EEPROM模拟 + u8 init(); + + // 从Flash EEPROM中读取数据 + FlashEepromStatus read(u8 virtualAddr, u16 *data) const; + // 向Flash EEPROM写入数据 + FlashEepromStatus write(u8 virtualAddr, u16 data); + // Float数据读相关函数 + FlashEepromStatus readFloat(u8 virtualAddr, float *data) const; + // Float数据存储相关函数 + FlashEepromStatus writeFloat(u8 virtualAddr, float data); + + // 格式化Flash EEPROM页面 + FlashEepromStatus format(); + + u8 read_saved_system_config(void); + float read_angle(); + + private: + FlashEepromStatus writeCRC(u32 CRC_NUM, bool saved); +}; + +void flash_eeprom_example_main(void); +#endif /* __FLASH_H */ \ No newline at end of file diff --git a/Robot_V2/sys/health.cpp b/Robot_V2/sys/health.cpp new file mode 100644 index 0000000..fbd5935 --- /dev/null +++ b/Robot_V2/sys/health.cpp @@ -0,0 +1,103 @@ +#include "health.h" +#include "Can.h" +#include "DengFOC.h" +#include "adc.h" +#include "flash.h" +#include + +extern sampler sampler; +extern CAN_transmiter CAN0_transmiter; +extern FOC_Controlroller FOC; +extern FlashEEPROM flashEEP; +ThermalController thermalController; // 热量控制器初始化 + +#define max(a, b, c) \ + ((a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c))) +constexpr u16 PROTECT_TIME = 6000; // 过热保护时间,单位*10ms +/** +** @brief 热能计算 +** @param None +** @retval 热量值 +*/ +u32 ThermalController::update() { + thermal_value = Q16_16_MUL(thermal_value, thermalRate); + // 添加温度积累 + int drv_temp = (int)sampler.get_drv_temp(); + int mcu_temp = (int)sampler.get_mcu_temp(); + if (drv_temp == 255) + drv_temp = 0; + if (mcu_temp == 255) + mcu_temp = 0; + thermal_value += drv_temp * drv_temp + mcu_temp * mcu_temp; + + if (remainingTime10Ms) { + // 过热停机状态 + // 检查是否可以恢复 + q16_16_t recovery_threshold = + Q16_16_MUL(thermal_capacity, recoveryRate); + if (thermal_value < recovery_threshold) { + remainingTime10Ms = 1; // 可以恢复工作 + } + if (remainingTime10Ms == 1) { // 过热恢复 + FOC.resume(); + CAN0_transmiter.ThermalStatus = 0; + return --remainingTime10Ms; + } + return --remainingTime10Ms; + } else { + // 当前没有过热停机 + // 添加电流热积累 + u32 currents[3] = {(u32)(sampler.get_current('U') * 1000), + (u32)(sampler.get_current('V') * 1000), + (u32)(sampler.get_current('W') * 1000)}; + + // 找最大电流(原始ADC值) + current_max = max(currents[0], currents[1], currents[2]); + if (current_max < 2000) { + thermal_value += current_max * current_max * gapTimeMs * + 0.00007f; // 计算当前电流热积累值 + } else if (current_max > 3800) { + thermal_value += current_max * current_max * gapTimeMs * + 0.01f; // 添加当前电流热积累值 + } else if (current_max > 3400) { + thermal_value += current_max * current_max * gapTimeMs * + 0.005f; // 计算当前电流热积累值 + } else if (current_max > 3000) { + thermal_value += current_max * current_max * gapTimeMs * + 0.0002f; // 计算当前电流热积累值 + } else if (current_max > 2000) { + thermal_value += current_max * current_max * gapTimeMs * + 0.0001f; // 计算当前电流热积累值 + } + } + + if (thermal_value > thermal_capacity) { + FOC.shut_down(); + remainingTime10Ms = PROTECT_TIME; // 过热停机 + CAN0_transmiter.ThermalStatus = 1; + return remainingTime10Ms; + } + return thermal_value; +} +/** +** @brief 温度检测 +** @param None +*/ +void angsens_MG_check(void) { + bool MGH = gpio_input_bit_get(GPIOB, GPIO_PIN_10); + bool MGL = gpio_input_bit_get(GPIOB, GPIO_PIN_11); + CAN0_transmiter.MagStatus = MGH or MGL; +} + +void power_manage(void) { + float last_vbus = sampler.get_vbus_voltage(); + sampler.update_vbus_voltage(); + FOC.update_power(); + float vbus = sampler.get_vbus_voltage(); + if ((vbus < 22.0f) and (last_vbus > vbus) and vbus > 8.0f) { + FOC.shut_down(); + flashEEP.save_system_config(true); + } else { + FOC.resume(); + } +} \ No newline at end of file diff --git a/Robot_V2/sys/health.h b/Robot_V2/sys/health.h new file mode 100644 index 0000000..a3b22cf --- /dev/null +++ b/Robot_V2/sys/health.h @@ -0,0 +1,40 @@ +#ifndef _HEALTH_H +#define _HEALTH_H + +#include "stdint.h" +typedef int32_t q16_16_t; // Q16.16格式 +// 定点数运算宏 +#define Q16_16_ONE 65536 // 1.0 in Q16.16 +#define FLOAT_TO_Q16_16(x) ((q16_16_t)((x) * Q16_16_ONE)) +#define Q16_16_TO_FLOAT(x) ((float)(x) / Q16_16_ONE) +#define Q16_16_MUL(a, b) ((q16_16_t)(((int64_t)(a) * (b)) >> 16)) +#define Q16_16_SQUARE(x) Q16_16_MUL((x), (x)) + +class ThermalController { + private: + u8 temperature; + u16 current_max; + + q16_16_t thermalRate; // 热耗散系数(每单位时间散热比例) + q16_16_t recoveryRate; // 自然恢复率(散热到多少以下开始工作) + + u32 thermal_value = 0; + u32 thermal_capacity = 3600000; // 热容量 + + u16 gapTimeMs = 10; // 单次计算间隔ms + u16 remainingTime10Ms = 0; // 过热冷却剩余ms + public: + ThermalController() + : thermalRate(FLOAT_TO_Q16_16(0.995f)), + recoveryRate(FLOAT_TO_Q16_16(0.33f)) {} + u32 update(); + void reset() { + thermal_value = 0; + remainingTime10Ms = 0; + } +}; + +void angsens_MG_check(void); +void power_manage(void); + +#endif diff --git a/Robot_V2/sys/initial.cpp b/Robot_V2/sys/initial.cpp new file mode 100644 index 0000000..90bdb52 --- /dev/null +++ b/Robot_V2/sys/initial.cpp @@ -0,0 +1,93 @@ +#include "initial.h" +#include "gd32c10x.h" +#include "gd32c10x_gpio.h" +#include "gd32c10x_rcu.h" +#include +#include +#include + +/* retarget the C library printf function to the USART */ +u8 USART0_init() { + gd_eval_com_init(EVAL_COM0); + return 1; +} + +/*! + \brief configure the watchdog peripheral + \param[in] none + \param[out] none + \retval none +*/ +u8 watchdog_init(u32 time) { + u8 status = 0; + /* configure FWDGT counter clock: 40KHz(IRC40K) / 64 = 0.625 KHz */ + /* time = reload_value / clock_frequency */ + status = fwdgt_config(time * 0.625, FWDGT_PSC_DIV64); + fwdgt_enable(); + return status; +} + + +int fputc(int ch, FILE *f) throw() { + usart_data_transmit(EVAL_COM0, (uint8_t)ch); + while (RESET == usart_flag_get(EVAL_COM0, USART_FLAG_TBE)) + ; + return ch; +} + +void unused_pin_init() { + rcu_periph_clock_enable(RCU_GPIOA); // 使能GPIOA时钟 + rcu_periph_clock_enable(RCU_GPIOB); // 使能GPIOB时钟 + rcu_periph_clock_enable(RCU_GPIOC); // 使能GPIOC时钟 + gpio_init(GPIOA, GPIO_MODE_IPU, GPIO_OSPEED_2MHZ, + GPIO_PIN_8 | GPIO_PIN_11 | GPIO_PIN_12); + gpio_init(GPIOB, GPIO_MODE_IPU, GPIO_OSPEED_2MHZ, + GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_15); + gpio_init(GPIOC, GPIO_MODE_IPU, GPIO_OSPEED_2MHZ, + GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); + gpio_bit_reset(GPIOA, GPIO_PIN_8 | GPIO_PIN_11 | GPIO_PIN_12); + gpio_bit_reset(GPIOB, GPIO_PIN_6 | GPIO_PIN_7 | GPIO_PIN_15); + gpio_bit_reset(GPIOC, GPIO_PIN_13 | GPIO_PIN_14 | GPIO_PIN_15); +} + +/*! + \brief 检测并打印复位源信息 + \param[in] none + \param[out] none + \retval none +*/ +u16 get_reset_cause(void) { + u16 cause = 0; + if (RESET != rcu_flag_get(RCU_FLAG_FWDGTRST)) { + // printf("Free Watchdog Timer Reset\r\n"); + cause = RCU_FLAG_FWDGTRST; + } + if (RESET != rcu_flag_get(RCU_FLAG_EPRST)) { + // printf("External Pin Reset\r\n"); + cause = RCU_FLAG_EPRST; + } + + if (RESET != rcu_flag_get(RCU_FLAG_PORRST)) { + // printf("Power Reset\r\n"); + cause = RCU_FLAG_PORRST; + } + + if (RESET != rcu_flag_get(RCU_FLAG_WWDGTRST)) { + // printf("Window Watchdog Timer Reset\r\n"); + cause = RCU_FLAG_WWDGTRST; + } + + if (RESET != rcu_flag_get(RCU_FLAG_LPRST)) { + // printf("Low Power Reset\r\n"); + cause = RCU_FLAG_LPRST; + } + + if (RESET != rcu_flag_get(RCU_FLAG_SWRST)) { + // printf("Software Reset\r\n"); + cause = RCU_FLAG_SWRST; + } + // 清除所有复位标志 + rcu_all_reset_flag_clear(); + // printf("cause:%d\r\n", cause); + return cause; +} diff --git a/Robot_V2/sys/initial.h b/Robot_V2/sys/initial.h new file mode 100644 index 0000000..844e8d0 --- /dev/null +++ b/Robot_V2/sys/initial.h @@ -0,0 +1,30 @@ +#ifndef _INITIAL_H +#define _INITIAL_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "gd32c10x_eval.h" +#include "stdint.h" +#include + + +constexpr u16 REDUCTION_RATIO = 25; +constexpr float DEG2RAD = 1.0f / 360.0f * 6.28318530718f; +constexpr float RAD2DEG = 360.0f / 6.28318530718f; + +void rcu_config(void); +static volatile uint32_t timer_delay_count = 0; // volatile 很重要! +int fputc(int ch, FILE *f); // 声明fputc函数以重载标准库实现 + +u8 USART0_init(void); +u8 watchdog_init(u32 time); +u16 get_reset_cause(void); +void unused_pin_init(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Robot_V2/sys/systick.cpp b/Robot_V2/sys/systick.cpp new file mode 100644 index 0000000..533e364 --- /dev/null +++ b/Robot_V2/sys/systick.cpp @@ -0,0 +1,117 @@ +/*! + \file systick.c + \brief the systick configuration file + + \version 2025-06-20, V1.5.1, firmware for GD32C10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from this +software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include "systick.h" +#include "Can.h" +#include "flash.h" +#include "gd32c10x.h" + +volatile static uint32_t delay; +extern CAN_transmiter CAN0_transmiter; +extern FlashEEPROM flashEEP; + +/*! + \brief configure systick + \param[in] none + \param[out] none + \retval none +*/ +void systick_config(void) { + /* setup systick timer for 1000Hz interrupts */ + if (SysTick_Config(SystemCoreClock / 1000U)) { + /* capture error */ + while (1) { + } + } + /* configure the systick handler priority */ + NVIC_SetPriority(SysTick_IRQn, 0x00U); +} +/*! + \brief delay a time in seconds + \param[in] count: count in seconds + \param[out] none + \retval none +*/ +void delay_1s(uint32_t count) { + uint32_t i; + for (i = 0; i < count; i++) { + delay_1ms(1000); + } +} + +/*! + \brief delay a time in milliseconds + \param[in] count: count in milliseconds + \param[out] none + \retval none +*/ +void delay_1ms(uint32_t count) { + delay = count; + while (0U != delay) { + fwdgt_counter_reload(); + fwdgt_counter_reload(); + } +} + +/*! + \brief delay decrement + \param[in] none + \param[out] none + \retval none +*/ +void delay_decrement(void) { + if (0U != delay) { + delay--; + } +} + +/*! + \brief system soft reset + \param[in] none + \param[out] none + \retval none +*/ +void system_soft_reset(void) { + /* Set the software reset bit */ + SCB->AIRCR = (0x05FA0000U | (SCB->AIRCR & (0x700U)) | (1U << 2)); + + /* Data Synchronization Barrier */ + __DSB(); + + /* Wait for reset */ + while (1) { + __NOP(); + } +} + diff --git a/Robot_V2/sys/systick.h b/Robot_V2/sys/systick.h new file mode 100644 index 0000000..5294ccb --- /dev/null +++ b/Robot_V2/sys/systick.h @@ -0,0 +1,62 @@ +/*! + \file systick.h + \brief the header file of systick + + \version 2025-06-20, V1.5.1, firmware for GD32C10x +*/ + +/* + Copyright (c) 2024, GigaDevice Semiconductor Inc. + + Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from this +software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef SYSTICK_H +#define SYSTICK_H + +#ifdef __cplusplus +extern "C" { +#endif +#include + +/* configure systick */ +void systick_config(void); +/* delay a time in milliseconds */ +void delay_1ms(uint32_t count); +/* delay a time in seconds */ +void delay_1s(uint32_t count); +/* delay decrement */ +void delay_decrement(void); +/* 空闲任务计数 */ +void idle_task_count(void); +/* 获取CPU使用率 */ +uint8_t get_cpu_usage(void); +/* 系统软复位 */ +void system_soft_reset(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SYSTICK_H */ \ No newline at end of file diff --git a/out/Robot_V2+GD32C103CB.cbuild-run.yml b/out/Robot_V2+GD32C103CB.cbuild-run.yml new file mode 100644 index 0000000..87e74c8 --- /dev/null +++ b/out/Robot_V2+GD32C103CB.cbuild-run.yml @@ -0,0 +1,44 @@ +cbuild-run: + generated-by: csolution version 2.12.0+p41-gfeadfc5e + solution: ../Robot_V2.csolution.yml + target-type: GD32C103CB + target-set: + compiler: AC6 + device: GigaDevice::GD32C103CB + device-pack: GigaDevice::GD32C10x_DFP@1.0.1 + output: + - file: Robot_V2/GD32C103CB/Release/Robot_V2.axf + info: generate by Robot_V2.Release+GD32C103CB + type: elf + load: symbols + - file: Robot_V2/GD32C103CB/Release/Robot_V2.hex + info: generate by Robot_V2.Release+GD32C103CB + type: hex + load: image + system-resources: + memory: + - name: IROM1 + access: rx + start: 0x08000000 + size: 0x00020000 + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + - name: IRAM1 + access: rwx + start: 0x20000000 + size: 0x00008000 + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + system-descriptions: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/SVD/GD32C10x.svd + type: svd + debugger: + name: ST-Link@pyOCD + protocol: swd + clock: 10000000 + gdbserver: + - port: 3333 + programming: + - algorithm: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Flash/GD32C10x.FLM + start: 0x08000000 + size: 0x00020000 + ram-start: 0x20000000 + ram-size: 0x00008000 diff --git a/out/Robot_V2/GD32C103CB/Debug/Robot_V2.Debug+GD32C103CB.cbuild.yml b/out/Robot_V2/GD32C103CB/Debug/Robot_V2.Debug+GD32C103CB.cbuild.yml new file mode 100644 index 0000000..ac0ddca --- /dev/null +++ b/out/Robot_V2/GD32C103CB/Debug/Robot_V2.Debug+GD32C103CB.cbuild.yml @@ -0,0 +1,406 @@ +build: + generated-by: csolution version 2.12.0 + solution: ../../../../Robot_V2.csolution.yml + project: ../../../../Robot_V2/Robot_V2.cproject.yml + context: Robot_V2.Debug+GD32C103CB + compiler: AC6 + device: GigaDevice::GD32C103CB + device-pack: GigaDevice::GD32C10x_DFP@1.0.1 + processor: + endian: little + fpu: sp + core: Cortex-M4 + packs: + - pack: ARM::CMSIS@4.5.0 + path: ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0 + - pack: GigaDevice::GD32C10x_DFP@1.0.1 + path: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1 + optimize: none + debug: on + misc: + ASM: + - -D__packed=packed + - -D__MICROLIB + - -gdwarf-5 + - -masm=auto + C: + - -D__packed=packed + - -fshort-enums + - -fshort-wchar + - -D__MICROLIB + - -Wno-register + - -gdwarf-5 + - -std=gnu11 + - -Wno-macro-redefined + - -Wno-pragma-pack + - -Wno-parentheses-equality + - -Wno-license-management + CPP: + - -fshort-enums + - -fshort-wchar + - -D__MICROLIB + - -Wno-register + - -gdwarf-5 + - -Wno-macro-redefined + - -Wno-pragma-pack + - -Wno-parentheses-equality + - -Wno-license-management + Link: + - --library_type=microlib + - --entry=Reset_Handler + - --info=summarysizes + - --summary_stderr + - --diag_suppress=L6314W + define: + - GD32C10x + - _RTE_ + define-asm: + - GD32C10x + - _RTE_ + add-path: + - ../../../../Robot_V2/RTE/_Debug_GD32C103CB + - ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities + add-path-asm: + - ../../../../Robot_V2/RTE/_Debug_GD32C103CB + - ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities + output-dirs: + intdir: ../../../../tmp + outdir: . + rtedir: ../../../../Robot_V2/RTE + output: + - type: elf + file: Robot_V2.axf + - type: hex + file: Robot_V2.hex + - type: map + file: Robot_V2.axf.map + components: + - component: ARM::CMSIS:CORE@4.3.0 + condition: Cortex-M Device + from-pack: ARM::CMSIS@4.5.0 + selected-by: ARM::CMSIS:CORE + files: + - file: ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Documentation/Core/html/index.html + category: doc + version: 4.3.0 + - file: ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include + category: include + version: 4.3.0 + - component: GigaDevice::Device:EVAL:GD32C10x@1.0.0 + condition: GD32C10x STDPERIPHERALS EVAL + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:EVAL:GD32C10x + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities/gd32c10x_eval.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:ADC@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:ADC + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_adc.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_adc.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:CAN + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_can.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:DBG + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_dbg.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:DMA + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_dma.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:EXTI + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_exti.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:FMC + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_fmc.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:FWDGT + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_fwdgt.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:GPIO + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_gpio.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 + condition: GD32C10x CMSIS + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:MISC + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_misc.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:PMU + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_pmu.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 + condition: GD32C10x STDPERIPHERALS MISC + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:RCU + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_rcu.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:SPI_I2S@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:SPI_I2S + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_spi.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_spi.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:TIMER@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:TIMER + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_timer.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_timer.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:USART + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_usart.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:WWDGT@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:WWDGT + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_wwdgt.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_wwdgt.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_libopt@1.0.0 + condition: GD32C10x CMSIS + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_libopt + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include/gd32c10x_libopt.h + category: header + version: 1.0.0 + - component: GigaDevice::Device:Startup@1.0.0 + condition: GD32C10x + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:Startup + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include + category: include + version: 1.0.0 + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include/gd32c10x.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s + category: source + attr: config + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c + category: source + attr: config + version: 1.0.0 + linker: + script: ../../../../Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src + regions: ../../../../Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h + groups: + - group: Source Files + files: + - file: ../../../../Robot_V2/main.h + category: header + - file: ../../../../Robot_V2/main.cpp + category: sourceCpp + - group: sys + files: + - file: ../../../../Robot_V2/sys/systick.cpp + category: sourceCpp + - file: ../../../../Robot_V2/sys/systick.h + category: header + - file: ../../../../Robot_V2/sys/initial.cpp + category: sourceCpp + - file: ../../../../Robot_V2/sys/initial.h + category: header + - file: ../../../../Robot_V2/sys/health.h + category: header + - file: ../../../../Robot_V2/sys/health.cpp + category: sourceCpp + - group: device + files: + - file: ../../../../Robot_V2/device/Can.cpp + category: sourceCpp + - file: ../../../../Robot_V2/device/Can.h + category: header + - file: ../../../../Robot_V2/device/ang_sensor.cpp + category: sourceCpp + - file: ../../../../Robot_V2/device/ang_sensor.h + category: header + - file: ../../../../Robot_V2/device/ADC.cpp + category: sourceCpp + - file: ../../../../Robot_V2/device/adc.h + category: header + - file: ../../../../Robot_V2/device/Timer.cpp + category: sourceCpp + - file: ../../../../Robot_V2/device/Timer.h + category: header + - file: ../../../../Robot_V2/device/test.cpp + category: sourceCpp + - file: ../../../../Robot_V2/device/motor.cpp + category: sourceCpp + - file: ../../../../Robot_V2/device/motor.h + category: header + - group: Algorithm + files: + - file: ../../../../Robot_V2/Algorithm/Filter.cpp + category: sourceCpp + - file: ../../../../Robot_V2/Algorithm/Filter.h + category: header + - file: ../../../../Robot_V2/Algorithm/DengFOC.cpp + category: sourceCpp + - file: ../../../../Robot_V2/Algorithm/DengFOC.h + category: header + - file: ../../../../Robot_V2/Algorithm/pid.cpp + category: sourceCpp + - file: ../../../../Robot_V2/pid.h + category: header + constructed-files: + - file: ../../../../Robot_V2/RTE/_Debug_GD32C103CB/RTE_Components.h + category: header + licenses: + - license: + packs: + - pack: ARM::CMSIS@4.5.0 + components: + - component: ARM::CMSIS:CORE@4.3.0 + - license: + packs: + - pack: GigaDevice::GD32C10x_DFP@1.0.1 + components: + - component: GigaDevice::Device:EVAL:GD32C10x@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:ADC@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:SPI_I2S@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:TIMER@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:WWDGT@1.0.0 + - component: GigaDevice::Device:GD32C10x_libopt@1.0.0 + - component: GigaDevice::Device:Startup@1.0.0 diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/Can.cpp.189F590D64E2E593.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/Can.cpp.189F590D64E2E593.idx new file mode 100644 index 0000000..3dc9658 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/Can.cpp.189F590D64E2E593.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/Can.h.8B31786D14DBA198.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/Can.h.8B31786D14DBA198.idx new file mode 100644 index 0000000..d41611d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/Can.h.8B31786D14DBA198.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/OTA.cpp.50C8AB01C9FB489F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/OTA.cpp.50C8AB01C9FB489F.idx new file mode 100644 index 0000000..1a6e88e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/OTA.cpp.50C8AB01C9FB489F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/OTA.h.A31C5333BB5BD1BE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/OTA.h.A31C5333BB5BD1BE.idx new file mode 100644 index 0000000..654bf83 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/OTA.h.A31C5333BB5BD1BE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__assert.E345279A48A82EDB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__assert.E345279A48A82EDB.idx new file mode 100644 index 0000000..fcae0cb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__assert.E345279A48A82EDB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__assertion_handler.A06D3288BF6A29D6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__assertion_handler.A06D3288BF6A29D6.idx new file mode 100644 index 0000000..d91ac8f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__assertion_handler.A06D3288BF6A29D6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__bit_reference.5581F6325EEF88AD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__bit_reference.5581F6325EEF88AD.idx new file mode 100644 index 0000000..5fc1891 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__bit_reference.5581F6325EEF88AD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__config.30A38D3F581253B6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__config.30A38D3F581253B6.idx new file mode 100644 index 0000000..43ce328 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__config.30A38D3F581253B6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__hash_table.6BACF26D905ACE43.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__hash_table.6BACF26D905ACE43.idx new file mode 100644 index 0000000..a826fa0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__hash_table.6BACF26D905ACE43.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__locale.CBD5BB79C9491443.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__locale.CBD5BB79C9491443.idx new file mode 100644 index 0000000..9135f60 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__locale.CBD5BB79C9491443.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__mbstate_t.h.E3CAD0BE2BA17A12.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__mbstate_t.h.E3CAD0BE2BA17A12.idx new file mode 100644 index 0000000..88a3977 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__mbstate_t.h.E3CAD0BE2BA17A12.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__node_handle.4DD592B5DB5DF1DD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__node_handle.4DD592B5DB5DF1DD.idx new file mode 100644 index 0000000..7173818 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__node_handle.4DD592B5DB5DF1DD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__posix_l_fallback.h.3DA06B8078D52A15.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__posix_l_fallback.h.3DA06B8078D52A15.idx new file mode 100644 index 0000000..bf38794 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__posix_l_fallback.h.3DA06B8078D52A15.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__split_buffer.4058F910FA3FAAED.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__split_buffer.4058F910FA3FAAED.idx new file mode 100644 index 0000000..a146f70 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__split_buffer.4058F910FA3FAAED.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__std_mbstate_t.h.4C6E89C1BEA8FB5D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__std_mbstate_t.h.4C6E89C1BEA8FB5D.idx new file mode 100644 index 0000000..46f1c03 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__std_mbstate_t.h.4C6E89C1BEA8FB5D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__strtonum_fallback.h.2071A03A8D89DB05.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__strtonum_fallback.h.2071A03A8D89DB05.idx new file mode 100644 index 0000000..450a17e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__strtonum_fallback.h.2071A03A8D89DB05.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__undef_macros.57D3C71F3A7CDC3F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__undef_macros.57D3C71F3A7CDC3F.idx new file mode 100644 index 0000000..8e8873d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__undef_macros.57D3C71F3A7CDC3F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__verbose_abort.F5A053E88C7D8970.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__verbose_abort.F5A053E88C7D8970.idx new file mode 100644 index 0000000..d935753 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/__verbose_abort.F5A053E88C7D8970.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/abi.h.FF4E2174A05AF0D4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/abi.h.FF4E2174A05AF0D4.idx new file mode 100644 index 0000000..6ae2c04 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/abi.h.FF4E2174A05AF0D4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/abs.h.88A27D96B3A57198.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/abs.h.88A27D96B3A57198.idx new file mode 100644 index 0000000..7e4a7be Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/abs.h.88A27D96B3A57198.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/access.h.145E1499C171D131.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/access.h.145E1499C171D131.idx new file mode 100644 index 0000000..a37feb2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/access.h.145E1499C171D131.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/access.h.AE1FF68D71BE4910.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/access.h.AE1FF68D71BE4910.idx new file mode 100644 index 0000000..9e4793a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/access.h.AE1FF68D71BE4910.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/accumulate.h.5466F2AED9365208.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/accumulate.h.5466F2AED9365208.idx new file mode 100644 index 0000000..19702e6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/accumulate.h.5466F2AED9365208.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_const.h.EE1659CCC75953B2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_const.h.EE1659CCC75953B2.idx new file mode 100644 index 0000000..9a4e32a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_const.h.EE1659CCC75953B2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_cv.h.D828F08421293930.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_cv.h.D828F08421293930.idx new file mode 100644 index 0000000..ce13124 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_cv.h.D828F08421293930.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_lvalue_reference.h.2BE6101D7483F1A8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_lvalue_reference.h.2BE6101D7483F1A8.idx new file mode 100644 index 0000000..8164ab3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_lvalue_reference.h.2BE6101D7483F1A8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_pointer.h.5A03EB062085C90F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_pointer.h.5A03EB062085C90F.idx new file mode 100644 index 0000000..6ec3a0b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_pointer.h.5A03EB062085C90F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_rvalue_reference.h.F9D3F9E30C668025.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_rvalue_reference.h.F9D3F9E30C668025.idx new file mode 100644 index 0000000..acf530a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_rvalue_reference.h.F9D3F9E30C668025.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_volatile.h.47B164B5FB9A18CF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_volatile.h.47B164B5FB9A18CF.idx new file mode 100644 index 0000000..5fd601b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/add_volatile.h.47B164B5FB9A18CF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/addressof.h.904B359A9449298E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/addressof.h.904B359A9449298E.idx new file mode 100644 index 0000000..5821b93 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/addressof.h.904B359A9449298E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/adjacent_difference.h.86AC4FED5FB91107.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/adjacent_difference.h.86AC4FED5FB91107.idx new file mode 100644 index 0000000..1e6f9f9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/adjacent_difference.h.86AC4FED5FB91107.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/adjacent_find.h.D96FBABC9AAF3B9B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/adjacent_find.h.D96FBABC9AAF3B9B.idx new file mode 100644 index 0000000..ee428f7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/adjacent_find.h.D96FBABC9AAF3B9B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/advance.h.5266297F85371B8C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/advance.h.5266297F85371B8C.idx new file mode 100644 index 0000000..fbf4505 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/advance.h.5266297F85371B8C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/algorithm.B30359D947B69808.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/algorithm.B30359D947B69808.idx new file mode 100644 index 0000000..99e62dd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/algorithm.B30359D947B69808.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aliases.h.E1DBA59293C59E0C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aliases.h.E1DBA59293C59E0C.idx new file mode 100644 index 0000000..6fd0af9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aliases.h.E1DBA59293C59E0C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aliasing_iterator.h.D9524FD581BAF72D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aliasing_iterator.h.D9524FD581BAF72D.idx new file mode 100644 index 0000000..1bdfd29 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aliasing_iterator.h.D9524FD581BAF72D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/align.h.FD51B79B3D7C593C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/align.h.FD51B79B3D7C593C.idx new file mode 100644 index 0000000..c438fea Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/align.h.FD51B79B3D7C593C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aligned_storage.h.E479E04EBB5F494C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aligned_storage.h.E479E04EBB5F494C.idx new file mode 100644 index 0000000..5359011 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aligned_storage.h.E479E04EBB5F494C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aligned_union.h.8B4152DD83941B69.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aligned_union.h.8B4152DD83941B69.idx new file mode 100644 index 0000000..6963b31 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/aligned_union.h.8B4152DD83941B69.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/alignment_of.h.16160A0F7457F061.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/alignment_of.h.16160A0F7457F061.idx new file mode 100644 index 0000000..e87c089 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/alignment_of.h.16160A0F7457F061.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/all_of.h.5995C1323207F3C0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/all_of.h.5995C1323207F3C0.idx new file mode 100644 index 0000000..21a0adf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/all_of.h.5995C1323207F3C0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocate_at_least.h.372CC9DA473A1A11.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocate_at_least.h.372CC9DA473A1A11.idx new file mode 100644 index 0000000..aa5fb4e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocate_at_least.h.372CC9DA473A1A11.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocation_guard.h.C0FC9EA0DABE6EB3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocation_guard.h.C0FC9EA0DABE6EB3.idx new file mode 100644 index 0000000..ff5d7d1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocation_guard.h.C0FC9EA0DABE6EB3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator.h.E2154D9C2D533F58.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator.h.E2154D9C2D533F58.idx new file mode 100644 index 0000000..2607e04 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator.h.E2154D9C2D533F58.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_arg_t.h.C61E4D03CAF2DB72.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_arg_t.h.C61E4D03CAF2DB72.idx new file mode 100644 index 0000000..07979da Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_arg_t.h.C61E4D03CAF2DB72.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_destructor.h.95895B512A88B71D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_destructor.h.95895B512A88B71D.idx new file mode 100644 index 0000000..452bdbc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_destructor.h.95895B512A88B71D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_traits.h.C39E12D9B656333D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_traits.h.C39E12D9B656333D.idx new file mode 100644 index 0000000..d3f4dd9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/allocator_traits.h.C39E12D9B656333D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/any_of.h.596A83D1376FF467.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/any_of.h.596A83D1376FF467.idx new file mode 100644 index 0000000..a52abac Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/any_of.h.596A83D1376FF467.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/arithmetic.h.472E5FB4788CDB44.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/arithmetic.h.472E5FB4788CDB44.idx new file mode 100644 index 0000000..90ba44a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/arithmetic.h.472E5FB4788CDB44.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/arm.h.B36414F100A03BC5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/arm.h.B36414F100A03BC5.idx new file mode 100644 index 0000000..afb86ac Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/arm.h.B36414F100A03BC5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/array.823BB78AF2DC6FB8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/array.823BB78AF2DC6FB8.idx new file mode 100644 index 0000000..975a0f2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/array.823BB78AF2DC6FB8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/array.h.4A931171DE6421B4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/array.h.4A931171DE6421B4.idx new file mode 100644 index 0000000..255a663 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/array.h.4A931171DE6421B4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/as_const.h.583845552C2B6EFC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/as_const.h.583845552C2B6EFC.idx new file mode 100644 index 0000000..53d8809 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/as_const.h.583845552C2B6EFC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/assignable.h.F6EB480E6DA2D825.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/assignable.h.F6EB480E6DA2D825.idx new file mode 100644 index 0000000..6eb1d34 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/assignable.h.F6EB480E6DA2D825.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic.6F0B5D149341F7F2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic.6F0B5D149341F7F2.idx new file mode 100644 index 0000000..994a61f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic.6F0B5D149341F7F2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic.h.796FC25F2505F6EC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic.h.796FC25F2505F6EC.idx new file mode 100644 index 0000000..477c76f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic.h.796FC25F2505F6EC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_base.h.4017A932C4226FB2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_base.h.4017A932C4226FB2.idx new file mode 100644 index 0000000..76cca42 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_base.h.4017A932C4226FB2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_flag.h.6E0A411934D9EC58.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_flag.h.6E0A411934D9EC58.idx new file mode 100644 index 0000000..6a0c98e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_flag.h.6E0A411934D9EC58.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_init.h.7B0EB7135A1804F5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_init.h.7B0EB7135A1804F5.idx new file mode 100644 index 0000000..4a923f4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_init.h.7B0EB7135A1804F5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_lock_free.h.D1E9374D2EC4C0B1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_lock_free.h.D1E9374D2EC4C0B1.idx new file mode 100644 index 0000000..1abb719 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_lock_free.h.D1E9374D2EC4C0B1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_sync.h.E5D7BA1914710C56.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_sync.h.E5D7BA1914710C56.idx new file mode 100644 index 0000000..9cd983b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/atomic_sync.h.E5D7BA1914710C56.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/auto_cast.h.8CF9D0A292C2A48A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/auto_cast.h.8CF9D0A292C2A48A.idx new file mode 100644 index 0000000..96aae0b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/auto_cast.h.8CF9D0A292C2A48A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/auto_ptr.h.C13AC252E0D54B59.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/auto_ptr.h.C13AC252E0D54B59.idx new file mode 100644 index 0000000..4ef83e0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/auto_ptr.h.C13AC252E0D54B59.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/availability.h.4A3E0FF96F5383BC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/availability.h.4A3E0FF96F5383BC.idx new file mode 100644 index 0000000..823fe88 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/availability.h.4A3E0FF96F5383BC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/back_insert_iterator.h.75B14E10F5662592.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/back_insert_iterator.h.75B14E10F5662592.idx new file mode 100644 index 0000000..3dcc33f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/back_insert_iterator.h.75B14E10F5662592.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bernoulli_distribution.h.54396DDE7A3A5D77.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bernoulli_distribution.h.54396DDE7A3A5D77.idx new file mode 100644 index 0000000..215a395 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bernoulli_distribution.h.54396DDE7A3A5D77.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_function.h.0270CAD7354089A4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_function.h.0270CAD7354089A4.idx new file mode 100644 index 0000000..cca500e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_function.h.0270CAD7354089A4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_negate.h.6728A6211F595C4E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_negate.h.6728A6211F595C4E.idx new file mode 100644 index 0000000..e0fd0c9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_negate.h.6728A6211F595C4E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_search.h.8C6FD15D08393FE0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_search.h.8C6FD15D08393FE0.idx new file mode 100644 index 0000000..ca05bbe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binary_search.h.8C6FD15D08393FE0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bind.h.58C1F5CA64878D61.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bind.h.58C1F5CA64878D61.idx new file mode 100644 index 0000000..a512273 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bind.h.58C1F5CA64878D61.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binder1st.h.FDD57B15FD661708.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binder1st.h.FDD57B15FD661708.idx new file mode 100644 index 0000000..d523db9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binder1st.h.FDD57B15FD661708.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binder2nd.h.EC8AE384DC5BFB06.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binder2nd.h.EC8AE384DC5BFB06.idx new file mode 100644 index 0000000..4c1ed40 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binder2nd.h.EC8AE384DC5BFB06.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binomial_distribution.h.8DC1D7F2150DA55A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binomial_distribution.h.8DC1D7F2150DA55A.idx new file mode 100644 index 0000000..b11c25c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/binomial_distribution.h.8DC1D7F2150DA55A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit.11EEF07B2FA18BD4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit.11EEF07B2FA18BD4.idx new file mode 100644 index 0000000..477883a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit.11EEF07B2FA18BD4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit_cast.h.BAF1058F560618B6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit_cast.h.BAF1058F560618B6.idx new file mode 100644 index 0000000..9647966 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit_cast.h.BAF1058F560618B6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit_reference.h.7E0EAF5F9323DE3A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit_reference.h.7E0EAF5F9323DE3A.idx new file mode 100644 index 0000000..affbf79 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bit_reference.h.7E0EAF5F9323DE3A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/blsr.h.6DFA61E449FF7F15.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/blsr.h.6DFA61E449FF7F15.idx new file mode 100644 index 0000000..d91e7f5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/blsr.h.6DFA61E449FF7F15.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/boolean_testable.h.763055A39DDA24B7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/boolean_testable.h.763055A39DDA24B7.idx new file mode 100644 index 0000000..f44c09f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/boolean_testable.h.763055A39DDA24B7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bounded_iter.h.2E95ED3788A69ED6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bounded_iter.h.2E95ED3788A69ED6.idx new file mode 100644 index 0000000..7f42ecf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bounded_iter.h.2E95ED3788A69ED6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/boyer_moore_searcher.h.78D863651A13F341.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/boyer_moore_searcher.h.78D863651A13F341.idx new file mode 100644 index 0000000..5874964 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/boyer_moore_searcher.h.78D863651A13F341.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bsd_locale_fallbacks.h.2B5764B2CC73DEC1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bsd_locale_fallbacks.h.2B5764B2CC73DEC1.idx new file mode 100644 index 0000000..af941dc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/bsd_locale_fallbacks.h.2B5764B2CC73DEC1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/buffer.h.8E0B1954A377CF97.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/buffer.h.8E0B1954A377CF97.idx new file mode 100644 index 0000000..e553d69 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/buffer.h.8E0B1954A377CF97.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/builtin_new_allocator.h.A33AB4FC7FC5A377.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/builtin_new_allocator.h.A33AB4FC7FC5A377.idx new file mode 100644 index 0000000..020ff0f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/builtin_new_allocator.h.A33AB4FC7FC5A377.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/can_extract_key.h.DDF8C1F767140C73.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/can_extract_key.h.DDF8C1F767140C73.idx new file mode 100644 index 0000000..4e3a566 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/can_extract_key.h.DDF8C1F767140C73.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cauchy_distribution.h.4B184DA389313C79.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cauchy_distribution.h.4B184DA389313C79.idx new file mode 100644 index 0000000..c8c267c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cauchy_distribution.h.4B184DA389313C79.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cctype.41E40031BAD0B66A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cctype.41E40031BAD0B66A.idx new file mode 100644 index 0000000..7becb3f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cctype.41E40031BAD0B66A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cerrno.0507BFB39A251894.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cerrno.0507BFB39A251894.idx new file mode 100644 index 0000000..d805eec Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cerrno.0507BFB39A251894.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/char_traits.h.ACAAAA892C3B7AF3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/char_traits.h.ACAAAA892C3B7AF3.idx new file mode 100644 index 0000000..a9ad860 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/char_traits.h.ACAAAA892C3B7AF3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/check_memory_order.h.45FFDD340ACC9CCA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/check_memory_order.h.45FFDD340ACC9CCA.idx new file mode 100644 index 0000000..3ee1586 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/check_memory_order.h.45FFDD340ACC9CCA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/chi_squared_distribution.h.AA839B6E0FF025AC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/chi_squared_distribution.h.AA839B6E0FF025AC.idx new file mode 100644 index 0000000..7845e64 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/chi_squared_distribution.h.AA839B6E0FF025AC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clamp.h.8681AE4D76E3C110.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clamp.h.8681AE4D76E3C110.idx new file mode 100644 index 0000000..56bb5e8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clamp.h.8681AE4D76E3C110.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clamp_to_integral.h.96582E5A141DFB65.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clamp_to_integral.h.96582E5A141DFB65.idx new file mode 100644 index 0000000..9f1949e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clamp_to_integral.h.96582E5A141DFB65.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/class_or_enum.h.08AB965AA082F9F6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/class_or_enum.h.08AB965AA082F9F6.idx new file mode 100644 index 0000000..2b7eb5f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/class_or_enum.h.08AB965AA082F9F6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/climits.E28CBAF95D6297E5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/climits.E28CBAF95D6297E5.idx new file mode 100644 index 0000000..f46f77c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/climits.E28CBAF95D6297E5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clocale.845299ED330323A2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clocale.845299ED330323A2.idx new file mode 100644 index 0000000..b335d2e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/clocale.845299ED330323A2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cmath.897A1FBCD85B8687.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cmath.897A1FBCD85B8687.idx new file mode 100644 index 0000000..dbce0e5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cmath.897A1FBCD85B8687.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_comparison_category.h.79D3A3A9F48F543A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_comparison_category.h.79D3A3A9F48F543A.idx new file mode 100644 index 0000000..c3b201f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_comparison_category.h.79D3A3A9F48F543A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_reference.h.53D18AD8F96D0322.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_reference.h.53D18AD8F96D0322.idx new file mode 100644 index 0000000..e3ddc64 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_reference.h.53D18AD8F96D0322.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_reference_with.h.D237B3CB1BE83226.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_reference_with.h.D237B3CB1BE83226.idx new file mode 100644 index 0000000..741207e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_reference_with.h.D237B3CB1BE83226.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_type.h.D1E41E04223A2EA1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_type.h.D1E41E04223A2EA1.idx new file mode 100644 index 0000000..38a446e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/common_type.h.D1E41E04223A2EA1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/comp.h.33EFFEB59228A79B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/comp.h.33EFFEB59228A79B.idx new file mode 100644 index 0000000..6f6b557 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/comp.h.33EFFEB59228A79B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/comp_ref_type.h.7C830A33ED20669F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/comp_ref_type.h.7C830A33ED20669F.idx new file mode 100644 index 0000000..98b7972 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/comp_ref_type.h.7C830A33ED20669F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare.B226725F596BB269.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare.B226725F596BB269.idx new file mode 100644 index 0000000..eb6fc5f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare.B226725F596BB269.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare_three_way.h.77E3698F10D0AD82.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare_three_way.h.77E3698F10D0AD82.idx new file mode 100644 index 0000000..47e12dc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare_three_way.h.77E3698F10D0AD82.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare_three_way_result.h.4A4AF3300AE42C79.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare_three_way_result.h.4A4AF3300AE42C79.idx new file mode 100644 index 0000000..810c7c2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compare_three_way_result.h.4A4AF3300AE42C79.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compiler.h.7B172C72923E4560.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compiler.h.7B172C72923E4560.idx new file mode 100644 index 0000000..2b79491 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compiler.h.7B172C72923E4560.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/complex.h.BE75731799287E48.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/complex.h.BE75731799287E48.idx new file mode 100644 index 0000000..fa74055 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/complex.h.BE75731799287E48.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compressed_pair.h.03142A32A127C044.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compressed_pair.h.03142A32A127C044.idx new file mode 100644 index 0000000..1cceae8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/compressed_pair.h.03142A32A127C044.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.5626189FF631F015.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.5626189FF631F015.idx new file mode 100644 index 0000000..800efcc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.5626189FF631F015.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.04CAA957A0692B88.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.04CAA957A0692B88.idx new file mode 100644 index 0000000..ae0d681 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.04CAA957A0692B88.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.259B56F1E2A3749C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.259B56F1E2A3749C.idx new file mode 100644 index 0000000..051f28d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.259B56F1E2A3749C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.36E8012122A56AC9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.36E8012122A56AC9.idx new file mode 100644 index 0000000..9e2b9b8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.36E8012122A56AC9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.FCB0BD7182788737.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.FCB0BD7182788737.idx new file mode 100644 index 0000000..67197ba Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/concepts.h.FCB0BD7182788737.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/condition_variable.h.FB8A7741F32CDE7E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/condition_variable.h.FB8A7741F32CDE7E.idx new file mode 100644 index 0000000..0ad3878 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/condition_variable.h.FB8A7741F32CDE7E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/conditional.h.A60C42E31A26E14B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/conditional.h.A60C42E31A26E14B.idx new file mode 100644 index 0000000..ae7c01e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/conditional.h.A60C42E31A26E14B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/config.h.64C4A69BAD8C2642.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/config.h.64C4A69BAD8C2642.idx new file mode 100644 index 0000000..dca53ce Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/config.h.64C4A69BAD8C2642.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/conjunction.h.C3C8BCA48E138593.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/conjunction.h.C3C8BCA48E138593.idx new file mode 100644 index 0000000..67a4f81 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/conjunction.h.C3C8BCA48E138593.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/constexpr_c_functions.h.C41E86195B675CFF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/constexpr_c_functions.h.C41E86195B675CFF.idx new file mode 100644 index 0000000..253ec1c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/constexpr_c_functions.h.C41E86195B675CFF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/construct_at.h.8575EA892FE66828.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/construct_at.h.8575EA892FE66828.idx new file mode 100644 index 0000000..af41427 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/construct_at.h.8575EA892FE66828.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/constructible.h.8305E16F97D03B92.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/constructible.h.8305E16F97D03B92.idx new file mode 100644 index 0000000..2d47947 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/constructible.h.8305E16F97D03B92.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/container_compatible_range.h.34DF8E0859E8CA0A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/container_compatible_range.h.34DF8E0859E8CA0A.idx new file mode 100644 index 0000000..1c0921a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/container_compatible_range.h.34DF8E0859E8CA0A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/contention_t.h.94CE35A00C98221B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/contention_t.h.94CE35A00C98221B.idx new file mode 100644 index 0000000..702455c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/contention_t.h.94CE35A00C98221B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/convert_to_integral.h.BB55A1173E0E5D1E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/convert_to_integral.h.BB55A1173E0E5D1E.idx new file mode 100644 index 0000000..f80a0fa Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/convert_to_integral.h.BB55A1173E0E5D1E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/convertible_to.h.AF7FB873A9C3BF81.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/convertible_to.h.AF7FB873A9C3BF81.idx new file mode 100644 index 0000000..5633e4f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/convertible_to.h.AF7FB873A9C3BF81.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy.h.973102E8206E202F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy.h.973102E8206E202F.idx new file mode 100644 index 0000000..809bf64 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy.h.973102E8206E202F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_backward.h.189F2F6CB7362E78.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_backward.h.189F2F6CB7362E78.idx new file mode 100644 index 0000000..68212d4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_backward.h.189F2F6CB7362E78.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_cv.h.F0B051EE47E984C0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_cv.h.F0B051EE47E984C0.idx new file mode 100644 index 0000000..6671cca Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_cv.h.F0B051EE47E984C0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_cvref.h.5E9807E6078DC895.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_cvref.h.5E9807E6078DC895.idx new file mode 100644 index 0000000..d70651d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_cvref.h.5E9807E6078DC895.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_if.h.AB9F6E505087491D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_if.h.AB9F6E505087491D.idx new file mode 100644 index 0000000..ed2cefa Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_if.h.AB9F6E505087491D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_move_common.h.D563070E7254EC13.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_move_common.h.D563070E7254EC13.idx new file mode 100644 index 0000000..bf4b382 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_move_common.h.D563070E7254EC13.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_n.h.0AC42427849132F9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_n.h.0AC42427849132F9.idx new file mode 100644 index 0000000..53733f2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copy_n.h.0AC42427849132F9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copyable.h.1156F81A09F1AD8E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copyable.h.1156F81A09F1AD8E.idx new file mode 100644 index 0000000..385ae57 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copyable.h.1156F81A09F1AD8E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copysign.h.AAC8FA3FDAEEA894.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copysign.h.AAC8FA3FDAEEA894.idx new file mode 100644 index 0000000..d79b714 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/copysign.h.AAC8FA3FDAEEA894.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cm4.h.CC705C8F3FEC8944.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cm4.h.CC705C8F3FEC8944.idx new file mode 100644 index 0000000..d73544e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cm4.h.CC705C8F3FEC8944.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cm4_simd.h.E8FC04F231FE4092.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cm4_simd.h.E8FC04F231FE4092.idx new file mode 100644 index 0000000..7fe41a5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cm4_simd.h.E8FC04F231FE4092.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cmFunc.h.77722454BC93B8E2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cmFunc.h.77722454BC93B8E2.idx new file mode 100644 index 0000000..09ca982 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cmFunc.h.77722454BC93B8E2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cmInstr.h.CDBA5A00B6B2E1D6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cmInstr.h.CDBA5A00B6B2E1D6.idx new file mode 100644 index 0000000..6db6da8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/core_cmInstr.h.CDBA5A00B6B2E1D6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/count.h.BDE8C409E04FEAC3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/count.h.BDE8C409E04FEAC3.idx new file mode 100644 index 0000000..801d0ea Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/count.h.BDE8C409E04FEAC3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/count_if.h.7834C7F763BF4AE0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/count_if.h.7834C7F763BF4AE0.idx new file mode 100644 index 0000000..59eac74 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/count_if.h.7834C7F763BF4AE0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/countl.h.C435FDEF26928854.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/countl.h.C435FDEF26928854.idx new file mode 100644 index 0000000..dd0c085 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/countl.h.C435FDEF26928854.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/countr.h.23679444F87C5A17.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/countr.h.23679444F87C5A17.idx new file mode 100644 index 0000000..8be2ad4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/countr.h.23679444F87C5A17.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdarg.8B2752D53B87D8FA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdarg.8B2752D53B87D8FA.idx new file mode 100644 index 0000000..d7d2cf8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdarg.8B2752D53B87D8FA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstddef.4FB307A386DE5065.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstddef.4FB307A386DE5065.idx new file mode 100644 index 0000000..30d5382 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstddef.4FB307A386DE5065.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdint.A28258D7D90B4F09.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdint.A28258D7D90B4F09.idx new file mode 100644 index 0000000..d61ad88 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdint.A28258D7D90B4F09.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdio.AD9B4EC480E77860.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdio.AD9B4EC480E77860.idx new file mode 100644 index 0000000..876d842 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdio.AD9B4EC480E77860.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdlib.65BC9BB3F270A9D6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdlib.65BC9BB3F270A9D6.idx new file mode 100644 index 0000000..83f4621 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstdlib.65BC9BB3F270A9D6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstring.B0715BA78B825871.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstring.B0715BA78B825871.idx new file mode 100644 index 0000000..8059506 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cstring.B0715BA78B825871.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctime.9CD23D8851A90920.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctime.9CD23D8851A90920.idx new file mode 100644 index 0000000..ac90e0f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctime.9CD23D8851A90920.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctype.h.A859AB71FC1AF149.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctype.h.A859AB71FC1AF149.idx new file mode 100644 index 0000000..762eb73 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctype.h.A859AB71FC1AF149.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctype.h.D2BF01A5EAB1C8AD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctype.h.D2BF01A5EAB1C8AD.idx new file mode 100644 index 0000000..4f1c04c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ctype.h.D2BF01A5EAB1C8AD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cwchar.E408FC646F0D5547.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cwchar.E408FC646F0D5547.idx new file mode 100644 index 0000000..bbbb4b5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cwchar.E408FC646F0D5547.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cwctype.38212B9A6D9B3D46.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cwctype.38212B9A6D9B3D46.idx new file mode 100644 index 0000000..a5c7e61 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cwctype.38212B9A6D9B3D46.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cxx_atomic_impl.h.F57C898D119C5E18.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cxx_atomic_impl.h.F57C898D119C5E18.idx new file mode 100644 index 0000000..37f96e3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/cxx_atomic_impl.h.F57C898D119C5E18.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/dangling.h.255EB75741B9F7D0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/dangling.h.255EB75741B9F7D0.idx new file mode 100644 index 0000000..6dec8e2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/dangling.h.255EB75741B9F7D0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/data.h.5D1DEB009CA3CFD8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/data.h.5D1DEB009CA3CFD8.idx new file mode 100644 index 0000000..9940ee1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/data.h.5D1DEB009CA3CFD8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/data.h.80DECDAC5E7932D1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/data.h.80DECDAC5E7932D1.idx new file mode 100644 index 0000000..e62078a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/data.h.80DECDAC5E7932D1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/datasizeof.h.AD464932AD7356B0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/datasizeof.h.AD464932AD7356B0.idx new file mode 100644 index 0000000..d9eb809 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/datasizeof.h.AD464932AD7356B0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/decay.h.F6682406F3F8D668.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/decay.h.F6682406F3F8D668.idx new file mode 100644 index 0000000..89489d9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/decay.h.F6682406F3F8D668.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/declval.h.EE8ED7882A74A218.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/declval.h.EE8ED7882A74A218.idx new file mode 100644 index 0000000..42c6dd3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/declval.h.EE8ED7882A74A218.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_random_engine.h.B9B906BAD56E3609.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_random_engine.h.B9B906BAD56E3609.idx new file mode 100644 index 0000000..932723b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_random_engine.h.B9B906BAD56E3609.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_searcher.h.E240A1A8B768056E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_searcher.h.E240A1A8B768056E.idx new file mode 100644 index 0000000..d22803e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_searcher.h.E240A1A8B768056E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_sentinel.h.B897A3FD54947BCA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_sentinel.h.B897A3FD54947BCA.idx new file mode 100644 index 0000000..ea4e791 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/default_sentinel.h.B897A3FD54947BCA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/dependent_type.h.ACCA67AD0B14D4AC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/dependent_type.h.ACCA67AD0B14D4AC.idx new file mode 100644 index 0000000..f92cc4b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/dependent_type.h.ACCA67AD0B14D4AC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/derived_from.h.C6BDD379E985EA2E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/derived_from.h.C6BDD379E985EA2E.idx new file mode 100644 index 0000000..45c93fe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/derived_from.h.C6BDD379E985EA2E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/destruct_n.h.92E52D2853C033CB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/destruct_n.h.92E52D2853C033CB.idx new file mode 100644 index 0000000..cb75854 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/destruct_n.h.92E52D2853C033CB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/destructible.h.705C0699A9D10199.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/destructible.h.705C0699A9D10199.idx new file mode 100644 index 0000000..846f3e6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/destructible.h.705C0699A9D10199.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/desugars_to.h.2195A466DF580F14.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/desugars_to.h.2195A466DF580F14.idx new file mode 100644 index 0000000..f911541 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/desugars_to.h.2195A466DF580F14.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/different_from.h.BD0F6307B6F0B6FC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/different_from.h.BD0F6307B6F0B6FC.idx new file mode 100644 index 0000000..fcf1d6f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/different_from.h.BD0F6307B6F0B6FC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/discard_block_engine.h.8093DA26EE4C9233.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/discard_block_engine.h.8093DA26EE4C9233.idx new file mode 100644 index 0000000..0de1c79 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/discard_block_engine.h.8093DA26EE4C9233.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/discrete_distribution.h.0801BDF957890E93.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/discrete_distribution.h.0801BDF957890E93.idx new file mode 100644 index 0000000..a21c1f3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/discrete_distribution.h.0801BDF957890E93.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/disjunction.h.CE6E738F5B4FA686.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/disjunction.h.CE6E738F5B4FA686.idx new file mode 100644 index 0000000..50024a8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/disjunction.h.CE6E738F5B4FA686.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/distance.h.DA7B3C92281713E9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/distance.h.DA7B3C92281713E9.idx new file mode 100644 index 0000000..f7377ca Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/distance.h.DA7B3C92281713E9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/duration.h.DB9974C660070F66.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/duration.h.DB9974C660070F66.idx new file mode 100644 index 0000000..3aa56b2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/duration.h.DB9974C660070F66.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.2ADEC2E99BEFFA0D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.2ADEC2E99BEFFA0D.idx new file mode 100644 index 0000000..6d92539 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.2ADEC2E99BEFFA0D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.AEF655102DC8EC54.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.AEF655102DC8EC54.idx new file mode 100644 index 0000000..162ea89 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.AEF655102DC8EC54.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.AFF76EF902F5662D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.AFF76EF902F5662D.idx new file mode 100644 index 0000000..56b8a66 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/empty.h.AFF76EF902F5662D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_borrowed_range.h.13DE2DEF7A398A5E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_borrowed_range.h.13DE2DEF7A398A5E.idx new file mode 100644 index 0000000..d29d16b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_borrowed_range.h.13DE2DEF7A398A5E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_if.h.BC3C82D5E21D7639.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_if.h.BC3C82D5E21D7639.idx new file mode 100644 index 0000000..f873deb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_if.h.BC3C82D5E21D7639.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_insertable.h.C29A8AA97AECB407.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_insertable.h.C29A8AA97AECB407.idx new file mode 100644 index 0000000..6a18383 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_insertable.h.C29A8AA97AECB407.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_view.h.CF466F520822E115.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_view.h.CF466F520822E115.idx new file mode 100644 index 0000000..7a71b5c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/enable_view.h.CF466F520822E115.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equal.h.2A6141FBF10917BC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equal.h.2A6141FBF10917BC.idx new file mode 100644 index 0000000..e3b2285 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equal.h.2A6141FBF10917BC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equal_range.h.70732B9350D3CD9C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equal_range.h.70732B9350D3CD9C.idx new file mode 100644 index 0000000..309f4a6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equal_range.h.70732B9350D3CD9C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equality_comparable.h.E7D218DA88BB04B6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equality_comparable.h.E7D218DA88BB04B6.idx new file mode 100644 index 0000000..4616910 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/equality_comparable.h.E7D218DA88BB04B6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/erase_if_container.h.024EDCFF0B1B8EF6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/erase_if_container.h.024EDCFF0B1B8EF6.idx new file mode 100644 index 0000000..6a33206 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/erase_if_container.h.024EDCFF0B1B8EF6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errc.h.75D0FD53E26E4F73.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errc.h.75D0FD53E26E4F73.idx new file mode 100644 index 0000000..0b25131 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errc.h.75D0FD53E26E4F73.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errno.h.10371C1DDC4BFC92.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errno.h.10371C1DDC4BFC92.idx new file mode 100644 index 0000000..108eed1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errno.h.10371C1DDC4BFC92.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errno.h.42779960C98FC621.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errno.h.42779960C98FC621.idx new file mode 100644 index 0000000..104ca6b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/errno.h.42779960C98FC621.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_category.h.239968016733BE57.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_category.h.239968016733BE57.idx new file mode 100644 index 0000000..95ac9ae Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_category.h.239968016733BE57.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_code.h.AC13E4769EAF7D59.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_code.h.AC13E4769EAF7D59.idx new file mode 100644 index 0000000..63551db Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_code.h.AC13E4769EAF7D59.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_condition.h.3BEAAC54DCEB195F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_condition.h.3BEAAC54DCEB195F.idx new file mode 100644 index 0000000..93cf19c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_condition.h.3BEAAC54DCEB195F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_functions.h.9935817FF1F33E52.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_functions.h.9935817FF1F33E52.idx new file mode 100644 index 0000000..1c61c04 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/error_functions.h.9935817FF1F33E52.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception.738A51C043E5C14F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception.738A51C043E5C14F.idx new file mode 100644 index 0000000..8bf9980 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception.738A51C043E5C14F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception.h.D8C5111A308F2692.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception.h.D8C5111A308F2692.idx new file mode 100644 index 0000000..1e37352 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception.h.D8C5111A308F2692.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception_guard.h.D545BBEB7909E6CA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception_guard.h.D545BBEB7909E6CA.idx new file mode 100644 index 0000000..57532bf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception_guard.h.D545BBEB7909E6CA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception_ptr.h.24C47F5B333FB7E1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception_ptr.h.24C47F5B333FB7E1.idx new file mode 100644 index 0000000..1cb7853 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exception_ptr.h.24C47F5B333FB7E1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exchange.h.300D90E40B3A7734.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exchange.h.300D90E40B3A7734.idx new file mode 100644 index 0000000..1dee3f9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exchange.h.300D90E40B3A7734.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exclusive_scan.h.C4AD492DBBA992DB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exclusive_scan.h.C4AD492DBBA992DB.idx new file mode 100644 index 0000000..67fd55c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exclusive_scan.h.C4AD492DBBA992DB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/execution.986FAA929C11DE44.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/execution.986FAA929C11DE44.idx new file mode 100644 index 0000000..cbbf72a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/execution.986FAA929C11DE44.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exponential_distribution.h.280BEB34D99FDD75.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exponential_distribution.h.280BEB34D99FDD75.idx new file mode 100644 index 0000000..f34aefb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exponential_distribution.h.280BEB34D99FDD75.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exponential_functions.h.55D5B21C0FBB1C0E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exponential_functions.h.55D5B21C0FBB1C0E.idx new file mode 100644 index 0000000..a0f7210 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/exponential_functions.h.55D5B21C0FBB1C0E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extended_grapheme_cluster_table.h.7559E4A8E1B3D831.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extended_grapheme_cluster_table.h.7559E4A8E1B3D831.idx new file mode 100644 index 0000000..d7ee06b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extended_grapheme_cluster_table.h.7559E4A8E1B3D831.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extent.h.BE25866992E84088.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extent.h.BE25866992E84088.idx new file mode 100644 index 0000000..8b503ca Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extent.h.BE25866992E84088.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extern_template_lists.h.55C2C02A1EA324F4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extern_template_lists.h.55C2C02A1EA324F4.idx new file mode 100644 index 0000000..c08db8d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extern_template_lists.h.55C2C02A1EA324F4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extreme_value_distribution.h.C8D53A1B89F27E5F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extreme_value_distribution.h.C8D53A1B89F27E5F.idx new file mode 100644 index 0000000..471c269 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/extreme_value_distribution.h.C8D53A1B89F27E5F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fdim.h.11A70B93B7E85CE9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fdim.h.11A70B93B7E85CE9.idx new file mode 100644 index 0000000..3dd241e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fdim.h.11A70B93B7E85CE9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fence.h.2E421EFC8E7123C3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fence.h.2E421EFC8E7123C3.idx new file mode 100644 index 0000000..c8c2343 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fence.h.2E421EFC8E7123C3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fill.h.7D29F04CC7CC0B03.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fill.h.7D29F04CC7CC0B03.idx new file mode 100644 index 0000000..c634ddb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fill.h.7D29F04CC7CC0B03.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fill_n.h.5EEDBEACB3CD43F3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fill_n.h.5EEDBEACB3CD43F3.idx new file mode 100644 index 0000000..ad38533 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fill_n.h.5EEDBEACB3CD43F3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find.h.D1A43C182763EE7D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find.h.D1A43C182763EE7D.idx new file mode 100644 index 0000000..246ee04 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find.h.D1A43C182763EE7D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_end.h.15FDE6E17A82D31D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_end.h.15FDE6E17A82D31D.idx new file mode 100644 index 0000000..e91bc04 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_end.h.15FDE6E17A82D31D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_first_of.h.2BB2AC66B095CEBC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_first_of.h.2BB2AC66B095CEBC.idx new file mode 100644 index 0000000..85d39f1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_first_of.h.2BB2AC66B095CEBC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_if.h.3FC9097A48E94ED8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_if.h.3FC9097A48E94ED8.idx new file mode 100644 index 0000000..ca8e815 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_if.h.3FC9097A48E94ED8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_if_not.h.9B02D1BECDA57157.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_if_not.h.9B02D1BECDA57157.idx new file mode 100644 index 0000000..95cdc94 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_if_not.h.9B02D1BECDA57157.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_index.h.B72F41E58BF0F68F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_index.h.B72F41E58BF0F68F.idx new file mode 100644 index 0000000..e3087af Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_index.h.B72F41E58BF0F68F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_segment_if.h.DC9FE000EB02479B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_segment_if.h.DC9FE000EB02479B.idx new file mode 100644 index 0000000..89360f0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/find_segment_if.h.DC9FE000EB02479B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fisher_f_distribution.h.B43ED9C624B3EBDD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fisher_f_distribution.h.B43ED9C624B3EBDD.idx new file mode 100644 index 0000000..31bf347 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fisher_f_distribution.h.B43ED9C624B3EBDD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/flash.cpp.8F9E316F74D04058.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/flash.cpp.8F9E316F74D04058.idx new file mode 100644 index 0000000..2849840 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/flash.cpp.8F9E316F74D04058.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/flash.h.5DA166015EA23E7C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/flash.h.5DA166015EA23E7C.idx new file mode 100644 index 0000000..8e21c0a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/flash.h.5DA166015EA23E7C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fma.h.58258C4934799F1D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fma.h.58258C4934799F1D.idx new file mode 100644 index 0000000..a574c4d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fma.h.58258C4934799F1D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each.h.035278B724E87AF0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each.h.035278B724E87AF0.idx new file mode 100644 index 0000000..5c4c26f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each.h.035278B724E87AF0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each_n.h.E4578CE2562136A1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each_n.h.E4578CE2562136A1.idx new file mode 100644 index 0000000..29197a9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each_n.h.E4578CE2562136A1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each_segment.h.CAB9A10BEBF7F261.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each_segment.h.CAB9A10BEBF7F261.idx new file mode 100644 index 0000000..157b9f0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/for_each_segment.h.CAB9A10BEBF7F261.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format.h.990F54CDB6C0B18A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format.h.990F54CDB6C0B18A.idx new file mode 100644 index 0000000..ee6ccc5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format.h.990F54CDB6C0B18A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_arg.h.5F776F736041F9C4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_arg.h.5F776F736041F9C4.idx new file mode 100644 index 0000000..864c0a7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_arg.h.5F776F736041F9C4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_error.h.E08DED97442A6F4A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_error.h.E08DED97442A6F4A.idx new file mode 100644 index 0000000..2ecceaa Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_error.h.E08DED97442A6F4A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_parse_context.h.E743FB3F06164780.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_parse_context.h.E743FB3F06164780.idx new file mode 100644 index 0000000..eec1f1a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_parse_context.h.E743FB3F06164780.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_string.h.7BFA80B3ADA1174E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_string.h.7BFA80B3ADA1174E.idx new file mode 100644 index 0000000..bdd4a62 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_string.h.7BFA80B3ADA1174E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_to_n_result.h.6E36E4D0B6835EE5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_to_n_result.h.6E36E4D0B6835EE5.idx new file mode 100644 index 0000000..a18bccd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/format_to_n_result.h.6E36E4D0B6835EE5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter.h.6C2294F5A2A978CC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter.h.6C2294F5A2A978CC.idx new file mode 100644 index 0000000..6490085 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter.h.6C2294F5A2A978CC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_bool.h.7AF1073675FDE69E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_bool.h.7AF1073675FDE69E.idx new file mode 100644 index 0000000..05bbc84 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_bool.h.7AF1073675FDE69E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_integral.h.9251ACCA130A9567.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_integral.h.9251ACCA130A9567.idx new file mode 100644 index 0000000..e6c228b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_integral.h.9251ACCA130A9567.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_output.h.0C707313BC8B1AC5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_output.h.0C707313BC8B1AC5.idx new file mode 100644 index 0000000..777be80 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/formatter_output.h.0C707313BC8B1AC5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/forward.h.EF526ED9681BEDE2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/forward.h.EF526ED9681BEDE2.idx new file mode 100644 index 0000000..4300f0f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/forward.h.EF526ED9681BEDE2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/forward_like.h.54AEDF8D977A59BE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/forward_like.h.54AEDF8D977A59BE.idx new file mode 100644 index 0000000..5b04558 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/forward_like.h.54AEDF8D977A59BE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fpos.h.51F847CC42CC7FB0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fpos.h.51F847CC42CC7FB0.idx new file mode 100644 index 0000000..581b54b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fpos.h.51F847CC42CC7FB0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/from_range.h.1813980F34DCA66A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/from_range.h.1813980F34DCA66A.idx new file mode 100644 index 0000000..2420cfe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/from_range.h.1813980F34DCA66A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/front_insert_iterator.h.F90717F379EE45F9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/front_insert_iterator.h.F90717F379EE45F9.idx new file mode 100644 index 0000000..dd9cba7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/front_insert_iterator.h.F90717F379EE45F9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fstream.h.B8F5415AA0A8938D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fstream.h.B8F5415AA0A8938D.idx new file mode 100644 index 0000000..bfd14f7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/fstream.h.B8F5415AA0A8938D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/function.h.49D9C8096C2908A3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/function.h.49D9C8096C2908A3.idx new file mode 100644 index 0000000..f784605 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/function.h.49D9C8096C2908A3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/functional.22015D78C09675A7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/functional.22015D78C09675A7.idx new file mode 100644 index 0000000..12c1843 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/functional.22015D78C09675A7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/functional.h.8343B93DC7AB798A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/functional.h.8343B93DC7AB798A.idx new file mode 100644 index 0000000..b345496 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/functional.h.8343B93DC7AB798A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gamma.h.565E36029249C60D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gamma.h.565E36029249C60D.idx new file mode 100644 index 0000000..45ae9ef Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gamma.h.565E36029249C60D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gamma_distribution.h.A7A4BD8575E0DD0E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gamma_distribution.h.A7A4BD8575E0DD0E.idx new file mode 100644 index 0000000..513a914 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gamma_distribution.h.A7A4BD8575E0DD0E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gcd_lcm.h.1D27E93FE773BA29.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gcd_lcm.h.1D27E93FE773BA29.idx new file mode 100644 index 0000000..4396321 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gcd_lcm.h.1D27E93FE773BA29.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x.h.CA3FDA6574B06FC1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x.h.CA3FDA6574B06FC1.idx new file mode 100644 index 0000000..90a5000 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x.h.CA3FDA6574B06FC1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_adc.h.EF4358569067F517.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_adc.h.EF4358569067F517.idx new file mode 100644 index 0000000..7576743 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_adc.h.EF4358569067F517.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_bkp.c.B2AC217BC86F058C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_bkp.c.B2AC217BC86F058C.idx new file mode 100644 index 0000000..d2301c1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_bkp.c.B2AC217BC86F058C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_bkp.h.28AB3DAAE2BCC6C2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_bkp.h.28AB3DAAE2BCC6C2.idx new file mode 100644 index 0000000..304784c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_bkp.h.28AB3DAAE2BCC6C2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_can.c.9A7AF0289E55BDB6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_can.c.9A7AF0289E55BDB6.idx new file mode 100644 index 0000000..395b89f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_can.c.9A7AF0289E55BDB6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_can.h.9D407DE6E7D7BBC6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_can.h.9D407DE6E7D7BBC6.idx new file mode 100644 index 0000000..b81f941 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_can.h.9D407DE6E7D7BBC6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_crc.c.F6DDC6B8B8993B58.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_crc.c.F6DDC6B8B8993B58.idx new file mode 100644 index 0000000..9a19b46 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_crc.c.F6DDC6B8B8993B58.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_crc.h.BCF9DD097BC0E558.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_crc.h.BCF9DD097BC0E558.idx new file mode 100644 index 0000000..d1215bf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_crc.h.BCF9DD097BC0E558.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_ctc.h.689D2BB536D5AB9B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_ctc.h.689D2BB536D5AB9B.idx new file mode 100644 index 0000000..7c064be Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_ctc.h.689D2BB536D5AB9B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dac.h.8E85B964D194DCF6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dac.h.8E85B964D194DCF6.idx new file mode 100644 index 0000000..01b6bfb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dac.h.8E85B964D194DCF6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dbg.c.77F06E5A520C4FCE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dbg.c.77F06E5A520C4FCE.idx new file mode 100644 index 0000000..77ef970 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dbg.c.77F06E5A520C4FCE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dbg.h.057F810B0DB71ECF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dbg.h.057F810B0DB71ECF.idx new file mode 100644 index 0000000..936d8a7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dbg.h.057F810B0DB71ECF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dma.c.35CA06EF854535A5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dma.c.35CA06EF854535A5.idx new file mode 100644 index 0000000..600612b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dma.c.35CA06EF854535A5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dma.h.E55AB735911EF4CD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dma.h.E55AB735911EF4CD.idx new file mode 100644 index 0000000..f49b350 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_dma.h.E55AB735911EF4CD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_eval.c.594FB0A3FEC0397F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_eval.c.594FB0A3FEC0397F.idx new file mode 100644 index 0000000..0339c3f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_eval.c.594FB0A3FEC0397F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_eval.h.5DA3DA1252F47ABB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_eval.h.5DA3DA1252F47ABB.idx new file mode 100644 index 0000000..3308620 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_eval.h.5DA3DA1252F47ABB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exmc.h.12FCFBE39F7C8EE1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exmc.h.12FCFBE39F7C8EE1.idx new file mode 100644 index 0000000..5fc6c38 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exmc.h.12FCFBE39F7C8EE1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exti.c.04D5F235593F65BA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exti.c.04D5F235593F65BA.idx new file mode 100644 index 0000000..76ecd04 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exti.c.04D5F235593F65BA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exti.h.325FE95D190A0DD5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exti.h.325FE95D190A0DD5.idx new file mode 100644 index 0000000..5dafc3b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_exti.h.325FE95D190A0DD5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fmc.c.6C918DDFBCD12E54.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fmc.c.6C918DDFBCD12E54.idx new file mode 100644 index 0000000..c552c90 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fmc.c.6C918DDFBCD12E54.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fmc.h.085216A0DF1765A6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fmc.h.085216A0DF1765A6.idx new file mode 100644 index 0000000..86976bc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fmc.h.085216A0DF1765A6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fwdgt.c.86603F7A914142A9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fwdgt.c.86603F7A914142A9.idx new file mode 100644 index 0000000..4f85bbe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fwdgt.c.86603F7A914142A9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fwdgt.h.A1DEE4AD92B3FDBA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fwdgt.h.A1DEE4AD92B3FDBA.idx new file mode 100644 index 0000000..9f7f5a4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_fwdgt.h.A1DEE4AD92B3FDBA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_gpio.c.7D9C99867F6F9BAE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_gpio.c.7D9C99867F6F9BAE.idx new file mode 100644 index 0000000..f483b73 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_gpio.c.7D9C99867F6F9BAE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_gpio.h.319A27BC78E6E6DF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_gpio.h.319A27BC78E6E6DF.idx new file mode 100644 index 0000000..a29097f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_gpio.h.319A27BC78E6E6DF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_i2c.h.F2668D21079D77C4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_i2c.h.F2668D21079D77C4.idx new file mode 100644 index 0000000..0d58c51 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_i2c.h.F2668D21079D77C4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_libopt.h.E4A1E3DB1E741BF6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_libopt.h.E4A1E3DB1E741BF6.idx new file mode 100644 index 0000000..814af09 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_libopt.h.E4A1E3DB1E741BF6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_misc.c.6B3DFF52F8233DF2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_misc.c.6B3DFF52F8233DF2.idx new file mode 100644 index 0000000..9f62513 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_misc.c.6B3DFF52F8233DF2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_misc.h.CB5209240ED995C3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_misc.h.CB5209240ED995C3.idx new file mode 100644 index 0000000..50b3aeb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_misc.h.CB5209240ED995C3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_pmu.c.7F8D1B29C554C9FD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_pmu.c.7F8D1B29C554C9FD.idx new file mode 100644 index 0000000..1f4730c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_pmu.c.7F8D1B29C554C9FD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_pmu.h.E6ED462BA1FFA736.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_pmu.h.E6ED462BA1FFA736.idx new file mode 100644 index 0000000..f70611e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_pmu.h.E6ED462BA1FFA736.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rcu.c.228F9724BB392EE3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rcu.c.228F9724BB392EE3.idx new file mode 100644 index 0000000..6bd71e7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rcu.c.228F9724BB392EE3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rcu.h.B5EAFBD1E2CFD229.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rcu.h.B5EAFBD1E2CFD229.idx new file mode 100644 index 0000000..4da8343 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rcu.h.B5EAFBD1E2CFD229.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rtc.h.A18544EABA387F40.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rtc.h.A18544EABA387F40.idx new file mode 100644 index 0000000..475b9da Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_rtc.h.A18544EABA387F40.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_spi.h.21EB4F19BDAFC3E0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_spi.h.21EB4F19BDAFC3E0.idx new file mode 100644 index 0000000..6e97749 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_spi.h.21EB4F19BDAFC3E0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_timer.h.0295D8FCD03CD7D6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_timer.h.0295D8FCD03CD7D6.idx new file mode 100644 index 0000000..d989c04 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_timer.h.0295D8FCD03CD7D6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_usart.c.E3B04A639D02B8B1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_usart.c.E3B04A639D02B8B1.idx new file mode 100644 index 0000000..4ae3065 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_usart.c.E3B04A639D02B8B1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_usart.h.0EEB29A2569AC05B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_usart.h.0EEB29A2569AC05B.idx new file mode 100644 index 0000000..3085062 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_usart.h.0EEB29A2569AC05B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_wwdgt.h.0FBAD93D1D95DB21.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_wwdgt.h.0FBAD93D1D95DB21.idx new file mode 100644 index 0000000..812d891 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/gd32c10x_wwdgt.h.0FBAD93D1D95DB21.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate.h.E9B5F2A10C2E7224.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate.h.E9B5F2A10C2E7224.idx new file mode 100644 index 0000000..9b1fdb5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate.h.E9B5F2A10C2E7224.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate_canonical.h.331BBBE2D2A0ED98.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate_canonical.h.331BBBE2D2A0ED98.idx new file mode 100644 index 0000000..d037751 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate_canonical.h.331BBBE2D2A0ED98.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate_n.h.6FF61CC2C0AA4587.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate_n.h.6FF61CC2C0AA4587.idx new file mode 100644 index 0000000..96a308f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/generate_n.h.6FF61CC2C0AA4587.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/geometric_distribution.h.91DA632C425405E7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/geometric_distribution.h.91DA632C425405E7.idx new file mode 100644 index 0000000..856244b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/geometric_distribution.h.91DA632C425405E7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/half_positive.h.835AC56A0E242B1F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/half_positive.h.835AC56A0E242B1F.idx new file mode 100644 index 0000000..33d9dcd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/half_positive.h.835AC56A0E242B1F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/has_unique_object_representation.h.8C81629C4A36156B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/has_unique_object_representation.h.8C81629C4A36156B.idx new file mode 100644 index 0000000..33e21b5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/has_unique_object_representation.h.8C81629C4A36156B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/has_virtual_destructor.h.64567FE18BF6E3DF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/has_virtual_destructor.h.64567FE18BF6E3DF.idx new file mode 100644 index 0000000..6637394 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/has_virtual_destructor.h.64567FE18BF6E3DF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hash.h.883B556D9DB05764.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hash.h.883B556D9DB05764.idx new file mode 100644 index 0000000..1645fd7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hash.h.883B556D9DB05764.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/high_resolution_clock.h.90C4FEF3764C2F9D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/high_resolution_clock.h.90C4FEF3764C2F9D.idx new file mode 100644 index 0000000..df02a49 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/high_resolution_clock.h.90C4FEF3764C2F9D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hyperbolic_functions.h.7AE80F11FB8FCB8C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hyperbolic_functions.h.7AE80F11FB8FCB8C.idx new file mode 100644 index 0000000..9a4783d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hyperbolic_functions.h.7AE80F11FB8FCB8C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hypot.h.6188795359D07194.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hypot.h.6188795359D07194.idx new file mode 100644 index 0000000..ea18463 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/hypot.h.6188795359D07194.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/id.h.8E48E9BB85BAFEDB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/id.h.8E48E9BB85BAFEDB.idx new file mode 100644 index 0000000..e924398 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/id.h.8E48E9BB85BAFEDB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/identity.h.3184AA958B4FFFC3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/identity.h.3184AA958B4FFFC3.idx new file mode 100644 index 0000000..72ec8ff Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/identity.h.3184AA958B4FFFC3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ignore.h.5C13969DE9B73E1F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ignore.h.5C13969DE9B73E1F.idx new file mode 100644 index 0000000..2823103 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ignore.h.5C13969DE9B73E1F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_in_out_result.h.512579FCBED28C25.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_in_out_result.h.512579FCBED28C25.idx new file mode 100644 index 0000000..1225101 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_in_out_result.h.512579FCBED28C25.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_out_result.h.2E5990760C39DE2F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_out_result.h.2E5990760C39DE2F.idx new file mode 100644 index 0000000..1f9c979 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_out_result.h.2E5990760C39DE2F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_place.h.33FB8B5B562FAB34.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_place.h.33FB8B5B562FAB34.idx new file mode 100644 index 0000000..19253ac Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/in_place.h.33FB8B5B562FAB34.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/includes.h.8B6877206B612D29.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/includes.h.8B6877206B612D29.idx new file mode 100644 index 0000000..fb637dd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/includes.h.8B6877206B612D29.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inclusive_scan.h.0480AFFA9E0915C0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inclusive_scan.h.0480AFFA9E0915C0.idx new file mode 100644 index 0000000..6a062cd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inclusive_scan.h.0480AFFA9E0915C0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/incrementable_traits.h.D1DA584B5709D41A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/incrementable_traits.h.D1DA584B5709D41A.idx new file mode 100644 index 0000000..59b2fa4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/incrementable_traits.h.D1DA584B5709D41A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/independent_bits_engine.h.765BCEAD1CF73B6D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/independent_bits_engine.h.765BCEAD1CF73B6D.idx new file mode 100644 index 0000000..20ed6d8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/independent_bits_engine.h.765BCEAD1CF73B6D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/indic_conjunct_break_table.h.A79BFBF5B5DC314A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/indic_conjunct_break_table.h.A79BFBF5B5DC314A.idx new file mode 100644 index 0000000..7978658 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/indic_conjunct_break_table.h.A79BFBF5B5DC314A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initial.cpp.091E9550D2F5002F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initial.cpp.091E9550D2F5002F.idx new file mode 100644 index 0000000..a49f988 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initial.cpp.091E9550D2F5002F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initial.h.3789E8A46017A9C9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initial.h.3789E8A46017A9C9.idx new file mode 100644 index 0000000..4ec1d7b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initial.h.3789E8A46017A9C9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initializer_list.967A8146E450D645.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initializer_list.967A8146E450D645.idx new file mode 100644 index 0000000..4cc7a6f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/initializer_list.967A8146E450D645.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inner_product.h.02CDC2358617CC13.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inner_product.h.02CDC2358617CC13.idx new file mode 100644 index 0000000..8de1056 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inner_product.h.02CDC2358617CC13.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inout_ptr.h.A27C06B285DB600B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inout_ptr.h.A27C06B285DB600B.idx new file mode 100644 index 0000000..d3c89ca Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inout_ptr.h.A27C06B285DB600B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inplace_merge.h.2A9C5DB1304275FC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inplace_merge.h.2A9C5DB1304275FC.idx new file mode 100644 index 0000000..05bff01 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inplace_merge.h.2A9C5DB1304275FC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/insert_iterator.h.66B801DEC63CD811.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/insert_iterator.h.66B801DEC63CD811.idx new file mode 100644 index 0000000..84a4f90 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/insert_iterator.h.66B801DEC63CD811.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/integer_sequence.h.E5F0501589D243E8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/integer_sequence.h.E5F0501589D243E8.idx new file mode 100644 index 0000000..c90b93b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/integer_sequence.h.E5F0501589D243E8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/integral_constant.h.AE83A9C783F3E1FC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/integral_constant.h.AE83A9C783F3E1FC.idx new file mode 100644 index 0000000..c3c8900 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/integral_constant.h.AE83A9C783F3E1FC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inverse_hyperbolic_functions.h.B3EF4DA55939D92A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inverse_hyperbolic_functions.h.B3EF4DA55939D92A.idx new file mode 100644 index 0000000..dd6408b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inverse_hyperbolic_functions.h.B3EF4DA55939D92A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inverse_trigonometric_functions.h.6FA2170402B62718.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inverse_trigonometric_functions.h.6FA2170402B62718.idx new file mode 100644 index 0000000..0494c5c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/inverse_trigonometric_functions.h.6FA2170402B62718.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invert_if.h.F0EEC460CC1B74F1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invert_if.h.F0EEC460CC1B74F1.idx new file mode 100644 index 0000000..54d499a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invert_if.h.F0EEC460CC1B74F1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invocable.h.5FBF525FC7995401.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invocable.h.5FBF525FC7995401.idx new file mode 100644 index 0000000..129e6bc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invocable.h.5FBF525FC7995401.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invoke.h.01F7682F585EBC75.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invoke.h.01F7682F585EBC75.idx new file mode 100644 index 0000000..10f36ce Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invoke.h.01F7682F585EBC75.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invoke.h.D5482CEF74F9AE21.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invoke.h.D5482CEF74F9AE21.idx new file mode 100644 index 0000000..173af39 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/invoke.h.D5482CEF74F9AE21.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ios.37D749D0BD5969FC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ios.37D749D0BD5969FC.idx new file mode 100644 index 0000000..6e9f3b8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ios.37D749D0BD5969FC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ios.h.38DC8C7C5E8EDF72.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ios.h.38DC8C7C5E8EDF72.idx new file mode 100644 index 0000000..1dc6204 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ios.h.38DC8C7C5E8EDF72.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iosfwd.FE59745E653D39BE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iosfwd.FE59745E653D39BE.idx new file mode 100644 index 0000000..6e01063 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iosfwd.FE59745E653D39BE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iota.h.FA0A39100F813132.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iota.h.FA0A39100F813132.idx new file mode 100644 index 0000000..c891299 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iota.h.FA0A39100F813132.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_abstract.h.49B5EA65BD6F7D8C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_abstract.h.49B5EA65BD6F7D8C.idx new file mode 100644 index 0000000..48e2f5b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_abstract.h.49B5EA65BD6F7D8C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_aggregate.h.4FD07E224BFB7AE8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_aggregate.h.4FD07E224BFB7AE8.idx new file mode 100644 index 0000000..b1e3009 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_aggregate.h.4FD07E224BFB7AE8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_allocator.h.AA303E57362A4729.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_allocator.h.AA303E57362A4729.idx new file mode 100644 index 0000000..581b262 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_allocator.h.AA303E57362A4729.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_always_bitcastable.h.7F1F54E927EB34D7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_always_bitcastable.h.7F1F54E927EB34D7.idx new file mode 100644 index 0000000..40bdaf5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_always_bitcastable.h.7F1F54E927EB34D7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_always_lock_free.h.AC3C87D950F4D6F8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_always_lock_free.h.AC3C87D950F4D6F8.idx new file mode 100644 index 0000000..6e32eac Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_always_lock_free.h.AC3C87D950F4D6F8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_arithmetic.h.ACD8E5D2A9FFFF1E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_arithmetic.h.ACD8E5D2A9FFFF1E.idx new file mode 100644 index 0000000..ad41a1c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_arithmetic.h.ACD8E5D2A9FFFF1E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_array.h.F12A9D5F316285B1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_array.h.F12A9D5F316285B1.idx new file mode 100644 index 0000000..c892b7d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_array.h.F12A9D5F316285B1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_assignable.h.3E3CEB4B8D4D4214.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_assignable.h.3E3CEB4B8D4D4214.idx new file mode 100644 index 0000000..f8ccd49 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_assignable.h.3E3CEB4B8D4D4214.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_base_of.h.B131E5198F7EC50C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_base_of.h.B131E5198F7EC50C.idx new file mode 100644 index 0000000..7fca40d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_base_of.h.B131E5198F7EC50C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_bounded_array.h.F72A3BC59A2990B2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_bounded_array.h.F72A3BC59A2990B2.idx new file mode 100644 index 0000000..9c4694a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_bounded_array.h.F72A3BC59A2990B2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_callable.h.3CB8357A2C5E0E65.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_callable.h.3CB8357A2C5E0E65.idx new file mode 100644 index 0000000..b5942e9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_callable.h.3CB8357A2C5E0E65.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_class.h.883AC9084E09F8A3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_class.h.883AC9084E09F8A3.idx new file mode 100644 index 0000000..689579c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_class.h.883AC9084E09F8A3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_compound.h.1CCB7D41E405206D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_compound.h.1CCB7D41E405206D.idx new file mode 100644 index 0000000..c4857ab Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_compound.h.1CCB7D41E405206D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_const.h.B2F55503C8C40DCC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_const.h.B2F55503C8C40DCC.idx new file mode 100644 index 0000000..c09a834 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_const.h.B2F55503C8C40DCC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_constant_evaluated.h.77CAD4341A852355.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_constant_evaluated.h.77CAD4341A852355.idx new file mode 100644 index 0000000..06aef55 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_constant_evaluated.h.77CAD4341A852355.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_constructible.h.96B6728AC672B2EC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_constructible.h.96B6728AC672B2EC.idx new file mode 100644 index 0000000..eb31ba6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_constructible.h.96B6728AC672B2EC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_convertible.h.03BF5079F7A83C51.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_convertible.h.03BF5079F7A83C51.idx new file mode 100644 index 0000000..9709a8d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_convertible.h.03BF5079F7A83C51.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_core_convertible.h.CDD0F4DD8EC5EAF5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_core_convertible.h.CDD0F4DD8EC5EAF5.idx new file mode 100644 index 0000000..21e4419 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_core_convertible.h.CDD0F4DD8EC5EAF5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_destructible.h.FB1858F75C6E1B8A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_destructible.h.FB1858F75C6E1B8A.idx new file mode 100644 index 0000000..686472a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_destructible.h.FB1858F75C6E1B8A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_empty.h.6D4DA0DBD064B226.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_empty.h.6D4DA0DBD064B226.idx new file mode 100644 index 0000000..164ec77 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_empty.h.6D4DA0DBD064B226.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_enum.h.BB2EBEE7DF91619E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_enum.h.BB2EBEE7DF91619E.idx new file mode 100644 index 0000000..1dfd338 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_enum.h.BB2EBEE7DF91619E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_equality_comparable.h.E27628545CB3B306.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_equality_comparable.h.E27628545CB3B306.idx new file mode 100644 index 0000000..bf230b9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_equality_comparable.h.E27628545CB3B306.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_execution_policy.h.5B362EFD9EF957C9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_execution_policy.h.5B362EFD9EF957C9.idx new file mode 100644 index 0000000..45a1eda Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_execution_policy.h.5B362EFD9EF957C9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_final.h.2C12464E43993C97.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_final.h.2C12464E43993C97.idx new file mode 100644 index 0000000..8905b81 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_final.h.2C12464E43993C97.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_floating_point.h.8EAB90A2EB9CCCBB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_floating_point.h.8EAB90A2EB9CCCBB.idx new file mode 100644 index 0000000..aadcd8f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_floating_point.h.8EAB90A2EB9CCCBB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_function.h.F6ED986B59B83663.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_function.h.F6ED986B59B83663.idx new file mode 100644 index 0000000..35f5cf6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_function.h.F6ED986B59B83663.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_fundamental.h.13BAC84CD66153C4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_fundamental.h.13BAC84CD66153C4.idx new file mode 100644 index 0000000..49e9e32 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_fundamental.h.13BAC84CD66153C4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_heap.h.09FD231B17C39C83.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_heap.h.09FD231B17C39C83.idx new file mode 100644 index 0000000..b36aa73 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_heap.h.09FD231B17C39C83.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_heap_until.h.D53F19D7B71F8B50.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_heap_until.h.D53F19D7B71F8B50.idx new file mode 100644 index 0000000..7215251 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_heap_until.h.D53F19D7B71F8B50.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_implicitly_default_constructible.h.3A4377990962FA8B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_implicitly_default_constructible.h.3A4377990962FA8B.idx new file mode 100644 index 0000000..65bcd02 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_implicitly_default_constructible.h.3A4377990962FA8B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_integral.h.DAE94075EC5D66C3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_integral.h.DAE94075EC5D66C3.idx new file mode 100644 index 0000000..a8273a0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_integral.h.DAE94075EC5D66C3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_literal_type.h.6A7166FB738E9FFE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_literal_type.h.6A7166FB738E9FFE.idx new file mode 100644 index 0000000..70f8c69 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_literal_type.h.6A7166FB738E9FFE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_member_pointer.h.DC574E93086B7A9D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_member_pointer.h.DC574E93086B7A9D.idx new file mode 100644 index 0000000..d799756 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_member_pointer.h.DC574E93086B7A9D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_assignable.h.DA66871630172DBD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_assignable.h.DA66871630172DBD.idx new file mode 100644 index 0000000..8432193 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_assignable.h.DA66871630172DBD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_constructible.h.2CC908809464F1E0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_constructible.h.2CC908809464F1E0.idx new file mode 100644 index 0000000..53ab8c0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_constructible.h.2CC908809464F1E0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_destructible.h.848AD33BDE197B71.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_destructible.h.848AD33BDE197B71.idx new file mode 100644 index 0000000..0744488 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_nothrow_destructible.h.848AD33BDE197B71.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_null_pointer.h.AA29EA114199F3A4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_null_pointer.h.AA29EA114199F3A4.idx new file mode 100644 index 0000000..7262031 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_null_pointer.h.AA29EA114199F3A4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_object.h.5C8684A7225DDDAA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_object.h.5C8684A7225DDDAA.idx new file mode 100644 index 0000000..62d61ac Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_object.h.5C8684A7225DDDAA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_partitioned.h.C8064981C4956B40.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_partitioned.h.C8064981C4956B40.idx new file mode 100644 index 0000000..6f82326 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_partitioned.h.C8064981C4956B40.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_permutation.h.0A91444E8F583F1B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_permutation.h.0A91444E8F583F1B.idx new file mode 100644 index 0000000..626080c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_permutation.h.0A91444E8F583F1B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pod.h.E2CBCD869A86E300.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pod.h.E2CBCD869A86E300.idx new file mode 100644 index 0000000..3aff131 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pod.h.E2CBCD869A86E300.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pointer.h.AA15CD79ABF2C9ED.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pointer.h.AA15CD79ABF2C9ED.idx new file mode 100644 index 0000000..cb373e3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pointer.h.AA15CD79ABF2C9ED.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pointer_in_range.h.5959AAF1450AFE8D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pointer_in_range.h.5959AAF1450AFE8D.idx new file mode 100644 index 0000000..e18c996 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_pointer_in_range.h.5959AAF1450AFE8D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_polymorphic.h.53467A5A539F2ADD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_polymorphic.h.53467A5A539F2ADD.idx new file mode 100644 index 0000000..208b0ee Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_polymorphic.h.53467A5A539F2ADD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_primary_template.h.40C05A6DC80217D3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_primary_template.h.40C05A6DC80217D3.idx new file mode 100644 index 0000000..ebf6bc5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_primary_template.h.40C05A6DC80217D3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_reference.h.0319D240F1BF7EF4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_reference.h.0319D240F1BF7EF4.idx new file mode 100644 index 0000000..317cb1b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_reference.h.0319D240F1BF7EF4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_reference_wrapper.h.D5FC88FA7EBA71AD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_reference_wrapper.h.D5FC88FA7EBA71AD.idx new file mode 100644 index 0000000..abca264 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_reference_wrapper.h.D5FC88FA7EBA71AD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_referenceable.h.2139A342F9598D63.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_referenceable.h.2139A342F9598D63.idx new file mode 100644 index 0000000..7614e9f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_referenceable.h.2139A342F9598D63.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_same.h.AA5B651ECDA46A9F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_same.h.AA5B651ECDA46A9F.idx new file mode 100644 index 0000000..938bb82 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_same.h.AA5B651ECDA46A9F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_scalar.h.6991FA1BFD30118A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_scalar.h.6991FA1BFD30118A.idx new file mode 100644 index 0000000..d6d633e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_scalar.h.6991FA1BFD30118A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_seed_sequence.h.8289C146A170DBCA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_seed_sequence.h.8289C146A170DBCA.idx new file mode 100644 index 0000000..a6ff642 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_seed_sequence.h.8289C146A170DBCA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_signed.h.139A87B80CEA610A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_signed.h.139A87B80CEA610A.idx new file mode 100644 index 0000000..69bdda5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_signed.h.139A87B80CEA610A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_signed_integer.h.332587A207E718CE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_signed_integer.h.332587A207E718CE.idx new file mode 100644 index 0000000..88782f5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_signed_integer.h.332587A207E718CE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_sorted.h.F896857BC419469D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_sorted.h.F896857BC419469D.idx new file mode 100644 index 0000000..1bb02e3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_sorted.h.F896857BC419469D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_sorted_until.h.3BC318266FB99A92.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_sorted_until.h.3BC318266FB99A92.idx new file mode 100644 index 0000000..544086f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_sorted_until.h.3BC318266FB99A92.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_specialization.h.E433D73BA7A52FCC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_specialization.h.E433D73BA7A52FCC.idx new file mode 100644 index 0000000..669d857 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_specialization.h.E433D73BA7A52FCC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_standard_layout.h.3377C5BE8672CA3B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_standard_layout.h.3377C5BE8672CA3B.idx new file mode 100644 index 0000000..8841b76 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_standard_layout.h.3377C5BE8672CA3B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_swappable.h.3BB2ECEBD0A61D48.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_swappable.h.3BB2ECEBD0A61D48.idx new file mode 100644 index 0000000..0e28ce0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_swappable.h.3BB2ECEBD0A61D48.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_transparent.h.C0C046C7AEABFED6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_transparent.h.C0C046C7AEABFED6.idx new file mode 100644 index 0000000..ce53bf3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_transparent.h.C0C046C7AEABFED6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivial.h.5138D1392FAF839A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivial.h.5138D1392FAF839A.idx new file mode 100644 index 0000000..5cb618f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivial.h.5138D1392FAF839A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_assignable.h.D9DCE11181ABE29B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_assignable.h.D9DCE11181ABE29B.idx new file mode 100644 index 0000000..0408e97 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_assignable.h.D9DCE11181ABE29B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_constructible.h.8D31EAF5056E6907.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_constructible.h.8D31EAF5056E6907.idx new file mode 100644 index 0000000..318a34a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_constructible.h.8D31EAF5056E6907.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_copyable.h.91C68C48F2E17D15.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_copyable.h.91C68C48F2E17D15.idx new file mode 100644 index 0000000..5c71b6a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_copyable.h.91C68C48F2E17D15.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_destructible.h.C60E7178F54BD94B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_destructible.h.C60E7178F54BD94B.idx new file mode 100644 index 0000000..22b77b8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_destructible.h.C60E7178F54BD94B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_lexicographically_comparable.h.45E47625872B5DCE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_lexicographically_comparable.h.45E47625872B5DCE.idx new file mode 100644 index 0000000..7c34a1b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_lexicographically_comparable.h.45E47625872B5DCE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_relocatable.h.C8775AB00396A68D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_relocatable.h.C8775AB00396A68D.idx new file mode 100644 index 0000000..6e08206 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_trivially_relocatable.h.C8775AB00396A68D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unbounded_array.h.CC460754E1D88DD3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unbounded_array.h.CC460754E1D88DD3.idx new file mode 100644 index 0000000..b5bb77f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unbounded_array.h.CC460754E1D88DD3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_union.h.A0EDF5E23D447FA7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_union.h.A0EDF5E23D447FA7.idx new file mode 100644 index 0000000..4d06846 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_union.h.A0EDF5E23D447FA7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unsigned.h.3C53D2566F0C5879.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unsigned.h.3C53D2566F0C5879.idx new file mode 100644 index 0000000..899c89d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unsigned.h.3C53D2566F0C5879.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unsigned_integer.h.B68D28746FA9E591.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unsigned_integer.h.B68D28746FA9E591.idx new file mode 100644 index 0000000..94fbdbf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_unsigned_integer.h.B68D28746FA9E591.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid.h.5D7192519EBAC22F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid.h.5D7192519EBAC22F.idx new file mode 100644 index 0000000..0c85acb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid.h.5D7192519EBAC22F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid_expansion.h.733378003B825D17.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid_expansion.h.733378003B825D17.idx new file mode 100644 index 0000000..e5493ff Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid_expansion.h.733378003B825D17.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid_range.h.7D190A33FA8990A0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid_range.h.7D190A33FA8990A0.idx new file mode 100644 index 0000000..4242084 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_valid_range.h.7D190A33FA8990A0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_void.h.EED11160F0850253.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_void.h.EED11160F0850253.idx new file mode 100644 index 0000000..4199cdc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_void.h.EED11160F0850253.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_volatile.h.FF8E1D441994F32D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_volatile.h.FF8E1D441994F32D.idx new file mode 100644 index 0000000..b31a269 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/is_volatile.h.FF8E1D441994F32D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istream.h.57D0390027A936D4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istream.h.57D0390027A936D4.idx new file mode 100644 index 0000000..ade1082 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istream.h.57D0390027A936D4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istream_iterator.h.206C0ABBDFB3FC09.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istream_iterator.h.206C0ABBDFB3FC09.idx new file mode 100644 index 0000000..84ee97d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istream_iterator.h.206C0ABBDFB3FC09.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istreambuf_iterator.h.F047DF33D44FBBF3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istreambuf_iterator.h.F047DF33D44FBBF3.idx new file mode 100644 index 0000000..7c8722a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/istreambuf_iterator.h.F047DF33D44FBBF3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_move.h.E14FA613D5A041C9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_move.h.E14FA613D5A041C9.idx new file mode 100644 index 0000000..b467096 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_move.h.E14FA613D5A041C9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_swap.h.ACEDDCDFF3B24E81.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_swap.h.ACEDDCDFF3B24E81.idx new file mode 100644 index 0000000..091f707 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_swap.h.ACEDDCDFF3B24E81.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_swap.h.FEB5042665CE4EFD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_swap.h.FEB5042665CE4EFD.idx new file mode 100644 index 0000000..ae3cd8e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iter_swap.h.FEB5042665CE4EFD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator.99A30467BF5E69A3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator.99A30467BF5E69A3.idx new file mode 100644 index 0000000..82f8aaf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator.99A30467BF5E69A3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator.h.594856F054C605A1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator.h.594856F054C605A1.idx new file mode 100644 index 0000000..d824e3d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator.h.594856F054C605A1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator_operations.h.C497B84E2783FF11.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator_operations.h.C497B84E2783FF11.idx new file mode 100644 index 0000000..310a0f2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator_operations.h.C497B84E2783FF11.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator_traits.h.D23B20C46EDA0250.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator_traits.h.D23B20C46EDA0250.idx new file mode 100644 index 0000000..9f40782 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/iterator_traits.h.D23B20C46EDA0250.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/kill_dependency.h.844803F4D9DE4C1A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/kill_dependency.h.844803F4D9DE4C1A.idx new file mode 100644 index 0000000..5bc679b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/kill_dependency.h.844803F4D9DE4C1A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/knuth_b.h.D8EAC1EF94216D5A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/knuth_b.h.D8EAC1EF94216D5A.idx new file mode 100644 index 0000000..b7280a3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/knuth_b.h.D8EAC1EF94216D5A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/language.h.1FF35719D4011FAA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/language.h.1FF35719D4011FAA.idx new file mode 100644 index 0000000..d2a08b1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/language.h.1FF35719D4011FAA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lazy.h.FFD84FDB223282BE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lazy.h.FFD84FDB223282BE.idx new file mode 100644 index 0000000..0a85c6c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lazy.h.FFD84FDB223282BE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lexicographical_compare.h.F87D7565F6AA22D4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lexicographical_compare.h.F87D7565F6AA22D4.idx new file mode 100644 index 0000000..527a319 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lexicographical_compare.h.F87D7565F6AA22D4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lexicographical_compare_three_way.h.682A24580EA4ACD8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lexicographical_compare_three_way.h.682A24580EA4ACD8.idx new file mode 100644 index 0000000..f1045cc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lexicographical_compare_three_way.h.682A24580EA4ACD8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/limits.7823894A40E92A27.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/limits.7823894A40E92A27.idx new file mode 100644 index 0000000..ea6ea56 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/limits.7823894A40E92A27.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/limits.h.4667C41B0CB6AF5F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/limits.h.4667C41B0CB6AF5F.idx new file mode 100644 index 0000000..907e951 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/limits.h.4667C41B0CB6AF5F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/linear_congruential_engine.h.41212A98EF204F5F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/linear_congruential_engine.h.41212A98EF204F5F.idx new file mode 100644 index 0000000..c9924a3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/linear_congruential_engine.h.41212A98EF204F5F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.7DCC05AEABC92EC6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.7DCC05AEABC92EC6.idx new file mode 100644 index 0000000..522f4b1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.7DCC05AEABC92EC6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.h.1459E9CD145BDF48.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.h.1459E9CD145BDF48.idx new file mode 100644 index 0000000..1cc4461 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.h.1459E9CD145BDF48.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.h.5DB8185214B4E86F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.h.5DB8185214B4E86F.idx new file mode 100644 index 0000000..afab89e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale.h.5DB8185214B4E86F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale_base_api.h.20FE6B0B0588F0C2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale_base_api.h.20FE6B0B0588F0C2.idx new file mode 100644 index 0000000..0104d48 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale_base_api.h.20FE6B0B0588F0C2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale_guard.h.2C2E448EDE025341.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale_guard.h.2C2E448EDE025341.idx new file mode 100644 index 0000000..9752be5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/locale_guard.h.2C2E448EDE025341.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lock_guard.h.335C023AEB5BC60B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lock_guard.h.335C023AEB5BC60B.idx new file mode 100644 index 0000000..ff13c89 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lock_guard.h.335C023AEB5BC60B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/log2.h.C5B4B93937412FC4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/log2.h.C5B4B93937412FC4.idx new file mode 100644 index 0000000..1f75629 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/log2.h.C5B4B93937412FC4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/logarithms.h.CB1AE45B0B2702D4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/logarithms.h.CB1AE45B0B2702D4.idx new file mode 100644 index 0000000..83b81a7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/logarithms.h.CB1AE45B0B2702D4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lognormal_distribution.h.B14475A998CB124C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lognormal_distribution.h.B14475A998CB124C.idx new file mode 100644 index 0000000..2749356 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lognormal_distribution.h.B14475A998CB124C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lower_bound.h.9E9D47C95A91ACD4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lower_bound.h.9E9D47C95A91ACD4.idx new file mode 100644 index 0000000..dc315d5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/lower_bound.h.9E9D47C95A91ACD4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/main.cpp.0E43507EBD398BBA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/main.cpp.0E43507EBD398BBA.idx new file mode 100644 index 0000000..f0d7998 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/main.cpp.0E43507EBD398BBA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_32_64_or_128_bit.h.6306278CFFAA9DB6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_32_64_or_128_bit.h.6306278CFFAA9DB6.idx new file mode 100644 index 0000000..c642767 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_32_64_or_128_bit.h.6306278CFFAA9DB6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_const_lvalue_ref.h.6E4C10E741F1B388.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_const_lvalue_ref.h.6E4C10E741F1B388.idx new file mode 100644 index 0000000..dace7dd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_const_lvalue_ref.h.6E4C10E741F1B388.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_heap.h.4511F87A5D6C0634.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_heap.h.4511F87A5D6C0634.idx new file mode 100644 index 0000000..7d51df3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_heap.h.4511F87A5D6C0634.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_projected.h.18D5DF92FA25D85F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_projected.h.18D5DF92FA25D85F.idx new file mode 100644 index 0000000..9f1b017 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_projected.h.18D5DF92FA25D85F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_signed.h.3A16A448C255F1EC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_signed.h.3A16A448C255F1EC.idx new file mode 100644 index 0000000..ec4241e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_signed.h.3A16A448C255F1EC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_tuple_types.h.DCE7A337E608B7BB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_tuple_types.h.DCE7A337E608B7BB.idx new file mode 100644 index 0000000..f1aa5d9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_tuple_types.h.DCE7A337E608B7BB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_unsigned.h.1DBAB563162F8611.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_unsigned.h.1DBAB563162F8611.idx new file mode 100644 index 0000000..4b4cb01 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/make_unsigned.h.1DBAB563162F8611.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/math.h.FA63853E54A56DD0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/math.h.FA63853E54A56DD0.idx new file mode 100644 index 0000000..a9fc909 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/math.h.FA63853E54A56DD0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/math.h.FDAF21D7A5B4B726.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/math.h.FDAF21D7A5B4B726.idx new file mode 100644 index 0000000..4827c4c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/math.h.FDAF21D7A5B4B726.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/max.h.74FCCCE84EF837CD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/max.h.74FCCCE84EF837CD.idx new file mode 100644 index 0000000..848ef9d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/max.h.74FCCCE84EF837CD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/max_element.h.5F6E46DDB4549D59.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/max_element.h.5F6E46DDB4549D59.idx new file mode 100644 index 0000000..a7da06d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/max_element.h.5F6E46DDB4549D59.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/maybe_const.h.9C98AC87F7791ABF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/maybe_const.h.9C98AC87F7791ABF.idx new file mode 100644 index 0000000..4229d3f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/maybe_const.h.9C98AC87F7791ABF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mem_fn.h.F314EAF99FE9A47E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mem_fn.h.F314EAF99FE9A47E.idx new file mode 100644 index 0000000..7beee44 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mem_fn.h.F314EAF99FE9A47E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mem_fun_ref.h.8CFA00FEA2165792.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mem_fun_ref.h.8CFA00FEA2165792.idx new file mode 100644 index 0000000..0bc68ff Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mem_fun_ref.h.8CFA00FEA2165792.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory.2AB23E2CB8981748.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory.2AB23E2CB8981748.idx new file mode 100644 index 0000000..daec8be Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory.2AB23E2CB8981748.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory.h.38E36F62DB1D52EE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory.h.38E36F62DB1D52EE.idx new file mode 100644 index 0000000..d3867b1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory.h.38E36F62DB1D52EE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_order.h.7EA3D6810723B78C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_order.h.7EA3D6810723B78C.idx new file mode 100644 index 0000000..ba144cf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_order.h.7EA3D6810723B78C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_resource.h.425E28114F9185E1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_resource.h.425E28114F9185E1.idx new file mode 100644 index 0000000..ed96496 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_resource.h.425E28114F9185E1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_resource.h.DC75938AB83C7CCC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_resource.h.DC75938AB83C7CCC.idx new file mode 100644 index 0000000..5b1d780 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/memory_resource.h.DC75938AB83C7CCC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/merge.h.AEFB228341672878.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/merge.h.AEFB228341672878.idx new file mode 100644 index 0000000..cdd62ca Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/merge.h.AEFB228341672878.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mersenne_twister_engine.h.32BEED209FC6FC30.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mersenne_twister_engine.h.32BEED209FC6FC30.idx new file mode 100644 index 0000000..aa6379e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mersenne_twister_engine.h.32BEED209FC6FC30.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min.h.8DA5F299BF82516F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min.h.8DA5F299BF82516F.idx new file mode 100644 index 0000000..340246e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min.h.8DA5F299BF82516F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min_element.h.E8CF37081C3AE3F1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min_element.h.E8CF37081C3AE3F1.idx new file mode 100644 index 0000000..1f532c5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min_element.h.E8CF37081C3AE3F1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min_max.h.B8043771CDCF322D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min_max.h.B8043771CDCF322D.idx new file mode 100644 index 0000000..423b584 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/min_max.h.B8043771CDCF322D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/minmax.h.E0B6AB5E18D00125.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/minmax.h.E0B6AB5E18D00125.idx new file mode 100644 index 0000000..3796d0e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/minmax.h.E0B6AB5E18D00125.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/minmax_element.h.4891F7E36DD4A2A8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/minmax_element.h.4891F7E36DD4A2A8.idx new file mode 100644 index 0000000..f377717 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/minmax_element.h.4891F7E36DD4A2A8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mismatch.h.9DA7550F5B08A645.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mismatch.h.9DA7550F5B08A645.idx new file mode 100644 index 0000000..f13568b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mismatch.h.9DA7550F5B08A645.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/modulo.h.FB829A77FA8BF72E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/modulo.h.FB829A77FA8BF72E.idx new file mode 100644 index 0000000..7d4febc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/modulo.h.FB829A77FA8BF72E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/monostate.h.A53F4D2FB87FE381.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/monostate.h.A53F4D2FB87FE381.idx new file mode 100644 index 0000000..99043f6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/monostate.h.A53F4D2FB87FE381.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/movable.h.18F69015A5EC72A6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/movable.h.18F69015A5EC72A6.idx new file mode 100644 index 0000000..043ca6c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/movable.h.18F69015A5EC72A6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/movable_box.h.757EB7D0A5E7A98F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/movable_box.h.757EB7D0A5E7A98F.idx new file mode 100644 index 0000000..a43856f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/movable_box.h.757EB7D0A5E7A98F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move.h.7690FA5DD03A0CEA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move.h.7690FA5DD03A0CEA.idx new file mode 100644 index 0000000..396aee3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move.h.7690FA5DD03A0CEA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move.h.C90662CD8D69F515.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move.h.C90662CD8D69F515.idx new file mode 100644 index 0000000..06b2f1b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move.h.C90662CD8D69F515.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_backward.h.8235D363C9EEEA34.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_backward.h.8235D363C9EEEA34.idx new file mode 100644 index 0000000..39a3fe7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_backward.h.8235D363C9EEEA34.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_iterator.h.8129EA95A6ADEAE4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_iterator.h.8129EA95A6ADEAE4.idx new file mode 100644 index 0000000..c8bc827 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_iterator.h.8129EA95A6ADEAE4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_sentinel.h.09059202E0D7E3BC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_sentinel.h.09059202E0D7E3BC.idx new file mode 100644 index 0000000..5c2b4b2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/move_sentinel.h.09059202E0D7E3BC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mutex.E453ECB8CC08EA8B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mutex.E453ECB8CC08EA8B.idx new file mode 100644 index 0000000..e327d7b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mutex.E453ECB8CC08EA8B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mutex.h.CFFBE8F4F617FCDA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mutex.h.CFFBE8F4F617FCDA.idx new file mode 100644 index 0000000..4bcc350 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/mutex.h.CFFBE8F4F617FCDA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nat.h.6F825F99E94F81F5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nat.h.6F825F99E94F81F5.idx new file mode 100644 index 0000000..4dface8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nat.h.6F825F99E94F81F5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/negation.h.2A420FFCAEDD9D78.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/negation.h.2A420FFCAEDD9D78.idx new file mode 100644 index 0000000..d2e3a0a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/negation.h.2A420FFCAEDD9D78.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/negative_binomial_distribution.h.EC0924C2A2A39B43.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/negative_binomial_distribution.h.EC0924C2A2A39B43.idx new file mode 100644 index 0000000..29fef07 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/negative_binomial_distribution.h.EC0924C2A2A39B43.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nested_exception.h.4E1A59394FF72293.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nested_exception.h.4E1A59394FF72293.idx new file mode 100644 index 0000000..4fadf08 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nested_exception.h.4E1A59394FF72293.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/new.90705CE65A1CC122.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/new.90705CE65A1CC122.idx new file mode 100644 index 0000000..228a687 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/new.90705CE65A1CC122.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/next.h.3C9EB7D4A263DDAA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/next.h.3C9EB7D4A263DDAA.idx new file mode 100644 index 0000000..087282f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/next.h.3C9EB7D4A263DDAA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/next_permutation.h.1382F12C95086674.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/next_permutation.h.1382F12C95086674.idx new file mode 100644 index 0000000..23ee5d3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/next_permutation.h.1382F12C95086674.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/no_destroy.h.360F19637543D9B7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/no_destroy.h.360F19637543D9B7.idx new file mode 100644 index 0000000..a639553 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/no_destroy.h.360F19637543D9B7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/noexcept_move_assign_container.h.A019306552E13D5B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/noexcept_move_assign_container.h.A019306552E13D5B.idx new file mode 100644 index 0000000..5f1755c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/noexcept_move_assign_container.h.A019306552E13D5B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/none_of.h.FAB89C5D643EA993.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/none_of.h.FAB89C5D643EA993.idx new file mode 100644 index 0000000..8ad7eac Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/none_of.h.FAB89C5D643EA993.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/normal_distribution.h.884FB25FED1AD797.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/normal_distribution.h.884FB25FED1AD797.idx new file mode 100644 index 0000000..60f8f01 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/normal_distribution.h.884FB25FED1AD797.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/not_fn.h.8C7A6C50221C47A1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/not_fn.h.8C7A6C50221C47A1.idx new file mode 100644 index 0000000..3141613 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/not_fn.h.8C7A6C50221C47A1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nth_element.h.3C78F1BB35A37EC3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nth_element.h.3C78F1BB35A37EC3.idx new file mode 100644 index 0000000..cb8f6b0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/nth_element.h.3C78F1BB35A37EC3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/numeric.61C1EC9ED621EAB9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/numeric.61C1EC9ED621EAB9.idx new file mode 100644 index 0000000..3be2c27 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/numeric.61C1EC9ED621EAB9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/once_flag.h.2A5C4B7BAC4511AE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/once_flag.h.2A5C4B7BAC4511AE.idx new file mode 100644 index 0000000..b51bf6d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/once_flag.h.2A5C4B7BAC4511AE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/operations.h.0D4ABE387B894C56.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/operations.h.0D4ABE387B894C56.idx new file mode 100644 index 0000000..c042fb3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/operations.h.0D4ABE387B894C56.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/operations.h.700ADDAD068F6FD5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/operations.h.700ADDAD068F6FD5.idx new file mode 100644 index 0000000..ed4fcbf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/operations.h.700ADDAD068F6FD5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/optional.BF78B44765411FDF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/optional.BF78B44765411FDF.idx new file mode 100644 index 0000000..72b3124 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/optional.BF78B44765411FDF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ordering.h.652ED507A57E28CC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ordering.h.652ED507A57E28CC.idx new file mode 100644 index 0000000..81a5385 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ordering.h.652ED507A57E28CC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostream.h.26C38309C53BE3D2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostream.h.26C38309C53BE3D2.idx new file mode 100644 index 0000000..70195ef Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostream.h.26C38309C53BE3D2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostream_iterator.h.1552B5EAD3538A26.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostream_iterator.h.1552B5EAD3538A26.idx new file mode 100644 index 0000000..39740db Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostream_iterator.h.1552B5EAD3538A26.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostreambuf_iterator.h.645371D68675D6AB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostreambuf_iterator.h.645371D68675D6AB.idx new file mode 100644 index 0000000..12c4fdb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ostreambuf_iterator.h.645371D68675D6AB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/out_ptr.h.FAE1C55C60A9C68D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/out_ptr.h.FAE1C55C60A9C68D.idx new file mode 100644 index 0000000..b729029 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/out_ptr.h.FAE1C55C60A9C68D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pair.h.3C5C0AC1D8B5C97A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pair.h.3C5C0AC1D8B5C97A.idx new file mode 100644 index 0000000..1080608 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pair.h.3C5C0AC1D8B5C97A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pair.h.E6D9FC01B6CFDFC4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pair.h.E6D9FC01B6CFDFC4.idx new file mode 100644 index 0000000..ea11877 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pair.h.E6D9FC01B6CFDFC4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/parser_std_format_spec.h.84860ADE692480B6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/parser_std_format_spec.h.84860ADE692480B6.idx new file mode 100644 index 0000000..2ad96cb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/parser_std_format_spec.h.84860ADE692480B6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sort.h.5087978FABD20AD0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sort.h.5087978FABD20AD0.idx new file mode 100644 index 0000000..dfd9ac2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sort.h.5087978FABD20AD0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sort_copy.h.319611E93B8A4CFB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sort_copy.h.319611E93B8A4CFB.idx new file mode 100644 index 0000000..0f9b140 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sort_copy.h.319611E93B8A4CFB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sum.h.7A19825E94E840CF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sum.h.7A19825E94E840CF.idx new file mode 100644 index 0000000..3528f58 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partial_sum.h.7A19825E94E840CF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition.h.0FA3FDBD646D84C4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition.h.0FA3FDBD646D84C4.idx new file mode 100644 index 0000000..50ef5c6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition.h.0FA3FDBD646D84C4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition_copy.h.21BD3CF0FB1C9940.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition_copy.h.21BD3CF0FB1C9940.idx new file mode 100644 index 0000000..5f43a60 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition_copy.h.21BD3CF0FB1C9940.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition_point.h.798E326AB036052F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition_point.h.798E326AB036052F.idx new file mode 100644 index 0000000..6ae4f2f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/partition_point.h.798E326AB036052F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/perfect_forward.h.79E69D5FF92240D0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/perfect_forward.h.79E69D5FF92240D0.idx new file mode 100644 index 0000000..7e06a7d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/perfect_forward.h.79E69D5FF92240D0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_constant_distribution.h.5C5063C93FFBA74D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_constant_distribution.h.5C5063C93FFBA74D.idx new file mode 100644 index 0000000..c582ae4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_constant_distribution.h.5C5063C93FFBA74D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_construct.h.968071A7FCB194C3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_construct.h.968071A7FCB194C3.idx new file mode 100644 index 0000000..b7ab951 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_construct.h.968071A7FCB194C3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_linear_distribution.h.7E62360378ED3202.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_linear_distribution.h.7E62360378ED3202.idx new file mode 100644 index 0000000..baaf048 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/piecewise_linear_distribution.h.7E62360378ED3202.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/platform.h.9519C817BB8896B2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/platform.h.9519C817BB8896B2.idx new file mode 100644 index 0000000..f1e95fe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/platform.h.9519C817BB8896B2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_to_binary_function.h.115E14BEDA96E8EF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_to_binary_function.h.115E14BEDA96E8EF.idx new file mode 100644 index 0000000..e9a288a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_to_binary_function.h.115E14BEDA96E8EF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_to_unary_function.h.A5E8AFBD5CFF6753.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_to_unary_function.h.A5E8AFBD5CFF6753.idx new file mode 100644 index 0000000..b733b8e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_to_unary_function.h.A5E8AFBD5CFF6753.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_traits.h.A1E4352FBFCB6789.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_traits.h.A1E4352FBFCB6789.idx new file mode 100644 index 0000000..f8f6f2a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pointer_traits.h.A1E4352FBFCB6789.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/poisson_distribution.h.CA7322EA1D26F160.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/poisson_distribution.h.CA7322EA1D26F160.idx new file mode 100644 index 0000000..b8cd237 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/poisson_distribution.h.CA7322EA1D26F160.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/poll_with_backoff.h.C9DCC4B7D84C81B7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/poll_with_backoff.h.C9DCC4B7D84C81B7.idx new file mode 100644 index 0000000..5f50f23 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/poll_with_backoff.h.C9DCC4B7D84C81B7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/polymorphic_allocator.h.2B50CA2ABE4DDB31.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/polymorphic_allocator.h.2B50CA2ABE4DDB31.idx new file mode 100644 index 0000000..600382d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/polymorphic_allocator.h.2B50CA2ABE4DDB31.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pop_heap.h.DB1B1B0698AAE775.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pop_heap.h.DB1B1B0698AAE775.idx new file mode 100644 index 0000000..0c7c18e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pop_heap.h.DB1B1B0698AAE775.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/popcount.h.A9B791436A2EB215.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/popcount.h.A9B791436A2EB215.idx new file mode 100644 index 0000000..d7a7464 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/popcount.h.A9B791436A2EB215.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/predicate.h.0AC652433C7D252E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/predicate.h.0AC652433C7D252E.idx new file mode 100644 index 0000000..7988260 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/predicate.h.0AC652433C7D252E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/prev.h.A9CF4EF00FA09869.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/prev.h.A9CF4EF00FA09869.idx new file mode 100644 index 0000000..4b2d2ad Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/prev.h.A9CF4EF00FA09869.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/prev_permutation.h.4E2079A766740303.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/prev_permutation.h.4E2079A766740303.idx new file mode 100644 index 0000000..39c80fc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/prev_permutation.h.4E2079A766740303.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/private_constructor_tag.h.41E10EC5CADF5751.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/private_constructor_tag.h.41E10EC5CADF5751.idx new file mode 100644 index 0000000..68d6543 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/private_constructor_tag.h.41E10EC5CADF5751.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/projected.h.F48E903DD8B268F9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/projected.h.F48E903DD8B268F9.idx new file mode 100644 index 0000000..6ada2ea Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/projected.h.F48E903DD8B268F9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/promote.h.7CEBE789ED3968C5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/promote.h.7CEBE789ED3968C5.idx new file mode 100644 index 0000000..6eac07f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/promote.h.7CEBE789ED3968C5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pstl.h.C5A38E55DBC590C4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pstl.h.C5A38E55DBC590C4.idx new file mode 100644 index 0000000..948ee15 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pstl.h.C5A38E55DBC590C4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pstl.h.C8221DABE666DA14.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pstl.h.C8221DABE666DA14.idx new file mode 100644 index 0000000..dfa697d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/pstl.h.C8221DABE666DA14.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/push_heap.h.C7920352CFA83778.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/push_heap.h.C7920352CFA83778.idx new file mode 100644 index 0000000..34f1865 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/push_heap.h.C7920352CFA83778.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/random.3D36632E17D00160.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/random.3D36632E17D00160.idx new file mode 100644 index 0000000..b714968 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/random.3D36632E17D00160.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/random_device.h.D6A5729AEB02B7AF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/random_device.h.D6A5729AEB02B7AF.idx new file mode 100644 index 0000000..3e3548a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/random_device.h.D6A5729AEB02B7AF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/randomize_range.h.F315D98A6403F2CE.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/randomize_range.h.F315D98A6403F2CE.idx new file mode 100644 index 0000000..b632b70 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/randomize_range.h.F315D98A6403F2CE.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_construct_at.h.99F5610A049957B8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_construct_at.h.99F5610A049957B8.idx new file mode 100644 index 0000000..5ca3247 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_construct_at.h.99F5610A049957B8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_copy.h.EE9AF5D32E59343D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_copy.h.EE9AF5D32E59343D.idx new file mode 100644 index 0000000..8272719 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_copy.h.EE9AF5D32E59343D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_copy_n.h.731F4D6C572C21B5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_copy_n.h.731F4D6C572C21B5.idx new file mode 100644 index 0000000..eae6999 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_copy_n.h.731F4D6C572C21B5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_fill_n.h.D4FD76B1D9303458.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_fill_n.h.D4FD76B1D9303458.idx new file mode 100644 index 0000000..d712814 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_fill_n.h.D4FD76B1D9303458.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_iterator_concept.h.7C37EDF27CC317CF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_iterator_concept.h.7C37EDF27CC317CF.idx new file mode 100644 index 0000000..f24446c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_iterator_concept.h.7C37EDF27CC317CF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_iterator_traits.h.D7913F4F66CD66C8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_iterator_traits.h.D7913F4F66CD66C8.idx new file mode 100644 index 0000000..4227617 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_iterator_traits.h.D7913F4F66CD66C8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_operations.h.262C5ECC38C86002.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_operations.h.262C5ECC38C86002.idx new file mode 100644 index 0000000..c6c81af Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_operations.h.262C5ECC38C86002.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_transform.h.9FD3703E515515AD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_transform.h.9FD3703E515515AD.idx new file mode 100644 index 0000000..d543747 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_transform.h.9FD3703E515515AD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_upper_bound.h.3BD163831FB6E89F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_upper_bound.h.3BD163831FB6E89F.idx new file mode 100644 index 0000000..a7a1e0c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranges_upper_bound.h.3BD163831FB6E89F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rank.h.924AA4335C03708B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rank.h.924AA4335C03708B.idx new file mode 100644 index 0000000..f875cde Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rank.h.924AA4335C03708B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranlux.h.E237E8199354923B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranlux.h.E237E8199354923B.idx new file mode 100644 index 0000000..2432f98 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ranlux.h.E237E8199354923B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ratio.5533D3494D735EE2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ratio.5533D3494D735EE2.idx new file mode 100644 index 0000000..e411e17 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/ratio.5533D3494D735EE2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/raw_storage_iterator.h.61BCA162BB248280.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/raw_storage_iterator.h.61BCA162BB248280.idx new file mode 100644 index 0000000..c51cf5e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/raw_storage_iterator.h.61BCA162BB248280.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/readable_traits.h.721829DEDF9D2840.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/readable_traits.h.721829DEDF9D2840.idx new file mode 100644 index 0000000..87e80f2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/readable_traits.h.721829DEDF9D2840.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reduce.h.428EF05B8A1A4A5A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reduce.h.428EF05B8A1A4A5A.idx new file mode 100644 index 0000000..e293f6b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reduce.h.428EF05B8A1A4A5A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reference_wrapper.h.977B591177265425.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reference_wrapper.h.977B591177265425.idx new file mode 100644 index 0000000..2364374 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reference_wrapper.h.977B591177265425.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/regular.h.605F1F6A3685148D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/regular.h.605F1F6A3685148D.idx new file mode 100644 index 0000000..b0c4464 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/regular.h.605F1F6A3685148D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rel_ops.h.BFBF1E87258219E0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rel_ops.h.BFBF1E87258219E0.idx new file mode 100644 index 0000000..1dc64b8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rel_ops.h.BFBF1E87258219E0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/relation.h.E03FBF96470C642F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/relation.h.E03FBF96470C642F.idx new file mode 100644 index 0000000..d320701 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/relation.h.E03FBF96470C642F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remainder.h.5FD2AC264FE76C7E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remainder.h.5FD2AC264FE76C7E.idx new file mode 100644 index 0000000..63b704c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remainder.h.5FD2AC264FE76C7E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove.h.75E0913B14A3CA8E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove.h.75E0913B14A3CA8E.idx new file mode 100644 index 0000000..4078492 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove.h.75E0913B14A3CA8E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_all_extents.h.229B5F6BA2B9205F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_all_extents.h.229B5F6BA2B9205F.idx new file mode 100644 index 0000000..58f5e72 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_all_extents.h.229B5F6BA2B9205F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_const.h.87C5B951ED53AB3F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_const.h.87C5B951ED53AB3F.idx new file mode 100644 index 0000000..fa4e521 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_const.h.87C5B951ED53AB3F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_const_ref.h.8034B53EAF7183E7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_const_ref.h.8034B53EAF7183E7.idx new file mode 100644 index 0000000..d6d8808 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_const_ref.h.8034B53EAF7183E7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_copy.h.59E1E2FC7ABAA199.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_copy.h.59E1E2FC7ABAA199.idx new file mode 100644 index 0000000..cae3c62 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_copy.h.59E1E2FC7ABAA199.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_copy_if.h.8F73042FE05B63F1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_copy_if.h.8F73042FE05B63F1.idx new file mode 100644 index 0000000..a49e501 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_copy_if.h.8F73042FE05B63F1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_cv.h.CE95648183D95206.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_cv.h.CE95648183D95206.idx new file mode 100644 index 0000000..e135cfe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_cv.h.CE95648183D95206.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_cvref.h.20D11949D987EDE4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_cvref.h.20D11949D987EDE4.idx new file mode 100644 index 0000000..c6d7dc9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_cvref.h.20D11949D987EDE4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_extent.h.E3037A0E97BA3EB6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_extent.h.E3037A0E97BA3EB6.idx new file mode 100644 index 0000000..a28c491 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_extent.h.E3037A0E97BA3EB6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_if.h.AB03B053B9E23B20.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_if.h.AB03B053B9E23B20.idx new file mode 100644 index 0000000..d2447c8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_if.h.AB03B053B9E23B20.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_pointer.h.4FC2EF010B5D012C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_pointer.h.4FC2EF010B5D012C.idx new file mode 100644 index 0000000..d429ffe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_pointer.h.4FC2EF010B5D012C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_reference.h.31CF85DCEDE6A3BD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_reference.h.31CF85DCEDE6A3BD.idx new file mode 100644 index 0000000..8e1bb55 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_reference.h.31CF85DCEDE6A3BD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_volatile.h.925762160888A177.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_volatile.h.925762160888A177.idx new file mode 100644 index 0000000..d126495 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/remove_volatile.h.925762160888A177.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace.h.3B2DC15CF8D44890.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace.h.3B2DC15CF8D44890.idx new file mode 100644 index 0000000..1f17b62 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace.h.3B2DC15CF8D44890.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_copy.h.17A3741966711320.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_copy.h.17A3741966711320.idx new file mode 100644 index 0000000..6a6377b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_copy.h.17A3741966711320.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_copy_if.h.CF26BBDBC2575B70.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_copy_if.h.CF26BBDBC2575B70.idx new file mode 100644 index 0000000..c5a2dbd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_copy_if.h.CF26BBDBC2575B70.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_if.h.C520D8E89B26A0C0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_if.h.C520D8E89B26A0C0.idx new file mode 100644 index 0000000..7b1f76f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/replace_if.h.C520D8E89B26A0C0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/result_of.h.F09E247C7592CD85.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/result_of.h.F09E247C7592CD85.idx new file mode 100644 index 0000000..a609fa0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/result_of.h.F09E247C7592CD85.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse.h.CFCF8DA94D88AF7C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse.h.CFCF8DA94D88AF7C.idx new file mode 100644 index 0000000..360340d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse.h.CFCF8DA94D88AF7C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_access.h.3BC7191EACA4E2CA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_access.h.3BC7191EACA4E2CA.idx new file mode 100644 index 0000000..3e45706 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_access.h.3BC7191EACA4E2CA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_copy.h.528D96AA8BADEF29.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_copy.h.528D96AA8BADEF29.idx new file mode 100644 index 0000000..fe80ba6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_copy.h.528D96AA8BADEF29.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_iterator.h.724E40878F82DCA2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_iterator.h.724E40878F82DCA2.idx new file mode 100644 index 0000000..28b55f1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/reverse_iterator.h.724E40878F82DCA2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/roots.h.7034EC9DF151E72D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/roots.h.7034EC9DF151E72D.idx new file mode 100644 index 0000000..68f1e89 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/roots.h.7034EC9DF151E72D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate.h.1275A7BBDCB011F6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate.h.1275A7BBDCB011F6.idx new file mode 100644 index 0000000..3052731 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate.h.1275A7BBDCB011F6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate.h.F66B1E4029766689.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate.h.F66B1E4029766689.idx new file mode 100644 index 0000000..2178ee1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate.h.F66B1E4029766689.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate_copy.h.3F5347FA54B87F92.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate_copy.h.3F5347FA54B87F92.idx new file mode 100644 index 0000000..1ebe554 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rotate_copy.h.3F5347FA54B87F92.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rounding_functions.h.794067E037665006.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rounding_functions.h.794067E037665006.idx new file mode 100644 index 0000000..90efe2d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/rounding_functions.h.794067E037665006.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/same_as.h.57D42C3DEBA8BD43.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/same_as.h.57D42C3DEBA8BD43.idx new file mode 100644 index 0000000..c9ee7e2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/same_as.h.57D42C3DEBA8BD43.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sample.h.6E07B845134BC18B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sample.h.6E07B845134BC18B.idx new file mode 100644 index 0000000..ceb5d07 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sample.h.6E07B845134BC18B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sanitizers.h.F74F63335D614D5E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sanitizers.h.F74F63335D614D5E.idx new file mode 100644 index 0000000..710c827 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sanitizers.h.F74F63335D614D5E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/search.h.D7253C6950B2C1E2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/search.h.D7253C6950B2C1E2.idx new file mode 100644 index 0000000..4ba3f36 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/search.h.D7253C6950B2C1E2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/search_n.h.BAA4E8D22CE7FED4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/search_n.h.BAA4E8D22CE7FED4.idx new file mode 100644 index 0000000..0463a4c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/search_n.h.BAA4E8D22CE7FED4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/seed_seq.h.79105115AE614921.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/seed_seq.h.79105115AE614921.idx new file mode 100644 index 0000000..5a75741 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/seed_seq.h.79105115AE614921.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/segmented_iterator.h.CF53F7E159FE02C1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/segmented_iterator.h.CF53F7E159FE02C1.idx new file mode 100644 index 0000000..33a18d3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/segmented_iterator.h.CF53F7E159FE02C1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/semiregular.h.0D2C9D4D585E4C4A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/semiregular.h.0D2C9D4D585E4C4A.idx new file mode 100644 index 0000000..8560c1e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/semiregular.h.0D2C9D4D585E4C4A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_difference.h.6530E96BBFF0E494.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_difference.h.6530E96BBFF0E494.idx new file mode 100644 index 0000000..39f3b29 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_difference.h.6530E96BBFF0E494.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_intersection.h.83EFDE2F3D7F43C7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_intersection.h.83EFDE2F3D7F43C7.idx new file mode 100644 index 0000000..ec52e2c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_intersection.h.83EFDE2F3D7F43C7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_symmetric_difference.h.0D643667100CE243.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_symmetric_difference.h.0D643667100CE243.idx new file mode 100644 index 0000000..b7aed3c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_symmetric_difference.h.0D643667100CE243.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_union.h.ECEF752AB3C4B13C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_union.h.ECEF752AB3C4B13C.idx new file mode 100644 index 0000000..0d4cdcd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/set_union.h.ECEF752AB3C4B13C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sfinae_helpers.h.4998634B7566175F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sfinae_helpers.h.4998634B7566175F.idx new file mode 100644 index 0000000..bf69ad4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sfinae_helpers.h.4998634B7566175F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shared_ptr.h.D04D3318B7ABF73D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shared_ptr.h.D04D3318B7ABF73D.idx new file mode 100644 index 0000000..6d010fe Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shared_ptr.h.D04D3318B7ABF73D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shuffle.h.FAD0CA60A22CC9D0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shuffle.h.FAD0CA60A22CC9D0.idx new file mode 100644 index 0000000..3cec90c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shuffle.h.FAD0CA60A22CC9D0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shuffle_order_engine.h.23876B288758363C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shuffle_order_engine.h.23876B288758363C.idx new file mode 100644 index 0000000..697847f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/shuffle_order_engine.h.23876B288758363C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sift_down.h.7B94369BC0C2E4C0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sift_down.h.7B94369BC0C2E4C0.idx new file mode 100644 index 0000000..6265048 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sift_down.h.7B94369BC0C2E4C0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/simd_utils.h.3634D4418600B905.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/simd_utils.h.3634D4418600B905.idx new file mode 100644 index 0000000..0455012 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/simd_utils.h.3634D4418600B905.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/size.h.932DCAFCB7B86EC4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/size.h.932DCAFCB7B86EC4.idx new file mode 100644 index 0000000..8146ece Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/size.h.932DCAFCB7B86EC4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/size.h.9E931F8BA0582D89.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/size.h.9E931F8BA0582D89.idx new file mode 100644 index 0000000..def4cb1 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/size.h.9E931F8BA0582D89.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sort.h.8CDF8820EB061655.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sort.h.8CDF8820EB061655.idx new file mode 100644 index 0000000..21d3254 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sort.h.8CDF8820EB061655.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sort_heap.h.ADCE49F00A9ABACD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sort_heap.h.ADCE49F00A9ABACD.idx new file mode 100644 index 0000000..30bec18 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sort_heap.h.ADCE49F00A9ABACD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/special_functions.h.798B540E1A4DD74E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/special_functions.h.798B540E1A4DD74E.idx new file mode 100644 index 0000000..b3047a6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/special_functions.h.798B540E1A4DD74E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sstream.h.125C3BA0793F4F64.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sstream.h.125C3BA0793F4F64.idx new file mode 100644 index 0000000..3824903 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/sstream.h.125C3BA0793F4F64.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stable_partition.h.4C959889C10A229D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stable_partition.h.4C959889C10A229D.idx new file mode 100644 index 0000000..8f177c2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stable_partition.h.4C959889C10A229D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stable_sort.h.4A8CE978DD5E5FB2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stable_sort.h.4A8CE978DD5E5FB2.idx new file mode 100644 index 0000000..8646bc3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stable_sort.h.4A8CE978DD5E5FB2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdarg.h.91D8E4F4F2AB368B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdarg.h.91D8E4F4F2AB368B.idx new file mode 100644 index 0000000..fff9065 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdarg.h.91D8E4F4F2AB368B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stddef.h.9AFA5AD8EF66A96D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stddef.h.9AFA5AD8EF66A96D.idx new file mode 100644 index 0000000..2972003 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stddef.h.9AFA5AD8EF66A96D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stddef.h.CD0E280344C76AAC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stddef.h.CD0E280344C76AAC.idx new file mode 100644 index 0000000..b0dc9c9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stddef.h.CD0E280344C76AAC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdexcept.54D08763FD1F5E48.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdexcept.54D08763FD1F5E48.idx new file mode 100644 index 0000000..cb61255 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdexcept.54D08763FD1F5E48.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdint.h.43B2D76160AC52CA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdint.h.43B2D76160AC52CA.idx new file mode 100644 index 0000000..fd447b8 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdint.h.43B2D76160AC52CA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdint.h.FB0C6441DE3EED80.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdint.h.FB0C6441DE3EED80.idx new file mode 100644 index 0000000..9065bab Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdint.h.FB0C6441DE3EED80.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdio.h.34DE98B629941C4A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdio.h.34DE98B629941C4A.idx new file mode 100644 index 0000000..1f41080 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdio.h.34DE98B629941C4A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdio.h.E6D66DA0CB3C3122.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdio.h.E6D66DA0CB3C3122.idx new file mode 100644 index 0000000..dcec980 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdio.h.E6D66DA0CB3C3122.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdlib.h.6AAF2D52688EAF4D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdlib.h.6AAF2D52688EAF4D.idx new file mode 100644 index 0000000..6630dfb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdlib.h.6AAF2D52688EAF4D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdlib.h.C292466360747BC9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdlib.h.C292466360747BC9.idx new file mode 100644 index 0000000..d707bb7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/stdlib.h.C292466360747BC9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/steady_clock.h.439DF5434184A609.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/steady_clock.h.439DF5434184A609.idx new file mode 100644 index 0000000..b1584c7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/steady_clock.h.439DF5434184A609.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/streambuf.66A76306EEAD9E71.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/streambuf.66A76306EEAD9E71.idx new file mode 100644 index 0000000..a392a67 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/streambuf.66A76306EEAD9E71.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/streambuf.h.F4952FB8C61AAF35.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/streambuf.h.F4952FB8C61AAF35.idx new file mode 100644 index 0000000..2bd09af Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/streambuf.h.F4952FB8C61AAF35.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/strict_weak_ordering_check.h.D4399C22DA29E043.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/strict_weak_ordering_check.h.D4399C22DA29E043.idx new file mode 100644 index 0000000..498fc0b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/strict_weak_ordering_check.h.D4399C22DA29E043.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.9711B4DED4D835CC.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.9711B4DED4D835CC.idx new file mode 100644 index 0000000..14240bd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.9711B4DED4D835CC.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.626939629D08384A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.626939629D08384A.idx new file mode 100644 index 0000000..1e651c0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.626939629D08384A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.797333FE765FB5F1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.797333FE765FB5F1.idx new file mode 100644 index 0000000..c92877f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.797333FE765FB5F1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.E220BF4E30EFDCC7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.E220BF4E30EFDCC7.idx new file mode 100644 index 0000000..96177dd Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string.h.E220BF4E30EFDCC7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string_view.05ECCF7139A44305.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string_view.05ECCF7139A44305.idx new file mode 100644 index 0000000..f8bc77d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string_view.05ECCF7139A44305.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string_view.h.CDDA0157556164D4.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string_view.h.CDDA0157556164D4.idx new file mode 100644 index 0000000..563ed20 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/string_view.h.CDDA0157556164D4.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/strip_signature.h.6F11072ECC5AB7BA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/strip_signature.h.6F11072ECC5AB7BA.idx new file mode 100644 index 0000000..df2287a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/strip_signature.h.6F11072ECC5AB7BA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/student_t_distribution.h.7A78252292DF9631.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/student_t_distribution.h.7A78252292DF9631.idx new file mode 100644 index 0000000..e564db7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/student_t_distribution.h.7A78252292DF9631.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subrange.h.833EE16C539BC01C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subrange.h.833EE16C539BC01C.idx new file mode 100644 index 0000000..1e9cc82 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subrange.h.833EE16C539BC01C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subrange.h.A51BAAA20BF1ABBA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subrange.h.A51BAAA20BF1ABBA.idx new file mode 100644 index 0000000..71dcfba Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subrange.h.A51BAAA20BF1ABBA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subtract_with_carry_engine.h.F1ABEDAA7C06F6FF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subtract_with_carry_engine.h.F1ABEDAA7C06F6FF.idx new file mode 100644 index 0000000..a40c52d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/subtract_with_carry_engine.h.F1ABEDAA7C06F6FF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/support.h.49371EC40513A70C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/support.h.49371EC40513A70C.idx new file mode 100644 index 0000000..e4981cb Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/support.h.49371EC40513A70C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap.h.77CD6A5FFB0C4FA2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap.h.77CD6A5FFB0C4FA2.idx new file mode 100644 index 0000000..989fa52 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap.h.77CD6A5FFB0C4FA2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap_allocator.h.98FC7D0779E432AB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap_allocator.h.98FC7D0779E432AB.idx new file mode 100644 index 0000000..aa62545 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap_allocator.h.98FC7D0779E432AB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap_ranges.h.4F23106FD90BB375.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap_ranges.h.4F23106FD90BB375.idx new file mode 100644 index 0000000..73a2be2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swap_ranges.h.4F23106FD90BB375.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swappable.h.13C66D84F12E1CD9.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swappable.h.13C66D84F12E1CD9.idx new file mode 100644 index 0000000..e0b88ef Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/swappable.h.13C66D84F12E1CD9.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/synth_three_way.h.732CC0C95E214BED.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/synth_three_way.h.732CC0C95E214BED.idx new file mode 100644 index 0000000..ba51e6b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/synth_three_way.h.732CC0C95E214BED.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_clock.h.77D3BB677FECB43B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_clock.h.77D3BB677FECB43B.idx new file mode 100644 index 0000000..6b8d2ac Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_clock.h.77D3BB677FECB43B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_error.8DCE5C30978940DB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_error.8DCE5C30978940DB.idx new file mode 100644 index 0000000..f5027be Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_error.8DCE5C30978940DB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_error.h.3B0DF7000664B9FD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_error.h.3B0DF7000664B9FD.idx new file mode 100644 index 0000000..9ac181f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_error.h.3B0DF7000664B9FD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_gd32c10x.c.452EB4E084F788B0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_gd32c10x.c.452EB4E084F788B0.idx new file mode 100644 index 0000000..018bb73 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_gd32c10x.c.452EB4E084F788B0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_gd32c10x.h.22477223D94E8216.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_gd32c10x.h.22477223D94E8216.idx new file mode 100644 index 0000000..126dcbc Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/system_gd32c10x.h.22477223D94E8216.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/systick.cpp.D6965781E9E353E3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/systick.cpp.D6965781E9E353E3.idx new file mode 100644 index 0000000..9ac8982 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/systick.cpp.D6965781E9E353E3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/systick.h.B6A7175B66896FF1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/systick.h.B6A7175B66896FF1.idx new file mode 100644 index 0000000..f538523 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/systick.h.B6A7175B66896FF1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tables.h.87D2B8EEB3F7FB90.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tables.h.87D2B8EEB3F7FB90.idx new file mode 100644 index 0000000..733307d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tables.h.87D2B8EEB3F7FB90.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tag_types.h.7EA08D2FCB5526FF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tag_types.h.7EA08D2FCB5526FF.idx new file mode 100644 index 0000000..ad7d803 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tag_types.h.7EA08D2FCB5526FF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/temp_value.h.FE7E37D703CAEDFB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/temp_value.h.FE7E37D703CAEDFB.idx new file mode 100644 index 0000000..56dd4e9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/temp_value.h.FE7E37D703CAEDFB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/temporary_buffer.h.70CB60F2B84D2F0E.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/temporary_buffer.h.70CB60F2B84D2F0E.idx new file mode 100644 index 0000000..20a13b0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/temporary_buffer.h.70CB60F2B84D2F0E.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/terminate.h.4B5AE8494DB60358.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/terminate.h.4B5AE8494DB60358.idx new file mode 100644 index 0000000..0b3744b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/terminate.h.4B5AE8494DB60358.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/three_way_comp_ref_type.h.1EDFDD7B6E521A85.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/three_way_comp_ref_type.h.1EDFDD7B6E521A85.idx new file mode 100644 index 0000000..998cf61 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/three_way_comp_ref_type.h.1EDFDD7B6E521A85.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/three_way_comparable.h.AA954713807061E1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/three_way_comparable.h.AA954713807061E1.idx new file mode 100644 index 0000000..35a5d9f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/three_way_comparable.h.AA954713807061E1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/time.h.D264233BC10C47A0.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/time.h.D264233BC10C47A0.idx new file mode 100644 index 0000000..d2d2640 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/time.h.D264233BC10C47A0.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/time_point.h.BFDF913C60D8BA11.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/time_point.h.BFDF913C60D8BA11.idx new file mode 100644 index 0000000..ea40c3a Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/time_point.h.BFDF913C60D8BA11.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_base_10.h.05E0EB5B5EEB34DF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_base_10.h.05E0EB5B5EEB34DF.idx new file mode 100644 index 0000000..a6d2f42 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_base_10.h.05E0EB5B5EEB34DF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_integral.h.ED223F62FCEA7398.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_integral.h.ED223F62FCEA7398.idx new file mode 100644 index 0000000..bc32255 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_integral.h.ED223F62FCEA7398.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_result.h.02A779CDBE37DE87.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_result.h.02A779CDBE37DE87.idx new file mode 100644 index 0000000..c6bc3ad Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_chars_result.h.02A779CDBE37DE87.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_gcc_order.h.CA3D0ED367860B07.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_gcc_order.h.CA3D0ED367860B07.idx new file mode 100644 index 0000000..1874f40 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/to_gcc_order.h.CA3D0ED367860B07.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/totally_ordered.h.9ACE0D9BD1A431BB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/totally_ordered.h.9ACE0D9BD1A431BB.idx new file mode 100644 index 0000000..81c3c91 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/totally_ordered.h.9ACE0D9BD1A431BB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/traits.h.054BA444558158FF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/traits.h.054BA444558158FF.idx new file mode 100644 index 0000000..242b1db Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/traits.h.054BA444558158FF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/traits.h.3A3A7EE63D605587.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/traits.h.3A3A7EE63D605587.idx new file mode 100644 index 0000000..adf40e2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/traits.h.3A3A7EE63D605587.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform.h.7020D2BAA4584EBA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform.h.7020D2BAA4584EBA.idx new file mode 100644 index 0000000..82287f2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform.h.7020D2BAA4584EBA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_exclusive_scan.h.B5D5D2F8F5AEA094.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_exclusive_scan.h.B5D5D2F8F5AEA094.idx new file mode 100644 index 0000000..1a10887 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_exclusive_scan.h.B5D5D2F8F5AEA094.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_inclusive_scan.h.60E5341877AD00A6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_inclusive_scan.h.60E5341877AD00A6.idx new file mode 100644 index 0000000..54589a6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_inclusive_scan.h.60E5341877AD00A6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_reduce.h.C4F0981BA496A189.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_reduce.h.C4F0981BA496A189.idx new file mode 100644 index 0000000..53a3d01 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/transform_reduce.h.C4F0981BA496A189.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/trigonometric_functions.h.3A9AC935DB747FC1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/trigonometric_functions.h.3A9AC935DB747FC1.idx new file mode 100644 index 0000000..50ce562 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/trigonometric_functions.h.3A9AC935DB747FC1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple.0145E94843AD1A46.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple.0145E94843AD1A46.idx new file mode 100644 index 0000000..354c8f7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple.0145E94843AD1A46.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple.h.67D03A8A5A38FE8B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple.h.67D03A8A5A38FE8B.idx new file mode 100644 index 0000000..2cd564c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple.h.67D03A8A5A38FE8B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_element.h.5EBFE0992EF5F6AA.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_element.h.5EBFE0992EF5F6AA.idx new file mode 100644 index 0000000..03cb8a5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_element.h.5EBFE0992EF5F6AA.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_indices.h.CBEB5740A14DE2F5.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_indices.h.CBEB5740A14DE2F5.idx new file mode 100644 index 0000000..0126dbf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_indices.h.CBEB5740A14DE2F5.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_like_ext.h.E0D1E3A0A3B5DB6D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_like_ext.h.E0D1E3A0A3B5DB6D.idx new file mode 100644 index 0000000..dcc8c1e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_like_ext.h.E0D1E3A0A3B5DB6D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_like_no_subrange.h.D64033078CC151F8.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_like_no_subrange.h.D64033078CC151F8.idx new file mode 100644 index 0000000..5b74639 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_like_no_subrange.h.D64033078CC151F8.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_size.h.09CEC8A002112EC1.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_size.h.09CEC8A002112EC1.idx new file mode 100644 index 0000000..5448b8f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_size.h.09CEC8A002112EC1.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_types.h.0D5AD9E137BC2B92.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_types.h.0D5AD9E137BC2B92.idx new file mode 100644 index 0000000..d810e89 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/tuple_types.h.0D5AD9E137BC2B92.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_identity.h.E76DB18F2B2B3CCD.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_identity.h.E76DB18F2B2B3CCD.idx new file mode 100644 index 0000000..2ea977d Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_identity.h.E76DB18F2B2B3CCD.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_list.h.CEA1C7FE77FDAB85.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_list.h.CEA1C7FE77FDAB85.idx new file mode 100644 index 0000000..1a0bd45 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_list.h.CEA1C7FE77FDAB85.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_traits.9761DD2E1700AB2D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_traits.9761DD2E1700AB2D.idx new file mode 100644 index 0000000..0baf3f5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/type_traits.9761DD2E1700AB2D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/typeinfo.FE0ACDE9DB83EC79.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/typeinfo.FE0ACDE9DB83EC79.idx new file mode 100644 index 0000000..259c1c3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/typeinfo.FE0ACDE9DB83EC79.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unary_function.h.3AA202CCD04741BB.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unary_function.h.3AA202CCD04741BB.idx new file mode 100644 index 0000000..db7e946 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unary_function.h.3AA202CCD04741BB.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unary_negate.h.F7CEC985FF0D4344.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unary_negate.h.F7CEC985FF0D4344.idx new file mode 100644 index 0000000..1a02f94 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unary_negate.h.F7CEC985FF0D4344.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/underlying_type.h.BE08A4C00E8C173C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/underlying_type.h.BE08A4C00E8C173C.idx new file mode 100644 index 0000000..fd24473 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/underlying_type.h.BE08A4C00E8C173C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unicode.h.B83D5D46FA0FD2C3.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unicode.h.B83D5D46FA0FD2C3.idx new file mode 100644 index 0000000..f9b5338 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unicode.h.B83D5D46FA0FD2C3.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_int_distribution.h.E265CE4A07C35D73.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_int_distribution.h.E265CE4A07C35D73.idx new file mode 100644 index 0000000..03a2b55 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_int_distribution.h.E265CE4A07C35D73.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_random_bit_generator.h.9CBDF3225CA92F78.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_random_bit_generator.h.9CBDF3225CA92F78.idx new file mode 100644 index 0000000..9ec3fec Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_random_bit_generator.h.9CBDF3225CA92F78.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_real_distribution.h.143AE5D861EE4E8C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_real_distribution.h.143AE5D861EE4E8C.idx new file mode 100644 index 0000000..0167dd2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uniform_real_distribution.h.143AE5D861EE4E8C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uninitialized_algorithms.h.C5EA7BE8E6577109.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uninitialized_algorithms.h.C5EA7BE8E6577109.idx new file mode 100644 index 0000000..9e9c7d4 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uninitialized_algorithms.h.C5EA7BE8E6577109.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique.h.5A62E4947B508F2C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique.h.5A62E4947B508F2C.idx new file mode 100644 index 0000000..5259d4f Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique.h.5A62E4947B508F2C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_copy.h.1B4C888D6DF1AA59.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_copy.h.1B4C888D6DF1AA59.idx new file mode 100644 index 0000000..a30cea0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_copy.h.1B4C888D6DF1AA59.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_lock.h.140006F566DA327D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_lock.h.140006F566DA327D.idx new file mode 100644 index 0000000..f3a931e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_lock.h.140006F566DA327D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_ptr.h.1D8B108D8DFC5B85.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_ptr.h.1D8B108D8DFC5B85.idx new file mode 100644 index 0000000..3288a7b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unique_ptr.h.1D8B108D8DFC5B85.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unordered_map.7B3D663F7BFFA563.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unordered_map.7B3D663F7BFFA563.idx new file mode 100644 index 0000000..654c492 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unordered_map.7B3D663F7BFFA563.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unreachable.h.051A6D54C9154348.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unreachable.h.051A6D54C9154348.idx new file mode 100644 index 0000000..25d9ba7 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unreachable.h.051A6D54C9154348.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unreachable_sentinel.h.93E8A07209989F81.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unreachable_sentinel.h.93E8A07209989F81.idx new file mode 100644 index 0000000..5ab3591 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unreachable_sentinel.h.93E8A07209989F81.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_iter.h.83DA630310A3AC8C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_iter.h.83DA630310A3AC8C.idx new file mode 100644 index 0000000..46c766c Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_iter.h.83DA630310A3AC8C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_range.h.61BE0D73AD25157D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_range.h.61BE0D73AD25157D.idx new file mode 100644 index 0000000..c3ca8a6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_range.h.61BE0D73AD25157D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_ref.h.474FD90C3321EEB7.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_ref.h.474FD90C3321EEB7.idx new file mode 100644 index 0000000..62c2cc0 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/unwrap_ref.h.474FD90C3321EEB7.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/upper_bound.h.9C32212E6017B999.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/upper_bound.h.9C32212E6017B999.idx new file mode 100644 index 0000000..0c40244 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/upper_bound.h.9C32212E6017B999.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uses_allocator.h.9281CEA1979A7A9D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uses_allocator.h.9281CEA1979A7A9D.idx new file mode 100644 index 0000000..0448396 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/uses_allocator.h.9281CEA1979A7A9D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/utility.AB477ADB3300132A.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/utility.AB477ADB3300132A.idx new file mode 100644 index 0000000..229ff1e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/utility.AB477ADB3300132A.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/variant.67131580FDDBB730.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/variant.67131580FDDBB730.idx new file mode 100644 index 0000000..6c6a0e3 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/variant.67131580FDDBB730.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/vector.F0ACE3709BA75640.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/vector.F0ACE3709BA75640.idx new file mode 100644 index 0000000..286d9a6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/vector.F0ACE3709BA75640.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/vector.h.4598AF5F599A3548.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/vector.h.4598AF5F599A3548.idx new file mode 100644 index 0000000..c544ec6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/vector.h.4598AF5F599A3548.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/version.68FAC25560644D60.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/version.68FAC25560644D60.idx new file mode 100644 index 0000000..2677599 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/version.68FAC25560644D60.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/view_interface.h.5EC3B1B4C4D1662C.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/view_interface.h.5EC3B1B4C4D1662C.idx new file mode 100644 index 0000000..9c79926 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/view_interface.h.5EC3B1B4C4D1662C.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/void_t.h.C65FACB8D0ADDC26.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/void_t.h.C65FACB8D0ADDC26.idx new file mode 100644 index 0000000..d8c49f9 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/void_t.h.C65FACB8D0ADDC26.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/voidify.h.D1E9E7C00EA3ED47.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/voidify.h.D1E9E7C00EA3ED47.idx new file mode 100644 index 0000000..5413e88 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/voidify.h.D1E9E7C00EA3ED47.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wchar.h.0B57B5D77F67DF8F.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wchar.h.0B57B5D77F67DF8F.idx new file mode 100644 index 0000000..95d698e Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wchar.h.0B57B5D77F67DF8F.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wchar.h.81D3D4D24961BC6D.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wchar.h.81D3D4D24961BC6D.idx new file mode 100644 index 0000000..b9f1925 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wchar.h.81D3D4D24961BC6D.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wctype.h.5F3D7D775E4B95FF.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wctype.h.5F3D7D775E4B95FF.idx new file mode 100644 index 0000000..5f67398 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wctype.h.5F3D7D775E4B95FF.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wctype.h.8D38237F4025A01B.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wctype.h.8D38237F4025A01B.idx new file mode 100644 index 0000000..d84b4da Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wctype.h.8D38237F4025A01B.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/weak_result_type.h.9EDE35462DD9E310.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/weak_result_type.h.9EDE35462DD9E310.idx new file mode 100644 index 0000000..67c13a2 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/weak_result_type.h.9EDE35462DD9E310.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/weibull_distribution.h.502721EDADFF92F2.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/weibull_distribution.h.502721EDADFF92F2.idx new file mode 100644 index 0000000..e6d205b Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/weibull_distribution.h.502721EDADFF92F2.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/width_estimation_table.h.F4544BD901E48883.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/width_estimation_table.h.F4544BD901E48883.idx new file mode 100644 index 0000000..7af5ebf Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/width_estimation_table.h.F4544BD901E48883.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wrap_iter.h.31F6BD71A78208B6.idx b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wrap_iter.h.31F6BD71A78208B6.idx new file mode 100644 index 0000000..a12e3b6 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/.cache/clangd/index/wrap_iter.h.31F6BD71A78208B6.idx differ diff --git a/out/Robot_V2/GD32C103CB/Release/Robot_V2.Release+GD32C103CB.cbuild.yml b/out/Robot_V2/GD32C103CB/Release/Robot_V2.Release+GD32C103CB.cbuild.yml new file mode 100644 index 0000000..1d8c97a --- /dev/null +++ b/out/Robot_V2/GD32C103CB/Release/Robot_V2.Release+GD32C103CB.cbuild.yml @@ -0,0 +1,354 @@ +build: + generated-by: csolution version 2.12.0+p41-gfeadfc5e + solution: ../../../../Robot_V2.csolution.yml + project: ../../../../Robot_V2/Robot_V2.cproject.yml + context: Robot_V2.Release+GD32C103CB + compiler: AC6 + device: GigaDevice::GD32C103CB + device-pack: GigaDevice::GD32C10x_DFP@1.0.1 + processor: + endian: little + fpu: sp + core: Cortex-M4 + packs: + - pack: ARM::CMSIS@4.5.0 + path: ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0 + - pack: GigaDevice::GD32C10x_DFP@1.0.1 + path: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1 + optimize: balanced + debug: off + misc: + ASM: + - -D__packed=packed + - -D__MICROLIB + - -gdwarf-5 + - -masm=auto + C: + - -D__packed=packed + - -fshort-enums + - -fshort-wchar + - -D__MICROLIB + - -Wno-register + - -gdwarf-5 + - -std=gnu11 + - -Wno-macro-redefined + - -Wno-pragma-pack + - -Wno-parentheses-equality + - -Wno-license-management + CPP: + - -fshort-enums + - -fshort-wchar + - -D__MICROLIB + - -Wno-register + - -gdwarf-5 + - -Wno-macro-redefined + - -Wno-pragma-pack + - -Wno-parentheses-equality + - -Wno-license-management + Link: + - --library_type=microlib + - --entry=Reset_Handler + - --info=summarysizes + - --summary_stderr + - --diag_suppress=L6314W + define: + - GD32C10x + - _RTE_ + define-asm: + - GD32C10x + - _RTE_ + add-path: + - ../../../../Robot_V2/RTE/_Release_GD32C103CB + - ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities + add-path-asm: + - ../../../../Robot_V2/RTE/_Release_GD32C103CB + - ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include + - ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities + output-dirs: + intdir: ../../../../tmp + outdir: . + rtedir: ../../../../Robot_V2/RTE + output: + - type: elf + file: Robot_V2.axf + - type: hex + file: Robot_V2.hex + - type: map + file: Robot_V2.axf.map + components: + - component: ARM::CMSIS:CORE@4.3.0 + condition: Cortex-M Device + from-pack: ARM::CMSIS@4.5.0 + selected-by: ARM::CMSIS:CORE + files: + - file: ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Documentation/Core/html/index.html + category: doc + version: 4.3.0 + - file: ${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include + category: include + version: 4.3.0 + - component: GigaDevice::Device:EVAL:GD32C10x@1.0.0 + condition: GD32C10x STDPERIPHERALS EVAL + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:EVAL:GD32C10x + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities/gd32c10x_eval.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:BKP@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:BKP + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_bkp.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:CAN + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_can.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:CRC@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:CRC + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_crc.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:DBG + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_dbg.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:DMA + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_dma.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:EXTI + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_exti.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:FMC + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_fmc.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:FWDGT + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_fwdgt.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:GPIO + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_gpio.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 + condition: GD32C10x CMSIS + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:MISC + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_misc.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:PMU + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_pmu.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 + condition: GD32C10x STDPERIPHERALS MISC + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:RCU + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_rcu.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 + condition: GD32C10x STDPERIPHERALS RCU + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_StdPeripherals:USART + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc/gd32c10x_usart.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c + category: source + attr: config + version: 1.0.0 + - component: GigaDevice::Device:GD32C10x_libopt@1.0.0 + condition: GD32C10x CMSIS + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:GD32C10x_libopt + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include/gd32c10x_libopt.h + category: header + version: 1.0.0 + - component: GigaDevice::Device:Startup@1.0.0 + condition: GD32C10x + from-pack: GigaDevice::GD32C10x_DFP@1.0.1 + selected-by: Device:Startup + files: + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include + category: include + version: 1.0.0 + - file: ${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include/gd32c10x.h + category: header + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s + category: source + attr: config + version: 1.0.0 + - file: ../../../../Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c + category: source + attr: config + version: 1.0.0 + linker: + script: ../../../../Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src + regions: ../../../../Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h + groups: + - group: Source Files + files: + - file: ../../../../Robot_V2/main.h + category: header + - file: ../../../../Robot_V2/main.cpp + category: sourceCpp + - group: sys + files: + - file: ../../../../Robot_V2/sys/systick.cpp + category: sourceCpp + - file: ../../../../Robot_V2/sys/systick.h + category: header + - file: ../../../../Robot_V2/sys/initial.cpp + category: sourceCpp + - file: ../../../../Robot_V2/sys/initial.h + category: header + - file: ../../../../Robot_V2/sys/flash.h + category: header + - file: ../../../../Robot_V2/sys/flash.cpp + category: sourceCpp + - file: ../../../../Robot_V2/sys/OTA.h + category: header + - file: ../../../../Robot_V2/sys/OTA.cpp + category: sourceCpp + - file: ../../../../Robot_V2/sys/config.h + category: header + - group: device + files: + - file: ../../../../Robot_V2/device/Can.cpp + category: sourceCpp + - file: ../../../../Robot_V2/device/Can.h + category: header + constructed-files: + - file: ../../../../Robot_V2/RTE/_Release_GD32C103CB/RTE_Components.h + category: header + licenses: + - license: + packs: + - pack: ARM::CMSIS@4.5.0 + components: + - component: ARM::CMSIS:CORE@4.3.0 + - license: + packs: + - pack: GigaDevice::GD32C10x_DFP@1.0.1 + components: + - component: GigaDevice::Device:EVAL:GD32C10x@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:BKP@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:CRC@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 + - component: GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 + - component: GigaDevice::Device:GD32C10x_libopt@1.0.0 + - component: GigaDevice::Device:Startup@1.0.0 diff --git a/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf b/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf new file mode 100644 index 0000000..202c2a5 Binary files /dev/null and b/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf differ diff --git a/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map b/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map new file mode 100644 index 0000000..a8a3af4 --- /dev/null +++ b/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map @@ -0,0 +1,139 @@ +Component: Arm Compiler for Embedded 6.24 Tool: armlink [5f371500] + +============================================================================== + +Memory Map of the image + + Image Entry point : 0x08000165 + + Load Region LR_ROM0 (Base: 0x08000000, Size: 0x00001888, Max: 0x00020000, ABSOLUTE) + + Execution Region ER_ROM0 (Base: 0x08000000, Size: 0x00001784, Max: 0x00020000, ABSOLUTE) + + Base Addr Size Type Attr Idx E Section Name Object + + 0x08000000 0x00000150 Data RO 922 RESET startup_gd32c10x.o + 0x08000150 0x00000000 Code RO 1086 * .ARM.Collect$$$$00000000 mc_w.l(entry.o) + 0x08000150 0x00000004 Code RO 1520 .ARM.Collect$$$$00000003 mc_w.l(entry4.o) + 0x08000154 0x00000004 Code RO 1523 .ARM.Collect$$$$00000004 mc_w.l(entry5.o) + 0x08000158 0x00000000 Code RO 1525 .ARM.Collect$$$$00000008 mc_w.l(entry7b.o) + 0x08000158 0x00000000 Code RO 1527 .ARM.Collect$$$$0000000A mc_w.l(entry8b.o) + 0x08000158 0x00000008 Code RO 1528 .ARM.Collect$$$$0000000B mc_w.l(entry9a.o) + 0x08000160 0x00000000 Code RO 1530 .ARM.Collect$$$$0000000D mc_w.l(entry10a.o) + 0x08000160 0x00000000 Code RO 1532 .ARM.Collect$$$$0000000F mc_w.l(entry11a.o) + 0x08000160 0x00000004 Code RO 1521 .ARM.Collect$$$$00002714 mc_w.l(entry4.o) + 0x08000164 0x0000002c Code RO 923 * .text startup_gd32c10x.o + 0x08000190 0x00000024 Code RO 1096 .text mc_w.l(memcpya.o) + 0x080001b4 0x00000024 Code RO 1098 .text mc_w.l(memseta.o) + 0x080001d8 0x00000002 Code RO 1550 .text mc_w.l(abort.o) + 0x080001da 0x00000002 PAD + 0x080001dc 0x00000030 Code RO 1877 .text mc_w.l(init.o) + 0x0800020c 0x000000cc Code RO 157 .text.CAN0_RX0_IRQHandler Can.o + 0x080002d8 0x0000004a Code RO 159 .text.DMA0_Channel4_IRQHandler Can.o + 0x08000322 0x00000002 PAD + 0x08000324 0x00000026 Code RO 161 .text.DMA0_Channel5_IRQHandler Can.o + 0x0800034a 0x00000002 PAD + 0x0800034c 0x000000e0 Code RO 931 .text.SystemCoreClockUpdate system_gd32c10x.o + 0x0800042c 0x00000342 Code RO 929 .text.SystemInit system_gd32c10x.o + 0x0800076e 0x00000002 PAD + 0x08000770 0x00000002 Code RO 101 .text._ZN10OTAHandler7processEv OTA.o + 0x08000772 0x00000002 PAD + 0x08000774 0x00000008 Code RO 97 .text._ZN10OTAHandlerC2Ev OTA.o + 0x0800077c 0x00000028 Code RO 952 .text._ZN10__cxxabiv121__isOurExceptionClassEPK21_Unwind_Control_Block libcppabi_wx.l(cxa_exception.cpp.o) + 0x080007a4 0x00000060 Code RO 980 .text._ZN10__cxxabiv1L22__cxa_end_cleanup_implEv libcppabi_wx.l(cxa_exception.cpp.o) + 0x08000804 0x00000038 Code RO 141 .text._ZN14CAN_transmiter4initEv Can.o + 0x0800083c 0x00000074 Code RO 1023 .text._ZSt11__terminatePFvvE libcppabi_wx.l(cxa_handlers.cpp.o) + 0x080008b0 0x00000030 Code RO 1014 .text._ZSt9terminatev libcppabi_wx.l(cxa_handlers.cpp.o) + 0x080008e0 0x0000000a Code RO 1009 .text.__clang_call_terminate libcppabi_wx.l(cxa_exception.cpp.o) + 0x080008ea 0x00000002 PAD + 0x080008ec 0x0000006c Code RO 957 .text.__cxa_begin_catch libcppabi_wx.l(cxa_exception.cpp.o) + 0x08000958 0x0000000a Code RO 1387 .text.__cxa_get_globals libcppabi_wx.l(cxa_exception_storage.cpp.o) + 0x08000962 0x0000000a Code RO 1389 .text.__cxa_get_globals_fast libcppabi_wx.l(cxa_exception_storage.cpp.o) + 0x0800096c 0x00000026 Code RO 263 .text.can_deinit gd32c10x_can.o + 0x08000992 0x00000002 PAD + 0x08000994 0x00000114 Code RO 269 .text.can_fd_init gd32c10x_can.o + 0x08000aa8 0x000000b2 Code RO 271 .text.can_filter_init gd32c10x_can.o + 0x08000b5a 0x00000002 PAD + 0x08000b5c 0x00000176 Code RO 267 .text.can_init gd32c10x_can.o + 0x08000cd2 0x00000002 PAD + 0x08000cd4 0x00000008 Code RO 313 .text.can_interrupt_enable gd32c10x_can.o + 0x08000cdc 0x00000016 Code RO 323 .text.can_interrupt_flag_clear gd32c10x_can.o + 0x08000cf2 0x00000002 PAD + 0x08000cf4 0x00000066 Code RO 321 .text.can_interrupt_flag_get gd32c10x_can.o + 0x08000d5a 0x00000002 PAD + 0x08000d5c 0x000001f4 Code RO 297 .text.can_message_receive gd32c10x_can.o + 0x08000f50 0x00000018 Code RO 301 .text.can_receive_message_length_get gd32c10x_can.o + 0x08000f68 0x00000072 Code RO 265 .text.can_struct_para_init gd32c10x_can.o + 0x08000fda 0x00000002 PAD + 0x08000fdc 0x00000100 Code RO 132 .text.canfd_config Can.o + 0x080010dc 0x00000018 Code RO 23 .text.delay_decrement systick.o + 0x080010f4 0x00000024 Code RO 403 .text.dma_channel_disable gd32c10x_dma.o + 0x08001118 0x00000024 Code RO 401 .text.dma_channel_enable gd32c10x_dma.o + 0x0800113c 0x00000074 Code RO 391 .text.dma_init gd32c10x_dma.o + 0x080011b0 0x0000000e Code RO 435 .text.dma_interrupt_flag_clear gd32c10x_dma.o + 0x080011be 0x00000002 PAD + 0x080011c0 0x0000003a Code RO 433 .text.dma_interrupt_flag_get gd32c10x_dma.o + 0x080011fa 0x00000002 PAD + 0x080011fc 0x0000002c Code RO 43 .text.fputc initial.o + 0x08001228 0x00000004 Code RO 601 .text.gpio_bit_reset gd32c10x_gpio.o + 0x0800122c 0x000002c0 Code RO 597 .text.gpio_init gd32c10x_gpio.o + 0x080014ec 0x00000080 Code RO 615 .text.gpio_pin_remap_config gd32c10x_gpio.o + 0x0800156c 0x00000066 Code RO 4 .text.main main.o + 0x080015d2 0x00000002 PAD + 0x080015d4 0x00000060 Code RO 644 .text.nvic_irq_enable gd32c10x_misc.o + 0x08001634 0x0000001c Code RO 648 .text.nvic_vector_table_set gd32c10x_misc.o + 0x08001650 0x0000001e Code RO 712 .text.rcu_periph_clock_enable gd32c10x_rcu.o + 0x0800166e 0x00000002 PAD + 0x08001670 0x00000020 Code RO 722 .text.rcu_periph_reset_disable gd32c10x_rcu.o + 0x08001690 0x0000001e Code RO 720 .text.rcu_periph_reset_enable gd32c10x_rcu.o + 0x080016ae 0x00000002 PAD + 0x080016b0 0x00000048 Code RO 17 .text.systick_config systick.o + 0x080016f8 0x00000006 Code RO 1372 .text.unlikely.abort_message libcppabi_wx.l(abort_message.cpp.o) + 0x080016fe 0x00000002 PAD + 0x08001700 0x00000008 Code RO 836 .text.usart_data_transmit gd32c10x_usart.o + 0x08001708 0x00000010 Code RO 898 .text.usart_flag_get gd32c10x_usart.o + 0x08001718 0x0000000e Code RO 1962 i.__scatterload_copy mc_w.l(handlers.o) + 0x08001726 0x00000002 Code RO 1963 i.__scatterload_null mc_w.l(handlers.o) + 0x08001728 0x0000000e Code RO 1964 i.__scatterload_zeroinit mc_w.l(handlers.o) + 0x08001736 0x00000002 PAD + 0x08001738 0x00000024 Code RO 1089 i.puts mc_w.l(puts.o) + 0x0800175c 0x00000007 Data RO 325 .rodata.g_can_fdlength_table gd32c10x_can.o + 0x08001763 0x00000001 PAD + 0x08001764 0x00000020 Data RO 1961 Region$$Table anon$$obj.o + + + Execution Region RW_NOINIT (Base: 0x20000000, Size: 0x00000000, Max: 0x00007200, ABSOLUTE, UNINIT) + + **** No section assigned to this execution region **** + + + Execution Region RW_RAM0 (Base: 0x20000000, Size: 0x00000940, Max: 0x00007200, ABSOLUTE) + + Base Addr Size Type Attr Idx E Section Name Object + + 0x20000000 0x00000004 Data RW 1534 .data mc_w.l(stdout.o) + 0x20000004 0x000000f4 Data RW 163 .data.CAN0_transmiter Can.o + 0x200000f8 0x00000004 Data RW 935 .data.SystemCoreClock system_gd32c10x.o + 0x200000fc 0x00000004 Data RW 1382 .data.__cxa_terminate_handler libcppabi_wx.l(cxa_default_handlers.cpp.o) + 0x20000100 0x00000004 Zero RW 27 .bss._ZL5delay systick.o + 0x20000104 0x0000000c Zero RW 1391 .bss._ZN10__cxxabiv1L10eh_globalsE libcppabi_wx.l(cxa_exception_storage.cpp.o) + 0x20000110 0x00000008 Zero RW 166 .bss.can_rx_buffer Can.o + 0x20000118 0x00000008 Zero RW 167 .bss.can_tx_buffer Can.o + 0x20000120 0x0000001c Zero RW 164 .bss.dma_rx_parameter Can.o + 0x2000013c 0x00000004 PAD + 0x20000140 0x00000800 Zero RW 920 STACK startup_gd32c10x.o + + + Execution Region ARM_LIB_HEAP (Base: 0x20000940, Size: 0x00000c00, Max: 0x00000c00, ABSOLUTE) + + Base Addr Size Type Attr Idx E Section Name Object + + 0x20000940 0x00000c00 Zero RW 1 ARM_LIB_HEAP.bss anon$$obj.o + + + Execution Region ARM_LIB_STACK (Base: 0x20007e00, Size: 0x00000200, Max: 0x00000200, ABSOLUTE) + + Base Addr Size Type Attr Idx E Section Name Object + + 0x20007e00 0x00000200 Zero RW 2 ARM_LIB_STACK.bss anon$$obj.o + diff --git a/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex b/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex new file mode 100644 index 0000000..8a33eea --- /dev/null +++ b/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex @@ -0,0 +1,396 @@ +:020000040800F2 +:1000000040090020650100086D0100086F0100082B +:10001000710100087301000875010008000000006C +:100020000000000000000000000000007701000850 +:1000300079010008000000007B0100087D01000834 +:100040008101000881010008810100088101000888 +:100050008101000881010008810100088101000878 +:100060008101000881010008810100088101000868 +:10007000810100088101000881010008D9020008FF +:1000800025030008810100088101000881010008A2 +:100090000D020008810100088101000881010008AB +:1000A0008101000881010008810100088101000828 +:1000B0008101000881010008810100088101000818 +:1000C0008101000881010008810100088101000808 +:1000D00081010008810100088101000881010008F8 +:1000E00081010008810100088101000881010008E8 +:1000F0008101000881010008810100080000000062 +:100100008101000800000000810100088101000851 +:1001100081010008810100088101000881010008B7 +:1001200081010008810100088101000881010008A7 +:1001300081010008000000000000000081010008AB +:100140008101000881010008810100088101000887 +:10015000DFF80CD000F042F8004800476D150008A9 +:10016000008000200748804707480047FEE7FEE779 +:10017000FEE7FEE7FEE7FEE7FEE7FEE7034800478F +:10018000FEE700002D04000851010008DD10000802 +:1001900040EA01039B0703D009E008C9121F08C009 +:1001A000042AFAD203E011F8013B00F8013B521E89 +:1001B000F9D27047D2B201E000F8012B491EFBD200 +:1001C00070470022F6E710B513460A460446194662 +:1001D000FFF7F0FF204610BD704700001CB509482E +:1001E0000090094801900546009C06E0E06840F058 +:1001F000010394E8070098471034AC42F6D3FFF7A8 +:10020000ABFF00006417000884170008B0B546F281 +:100210000044C4F2000420464CF2810100F06AFD63 +:1002200040B320464CF2810100F058FD04F5CE3574 +:100230002846042100F05EFF2046002100F088FEE1 +:1002400040F22012C2F2000210612846042100F0A0 +:1002500075FF2846042100F05FFF40F20405C2F25A +:10026000000505F198022046002100F077FD0120ED +:1002700085F8E80020464CF2C20100F03BFD38B1A1 +:1002800020464CF2C20100F029FD0AA001F054FA08 +:1002900020464CF2031100F02DFD002808BFB0BD30 +:1002A00020464CF2031100F019FD06A0BDE8B04055 +:1002B00001F042BA43414E204649464F3020667510 +:1002C0006C6C000043414E204649464F30206F760B +:1002D0006572666C6F77000010B50024C4F20204EA +:1002E00020460421022200F06BFF002808BF10BD49 +:1002F00020460421012200F05BFF40F20400C2F21C +:10030000000090F8A2205AB140F21011082A28BF2C +:100310000822A330C2F20001BDE81040FFF738BF49 +:1003200010BD000010B50024C4F2020420460521CF +:10033000022200F045FF002808BF10BD204605211D +:100340000122BDE8104000F033BF000080B541F24B +:10035000040EC4F2020EDEF8001041F2002201F099 +:100360000C0140F2F80CC0F27A020829C2F2000C2B +:1003700047D1DEF80030DB0304D440F60013C0F2AE +:100380003D0324E0DEF82830DEF828105B0046F656 +:100390000043C0F2DC2358BF1346C90310D5DEF872 +:1003A0002810DEF82820C1F303110131C2F3032223 +:1003B000B3FBF1F10232112A08BF142202FB01F350 +:1003C000DEF8281001F00F010131B3FBF1F3DEF884 +:1003D0000010DEF800201020C1F3834100EA5260D3 +:1003E000084401210F2838BF0221084400FB03F212 +:1003F0000F28CCF8002006D103EB4300400000EBAF +:100400005302CCF80020DEF8000004A1C0F3031072 +:10041000085C22FA00F0CCF8000080BD000000006B +:1004200000000000010203040607080982B04EF62E +:100430008851CEF200010A6841F2000042F47002D5 +:10044000C4F202000A60016841F001010160016824 +:10045000890709D4016889075CBF01685FEA817177 +:1004600002D401688907F2D5416801F00C0108291E +:1004700040F0C28000210191019A4F2A18D800BF94 +:10048000019A01320192019A4F2A11D8019A013240 +:100490000192019A4F2A0BD8019A01320192019AD6 +:1004A0004F2A05D8019A01320192019A502AE7D3C6 +:1004B00042680092009A22F0F0020092009A42F004 +:1004C00080020092009A4260019101994F2917D849 +:1004D00001990131019101994F2911D801990131F7 +:1004E000019101994F290BD801990131019101998D +:1004F0004F2905D801990131019101995029E7D37C +:1005000041680091009921F0F0010091009941F0BB +:10051000900100910099416000210191019A4F2AB8 +:1005200018D800BF019A01320192019A4F2A11D8BE +:10053000019A01320192019A4F2A0BD8019A013295 +:100540000192019A4F2A05D8019A01320192019A2B +:10055000502AE7D342680092009A22F0F0020092FB +:10056000009A42F0A0020092009A42600191019923 +:100570004F2917D801990131019101994F2911D8BB +:1005800001990131019101994F290BD8019901314C +:10059000019101994F2905D80199013101910199E2 +:1005A0005029E7D341680091009921F0F0010091B2 +:1005B000009941F0B0010091009941600021019142 +:1005C00001994F2918D800BF019901310191019972 +:1005D0004F2911D801990131019101994F290BD867 +:1005E00001990131019101994F2905D801990131F2 +:1005F000019101995029E7D3416821F0030141603D +:1006000000210191019A12097C2A1BD8019A01321A +:100610000192019A12097C2A14D8019A013201929E +:10062000019A12097C2A0DD8019A01320192019A8D +:1006300012097C2A06D8019A01320192019AB2F578 +:10064000FA6FE3D302684FF6FF73CEF6F6231A4033 +:1006500002604FF47F0282604160C162016821F450 +:1006600080210160016841F4803101604FF6FC7126 +:10067000026892030BD4026892035CBF02685FEACF +:10068000823204D419B1026804399203F0D50168AA +:10069000890300D4FEE742F20001C4F202010A68B5 +:1006A000032363F302020A6041684FF6FF72416060 +:1006B0004168CDF6C3724160416841F48061416098 +:1006C00041681140416041684FF2000241F0005121 +:1006D00041F454114160C16ACBF6FE721140C1620F +:1006E000C16A41F4843141F01901C162016841F0ED +:1006F000806101600168090109D4016809015CBFDA +:1007000001685FEA011102D401680901F2D50168AC +:1007100041F0807101600168890109D40168890193 +:100720005CBF01685FEA811102D401688901F2D5DA +:1007300041680191019921F003010191019941F072 +:1007400002010191019941604168090709D441689A +:1007500009075CBF41685FEA017102D4416809077B +:10076000F2D54FF00060002102B000F063BF00003E +:1007700070470000002101704160704703C844F6D3 +:100780004E42C0F24302000A82EA112240EA0160AE +:1007900042F62B31C4F2437148401043B0FA80F066 +:1007A0004009704710B500F0D7F8D0F808E0BEF166 +:1007B000000F25D0714651F828CF44F64E424B68C1 +:1007C000C0F2430282EA13244FEA1C2242EA036287 +:1007D00042F62B33C4F243735A4022430CD1DEF865 +:1007E0002420013ACEF8242008D1DEF820208260AF +:1007F0000020CEF8200001E000228260084610BDF3 +:1008000000F056F810B5044600F0E8FB211D032067 +:1008100000F0AAFB04F19801042000F0A5FB40F2CF +:100820001010C2F20000002140F21812C0E90011BD +:10083000C2F2000200201160516010BD80B58047F7 +:1008400004A000F059FF00F051F80CA000F054FF94 +:1008500000F046F87465726D696E6174655F686179 +:100860006E646C657220756E65787065637465641E +:100870006C792072657475726E6564007465726D52 +:10088000696E6174655F68616E646C657220756E17 +:1008900065787065637465646C79207468726577D7 +:1008A00020616E20657863657074696F6E0000006A +:1008B00010B500F056F808B1046834B940F2FC00F5 +:1008C000C2F200000068FFF7B9FF04F12800FFF74B +:1008D00055FF0028F2D06069FFF7B0FF00F000F884 +:1008E00080B500F003F8FFF7E3FF000070B5D0E932 +:1008F0000065044600F030F844F64E41320A42F6F4 +:100900002B33C0F2430142EA0562C4F2437381EA29 +:1009100015215A401143A4F1280112D154F80C2C8E +:10092000002A48BF524203680132994244F80C2C15 +:100930001CBF44F8103C0160416801394160606AA5 +:1009400070BD0268002A02BF016004F1580070BD4A +:10095000FFF7AEFFFFF7C4FF40F20410C2F2000041 +:10096000704740F20410C2F20000704710B546F222 +:100970000041C4F2000140F21A44884208BF40F22C +:100980001944204600F084FE2046BDE8104000F0E7 +:100990006FBE0000002904BF00207047B0B5026898 +:1009A00040F2040E22F0020202600368CFF6FF7EDE +:1009B00043F00103036073464268D20704BF4268F4 +:1009C0005FEAC2720AD14268D20704BF42685FEA96 +:1009D000C27203D1002B03F10403EDD14268D207A8 +:1009E00001D100215CE00B7C4FF0E0654C7C05EA16 +:1009F00003638D7C64F3134305F007048D8A43EA97 +:100A000004536C1E6FF39F2423444A7891F802C06C +:100A1000C362D1E90234012A43EA040323F0040348 +:100A200018BF0433BCF1010F15D1D1F804C0BCF1DB +:100A3000000FD6D0DCF800209CF8055002F0200210 +:100A40001A4342F010039CF8042002F07F0265F381 +:100A50000E22826201E023F01003097823F00102E4 +:100A6000012908BF01320262016821F00101016021 +:100A70004168C90713D04168C90710D04168C90748 +:100A80000DD04268BEF1000F714618BF0121D20798 +:100A900006D0BEF1000F0EF1040EE9D100E00121F5 +:100AA000BDE8B04008467047B0B546F20061C4F2F8 +:100AB000000144890A684FF0010C42F001020A600B +:100AC000CB690CFA04F5AB43CB61C3896FEA050C23 +:100AD000012B10D023BBCB6803EA0C03CB60B0F82A +:100AE00006E0438843EA0E434FEAC40E01EBC40418 +:100AF000236403460DE0CB682B43CB60B0F800E0E5 +:100B0000438843EA0E434FEAC40E01EBC404236456 +:100B1000831D84881B8843EA044301EB0E0463644D +:100B200083894C68002B44EA050208BF04EA0C02E2 +:100B30004A6002894B69002A43EA050408BF03EAB8 +:100B40000C044C61007C012802D1C8692843C861AB +:100B5000086820F001000860B0BD000070B50268B0 +:100B600040F2040C22F0020202600368CFF6FF7C20 +:100B700043F00103036063464268D20704BF426842 +:100B80005FEAC2720AD14268D20704BF42685FEAD4 +:100B9000C27203D1002B03F10403EDD14268D207E6 +:100BA00004BF002070BD036ADA0724D143F00102BC +:100BB00002628C780A78250491F801E045EA8415F0 +:100BC00041F60044CE789207C0F20F046EF31C6227 +:100BD00025402A44350545EA862646F20005C0F23E +:100BE00070052E404D8932446E1E6FF39F263244AD +:100BF000C26103621EE00A784B788E78920763F335 +:100C00001C62330443EA861341F60046CD78C0F2F5 +:100C10000F0633401A442B0546F2000643EA8523AB +:100C2000C0F2700633404E891A44731E6FF39F233F +:100C30001A44C26102680B7922F080024E798D79E4 +:100C4000CC79012B08BF803202600268012E22F0AD +:100C5000400208BF403202600268012D22F02002EB +:100C600008BF203202600268012C22F0100218BF77 +:100C7000103202600A7A0368012A23F0080318BFC1 +:100C800008330360497A0268012922F0040208BF90 +:100C900004320260016821F0010101604168C90766 +:100CA00015D04168C9071CBF41685FEAC1710ED009 +:100CB0004268BCF1000F614618BF0121D20704D081 +:100CC000BCF1000F0CF1040CE8D1084670BD012006 +:100CD00070BD00004269114341617047C1F3841245 +:100CE000090B4FF0010C0B580CFA02F21A430A5090 +:100CF0007047000048F2CB02C0F20102914210D0CE +:100D00008422C0F20102914207D04CF2810291424A +:100D10000BD1C26802F0030210E0026902F0030284 +:100D20000CE08269C2F3021208E00A0B52F800C01C +:100D3000C1F3841301229A4002EA0C02406901F0D7 +:100D40001F01012303FA01F10840002A18BF012204 +:100D5000002818BF0120104070470000B0B582B0D5 +:100D600000EB0113D3F8B05115F004051572D3F858 +:100D7000B0C119BF4FEADC0555604FEA5C551560FC +:100D8000D3F8B05105F002055572D3F8B4512D0ACD +:100D900082F84B50D3F8B4C15FFA8CF5ED0982F8B4 +:100DA0004C50056AED0727D14FFA8CF5002D63D41E +:100DB000D3F8B45105F00F059572D3F8B851D57238 +:100DC000D3F8B8512D0A1573D3F8B8512D0C5573BB +:100DD000D3F8B8512D0E9573D3F8BC51D573D3F811 +:100DE000BC512D0A1574D3F8BC512D0C5574D3F891 +:100DF000BC311B0E937489E0D3F8B45105F00F0C8D +:100E0000BCF1080F06D941F25C75C0F600056544D7 +:100E100015F809CC82F80AC0D3F8B451BCF1040427 +:100E2000C5F3401582F84D50D3F8B451C5F3001501 +:100E300082F84E504FF0FF3505EB9C05B5FA85F56D +:100E40004FEA551518BF0124254005EB9C0C0B32C9 +:100E50005FEA0C65019218D01CF003021AD0D3F897 +:100E6000B851019C012A2560019D05F104050195F9 +:100E700012D1ACF1010225E029A2044610460D462C +:100E800000F05AFC2946204640E0D3F8B821019BE7 +:100E90001A603BE0624615E0D3F8B851019C022A83 +:100EA0002560019D05F10405019502D1ACF1020216 +:100EB00008E0D3F8B821019D2A60019A043201921A +:100EC000ACF103025FFA8CF5042D1FD3D3F8B851AF +:100ED000019C043A2560019D04350195D3F8B85171 +:100EE000019C2560019D04350195D3F8B851019C02 +:100EF0002560019D04350195D3F8B851019C25600A +:100F0000019D140605F104050195DFD11022002989 +:100F100008BF0C22815841F02001815002B0B0BDC1 +:100F200043414E2046442066756E6374696F6E209F +:100F300064697361626C6564206275742046442044 +:100F40006672616D652072656365697665640D0022 +:100F500029B101291CBF00207047102100E00C219D +:100F6000405800F00300704780B579B104280FD8CD +:100F7000DFE800F0032A14250F004FF0806088603E +:100F8000002048604FF40030086080BDFEE700BFDD +:100F9000FEE708464F21FFF714F980BD4FF480604B +:100FA00088824FF4007008820120887400204FF47A +:100FB000807288700A80C1E90100C86080BD08465F +:100FC0004E21FFF7FEF880BD00204FF480320874F8 +:100FD000CA6008604860886080BD00002DE9F0416B +:100FE00090B040F2197000F033FB40F2036000F063 +:100FF0002FFB4FF4C06000F02BFB46F20044C4F21C +:10100000000404F528452846482103224FF4807344 +:1010100000F00CF92846182103224FF400734FF416 +:10102000007800F003F94FF4EA100121012600F0E6 +:101030005DFA2846102103224FF4005300F0F6F821 +:1010400028464FF4005100F0EFF82046FFF78EFCE1 +:101050004FF080700E9040F20110C0F206000F9029 +:101060004FF083700D900DA92046FFF777FD07AD77 +:1010700002202946FFF778FF40F20110ADF81C006E +:1010800040F20440ADF81800002705A8CDE9080794 +:101090000620ADF83000204629468DF81E600597E1 +:1010A0000A97ADF82C808DF82E70FFF773FC4FF483 +:1010B0008030CDE902706846CDE900778DF8106088 +:1010C000FFF7F2FC14200121002200F083FA2046F1 +:1010D0000221FFF7FFFD10B0BDE8F08140F20010E3 +:1010E000C2F200000168002908BF70470168013999 +:1010F0000160704740F20042C4F20202904202D105 +:10110000052900D3FEE701EB810100EB8100816836 +:1011100021F001018160704740F20042C4F20202F6 +:10112000904202D1052900D3FEE701EB810100EBDB +:101130008100816841F001018160704740F2004305 +:10114000C4F20203984202D1052900D3FEE780B51C +:10115000136801EB810100EB81000361916841613B +:10116000118AC1608168536821F47C5CD168D2F82F +:1011700014E043EA0C03194341EA0E018160117E39 +:101180008368012923F0400308BF40338360517E08 +:101190008368012923F0800308BF80338360917E38 +:1011A0008268002922F0100218BF1032826080BDD0 +:1011B0008900436802FA01F1194341607047000059 +:1011C000082A19D80123934013F48A7F14D08B0086 +:1011D00001EB8101D0F800C000EB8100806802FAC9 +:1011E00003F31CEA030100EA020018BF01210028F2 +:1011F00018BF012008407047FEE70000B0B543F675 +:1012000000050446C4F20105C1B2284600F078FA90 +:101210002846072100F078FA0028F9D02046B0BD12 +:10122000FFF75EFBFFF75CFB4161704770B5CE06D0 +:1012300001F00F0C09D5042A05D1C26B4CF0030C48 +:101240001A43C26301E04CEA020C00F1100213F0F1 +:10125000010400F1140E33D113F0020441D113F054 +:1012600004044FD113F008045DD113F010046BD1C6 +:1012700013F020047AD113F0400440F0898013F079 +:10128000800440F0978013F4807440F0A58013F43C +:10129000007440F0B38013F4806440F0C18013F414 +:1012A000006440F0CF8013F4805440F0DD8013F4EC +:1012B000005440F0EB8013F4804440F0F88004E1E7 +:1012C0000568282925F00F0545EA0C0503D04829B3 +:1012D00003D1164600E076463460056013F0020440 +:1012E000BDD00568482925F0F00545EA0C1503D066 +:1012F000282903D1764600E016463460056013F0D5 +:101300000404AFD00568482925F4706545EA0C252A +:1013100003D0282903D1764600E0164634600560E4 +:1013200013F00804A1D00568482925F4704545EA62 +:101330000C3503D0282903D1764600E016463460E8 +:10134000056013F0100493D00568482925F4702532 +:1013500045EA0C4503D0282903D1764600E016461D +:101360003460056013F020043FF485AF0568482918 +:1013700025F4700545EA0C5503D0282903D176469B +:1013800000E016463460056013F040043FF477AF88 +:101390000568482925F0706545EA0C6503D02829C1 +:1013A00003D1764600E016463460056013F08004F1 +:1013B0003FF469AF0568482925F0704545EA0C758A +:1013C00003D0282903D1764600E016463460056034 +:1013D00013F480743FF45BAF4568282925F00F05AE +:1013E00045EA0C0503D0482903D1164600E07646AD +:1013F0003460456013F400743FF44DAF45684829EC +:1014000025F0F00545EA0C1503D0282903D17646CE +:1014100000E016463460456013F480643FF43FAF4B +:101420004568482925F4706545EA0C2503D028292C +:1014300003D1764600E016463460456013F400643C +:101440003FF431AF4568482925F4704545EA0C352D +:1014500003D0282903D1764600E016463460456063 +:1014600013F480543FF423AF4568482925F47025D0 +:1014700045EA0C4503D0282903D1764600E01646FC +:101480003460456013F400543FF415AF45684829B3 +:1014900025F4700545EA0C5503D0282903D176467A +:1014A00000E016463460456013F480440DD0456872 +:1014B000482925F0706545EA0C6503D0282903D139 +:1014C000764600E016463460456013F4004308BFDA +:1014D00070BD4468482924F0704444EA0C7502D079 +:1014E000282901D172461360456070BDB0B540F245 +:1014F000040CC4F2010C0CF118031A46B0F1FF3FC2 +:10150000C4BF0422C4F20102146800F44012B2F510 +:10151000401F1FFA80FE08D1DCF8005024F0E06282 +:1015200025F0E064CCF8004011E0C20206D46FF070 +:101530000F0202EA50420EFA02F204E0C0F3034244 +:10154000032505FA02F224EA020242F0E0626FF09B +:101550000F0404EA504400290EFA04F518BF2A4388 +:10156000B0F1FF3FC8BF63461A60B0BD70B584B02C +:101570006C464AF220152046C0F20705FFF7FAF83C +:1015800000F096F8FEF7E2FE40F20400C2F200001E +:10159000FFF738F9002600BF2046FFF7E9F8039669 +:1015A0000398A842F8DA0398013003900398A84200 +:1015B000F2DA0398013003900398A842ECDA03981A +:1015C000013003900398A842E6DA039801300390B3 +:1015D000E6E700004EF60C5CCEF2000CDCF80030C2 +:1015E00003F4E063A3F54073B3F5A06F01D21B0AC7 +:1015F00006E040F20053C0F2FA53CCF80030022368 +:1016000001FA03FCC3F104030F21D94011404EF24B +:10161000001241EA0C01CEF200020901831883F89E +:10162000001300F01F01012303FA01F1401142F8F9 +:10163000201070474FF68072C1F6FF7211400843C8 +:101640004EF60851CEF200010860BFF34F8F70478D +:1016500041F2000300F01F018009C4F202034FF0C1 +:10166000010CC2580CFA01F11143C150704700003F +:1016700041F2000300F01F018009C4F202034FF0A1 +:10168000010CC2580CFA01F122EA0101C150704765 +:1016900041F2000300F01F018009C4F202034FF081 +:1016A000010CC2580CFA01F11143C15070470000FF +:1016B00040F2F800C2F20000006844F6D351C1F2D3 +:1016C0006201A0FB01014FF0FF3000EB9110B0F17F +:1016D000807F00D3FEE74EF21001CEF20001486099 +:1016E0004EF62350CEF20000F022027000220723B3 +:1016F0008A600B600270704780B5AFF30080000015 +:101700006FF35F21416070478A09105801F01F0193 +:10171000C84000F00100704702E008C8121F08C16D +:10172000002AFAD170477047002001E001C1121F62 +:10173000002AFBD17047000010B5044601E0FFF716 +:101740005DFD14F8010B04490028F8D1BDE81040F4 +:101750000A20FFF753BD0000000000200C101418F1 +:101760002030400088170008000000200001000021 +:101770001817000888180008000100204008000021 +:101780002817000800000000000000000000000012 +:101790000000000000000000000000000000000049 +:1017A0000000000000000000000000000000000039 +:1017B0000000000000000000000000000000000029 +:1017C0000000000000000000000000000000000019 +:1017D0000000000000000000000000000000000009 +:1017E00003000000000000000000000000000000F6 +:1017F00000000000000000000000000000000000E9 +:1018000000000000000000000000000000000000D8 +:1018100000000000000000000000000000000000C8 +:1018200000000000000000000000000000000000B8 +:1018300000000000000000000000000000000000A8 +:101840000000000000000000000000000000000098 +:101850000000000000000000000000000000000088 +:101860000000000000000000000000000000000078 +:101870000000000000000000000000000000000068 +:08188000000E2707D901000842 +:040000050800016589 +:00000001FF diff --git a/out/Robot_V2/GD32C103CB/Release/compile_commands.json b/out/Robot_V2/GD32C103CB/Release/compile_commands.json new file mode 100644 index 0000000..ca2a3c7 --- /dev/null +++ b/out/Robot_V2/GD32C103CB/Release/compile_commands.json @@ -0,0 +1,134 @@ +[ +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_Source_Files.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\main.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\main.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\main.cpp", + "output": "CMakeFiles\\Group_Source_Files.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\main.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_device.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.cpp", + "output": "CMakeFiles\\Group_device.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.c", + "output": "CMakeFiles\\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -D__MICROLIB -gdwarf-5 -masm=auto -O2 -Wa,armasm,--pd,\"GD32C10x SETA 1\" -Wa,armasm,--pd,\"_RTE_ SETA 1\" -c -o CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.o G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.s", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.s", + "output": "CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.c", + "output": "CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.o" +} +] \ No newline at end of file diff --git a/tmp/.ninja_log b/tmp/.ninja_log new file mode 100644 index 0000000..b9fa410 --- /dev/null +++ b/tmp/.ninja_log @@ -0,0 +1,28 @@ +# ninja log v6 +11 113 7883035108370575 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir 33f68be7a9762efe +113 210 7883035109353619 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download 8d5ce3c00fc16ca4 +11 113 7883035108370575 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir 33f68be7a9762efe +113 210 7883035109353619 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download 8d5ce3c00fc16ca4 +219 315 7883035110394429 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update 3ae75db438d97fbf +315 414 7883035111373059 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch b54a62060b325746 +219 315 7883035110394429 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update 3ae75db438d97fbf +315 414 7883035111373059 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch b54a62060b325746 +414 8451 7883035191741560 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure 708efa7dee4d8c45 +414 8451 7883035191741560 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure 708efa7dee4d8c45 +14 1353 7883387345027414 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8 +14 1353 7883387345027414 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf c3a3e5728b3e60b8 +14 1353 7883387345027414 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex c3a3e5728b3e60b8 +14 1353 7883387345027414 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map c3a3e5728b3e60b8 +14 1353 7883387345027414 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8 +1358 1475 7883387359193630 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes 9db191f9941f966f +1358 1475 7883387359193630 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes 9db191f9941f966f +1354 1625 7883387358421101 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205 +1354 1625 7883387358421101 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205 +1625 1679 7883387361142665 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4 +1625 1679 7883387361142665 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4 +1679 1779 7883387362328896 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0 +1679 1779 7883387362328896 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0 +1779 1924 7883387363787166 CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9 +1779 1924 7883387363787166 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9 +1779 1924 7883387363787166 G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9 +1779 1924 7883387363787166 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9 diff --git a/tmp/1/.ninja_deps b/tmp/1/.ninja_deps new file mode 100644 index 0000000..f6ce65c Binary files /dev/null and b/tmp/1/.ninja_deps differ diff --git a/tmp/1/.ninja_log b/tmp/1/.ninja_log new file mode 100644 index 0000000..9770c95 --- /dev/null +++ b/tmp/1/.ninja_log @@ -0,0 +1,28 @@ +# ninja log v6 +24 299 7883387345991738 CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/systick.o 90049e3a9997d47e +20 264 7883387345945878 CMakeFiles/Group_Source_Files.dir/G_/Robot_v2/BOOT/Robot_V2/main.o a1e7d66abb20e63f +69 292 7883387346441629 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.o 77d2407664c0b50e +28 313 7883387346028495 CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/initial.o 671120909b55a6ec +41 295 7883387346158259 CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.o 9a409ccbbaf0b506 +54 255 7883387346291527 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.o afbddcf2f39ba5cd +44 308 7883387346192291 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.o 56205422b88d73 +51 256 7883387346253762 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.o 67890dbd6b26def8 +89 210 7883035193634882 CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.o 7333d2a666947fb3 +62 278 7883387346366920 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.o dc69558be82ddab3 +76 278 7883387346504352 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.o 249b986db23681a2 +82 348 7883387346567298 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.o 8a38055acf3e9414 +34 334 7883387346087652 CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/OTA.o d3ceecf5eb5da62f +72 320 7883387346467887 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.o 54f1765925ee6320 +79 302 7883387346536130 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.o 90d7d435f1eb4630 +89 314 7883387346635449 CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.o 59beee78be430f18 +85 341 7883387346603852 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.o 25d66ba79c0b0dee +58 320 7883387346329634 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.o d976b2f727d5d643 +47 373 7883387346221104 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.o faa264156fd20815 +65 441 7883387346398800 CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.o bf3ed2250296db4a +31 479 7883387346055034 CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/flash.o b46fd0fc5d6515ff +37 1011 7883387346119672 CMakeFiles/Group_device.dir/G_/Robot_v2/BOOT/Robot_V2/device/Can.o 45fb475e6531516a +1011 1230 7883387357203390 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf 7108a2cea676523c +1011 1230 7883387357203390 ac6_linker_script.sct 7108a2cea676523c +1011 1230 7883387357203390 G:/Robot_v2/BOOT/tmp/1/ac6_linker_script.sct 7108a2cea676523c +21 136 7883387359334391 CMakeFiles/database cd32a3f4a99f5b2a +21 136 7883387359334391 G:/Robot_v2/BOOT/tmp/1/CMakeFiles/database cd32a3f4a99f5b2a diff --git a/tmp/1/CMakeCache.txt b/tmp/1/CMakeCache.txt new file mode 100644 index 0000000..a9be388 --- /dev/null +++ b/tmp/1/CMakeCache.txt @@ -0,0 +1,370 @@ +# This is the CMakeCache file. +# For build in directory: g:/Robot_v2/BOOT/tmp/1 +# It was generated by CMake: C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake.exe +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=CMAKE_ADDR2LINE-NOTFOUND + +//Path to a program. +CMAKE_AR:FILEPATH=c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armar.exe + +//Flags used by the ASM compiler during all build types. +CMAKE_ASM_FLAGS:STRING= + +//Flags used by the ASM compiler during DEBUG builds. +CMAKE_ASM_FLAGS_DEBUG:STRING= + +//Flags used by the ASM compiler during MINSIZEREL builds. +CMAKE_ASM_FLAGS_MINSIZEREL:STRING= + +//Flags used by the ASM compiler during RELEASE builds. +CMAKE_ASM_FLAGS_RELEASE:STRING= + +//Flags used by the ASM compiler during RELWITHDEBINFO builds. +CMAKE_ASM_FLAGS_RELWITHDEBINFO:STRING= + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING= + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING=--target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the C compiler during all build types. +CMAKE_C_FLAGS:STRING=--target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard + +//Flags used by the C compiler during DEBUG builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the C compiler during RELEASE builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of build database during the build. +CMAKE_EXPORT_BUILD_DATABASE:BOOL= + +//Value Computed by CMake. +CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=G:/Robot_v2/BOOT/tmp/1/CMakeFiles/pkgRedirects + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/Robot_V2.Release+GD32C103CB + +//Path to a program. +CMAKE_LINKER:FILEPATH=c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armlink.exe + +//Program used to build from build.ninja files. +CMAKE_MAKE_PROGRAM:FILEPATH=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.ninja.build.ninja/1.12.1/ninja.exe + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=CMAKE_NM-NOTFOUND + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/fromelf.exe + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=CMAKE_OBJDUMP-NOTFOUND + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=Robot_V2.Release+GD32C103CB + +//Path to a program. +CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=CMAKE_STRIP-NOTFOUND + +//Path to a program. +CMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//CMSIS compiler root +CMSIS_COMPILER_ROOT:PATH=C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc + +//CMSIS pack root +CMSIS_PACK_ROOT:PATH=C:/Users/cbb/AppData/Local/arm/packs + +//Value Computed by CMake +Robot_V2.Release+GD32C103CB_BINARY_DIR:STATIC=G:/Robot_v2/BOOT/tmp/1 + +//Value Computed by CMake +Robot_V2.Release+GD32C103CB_IS_TOP_LEVEL:STATIC=ON + +//Value Computed by CMake +Robot_V2.Release+GD32C103CB_SOURCE_DIR:STATIC=G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB + +//CMSIS solution root +SOLUTION_ROOT:PATH=G:/Robot_v2/BOOT + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +CMAKE_ASM_COMPILER_WORKS:INTERNAL=1 +//ADVANCED property for variable: CMAKE_ASM_FLAGS +CMAKE_ASM_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_ASM_FLAGS_DEBUG +CMAKE_ASM_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_ASM_FLAGS_MINSIZEREL +CMAKE_ASM_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_ASM_FLAGS_RELEASE +CMAKE_ASM_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_ASM_FLAGS_RELWITHDEBINFO +CMAKE_ASM_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=g:/Robot_v2/BOOT/tmp/1 +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=31 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=5 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake.exe +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cpack.exe +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/ctest.exe +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake-gui.exe +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_BUILD_DATABASE +CMAKE_EXPORT_BUILD_DATABASE-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Ninja +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//noop for ranlib +CMAKE_RANLIB:INTERNAL=: +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_TAPI +CMAKE_TAPI-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/tmp/1/CMakeFiles/3.31.5/CMakeASMCompiler.cmake b/tmp/1/CMakeFiles/3.31.5/CMakeASMCompiler.cmake new file mode 100644 index 0000000..0c52e69 --- /dev/null +++ b/tmp/1/CMakeFiles/3.31.5/CMakeASMCompiler.cmake @@ -0,0 +1,28 @@ +set(CMAKE_ASM_COMPILER "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe") +set(CMAKE_ASM_COMPILER_ARG1 "") +set(CMAKE_AR "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armar.exe") +set(CMAKE_ASM_COMPILER_AR "") +set(CMAKE_RANLIB ":") +set(CMAKE_ASM_COMPILER_RANLIB "") +set(CMAKE_LINKER "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armlink.exe") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_ASM_COMPILER_LINKER "") +set(CMAKE_ASM_COMPILER_LINKER_ID "") +set(CMAKE_ASM_COMPILER_LINKER_VERSION ) +set(CMAKE_ASM_COMPILER_LINKER_FRONTEND_VARIANT ) +set(CMAKE_MT "") +set(CMAKE_TAPI "CMAKE_TAPI-NOTFOUND") +set(CMAKE_ASM_COMPILER_LOADED 1) +set(CMAKE_ASM_COMPILER_ID "ARMClang") +set(CMAKE_ASM_COMPILER_VERSION "") +set(CMAKE_ASM_COMPILER_ENV_VAR "ASM") + + + + +set(CMAKE_ASM_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_ASM_LINKER_PREFERENCE 0) +set(CMAKE_ASM_LINKER_DEPFILE_SUPPORTED ) + + diff --git a/tmp/1/CMakeFiles/3.31.5/CMakeCCompiler.cmake b/tmp/1/CMakeFiles/3.31.5/CMakeCCompiler.cmake new file mode 100644 index 0000000..a13a011 --- /dev/null +++ b/tmp/1/CMakeFiles/3.31.5/CMakeCCompiler.cmake @@ -0,0 +1,81 @@ +set(CMAKE_C_COMPILER "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "ARMClang") +set(CMAKE_C_COMPILER_VERSION "6.24.0") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "6240002") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_C_STANDARD_LATEST "11") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") +set(CMAKE_C17_COMPILE_FEATURES "") +set(CMAKE_C23_COMPILE_FEATURES "") + +set(CMAKE_C_PLATFORM_ID "") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_C_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armar.exe") +set(CMAKE_C_COMPILER_AR "") +set(CMAKE_RANLIB ":") +set(CMAKE_C_COMPILER_RANLIB "") +set(CMAKE_LINKER "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armlink.exe") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_C_COMPILER_LINKER "NOTFOUND") +set(CMAKE_C_COMPILER_LINKER_ID "") +set(CMAKE_C_COMPILER_LINKER_VERSION ) +set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT ) +set(CMAKE_MT "") +set(CMAKE_TAPI "CMAKE_TAPI-NOTFOUND") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) +set(CMAKE_C_LINKER_DEPFILE_SUPPORTED ) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "4") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/tmp/1/CMakeFiles/3.31.5/CMakeCXXCompiler.cmake b/tmp/1/CMakeFiles/3.31.5/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..2fdfa29 --- /dev/null +++ b/tmp/1/CMakeFiles/3.31.5/CMakeCXXCompiler.cmake @@ -0,0 +1,97 @@ +set(CMAKE_CXX_COMPILER "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "ARMClang") +set(CMAKE_CXX_COMPILER_VERSION "6.24.0") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "6240002") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_CXX_STANDARD_LATEST "") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_std_11;cxx_std_14;cxx_std_17;cxx_std_20;cxx_std_23;cxx_std_26;cxx_template_template_parameters;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX98_COMPILE_FEATURES "") +set(CMAKE_CXX11_COMPILE_FEATURES "") +set(CMAKE_CXX14_COMPILE_FEATURES "") +set(CMAKE_CXX17_COMPILE_FEATURES "") +set(CMAKE_CXX20_COMPILE_FEATURES "") +set(CMAKE_CXX23_COMPILE_FEATURES "") +set(CMAKE_CXX26_COMPILE_FEATURES "") + +set(CMAKE_CXX_PLATFORM_ID "") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armar.exe") +set(CMAKE_CXX_COMPILER_AR "") +set(CMAKE_RANLIB ":") +set(CMAKE_CXX_COMPILER_RANLIB "") +set(CMAKE_LINKER "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armlink.exe") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_CXX_COMPILER_LINKER "NOTFOUND") +set(CMAKE_CXX_COMPILER_LINKER_ID "") +set(CMAKE_CXX_COMPILER_LINKER_VERSION ) +set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT ) +set(CMAKE_MT "") +set(CMAKE_TAPI "CMAKE_TAPI-NOTFOUND") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang IN ITEMS C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) +set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED ) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "4") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx;C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") +set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "") + +set(CMAKE_CXX_COMPILER_IMPORT_STD "") + diff --git a/tmp/1/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_C.bin b/tmp/1/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_C.bin new file mode 100644 index 0000000..d919580 Binary files /dev/null and b/tmp/1/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_C.bin differ diff --git a/tmp/1/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_CXX.bin b/tmp/1/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_CXX.bin new file mode 100644 index 0000000..f50dfcc Binary files /dev/null and b/tmp/1/CMakeFiles/3.31.5/CMakeDetermineCompilerABI_CXX.bin differ diff --git a/tmp/1/CMakeFiles/3.31.5/CMakeSystem.cmake b/tmp/1/CMakeFiles/3.31.5/CMakeSystem.cmake new file mode 100644 index 0000000..41b007a --- /dev/null +++ b/tmp/1/CMakeFiles/3.31.5/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Windows-10.0.26220") +set(CMAKE_HOST_SYSTEM_NAME "Windows") +set(CMAKE_HOST_SYSTEM_VERSION "10.0.26220") +set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") + + + +set(CMAKE_SYSTEM "Generic") +set(CMAKE_SYSTEM_NAME "Generic") +set(CMAKE_SYSTEM_VERSION "") +set(CMAKE_SYSTEM_PROCESSOR "") + +set(CMAKE_CROSSCOMPILING "TRUE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/tmp/1/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c b/tmp/1/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 0000000..8d8bb03 --- /dev/null +++ b/tmp/1/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,904 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "Arm" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#define C_STD_99 199901L +#define C_STD_11 201112L +#define C_STD_17 201710L +#define C_STD_23 202311L + +#ifdef __STDC_VERSION__ +# define C_STD __STDC_VERSION__ +#endif + +#if !defined(__STDC__) && !defined(__clang__) +# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) +# define C_VERSION "90" +# else +# define C_VERSION +# endif +#elif C_STD > C_STD_17 +# define C_VERSION "23" +#elif C_STD > C_STD_11 +# define C_VERSION "17" +#elif C_STD > C_STD_99 +# define C_VERSION "11" +#elif C_STD >= C_STD_99 +# define C_VERSION "99" +#else +# define C_VERSION "90" +#endif +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/tmp/1/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o b/tmp/1/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o new file mode 100644 index 0000000..1b479d7 Binary files /dev/null and b/tmp/1/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o differ diff --git a/tmp/1/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.cpp b/tmp/1/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 0000000..da6c824 --- /dev/null +++ b/tmp/1/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,919 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "Arm" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#define CXX_STD_98 199711L +#define CXX_STD_11 201103L +#define CXX_STD_14 201402L +#define CXX_STD_17 201703L +#define CXX_STD_20 202002L +#define CXX_STD_23 202302L + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) +# if _MSVC_LANG > CXX_STD_17 +# define CXX_STD _MSVC_LANG +# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init) +# define CXX_STD CXX_STD_20 +# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17 +# define CXX_STD CXX_STD_20 +# elif _MSVC_LANG > CXX_STD_14 +# define CXX_STD CXX_STD_17 +# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# elif defined(__INTEL_CXX11_MODE__) +# define CXX_STD CXX_STD_11 +# else +# define CXX_STD CXX_STD_98 +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# if _MSVC_LANG > __cplusplus +# define CXX_STD _MSVC_LANG +# else +# define CXX_STD __cplusplus +# endif +#elif defined(__NVCOMPILER) +# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init) +# define CXX_STD CXX_STD_20 +# else +# define CXX_STD __cplusplus +# endif +#elif defined(__INTEL_COMPILER) || defined(__PGI) +# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes) +# define CXX_STD CXX_STD_17 +# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif +#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__) +# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif +#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__) +# define CXX_STD CXX_STD_11 +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_standard_default = "INFO" ":" "standard_default[" +#if CXX_STD > CXX_STD_23 + "26" +#elif CXX_STD > CXX_STD_20 + "23" +#elif CXX_STD > CXX_STD_17 + "20" +#elif CXX_STD > CXX_STD_14 + "17" +#elif CXX_STD > CXX_STD_11 + "14" +#elif CXX_STD >= CXX_STD_11 + "11" +#else + "98" +#endif +"]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} diff --git a/tmp/1/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o b/tmp/1/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o new file mode 100644 index 0000000..93c0162 Binary files /dev/null and b/tmp/1/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o differ diff --git a/tmp/1/CMakeFiles/CMakeConfigureLog.yaml b/tmp/1/CMakeFiles/CMakeConfigureLog.yaml new file mode 100644 index 0000000..b6ab8fe --- /dev/null +++ b/tmp/1/CMakeFiles/CMakeConfigureLog.yaml @@ -0,0 +1,328 @@ + +--- +events: + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineSystem.cmake:200 (message)" + - "CMakeLists.txt:25 (project)" + message: | + The target system is: Generic - - + The host system is: Windows - 10.0.26220 - AMD64 + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCXXCompiler.cmake:126 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:25 (project)" + message: | + Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. + Compiler: c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe + Build flags: --target=arm-arm-none-eabi;-mcpu=Cortex-M4;-mfpu=fpv4-sp-d16;-mfloat-abi=hard + Id flags: -c;--target=arm-arm-none-eabi + + The output was: + 0 + + + Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.o" + + The CXX compiler identification is ARMClang, found in: + G:/Robot_v2/BOOT/tmp/1/CMakeFiles/3.31.5/CompilerIdCXX/CMakeCXXCompilerId.o + + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCCompiler.cmake:123 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:25 (project)" + message: | + Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. + Compiler: c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe + Build flags: --target=arm-arm-none-eabi;-mcpu=Cortex-M4;-mfpu=fpv4-sp-d16;-mfloat-abi=hard + Id flags: -c;--target=arm-arm-none-eabi + + The output was: + 0 + + + Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o" + + The C compiler identification is ARMClang, found in: + G:/Robot_v2/BOOT/tmp/1/CMakeFiles/3.31.5/CompilerIdC/CMakeCCompilerId.o + + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:1250 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineASMCompiler.cmake:135 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)" + - "CMakeLists.txt:25 (project)" + message: | + Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)": + Product: Keil MDK Community (non-commercial free of charge) + Component: Arm Compiler for Embedded 6.24 + Tool: armclang [5f371800] + + Target: unspecified-arm-none-none + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:1250 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineASMCompiler.cmake:135 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)" + - "CMakeLists.txt:25 (project)" + message: | + Checking whether the ASM compiler is AppleClang using "--version" did not match "(Apple (clang|LLVM) version)": + Product: Keil MDK Community (non-commercial free of charge) + Component: Arm Compiler for Embedded 6.24 + Tool: armclang [5f371800] + + Target: unspecified-arm-none-none + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:1250 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineASMCompiler.cmake:135 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)" + - "CMakeLists.txt:25 (project)" + message: | + Checking whether the ASM compiler is Clang using "--version" did not match "(clang version)": + Product: Keil MDK Community (non-commercial free of charge) + Component: Arm Compiler for Embedded 6.24 + Tool: armclang [5f371800] + + Target: unspecified-arm-none-none + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake:1237 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineASMCompiler.cmake:135 (CMAKE_DETERMINE_COMPILER_ID_VENDOR)" + - "CMakeLists.txt:25 (project)" + message: | + Checking whether the ASM compiler is ARMClang using "--version" matched "armclang": + Product: Keil MDK Community (non-commercial free of charge) + Component: Arm Compiler for Embedded 6.24 + Tool: armclang [5f371800] + + Target: unspecified-arm-none-none + - + kind: "try_compile-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake:74 (try_compile)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:25 (project)" + checks: + - "Detecting CXX compiler ABI info" + directories: + source: "G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-gm8kpl" + binary: "G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-gm8kpl" + cmakeVariables: + CMAKE_CXX_COMPILER_TARGET: "arm-arm-none-eabi" + CMAKE_CXX_FLAGS: "--target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard" + CMAKE_CXX_FLAGS_DEBUG: "-g" + CMAKE_CXX_SCAN_FOR_MODULES: "OFF" + CMAKE_C_COMPILER_TARGET: "arm-arm-none-eabi" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc/CMakeASM" + buildResult: + variable: "CMAKE_CXX_ABI_COMPILED" + cached: true + stdout: | + Change Dir: 'G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-gm8kpl' + + Run Build Command(s): C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.ninja.build.ninja/1.12.1/ninja.exe -v cmTC_bee6c + [1/2] c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -v -MD -MT CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -MF CMakeFiles\\cmTC_bee6c.dir\\CMakeCXXCompilerABI.o.d -o CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -c C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp + Product: Keil MDK Community (non-commercial free of charge) + Component: Arm Compiler for Embedded 6.24 + Tool: armclang [5f371800] + + Target: arm-arm-none-eabi + (in-process) + "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\armclang.exe" -cc1 -triple thumbv7em-arm-none-eabihf -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -Werror=return-type -mrelocation-model static -mframe-pointer=none -menable-no-infs -menable-no-nans -fmath-errno -fno-signed-zeros -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=on -fno-rounding-math -ffinite-math-only -mconstructor-aliases -target-cpu cortex-m4 -target-feature -vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -sha2 -target-feature -aes -target-feature -fp16fml -target-abi aapcs -mfloat-abi hard -debugger-tuning=gdb -fforce-dwarf-frame "-fdebug-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-gm8kpl" -v -ffunction-sections -fdata-sections "-fcoverage-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-gm8kpl" -resource-dir "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\lib\\\\clang\\\\20" -dependency-file "CMakeFiles\\\\cmTC_bee6c.dir\\\\CMakeCXXCompilerABI.o.d" -MT CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -sys-header-deps -D__ARMCOMPILER_LIBCXX=1 -internal-isystem "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\..\\\\include\\\\libcxx" -internal-isystem "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\..\\\\include" -nobuiltininc -fdeprecated-macro -ferror-limit 19 -fvisibility=hidden -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fsuppress-licensing -aggressive-jump-threading -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -x c++ C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp + Arm Compiler for Embedded 6.24 -cc1 default target aarch64-arm-none-eabi\x0d + #include "..." search starts here:\x0d + #include <...> search starts here:\x0d + C:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\..\\include\\libcxx\x0d + C:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\..\\include\x0d + End of search list.\x0d + [2/2] C:\\WINDOWS\\system32\\cmd.exe /C "cd . && c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armar.exe --create -cr libcmTC_bee6c.a CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o && cd ." + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake:182 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:25 (project)" + message: | + Parsed CXX implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/../include/libcxx] + add: [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/../include] + end of search list found + collapse include dir [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/../include/libcxx] ==> [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx] + collapse include dir [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/../include] ==> [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include] + implicit include dirs: [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx;C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include] + + + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake:218 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:25 (project)" + message: | + Parsed CXX implicit link information: + link line regex: [^( *|.*[/\\])(armlink\\.exe|;ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(armlink\\.exe|;ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: 'G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-gm8kpl'] + ignore line: [] + ignore line: [Run Build Command(s): C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.ninja.build.ninja/1.12.1/ninja.exe -v cmTC_bee6c] + ignore line: [[1/2] c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -v -MD -MT CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -MF CMakeFiles\\cmTC_bee6c.dir\\CMakeCXXCompilerABI.o.d -o CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -c C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Product: Keil MDK Community (non-commercial free of charge)] + ignore line: [Component: Arm Compiler for Embedded 6.24] + ignore line: [Tool: armclang [5f371800]] + ignore line: [] + ignore line: [Target: arm-arm-none-eabi] + ignore line: [ (in-process)] + ignore line: [ "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\armclang.exe" -cc1 -triple thumbv7em-arm-none-eabihf -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -Werror=return-type -mrelocation-model static -mframe-pointer=none -menable-no-infs -menable-no-nans -fmath-errno -fno-signed-zeros -fdenormal-fp-math=preserve-sign preserve-sign -ffp-contract=on -fno-rounding-math -ffinite-math-only -mconstructor-aliases -target-cpu cortex-m4 -target-feature -vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -sha2 -target-feature -aes -target-feature -fp16fml -target-abi aapcs -mfloat-abi hard -debugger-tuning=gdb -fforce-dwarf-frame "-fdebug-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-gm8kpl" -v -ffunction-sections -fdata-sections "-fcoverage-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-gm8kpl" -resource-dir "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\lib\\\\clang\\\\20" -dependency-file "CMakeFiles\\\\cmTC_bee6c.dir\\\\CMakeCXXCompilerABI.o.d" -MT CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -sys-header-deps -D__ARMCOMPILER_LIBCXX=1 -internal-isystem "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\..\\\\include\\\\libcxx" -internal-isystem "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\..\\\\include" -nobuiltininc -fdeprecated-macro -ferror-limit 19 -fvisibility=hidden -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fsuppress-licensing -aggressive-jump-threading -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o -x c++ C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Arm Compiler for Embedded 6.24 -cc1 default target aarch64-arm-none-eabi\x0d] + ignore line: [#include "..." search starts here:\x0d] + ignore line: [#include <...> search starts here:\x0d] + ignore line: [ C:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\..\\include\\libcxx\x0d] + ignore line: [ C:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\..\\include\x0d] + ignore line: [End of search list.\x0d] + ignore line: [[2/2] C:\\WINDOWS\\system32\\cmd.exe /C "cd . && c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armar.exe --create -cr libcmTC_bee6c.a CMakeFiles/cmTC_bee6c.dir/CMakeCXXCompilerABI.o && cd ."] + ignore line: [] + ignore line: [] + implicit libs: [] + implicit objs: [] + implicit dirs: [] + implicit fwks: [] + + + - + kind: "try_compile-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/FeatureTesting.cmake:34 (try_compile)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang.cmake:315 (_record_compiler_features)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerSupport.cmake:70 (cmake_record_cxx_compile_features)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake:83 (CMAKE_DETERMINE_COMPILER_SUPPORT)" + - "CMakeLists.txt:25 (project)" + checks: + - "Detecting CXX compile features" + directories: + source: "G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-4p17s0" + binary: "G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-4p17s0" + cmakeVariables: + CMAKE_CXX_COMPILER_TARGET: "arm-arm-none-eabi" + CMAKE_CXX_FLAGS: "--target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard" + CMAKE_CXX_FLAGS_DEBUG: "-g" + CMAKE_C_COMPILER_TARGET: "arm-arm-none-eabi" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc/CMakeASM" + buildResult: + variable: "CMAKE_CXX_FEATURE_TEST" + cached: true + stdout: | + Change Dir: 'G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-4p17s0' + + Run Build Command(s): C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.ninja.build.ninja/1.12.1/ninja.exe -v cmTC_aa3f5 + [1/2] c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -MD -MT CMakeFiles/cmTC_aa3f5.dir/feature_tests.o -MF CMakeFiles\\cmTC_aa3f5.dir\\feature_tests.o.d -o CMakeFiles/cmTC_aa3f5.dir/feature_tests.o -c G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-4p17s0/feature_tests.cxx + [2/2] C:\\WINDOWS\\system32\\cmd.exe /C "cd . && c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armar.exe --create -cr libcmTC_aa3f5.a CMakeFiles/cmTC_aa3f5.dir/feature_tests.o && cd ." + + exitCode: 0 + - + kind: "try_compile-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake:74 (try_compile)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:25 (project)" + checks: + - "Detecting C compiler ABI info" + directories: + source: "G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-scu6p9" + binary: "G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-scu6p9" + cmakeVariables: + CMAKE_CXX_COMPILER_TARGET: "arm-arm-none-eabi" + CMAKE_C_COMPILER_TARGET: "arm-arm-none-eabi" + CMAKE_C_FLAGS: "--target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_MODULE_PATH: "C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc/CMakeASM" + buildResult: + variable: "CMAKE_C_ABI_COMPILED" + cached: true + stdout: | + Change Dir: 'G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-scu6p9' + + Run Build Command(s): C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.ninja.build.ninja/1.12.1/ninja.exe -v cmTC_76306 + [1/2] c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -v -MD -MT CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -MF CMakeFiles\\cmTC_76306.dir\\CMakeCCompilerABI.o.d -o CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -c C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompilerABI.c + Product: Keil MDK Community (non-commercial free of charge) + Component: Arm Compiler for Embedded 6.24 + Tool: armclang [5f371800] + + Target: arm-arm-none-eabi + (in-process) + "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\armclang.exe" -cc1 -triple thumbv7em-arm-none-eabihf -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mframe-pointer=none -menable-no-infs -menable-no-nans -fmath-errno -fno-signed-zeros -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=on -fno-rounding-math -ffinite-math-only -mconstructor-aliases -target-cpu cortex-m4 -target-feature -vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -sha2 -target-feature -aes -target-feature -fp16fml -target-abi aapcs -mfloat-abi hard -debugger-tuning=gdb -fforce-dwarf-frame "-fdebug-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-scu6p9" -v -ffunction-sections -fdata-sections "-fcoverage-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-scu6p9" -resource-dir "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\lib\\\\clang\\\\20" -dependency-file "CMakeFiles\\\\cmTC_76306.dir\\\\CMakeCCompilerABI.o.d" -MT CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -sys-header-deps -internal-isystem "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\..\\\\include" -nobuiltininc -ferror-limit 19 -fvisibility=hidden -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fsuppress-licensing -aggressive-jump-threading -o CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -x c C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompilerABI.c\x0d + Arm Compiler for Embedded 6.24 -cc1 default target aarch64-arm-none-eabi\x0d + #include "..." search starts here:\x0d + #include <...> search starts here:\x0d + C:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\..\\include\x0d + End of search list.\x0d + [2/2] C:\\WINDOWS\\system32\\cmd.exe /C "cd . && c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armar.exe --create -cr libcmTC_76306.a CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o && cd ." + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake:182 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:25 (project)" + message: | + Parsed C implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/../include] + end of search list found + collapse include dir [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/../include] ==> [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include] + implicit include dirs: [C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include] + + + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake:218 (message)" + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:25 (project)" + message: | + Parsed C implicit link information: + link line regex: [^( *|.*[/\\])(armlink\\.exe|;ld[0-9]*(\\.[a-z]+)?|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(armlink\\.exe|;ld[0-9]*(\\.[a-z]+)?))("|,| |$)] + ignore line: [Change Dir: 'G:/Robot_v2/BOOT/tmp/1/CMakeFiles/CMakeScratch/TryCompile-scu6p9'] + ignore line: [] + ignore line: [Run Build Command(s): C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.ninja.build.ninja/1.12.1/ninja.exe -v cmTC_76306] + ignore line: [[1/2] c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -v -MD -MT CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -MF CMakeFiles\\cmTC_76306.dir\\CMakeCCompilerABI.o.d -o CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -c C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompilerABI.c] + ignore line: [Product: Keil MDK Community (non-commercial free of charge)] + ignore line: [Component: Arm Compiler for Embedded 6.24] + ignore line: [Tool: armclang [5f371800]] + ignore line: [] + ignore line: [Target: arm-arm-none-eabi] + ignore line: [ (in-process)] + ignore line: [ "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\armclang.exe" -cc1 -triple thumbv7em-arm-none-eabihf -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mframe-pointer=none -menable-no-infs -menable-no-nans -fmath-errno -fno-signed-zeros -fdenormal-fp-math=preserve-sign preserve-sign -ffp-contract=on -fno-rounding-math -ffinite-math-only -mconstructor-aliases -target-cpu cortex-m4 -target-feature -vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature -vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature -vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature -fp-armv8d16 -target-feature -fp-armv8d16sp -target-feature -fp-armv8sp -target-feature -fullfp16 -target-feature -fp64 -target-feature -d32 -target-feature -neon -target-feature -sha2 -target-feature -aes -target-feature -fp16fml -target-abi aapcs -mfloat-abi hard -debugger-tuning=gdb -fforce-dwarf-frame "-fdebug-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-scu6p9" -v -ffunction-sections -fdata-sections "-fcoverage-compilation-dir=G:\\\\Robot_v2\\\\BOOT\\\\tmp\\\\1\\\\CMakeFiles\\\\CMakeScratch\\\\TryCompile-scu6p9" -resource-dir "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\lib\\\\clang\\\\20" -dependency-file "CMakeFiles\\\\cmTC_76306.dir\\\\CMakeCCompilerABI.o.d" -MT CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -sys-header-deps -internal-isystem "C:\\\\Users\\\\cbb\\\\.vcpkg\\\\artifacts\\\\2139c4c6\\\\compilers.arm.armclang\\\\6.24.0\\\\bin\\\\..\\\\include" -nobuiltininc -ferror-limit 19 -fvisibility=hidden -fno-signed-char -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fsuppress-licensing -aggressive-jump-threading -o CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o -x c C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompilerABI.c\x0d] + ignore line: [Arm Compiler for Embedded 6.24 -cc1 default target aarch64-arm-none-eabi\x0d] + ignore line: [#include "..." search starts here:\x0d] + ignore line: [#include <...> search starts here:\x0d] + ignore line: [ C:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\..\\include\x0d] + ignore line: [End of search list.\x0d] + ignore line: [[2/2] C:\\WINDOWS\\system32\\cmd.exe /C "cd . && c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armar.exe --create -cr libcmTC_76306.a CMakeFiles/cmTC_76306.dir/CMakeCCompilerABI.o && cd ."] + ignore line: [] + ignore line: [] + implicit libs: [] + implicit objs: [] + implicit dirs: [] + implicit fwks: [] + + +... diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.o b/tmp/1/CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.o new file mode 100644 index 0000000..1b21915 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.o new file mode 100644 index 0000000..b0b7a98 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.o new file mode 100644 index 0000000..6395762 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.o new file mode 100644 index 0000000..0c78a42 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.o new file mode 100644 index 0000000..f7ae5ad Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.o new file mode 100644 index 0000000..a40e92a Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.o new file mode 100644 index 0000000..8ced409 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.o new file mode 100644 index 0000000..db109cb Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.o new file mode 100644 index 0000000..0c034e5 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.o new file mode 100644 index 0000000..52d295f Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.o new file mode 100644 index 0000000..e8a2a28 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.o new file mode 100644 index 0000000..86e3531 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.o new file mode 100644 index 0000000..6aed31f Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.o b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.o new file mode 100644 index 0000000..2015aa1 Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.o b/tmp/1/CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.o new file mode 100644 index 0000000..34589fe Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.o differ diff --git a/tmp/1/CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.o b/tmp/1/CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.o new file mode 100644 index 0000000..5dcad2e Binary files /dev/null and b/tmp/1/CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.o differ diff --git a/tmp/1/CMakeFiles/Group_Source_Files.dir/G_/Robot_v2/BOOT/Robot_V2/main.o b/tmp/1/CMakeFiles/Group_Source_Files.dir/G_/Robot_v2/BOOT/Robot_V2/main.o new file mode 100644 index 0000000..056573b Binary files /dev/null and b/tmp/1/CMakeFiles/Group_Source_Files.dir/G_/Robot_v2/BOOT/Robot_V2/main.o differ diff --git a/tmp/1/CMakeFiles/Group_device.dir/G_/Robot_v2/BOOT/Robot_V2/device/Can.o b/tmp/1/CMakeFiles/Group_device.dir/G_/Robot_v2/BOOT/Robot_V2/device/Can.o new file mode 100644 index 0000000..f6fb319 Binary files /dev/null and b/tmp/1/CMakeFiles/Group_device.dir/G_/Robot_v2/BOOT/Robot_V2/device/Can.o differ diff --git a/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/OTA.o b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/OTA.o new file mode 100644 index 0000000..26f6e74 Binary files /dev/null and b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/OTA.o differ diff --git a/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/flash.o b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/flash.o new file mode 100644 index 0000000..1accc66 Binary files /dev/null and b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/flash.o differ diff --git a/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/initial.o b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/initial.o new file mode 100644 index 0000000..269666c Binary files /dev/null and b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/initial.o differ diff --git a/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/systick.o b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/systick.o new file mode 100644 index 0000000..20c6e0e Binary files /dev/null and b/tmp/1/CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/systick.o differ diff --git a/tmp/1/CMakeFiles/TargetDirectories.txt b/tmp/1/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..93455d2 --- /dev/null +++ b/tmp/1/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,22 @@ +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/database.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/Robot_V2.Release+GD32C103CB.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/Group_Source_Files.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/Group_sys.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/Group_device.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/edit_cache.dir +G:/Robot_v2/BOOT/tmp/1/CMakeFiles/rebuild_cache.dir diff --git a/tmp/1/CMakeFiles/cmake.check_cache b/tmp/1/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/tmp/1/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/tmp/1/CMakeFiles/feature_tests.bin b/tmp/1/CMakeFiles/feature_tests.bin new file mode 100644 index 0000000..930ac66 Binary files /dev/null and b/tmp/1/CMakeFiles/feature_tests.bin differ diff --git a/tmp/1/CMakeFiles/rules.ninja b/tmp/1/CMakeFiles/rules.ninja new file mode 100644 index 0000000..455ce67 --- /dev/null +++ b/tmp/1/CMakeFiles/rules.ninja @@ -0,0 +1,244 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Ninja" Generator, CMake Version 3.31 + +# This file contains all the rules used to get the outputs files +# built from the input files. +# It is included in the main 'build.ninja'. + +# ============================================================================= +# Project: Robot_V2.Release+GD32C103CB +# Configurations: +# ============================================================================= +# ============================================================================= + +############################################# +# Rule for linking CXX executable. + +rule CXX_EXECUTABLE_LINKER__Robot_V2.2eRelease.2bGD32C103CB_ + command = C:\WINDOWS\system32\cmd.exe /C "$PRE_LINK && c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armlink.exe $LINK_FLAGS $LINK_PATH $LINK_LIBRARIES $in -o $TARGET_FILE --list=$TARGET_FILE.map && $POST_BUILD" + description = Linking CXX executable $TARGET_FILE + restat = $RESTAT + + +############################################# +# Rule for compiling CXX files. + +rule CXX_COMPILER__Group_Source_Files_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building CXX object $out + + +############################################# +# Rule for compiling CXX files. + +rule CXX_COMPILER__Group_sys_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building CXX object $out + + +############################################# +# Rule for compiling CXX files. + +rule CXX_COMPILER__Group_device_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building CXX object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_EVAL_GD32C10x_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for compiling ASM files. + +rule ASM_COMPILER__GigaDevice_Device_Startup_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -c -o $out $in + description = Building ASM object $out + + +############################################# +# Rule for compiling C files. + +rule C_COMPILER__GigaDevice_Device_Startup_1_0_0_unscanned_ + depfile = $DEP_FILE + deps = gcc + command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in + description = Building C object $out + + +############################################# +# Rule for running custom commands. + +rule CUSTOM_COMMAND + command = $COMMAND + description = $DESC + + +############################################# +# Rule for re-running cmake. + +rule RERUN_CMAKE + command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe --regenerate-during-build -SG:\Robot_v2\BOOT\tmp\Robot_V2.Release+GD32C103CB -BG:\Robot_v2\BOOT\tmp\1 + description = Re-running CMake... + generator = 1 + + +############################################# +# Rule for cleaning all built files. + +rule CLEAN + command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.1\ninja.exe $FILE_ARG -t clean $TARGETS + description = Cleaning all built files... + + +############################################# +# Rule for printing all primary targets available. + +rule HELP + command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.1\ninja.exe -t targets + description = All primary targets available: + diff --git a/tmp/1/ac6_linker_script.sct b/tmp/1/ac6_linker_script.sct new file mode 100644 index 0000000..252b79e --- /dev/null +++ b/tmp/1/ac6_linker_script.sct @@ -0,0 +1,42 @@ +# 1 "G:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src" +# 1 "" 1 +# 1 "" 3 +# 411 "" 3 +# 1 "" 1 +# 1 "" 2 +# 1 "G:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h" 1 +# 2 "" 2 +# 1 "G:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src" 2 +# 32 "G:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src" +LR_ROM0 0x08000000 0x00020000 { + + ER_ROM0 0x08000000 0x00020000 { + *.o (RESET, +First) + *(InRoot$$Sections) + *(+RO +XO) + } + + + + + + + + RW_NOINIT 0x20000000 UNINIT (0x00008000 - 0x00000C00 - 0x00000200 - 0) { + *.o(.bss.noinit) + *.o(.bss.noinit.*) + } + + RW_RAM0 AlignExpr(+0, 8) (0x00008000 - 0x00000C00 - 0x00000200 - 0 - AlignExpr(ImageLength(RW_NOINIT), 8)) { + *(+RW +ZI) + } + + + ARM_LIB_HEAP (AlignExpr(+0, 8)) EMPTY 0x00000C00 { ; Reserve empty region for heap + } + + + ARM_LIB_STACK (0x20000000 + 0x00008000 - 0) EMPTY -0x00000200 { ; Reserve empty region for stack + } +# 85 "G:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src" +} diff --git a/tmp/1/build.ninja b/tmp/1/build.ninja new file mode 100644 index 0000000..3c95700 --- /dev/null +++ b/tmp/1/build.ninja @@ -0,0 +1,659 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Ninja" Generator, CMake Version 3.31 + +# This file contains all the build statements describing the +# compilation DAG. + +# ============================================================================= +# Write statements declared in CMakeLists.txt: +# +# Which is the root file. +# ============================================================================= + +# ============================================================================= +# Project: Robot_V2.Release+GD32C103CB +# Configurations: +# ============================================================================= + +############################################# +# Minimal version of Ninja required by this file + +ninja_required_version = 1.5 + +# ============================================================================= +# Include auxiliary files. + + +############################################# +# Include rules file. + +include CMakeFiles/rules.ninja + +# ============================================================================= + +############################################# +# Logical path to working directory; prefix for absolute paths. + +cmake_ninja_workdir = G$:/Robot_v2/BOOT/tmp/1/ + +############################################# +# Utility command for database + +build database: phony CMakeFiles/database + +# ============================================================================= +# Object build statements for EXECUTABLE target Robot_V2.Release+GD32C103CB + + +############################################# +# Order-only phony target for Robot_V2.Release+GD32C103CB + +build cmake_object_order_depends_target_Robot_V2.Release+GD32C103CB: phony || cmake_object_order_depends_target_GigaDevice_Device_EVAL_GD32C10x_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 cmake_object_order_depends_target_GigaDevice_Device_Startup_1_0_0 cmake_object_order_depends_target_Group_Source_Files cmake_object_order_depends_target_Group_device cmake_object_order_depends_target_Group_sys + + +# ============================================================================= +# Link build statements for EXECUTABLE target Robot_V2.Release+GD32C103CB + + +############################################# +# Link the executable G:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf + +build G$:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf ac6_linker_script.sct | ${cmake_ninja_workdir}ac6_linker_script.sct: CXX_EXECUTABLE_LINKER__Robot_V2.2eRelease.2bGD32C103CB_ CMakeFiles/Group_Source_Files.dir/G_/Robot_v2/BOOT/Robot_V2/main.o CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/systick.o CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/initial.o CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/flash.o CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/OTA.o CMakeFiles/Group_device.dir/G_/Robot_v2/BOOT/Robot_V2/device/Can.o CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.o CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.o CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.o CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.o | G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h || GigaDevice_Device_EVAL_GD32C10x_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 GigaDevice_Device_Startup_1_0_0 Group_Source_Files Group_device Group_sys + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard + LINK_FLAGS = --cpu=Cortex-M4 --scatter=G:/Robot_v2/BOOT/tmp/1/ac6_linker_script.sct --map --list G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map --library_type=microlib --entry=Reset_Handler --info=summarysizes --summary_stderr --diag_suppress=L6314W + OBJECT_DIR = CMakeFiles\Robot_V2.Release+GD32C103CB.dir + POST_BUILD = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\fromelf.exe --i32combined --output G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf" + PRE_LINK = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\\armclang.exe -E --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -xc -include G:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h G:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src -o G:/Robot_v2/BOOT/tmp/1/ac6_linker_script.sct && cd G:\Robot_v2\BOOT\tmp\1" + RESTAT = 1 + TARGET_COMPILE_PDB = CMakeFiles\Robot_V2.Release+GD32C103CB.dir\ + TARGET_FILE = G:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf + TARGET_PDB = G:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.pdb + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target Group_Source_Files + + +############################################# +# Order-only phony target for Group_Source_Files + +build cmake_object_order_depends_target_Group_Source_Files: phony || . + +build CMakeFiles/Group_Source_Files.dir/G_/Robot_v2/BOOT/Robot_V2/main.o: CXX_COMPILER__Group_Source_Files_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/main.cpp || cmake_object_order_depends_target_Group_Source_Files + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\Group_Source_Files.dir\G_\Robot_v2\BOOT\Robot_V2\main.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\Group_Source_Files.dir + OBJECT_FILE_DIR = CMakeFiles\Group_Source_Files.dir\G_\Robot_v2\BOOT\Robot_V2 + TARGET_COMPILE_PDB = CMakeFiles\Group_Source_Files.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library Group_Source_Files + +build Group_Source_Files: phony CMakeFiles/Group_Source_Files.dir/G_/Robot_v2/BOOT/Robot_V2/main.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target Group_sys + + +############################################# +# Order-only phony target for Group_sys + +build cmake_object_order_depends_target_Group_sys: phony || . + +build CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/systick.o: CXX_COMPILER__Group_sys_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/sys/systick.cpp || cmake_object_order_depends_target_Group_sys + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys\systick.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\Group_sys.dir + OBJECT_FILE_DIR = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys + TARGET_COMPILE_PDB = CMakeFiles\Group_sys.dir\ + TARGET_PDB = "" + +build CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/initial.o: CXX_COMPILER__Group_sys_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/sys/initial.cpp || cmake_object_order_depends_target_Group_sys + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys\initial.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\Group_sys.dir + OBJECT_FILE_DIR = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys + TARGET_COMPILE_PDB = CMakeFiles\Group_sys.dir\ + TARGET_PDB = "" + +build CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/flash.o: CXX_COMPILER__Group_sys_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/sys/flash.cpp || cmake_object_order_depends_target_Group_sys + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys\flash.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\Group_sys.dir + OBJECT_FILE_DIR = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys + TARGET_COMPILE_PDB = CMakeFiles\Group_sys.dir\ + TARGET_PDB = "" + +build CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/OTA.o: CXX_COMPILER__Group_sys_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/sys/OTA.cpp || cmake_object_order_depends_target_Group_sys + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys\OTA.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\Group_sys.dir + OBJECT_FILE_DIR = CMakeFiles\Group_sys.dir\G_\Robot_v2\BOOT\Robot_V2\sys + TARGET_COMPILE_PDB = CMakeFiles\Group_sys.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library Group_sys + +build Group_sys: phony CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/systick.o CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/initial.o CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/flash.o CMakeFiles/Group_sys.dir/G_/Robot_v2/BOOT/Robot_V2/sys/OTA.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target Group_device + + +############################################# +# Order-only phony target for Group_device + +build cmake_object_order_depends_target_Group_device: phony || . + +build CMakeFiles/Group_device.dir/G_/Robot_v2/BOOT/Robot_V2/device/Can.o: CXX_COMPILER__Group_device_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/device/Can.cpp || cmake_object_order_depends_target_Group_device + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\Group_device.dir\G_\Robot_v2\BOOT\Robot_V2\device\Can.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\Group_device.dir + OBJECT_FILE_DIR = CMakeFiles\Group_device.dir\G_\Robot_v2\BOOT\Robot_V2\device + TARGET_COMPILE_PDB = CMakeFiles\Group_device.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library Group_device + +build Group_device: phony CMakeFiles/Group_device.dir/G_/Robot_v2/BOOT/Robot_V2/device/Can.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_EVAL_GD32C10x_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_EVAL_GD32C10x_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_EVAL_GD32C10x_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.o: C_COMPILER__GigaDevice_Device_EVAL_GD32C10x_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c || cmake_object_order_depends_target_GigaDevice_Device_EVAL_GD32C10x_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_eval.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_EVAL_GD32C10x_1_0_0 + +build GigaDevice_Device_EVAL_GD32C10x_1_0_0: phony CMakeFiles/GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_bkp.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_can.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_crc.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_dbg.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_dma.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_exti.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_fmc.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_fwdgt.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_gpio.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_misc.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_pmu.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_rcu.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.o: C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c || cmake_object_order_depends_target_GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\gd32c10x_usart.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 + +build GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0: phony CMakeFiles/GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.o + +# ============================================================================= +# Object build statements for OBJECT_LIBRARY target GigaDevice_Device_Startup_1_0_0 + + +############################################# +# Order-only phony target for GigaDevice_Device_Startup_1_0_0 + +build cmake_object_order_depends_target_GigaDevice_Device_Startup_1_0_0: phony || . + +build CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.o: ASM_COMPILER__GigaDevice_Device_Startup_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s || cmake_object_order_depends_target_GigaDevice_Device_Startup_1_0_0 + DEP_FILE = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\startup_gd32c10x.o.d + FLAGS = -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -D__MICROLIB -gdwarf-5 -masm=auto -O2 -Wa,armasm,--pd,"GD32C10x SETA 1" -Wa,armasm,--pd,"_RTE_ SETA 1" + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device + OBJECT_DIR = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir\ + TARGET_PDB = "" + +build CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.o: C_COMPILER__GigaDevice_Device_Startup_1_0_0_unscanned_ G$:/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c || cmake_object_order_depends_target_GigaDevice_Device_Startup_1_0_0 + DEFINES = -DGD32C10x -D_RTE_ + DEP_FILE = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB\system_gd32c10x.o.d + FLAGS = --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 + INCLUDES = -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include + OBJECT_DIR = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir + OBJECT_FILE_DIR = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir\G_\Robot_v2\BOOT\Robot_V2\RTE\Device\GD32C103CB + TARGET_COMPILE_PDB = CMakeFiles\GigaDevice_Device_Startup_1_0_0.dir\ + TARGET_PDB = "" + + + +############################################# +# Object library GigaDevice_Device_Startup_1_0_0 + +build GigaDevice_Device_Startup_1_0_0: phony CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.o CMakeFiles/GigaDevice_Device_Startup_1_0_0.dir/G_/Robot_v2/BOOT/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.o + + +############################################# +# Utility command for edit_cache + +build CMakeFiles/edit_cache.util: CUSTOM_COMMAND + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake-gui.exe -SG:\Robot_v2\BOOT\tmp\Robot_V2.Release+GD32C103CB -BG:\Robot_v2\BOOT\tmp\1" + DESC = Running CMake cache editor... + pool = console + restat = 1 + +build edit_cache: phony CMakeFiles/edit_cache.util + + +############################################# +# Utility command for rebuild_cache + +build CMakeFiles/rebuild_cache.util: CUSTOM_COMMAND + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe --regenerate-during-build -SG:\Robot_v2\BOOT\tmp\Robot_V2.Release+GD32C103CB -BG:\Robot_v2\BOOT\tmp\1" + DESC = Running CMake to regenerate build system... + pool = console + restat = 1 + +build rebuild_cache: phony CMakeFiles/rebuild_cache.util + + +############################################# +# Custom command for CMakeFiles\database + +build CMakeFiles/database | ${cmake_ninja_workdir}CMakeFiles/database: CUSTOM_COMMAND + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E make_directory G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E copy_if_different G:/Robot_v2/BOOT/tmp/1/compile_commands.json G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release" + +# ============================================================================= +# Target aliases. + +build Robot_V2.Release+GD32C103CB: phony G$:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf + +build Robot_V2.axf: phony G$:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf + +# ============================================================================= +# Folder targets. + +# ============================================================================= + +############################################# +# Folder: G:/Robot_v2/BOOT/tmp/1 + +build all: phony G$:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf Group_Source_Files Group_sys Group_device GigaDevice_Device_EVAL_GD32C10x_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 GigaDevice_Device_Startup_1_0_0 + +# ============================================================================= +# Built-in targets + + +############################################# +# Re-run CMake if any of its inputs changed. + +build build.ninja: RERUN_CMAKE | C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeASMCompiler.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeASMInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompiler.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompilerABI.c C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompiler.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCommonLanguageInclude.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCompilerIdDetection.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineASMCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCXXCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerSupport.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineSystem.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeFindBinUtils.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeGenericSystem.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeInitializeConfigs.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeLanguageInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeNinjaFindMake.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeParseImplicitIncludeInfo.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeParseImplicitLinkInfo.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeParseLibraryArchitecture.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeSystem.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeSystemSpecificInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeSystemSpecificInitialize.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestASMCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCompilerCommon.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ADSP-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMCC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-ASM.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-C.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-CXX-FeatureTests.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-CXX.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/AppleClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Borland-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Bruce-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/CMakeCommonCompilerMacros.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-C.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-CXX-FeatureTests.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-CXX-TestableFeatures.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-CXX.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-DetermineCompilerInternal.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Compaq-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Cray-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/CrayClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Embarcadero-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Fujitsu-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/FujitsuClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GHS-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GNU-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GNU.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/HP-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/HP-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IAR-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMClang-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMClang-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Intel-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/LCC-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/MSVC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/NVHPC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/NVIDIA-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/OrangeC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/PGI-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/PathScale-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SCO-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SDCC-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SunPro-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/TI-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/TIClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Tasking-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Watcom-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XL-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XL-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XLClang-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/zOS-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeASMLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeCLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeCXXLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeCommonLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeDetermineLinkerId.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/FeatureTesting.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Platform/Generic.cmake C$:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc/AC6.6.16.2.cmake CMakeCache.txt CMakeFiles/3.31.5/CMakeASMCompiler.cmake CMakeFiles/3.31.5/CMakeCCompiler.cmake CMakeFiles/3.31.5/CMakeCXXCompiler.cmake CMakeFiles/3.31.5/CMakeSystem.cmake G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/CMakeLists.txt G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/components.cmake G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/groups.cmake G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/toolchain.cmake G$:/Robot_v2/BOOT/tmp/roots.cmake + pool = console + + +############################################# +# A missing CMake input file is not an error. + +build C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeASMCompiler.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeASMInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompiler.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCCompilerABI.c C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompiler.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXCompilerABI.cpp C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCXXInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCommonLanguageInclude.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeCompilerIdDetection.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineASMCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCXXCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerABI.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerId.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineCompilerSupport.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineSystem.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeFindBinUtils.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeGenericSystem.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeInitializeConfigs.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeLanguageInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeNinjaFindMake.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeParseImplicitIncludeInfo.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeParseImplicitLinkInfo.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeParseLibraryArchitecture.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeSystem.cmake.in C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeSystemSpecificInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeSystemSpecificInitialize.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestASMCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCXXCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCompilerCommon.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ADSP-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMCC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-ASM.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-C.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-CXX-FeatureTests.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-CXX.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/ARMClang.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/AppleClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Borland-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Bruce-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/CMakeCommonCompilerMacros.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-C.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-CXX-FeatureTests.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-CXX-TestableFeatures.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-CXX.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang-DetermineCompilerInternal.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Clang.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Compaq-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Cray-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/CrayClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Embarcadero-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Fujitsu-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/FujitsuClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GHS-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GNU-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/GNU.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/HP-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/HP-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IAR-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMClang-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IBMClang-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Intel-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/IntelLLVM-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/LCC-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/LCC-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/MSVC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/NVHPC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/NVIDIA-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/OrangeC-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/PGI-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/PathScale-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SCO-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SDCC-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SunPro-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/TI-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/TIClang-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Tasking-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/Watcom-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XL-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XL-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XLClang-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/zOS-C-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeASMLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeCLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeCXXLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeCommonLinkerInformation.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/CMakeDetermineLinkerId.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Internal/FeatureTesting.cmake C$:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/Platform/Generic.cmake C$:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc/AC6.6.16.2.cmake CMakeCache.txt CMakeFiles/3.31.5/CMakeASMCompiler.cmake CMakeFiles/3.31.5/CMakeCCompiler.cmake CMakeFiles/3.31.5/CMakeCXXCompiler.cmake CMakeFiles/3.31.5/CMakeSystem.cmake G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/CMakeLists.txt G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/components.cmake G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/groups.cmake G$:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/toolchain.cmake G$:/Robot_v2/BOOT/tmp/roots.cmake: phony + + +############################################# +# Clean all the built files. + +build clean: CLEAN + + +############################################# +# Print all primary targets available. + +build help: HELP + + +############################################# +# Make the all target the default. + +default all diff --git a/tmp/1/cmake_install.cmake b/tmp/1/cmake_install.cmake new file mode 100644 index 0000000..09bc67e --- /dev/null +++ b/tmp/1/cmake_install.cmake @@ -0,0 +1,61 @@ +# Install script for directory: G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Robot_V2.Release+GD32C103CB") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "TRUE") +endif() + +# Set path to fallback-tool for dependency-resolution. +if(NOT DEFINED CMAKE_OBJDUMP) + set(CMAKE_OBJDUMP "CMAKE_OBJDUMP-NOTFOUND") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +if(CMAKE_INSTALL_LOCAL_ONLY) + file(WRITE "G:/Robot_v2/BOOT/tmp/1/install_local_manifest.txt" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") +endif() +if(CMAKE_INSTALL_COMPONENT) + if(CMAKE_INSTALL_COMPONENT MATCHES "^[a-zA-Z0-9_.+-]+$") + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") + else() + string(MD5 CMAKE_INST_COMP_HASH "${CMAKE_INSTALL_COMPONENT}") + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INST_COMP_HASH}.txt") + unset(CMAKE_INST_COMP_HASH) + endif() +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +if(NOT CMAKE_INSTALL_LOCAL_ONLY) + file(WRITE "G:/Robot_v2/BOOT/tmp/1/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") +endif() diff --git a/tmp/1/compile_commands.json b/tmp/1/compile_commands.json new file mode 100644 index 0000000..ca2a3c7 --- /dev/null +++ b/tmp/1/compile_commands.json @@ -0,0 +1,134 @@ +[ +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_Source_Files.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\main.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\main.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\main.cpp", + "output": "CMakeFiles\\Group_Source_Files.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\main.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\systick.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\initial.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\flash.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.cpp", + "output": "CMakeFiles\\Group_sys.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\sys\\OTA.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include/libcxx -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\Group_device.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.cpp", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.cpp", + "output": "CMakeFiles\\Group_device.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\device\\Can.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.c", + "output": "CMakeFiles\\GigaDevice_Device_EVAL_GD32C10x_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_eval.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_bkp.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_can.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_crc.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dbg.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_dma.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_exti.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fmc.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_fwdgt.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_gpio.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_misc.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_pmu.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_rcu.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.c", + "output": "CMakeFiles\\GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\gd32c10x_usart.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -D__MICROLIB -gdwarf-5 -masm=auto -O2 -Wa,armasm,--pd,\"GD32C10x SETA 1\" -Wa,armasm,--pd,\"_RTE_ SETA 1\" -c -o CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.o G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.s", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.s", + "output": "CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\startup_gd32c10x.o" +}, +{ + "directory": "G:/Robot_v2/BOOT/tmp/1", + "command": "c:\\Users\\cbb\\.vcpkg\\artifacts\\2139c4c6\\compilers.arm.armclang\\6.24.0\\bin\\armclang.exe --target=arm-arm-none-eabi -DGD32C10x -D_RTE_ -IG:/Robot_v2/BOOT/Robot_V2/RTE/_Release_GD32C103CB -IC:/Users/cbb/AppData/Local/arm/packs/ARM/CMSIS/4.5.0/CMSIS/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include -IC:/Users/cbb/AppData/Local/arm/packs/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities -IG:/Robot_v2/BOOT/Robot_V2 -IG:/Robot_v2/BOOT/Robot_V2/sys -IG:/Robot_v2/BOOT/Robot_V2/device -isystem C:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/include --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -mcpu=Cortex-M4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard --target=arm-arm-none-eabi -c -mlittle-endian -D__packed=packed -fshort-enums -fshort-wchar -D__MICROLIB -Wno-register -gdwarf-5 -std=gnu11 -Wno-macro-redefined -Wno-pragma-pack -Wno-parentheses-equality -Wno-license-management -O2 -o CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.o -c G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.c", + "file": "G:\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.c", + "output": "CMakeFiles\\GigaDevice_Device_Startup_1_0_0.dir\\G_\\Robot_v2\\BOOT\\Robot_V2\\RTE\\Device\\GD32C103CB\\system_gd32c10x.o" +} +] \ No newline at end of file diff --git a/tmp/CMakeCache.txt b/tmp/CMakeCache.txt new file mode 100644 index 0000000..ce74a15 --- /dev/null +++ b/tmp/CMakeCache.txt @@ -0,0 +1,134 @@ +# This is the CMakeCache file. +# For build in directory: g:/Robot_v2/BOOT/tmp +# It was generated by CMake: C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake.exe +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Enable/Disable output of build database during the build. +CMAKE_EXPORT_BUILD_DATABASE:BOOL= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//Value Computed by CMake. +CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=G:/Robot_v2/BOOT/tmp/CMakeFiles/pkgRedirects + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/Robot_V2 + +//Program used to build from build.ninja files. +CMAKE_MAKE_PROGRAM:FILEPATH=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.ninja.build.ninja/1.12.1/ninja.exe + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=Robot_V2 + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//CMSIS compiler root +CMSIS_COMPILER_ROOT:PATH=C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc + +//CMSIS pack root +CMSIS_PACK_ROOT:PATH=C:/Users/cbb/AppData/Local/arm/packs + +//Value Computed by CMake +Robot_V2_BINARY_DIR:STATIC=G:/Robot_v2/BOOT/tmp + +//Value Computed by CMake +Robot_V2_IS_TOP_LEVEL:STATIC=ON + +//Value Computed by CMake +Robot_V2_SOURCE_DIR:STATIC=G:/Robot_v2/BOOT/tmp + +//CMSIS solution root +SOLUTION_ROOT:PATH=G:/Robot_v2/BOOT + + +######################## +# INTERNAL cache entries +######################## + +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=g:/Robot_v2/BOOT/tmp +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=31 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=5 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake.exe +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cpack.exe +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/ctest.exe +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake-gui.exe +//Whether to issue deprecation errors for macros and functions. +CMAKE_ERROR_DEPRECATED:INTERNAL=FALSE +//ADVANCED property for variable: CMAKE_EXPORT_BUILD_DATABASE +CMAKE_EXPORT_BUILD_DATABASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Ninja +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=G:/Robot_v2/BOOT/tmp +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//Suppress errors that are meant for the author of the CMakeLists.txt +// files. +CMAKE_SUPPRESS_DEVELOPER_ERRORS:INTERNAL=TRUE +//Suppress Warnings that are meant for the author of the CMakeLists.txt +// files. +CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=TRUE +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//Whether to issue warnings for deprecated functionality. +CMAKE_WARN_DEPRECATED:INTERNAL=FALSE + diff --git a/tmp/CMakeFiles/3.31.5/CMakeSystem.cmake b/tmp/CMakeFiles/3.31.5/CMakeSystem.cmake new file mode 100644 index 0000000..52688ab --- /dev/null +++ b/tmp/CMakeFiles/3.31.5/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Windows-10.0.26220") +set(CMAKE_HOST_SYSTEM_NAME "Windows") +set(CMAKE_HOST_SYSTEM_VERSION "10.0.26220") +set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64") + + + +set(CMAKE_SYSTEM "Windows-10.0.26220") +set(CMAKE_SYSTEM_NAME "Windows") +set(CMAKE_SYSTEM_VERSION "10.0.26220") +set(CMAKE_SYSTEM_PROCESSOR "AMD64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/tmp/CMakeFiles/CMakeConfigureLog.yaml b/tmp/CMakeFiles/CMakeConfigureLog.yaml new file mode 100644 index 0000000..df119ac --- /dev/null +++ b/tmp/CMakeFiles/CMakeConfigureLog.yaml @@ -0,0 +1,11 @@ + +--- +events: + - + kind: "message-v1" + backtrace: + - "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeDetermineSystem.cmake:205 (message)" + - "CMakeLists.txt:4 (project)" + message: | + The system is: Windows - 10.0.26220 - AMD64 +... diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.dir/Labels.json b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.dir/Labels.json new file mode 100644 index 0000000..bc4584b --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.dir/Labels.json @@ -0,0 +1,37 @@ +{ + "sources" : + [ + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule" + } + ], + "target" : + { + "labels" : + [ + "Robot_V2.Release+GD32C103CB" + ], + "name" : "Robot_V2.Release+GD32C103CB-build" + } +} \ No newline at end of file diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.dir/Labels.txt b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.dir/Labels.txt new file mode 100644 index 0000000..0179d1c --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.dir/Labels.txt @@ -0,0 +1,11 @@ +# Target labels + Robot_V2.Release+GD32C103CB +# Source files and their labels +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete new file mode 100644 index 0000000..e69de29 diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.dir/Labels.json b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.dir/Labels.json new file mode 100644 index 0000000..fb95d96 --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.dir/Labels.json @@ -0,0 +1,34 @@ +{ + "sources" : + [ + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule" + } + ], + "target" : + { + "labels" : + [ + "Robot_V2.Release+GD32C103CB" + ], + "name" : "Robot_V2.Release+GD32C103CB-configure" + } +} \ No newline at end of file diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.dir/Labels.txt b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.dir/Labels.txt new file mode 100644 index 0000000..a578dfc --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.dir/Labels.txt @@ -0,0 +1,10 @@ +# Target labels + Robot_V2.Release+GD32C103CB +# Source files and their labels +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.dir/Labels.json b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.dir/Labels.json new file mode 100644 index 0000000..6c4c7d7 --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.dir/Labels.json @@ -0,0 +1,37 @@ +{ + "sources" : + [ + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule" + } + ], + "target" : + { + "labels" : + [ + "Robot_V2.Release+GD32C103CB" + ], + "name" : "Robot_V2.Release+GD32C103CB-database" + } +} \ No newline at end of file diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.dir/Labels.txt b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.dir/Labels.txt new file mode 100644 index 0000000..63595cc --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.dir/Labels.txt @@ -0,0 +1,11 @@ +# Target labels + Robot_V2.Release+GD32C103CB +# Source files and their labels +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.dir/Labels.json b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.dir/Labels.json new file mode 100644 index 0000000..e1c4055 --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.dir/Labels.json @@ -0,0 +1,40 @@ +{ + "sources" : + [ + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule" + } + ], + "target" : + { + "labels" : + [ + "Robot_V2.Release+GD32C103CB" + ], + "name" : "Robot_V2.Release+GD32C103CB-executes" + } +} \ No newline at end of file diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.dir/Labels.txt b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.dir/Labels.txt new file mode 100644 index 0000000..972aa36 --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.dir/Labels.txt @@ -0,0 +1,12 @@ +# Target labels + Robot_V2.Release+GD32C103CB +# Source files and their labels +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.dir/Labels.json b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.dir/Labels.json new file mode 100644 index 0000000..f86afaf --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.dir/Labels.json @@ -0,0 +1,52 @@ +{ + "sources" : + [ + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test.rule" + }, + { + "file" : "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule" + } + ], + "target" : + { + "labels" : + [ + "Robot_V2.Release+GD32C103CB" + ], + "name" : "Robot_V2.Release+GD32C103CB" + } +} \ No newline at end of file diff --git a/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.dir/Labels.txt b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.dir/Labels.txt new file mode 100644 index 0000000..8cf7ee1 --- /dev/null +++ b/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.dir/Labels.txt @@ -0,0 +1,16 @@ +# Target labels + Robot_V2.Release+GD32C103CB +# Source files and their labels +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.rule +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test.rule +G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update.rule diff --git a/tmp/CMakeFiles/TargetDirectories.txt b/tmp/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..2b59f18 --- /dev/null +++ b/tmp/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,8 @@ +G:/Robot_v2/BOOT/tmp/CMakeFiles/database.dir +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB.dir +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-build.dir +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-configure.dir +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-executes.dir +G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-database.dir +G:/Robot_v2/BOOT/tmp/CMakeFiles/edit_cache.dir +G:/Robot_v2/BOOT/tmp/CMakeFiles/rebuild_cache.dir diff --git a/tmp/CMakeFiles/cmake.check_cache b/tmp/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/tmp/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/tmp/CMakeFiles/rules.ninja b/tmp/CMakeFiles/rules.ninja new file mode 100644 index 0000000..81e4b2e --- /dev/null +++ b/tmp/CMakeFiles/rules.ninja @@ -0,0 +1,45 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Ninja" Generator, CMake Version 3.31 + +# This file contains all the rules used to get the outputs files +# built from the input files. +# It is included in the main 'build.ninja'. + +# ============================================================================= +# Project: Robot_V2 +# Configurations: +# ============================================================================= +# ============================================================================= + +############################################# +# Rule for running custom commands. + +rule CUSTOM_COMMAND + command = $COMMAND + description = $DESC + + +############################################# +# Rule for re-running cmake. + +rule RERUN_CMAKE + command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe --regenerate-during-build -SG:\Robot_v2\BOOT\tmp -BG:\Robot_v2\BOOT\tmp + description = Re-running CMake... + generator = 1 + + +############################################# +# Rule for cleaning all built files. + +rule CLEAN + command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.1\ninja.exe $FILE_ARG -t clean $TARGETS + description = Cleaning all built files... + + +############################################# +# Rule for printing all primary targets available. + +rule HELP + command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.1\ninja.exe -t targets + description = All primary targets available: + diff --git a/tmp/CMakeLists.txt b/tmp/CMakeLists.txt new file mode 100644 index 0000000..249795f --- /dev/null +++ b/tmp/CMakeLists.txt @@ -0,0 +1,80 @@ +cmake_minimum_required(VERSION 3.27) +include(ExternalProject) + +project("Robot_V2" NONE) + +# Roots +include("roots.cmake") + +# Context specific lists +set(CONTEXTS + "Robot_V2.Release+GD32C103CB" +) +list(LENGTH CONTEXTS CONTEXTS_LENGTH) +math(EXPR CONTEXTS_LENGTH "${CONTEXTS_LENGTH}-1") + +set(DIRS + "${CMAKE_CURRENT_SOURCE_DIR}/Robot_V2.Release+GD32C103CB" +) + +set(OUTPUTS_1 + "${SOLUTION_ROOT}/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf" + "${SOLUTION_ROOT}/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex" + "${SOLUTION_ROOT}/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map" +) + +set(ARGS + "-DSOLUTION_ROOT=${SOLUTION_ROOT}" + "-DCMSIS_PACK_ROOT=${CMSIS_PACK_ROOT}" + "-DCMSIS_COMPILER_ROOT=${CMSIS_COMPILER_ROOT}" +) + +# Compilation database +add_custom_target(database) + +# Iterate over contexts +foreach(INDEX RANGE ${CONTEXTS_LENGTH}) + + math(EXPR N "${INDEX}+1") + list(GET CONTEXTS ${INDEX} CONTEXT) + list(GET DIRS ${INDEX} DIR) + + # Create external project, set configure and build steps + ExternalProject_Add(${CONTEXT} + PREFIX ${DIR} + SOURCE_DIR ${DIR} + BINARY_DIR ${N} + INSTALL_COMMAND "" + TEST_COMMAND "" + CONFIGURE_COMMAND ${CMAKE_COMMAND} -G Ninja -S -B ${ARGS} + BUILD_COMMAND ${CMAKE_COMMAND} -E echo "Building CMake target '${CONTEXT}'" + COMMAND ${CMAKE_COMMAND} --build + BUILD_ALWAYS TRUE + BUILD_BYPRODUCTS ${OUTPUTS_${N}} + LOG_CONFIGURE ON + LOG_OUTPUT_ON_FAILURE ON + USES_TERMINAL_BUILD ON + ) + + # Executes command step + ExternalProject_Add_Step(${CONTEXT} executes + DEPENDEES build + ) + + ExternalProject_Add_StepTargets(${CONTEXT} build configure executes) + + # Debug + message(VERBOSE "Configure Context: ${CMAKE_COMMAND} -G Ninja -S ${DIR} -B ${N}") + + # Database generation step + ExternalProject_Add_Step(${CONTEXT} database + COMMAND ${CMAKE_COMMAND} --build --target database + ALWAYS TRUE + LOG TRUE + USES_TERMINAL ON + DEPENDEES configure + ) + ExternalProject_Add_StepTargets(${CONTEXT} database) + add_dependencies(database ${CONTEXT}-database) + +endforeach() diff --git a/tmp/Robot_V2.Release+GD32C103CB/CMakeLists.txt b/tmp/Robot_V2.Release+GD32C103CB/CMakeLists.txt new file mode 100644 index 0000000..55f0dd9 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/CMakeLists.txt @@ -0,0 +1,166 @@ +cmake_minimum_required(VERSION 3.27) + +# Roots +include("../roots.cmake") + +set(CONTEXT Robot_V2.Release+GD32C103CB) +set(TARGET ${CONTEXT}) +set(OUT_DIR "${SOLUTION_ROOT}/out/Robot_V2/GD32C103CB/Release") +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(HEX_FILE "Robot_V2.hex") +set(LD_MAP_FILE "Robot_V2.axf.map") +set(LD_SCRIPT "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/ac6_linker_script.sct.src") +set(LD_REGIONS "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/regions_GD32C103CB.h") +set(LD_SCRIPT_PP "${CMAKE_CURRENT_BINARY_DIR}/ac6_linker_script.sct") + +# Processor Options +set(CPU Cortex-M4) +set(FPU SP_FPU) +set(BYTE_ORDER Little-endian) + +# Toolchain config map +include("toolchain.cmake") + +# Setup project +project(${CONTEXT} LANGUAGES CXX C ASM) + +# Compilation database +add_custom_target(database + COMMAND ${CMAKE_COMMAND} -E make_directory "${OUT_DIR}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json" "${OUT_DIR}" +) +set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) +set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}) + +# Setup context +add_executable(${CONTEXT}) +set_target_properties(${CONTEXT} PROPERTIES PREFIX "" SUFFIX ".axf" OUTPUT_NAME "Robot_V2") +set_target_properties(${CONTEXT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${OUT_DIR}) +add_library(${CONTEXT}_GLOBAL INTERFACE) + +# Includes +target_include_directories(${CONTEXT} PUBLIC + "${SOLUTION_ROOT}/Robot_V2/RTE/_Release_GD32C103CB" + "${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include" + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include" + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities" + "${SOLUTION_ROOT}/Robot_V2" + "${SOLUTION_ROOT}/Robot_V2/sys" + "${SOLUTION_ROOT}/Robot_V2/device" +) + +# Defines +target_compile_definitions(${CONTEXT} PUBLIC + $<$: + GD32C10x + _RTE_ + > +) + +# Compile options +target_compile_options(${CONTEXT} PUBLIC + $<$: + "SHELL:${ASM_CPU}" + "SHELL:${ASM_FLAGS}" + "SHELL:${ASM_BYTE_ORDER}" + "SHELL:-D__packed=packed" + "SHELL:-D__MICROLIB" + "SHELL:-gdwarf-5" + "SHELL:-masm=auto" + > + $<$: + "SHELL:${CC_CPU}" + "SHELL:${CC_FLAGS}" + "SHELL:${CC_BYTE_ORDER}" + "SHELL:-D__packed=packed" + "SHELL:-fshort-enums" + "SHELL:-fshort-wchar" + "SHELL:-D__MICROLIB" + "SHELL:-Wno-register" + "SHELL:-gdwarf-5" + "SHELL:-std=gnu11" + "SHELL:-Wno-macro-redefined" + "SHELL:-Wno-pragma-pack" + "SHELL:-Wno-parentheses-equality" + "SHELL:-Wno-license-management" + > + $<$: + "SHELL:${CXX_CPU}" + "SHELL:${CXX_FLAGS}" + "SHELL:${CXX_BYTE_ORDER}" + "SHELL:-fshort-enums" + "SHELL:-fshort-wchar" + "SHELL:-D__MICROLIB" + "SHELL:-Wno-register" + "SHELL:-gdwarf-5" + "SHELL:-Wno-macro-redefined" + "SHELL:-Wno-pragma-pack" + "SHELL:-Wno-parentheses-equality" + "SHELL:-Wno-license-management" + > +) + +# Compile Options Abstractions +add_library(${CONTEXT}_ABSTRACTIONS INTERFACE) +cbuild_set_options_flags(CXX "balanced" "off" "" "" CXX_OPTIONS_FLAGS_${CONTEXT}) +cbuild_set_options_flags(CC "balanced" "off" "" "" CC_OPTIONS_FLAGS_${CONTEXT}) +cbuild_set_options_flags(ASM "balanced" "off" "" "" ASM_OPTIONS_FLAGS_${CONTEXT}) +target_compile_options(${CONTEXT}_ABSTRACTIONS INTERFACE + $<$: + "SHELL:${CXX_OPTIONS_FLAGS_${CONTEXT}}" + > + $<$: + "SHELL:${CC_OPTIONS_FLAGS_${CONTEXT}}" + > + $<$: + "SHELL:${ASM_OPTIONS_FLAGS_${CONTEXT}}" + > +) + +# Add groups and components +include("groups.cmake") +include("components.cmake") + +target_link_libraries(${CONTEXT} PUBLIC + Group_Source_Files + Group_sys + Group_device + ARM_CMSIS_CORE_4_3_0 + GigaDevice_Device_EVAL_GD32C10x_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 + GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 + GigaDevice_Device_GD32C10x_libopt_1_0_0 + GigaDevice_Device_Startup_1_0_0 +) + +# Linker options +target_link_options(${CONTEXT} PUBLIC + "SHELL:${LD_CPU}" + "SHELL:${_LS}\"${LD_SCRIPT_PP}\"" + "SHELL:${LD_MAP}" + "SHELL:--library_type=microlib" + "SHELL:--entry=Reset_Handler" + "SHELL:--info=summarysizes" + "SHELL:--summary_stderr" + "SHELL:--diag_suppress=L6314W" +) +set(LD_DEPS ${LD_SCRIPT} ${LD_REGIONS}) +set_target_properties(${CONTEXT} PROPERTIES LINK_DEPENDS "${LD_DEPS}") + +# Linker script pre-processing +add_custom_command(TARGET ${CONTEXT} PRE_LINK COMMAND ${CPP} ARGS ${CPP_ARGS_LD_SCRIPT} BYPRODUCTS ${LD_SCRIPT_PP}) + +# Hex Conversion + add_custom_command(TARGET ${CONTEXT} POST_BUILD COMMAND ${CMAKE_OBJCOPY} ${ELF2HEX}) diff --git a/tmp/Robot_V2.Release+GD32C103CB/components.cmake b/tmp/Robot_V2.Release+GD32C103CB/components.cmake new file mode 100644 index 0000000..363f381 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/components.cmake @@ -0,0 +1,306 @@ +# components.cmake + +# component ARM::CMSIS:CORE@4.3.0 +add_library(ARM_CMSIS_CORE_4_3_0 INTERFACE) +target_include_directories(ARM_CMSIS_CORE_4_3_0 INTERFACE + $ + "${CMSIS_PACK_ROOT}/ARM/CMSIS/4.5.0/CMSIS/Include" +) +target_compile_definitions(ARM_CMSIS_CORE_4_3_0 INTERFACE + $ +) +target_link_libraries(ARM_CMSIS_CORE_4_3_0 INTERFACE + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:EVAL:GD32C10x@1.0.0 +add_library(GigaDevice_Device_EVAL_GD32C10x_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_eval.c" +) +target_include_directories(GigaDevice_Device_EVAL_GD32C10x_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Utilities" +) +target_compile_definitions(GigaDevice_Device_EVAL_GD32C10x_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_EVAL_GD32C10x_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_EVAL_GD32C10x_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:BKP@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_bkp.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_BKP_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:CAN@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_can.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:CRC@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_crc.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:DBG@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dbg.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:DMA@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_dma.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:EXTI@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_exti.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:FMC@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fmc.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:FWDGT@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_fwdgt.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:GPIO@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_gpio.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:MISC@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_misc.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:PMU@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_pmu.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:RCU@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_rcu.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_StdPeripherals:USART@1.0.0 +add_library(GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/gd32c10x_usart.c" +) +target_include_directories(GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Firmware/Peripherals/inc" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:GD32C10x_libopt@1.0.0 +add_library(GigaDevice_Device_GD32C10x_libopt_1_0_0 INTERFACE) +target_include_directories(GigaDevice_Device_GD32C10x_libopt_1_0_0 INTERFACE + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include" +) +target_compile_definitions(GigaDevice_Device_GD32C10x_libopt_1_0_0 INTERFACE + $ +) +target_link_libraries(GigaDevice_Device_GD32C10x_libopt_1_0_0 INTERFACE + ${CONTEXT}_ABSTRACTIONS +) + +# component GigaDevice::Device:Startup@1.0.0 +add_library(GigaDevice_Device_Startup_1_0_0 OBJECT + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s" + "${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/system_gd32c10x.c" +) +target_include_directories(GigaDevice_Device_Startup_1_0_0 PUBLIC + $ + "${CMSIS_PACK_ROOT}/GigaDevice/GD32C10x_DFP/1.0.1/Device/Include" +) +target_compile_definitions(GigaDevice_Device_Startup_1_0_0 PUBLIC + $ +) +target_compile_options(GigaDevice_Device_Startup_1_0_0 PUBLIC + $ +) +target_link_libraries(GigaDevice_Device_Startup_1_0_0 PUBLIC + ${CONTEXT}_ABSTRACTIONS +) +set(COMPILE_DEFINITIONS + GD32C10x + _RTE_ +) +cbuild_set_defines(AS_ARM COMPILE_DEFINITIONS) +set_source_files_properties("${SOLUTION_ROOT}/Robot_V2/RTE/Device/GD32C103CB/startup_gd32c10x.s" PROPERTIES + COMPILE_FLAGS "${COMPILE_DEFINITIONS}" +) diff --git a/tmp/Robot_V2.Release+GD32C103CB/groups.cmake b/tmp/Robot_V2.Release+GD32C103CB/groups.cmake new file mode 100644 index 0000000..5755c55 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/groups.cmake @@ -0,0 +1,70 @@ +# groups.cmake + +# group Source Files +add_library(Group_Source_Files OBJECT + "${SOLUTION_ROOT}/Robot_V2/main.cpp" +) +target_include_directories(Group_Source_Files PUBLIC + $ + "${SOLUTION_ROOT}/Robot_V2" +) +target_compile_definitions(Group_Source_Files PUBLIC + $ +) +add_library(Group_Source_Files_ABSTRACTIONS INTERFACE) +target_link_libraries(Group_Source_Files_ABSTRACTIONS INTERFACE + ${CONTEXT}_ABSTRACTIONS +) +target_compile_options(Group_Source_Files PUBLIC + $ +) +target_link_libraries(Group_Source_Files PUBLIC + Group_Source_Files_ABSTRACTIONS +) + +# group sys +add_library(Group_sys OBJECT + "${SOLUTION_ROOT}/Robot_V2/sys/systick.cpp" + "${SOLUTION_ROOT}/Robot_V2/sys/initial.cpp" + "${SOLUTION_ROOT}/Robot_V2/sys/flash.cpp" + "${SOLUTION_ROOT}/Robot_V2/sys/OTA.cpp" +) +target_include_directories(Group_sys PUBLIC + $ + "${SOLUTION_ROOT}/Robot_V2/sys" +) +target_compile_definitions(Group_sys PUBLIC + $ +) +add_library(Group_sys_ABSTRACTIONS INTERFACE) +target_link_libraries(Group_sys_ABSTRACTIONS INTERFACE + ${CONTEXT}_ABSTRACTIONS +) +target_compile_options(Group_sys PUBLIC + $ +) +target_link_libraries(Group_sys PUBLIC + Group_sys_ABSTRACTIONS +) + +# group device +add_library(Group_device OBJECT + "${SOLUTION_ROOT}/Robot_V2/device/Can.cpp" +) +target_include_directories(Group_device PUBLIC + $ + "${SOLUTION_ROOT}/Robot_V2/device" +) +target_compile_definitions(Group_device PUBLIC + $ +) +add_library(Group_device_ABSTRACTIONS INTERFACE) +target_link_libraries(Group_device_ABSTRACTIONS INTERFACE + ${CONTEXT}_ABSTRACTIONS +) +target_compile_options(Group_device PUBLIC + $ +) +target_link_libraries(Group_device PUBLIC + Group_device_ABSTRACTIONS +) diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-.cmake b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-.cmake new file mode 100644 index 0000000..50c4221 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-.cmake @@ -0,0 +1,56 @@ + +cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake + +set(command "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake.exe;-G;Ninja;-S;G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB;-B;G:/Robot_v2/BOOT/tmp/1;-DSOLUTION_ROOT=G:/Robot_v2/BOOT;-DCMSIS_PACK_ROOT=C:/Users/cbb/AppData/Local/arm/packs;-DCMSIS_COMPILER_ROOT=C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc") +set(log_merged "") +set(log_output_on_failure "ON") +set(stdout_log "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-out.log") +set(stderr_log "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-err.log") +execute_process( + COMMAND ${command} + RESULT_VARIABLE result + OUTPUT_FILE "${stdout_log}" + ERROR_FILE "${stderr_log}" +) +macro(read_up_to_max_size log_file output_var) + file(SIZE ${log_file} determined_size) + set(max_size 10240) + if (determined_size GREATER max_size) + math(EXPR seek_position "${determined_size} - ${max_size}") + file(READ ${log_file} ${output_var} OFFSET ${seek_position}) + set(${output_var} "...skipping to end...\n${${output_var}}") + else() + file(READ ${log_file} ${output_var}) + endif() +endmacro() +if(result) + set(msg "Command failed: ${result}\n") + foreach(arg IN LISTS command) + set(msg "${msg} '${arg}'") + endforeach() + if (${log_merged}) + set(msg "${msg}\nSee also\n ${stderr_log}") + else() + set(msg "${msg}\nSee also\n G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-*.log") + endif() + if (${log_output_on_failure}) + message(SEND_ERROR "${msg}") + if (${log_merged}) + read_up_to_max_size("${stderr_log}" error_log_contents) + message(STATUS "Log output is:\n${error_log_contents}") + else() + read_up_to_max_size("${stdout_log}" out_log_contents) + read_up_to_max_size("${stderr_log}" err_log_contents) + message(STATUS "stdout output is:\n${out_log_contents}") + message(STATUS "stderr output is:\n${err_log_contents}") + endif() + message(FATAL_ERROR "Stopping after outputting logs.") + else() + message(FATAL_ERROR "${msg}") + endif() +else() + if(NOT "Ninja" MATCHES "Ninja") + set(msg "Robot_V2.Release+GD32C103CB configure command succeeded. See also G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-*.log") + message(STATUS "${msg}") + endif() +endif() diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-err.log b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-err.log new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-out.log b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-out.log new file mode 100644 index 0000000..8cbaab3 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-out.log @@ -0,0 +1,17 @@ +-- The CXX compiler identification is ARMClang 6.24.0 +-- The C compiler identification is ARMClang 6.24.0 +-- The ASM compiler identification is ARMClang +-- Found assembler: c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe +-- Detecting CXX compiler ABI info +-- Detecting CXX compiler ABI info - done +-- Check for working CXX compiler: c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe - skipped +-- Detecting CXX compile features +-- Detecting CXX compile features - done +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - done +-- Check for working C compiler: c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang.exe - skipped +-- Detecting C compile features +-- Detecting C compile features - done +-- Configuring done (7.8s) +-- Generating done (0.1s) +-- Build files have been written to: G:/Robot_v2/BOOT/tmp/1 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-.cmake b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-.cmake new file mode 100644 index 0000000..6161ebf --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-.cmake @@ -0,0 +1,56 @@ + +cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake + +set(command "C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake.exe;--build;G:/Robot_v2/BOOT/tmp/1;--target;database") +set(log_merged "") +set(log_output_on_failure "ON") +set(stdout_log "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-out.log") +set(stderr_log "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-err.log") +execute_process( + COMMAND ${command} + RESULT_VARIABLE result + OUTPUT_FILE "${stdout_log}" + ERROR_FILE "${stderr_log}" +) +macro(read_up_to_max_size log_file output_var) + file(SIZE ${log_file} determined_size) + set(max_size 10240) + if (determined_size GREATER max_size) + math(EXPR seek_position "${determined_size} - ${max_size}") + file(READ ${log_file} ${output_var} OFFSET ${seek_position}) + set(${output_var} "...skipping to end...\n${${output_var}}") + else() + file(READ ${log_file} ${output_var}) + endif() +endmacro() +if(result) + set(msg "Command failed: ${result}\n") + foreach(arg IN LISTS command) + set(msg "${msg} '${arg}'") + endforeach() + if (${log_merged}) + set(msg "${msg}\nSee also\n ${stderr_log}") + else() + set(msg "${msg}\nSee also\n G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-*.log") + endif() + if (${log_output_on_failure}) + message(SEND_ERROR "${msg}") + if (${log_merged}) + read_up_to_max_size("${stderr_log}" error_log_contents) + message(STATUS "Log output is:\n${error_log_contents}") + else() + read_up_to_max_size("${stdout_log}" out_log_contents) + read_up_to_max_size("${stderr_log}" err_log_contents) + message(STATUS "stdout output is:\n${out_log_contents}") + message(STATUS "stderr output is:\n${err_log_contents}") + endif() + message(FATAL_ERROR "Stopping after outputting logs.") + else() + message(FATAL_ERROR "${msg}") + endif() +else() + if(NOT "Ninja" MATCHES "Ninja") + set(msg "Robot_V2.Release+GD32C103CB database command succeeded. See also G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-*.log") + message(STATUS "${msg}") + endif() +endif() diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-err.log b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-err.log new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-out.log b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-out.log new file mode 100644 index 0000000..3da3bad --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-out.log @@ -0,0 +1 @@ +[1/1] C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E make_directory G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E copy_if_different G:/Robot_v2/BOOT/tmp/1/compile_commands.json G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release" diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch-info.txt b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch-info.txt new file mode 100644 index 0000000..53e1e1e --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch-info.txt @@ -0,0 +1,6 @@ +# This is a generated file and its contents are an internal implementation detail. +# The update step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +command= +work_dir= diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-source_dirinfo.txt b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-source_dirinfo.txt new file mode 100644 index 0000000..c057e85 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-source_dirinfo.txt @@ -0,0 +1,9 @@ +# This is a generated file and its contents are an internal implementation detail. +# The download step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +method=source_dir +command= +source_dir=G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB +work_dir= + diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update new file mode 100644 index 0000000..e69de29 diff --git a/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update-info.txt b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update-info.txt new file mode 100644 index 0000000..31617d1 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update-info.txt @@ -0,0 +1,7 @@ +# This is a generated file and its contents are an internal implementation detail. +# The patch step will be re-executed if anything in this file changes. +# No other meaning or use of this file is supported. + +command (connected)= +command (disconnected)= +work_dir= diff --git a/tmp/Robot_V2.Release+GD32C103CB/tmp/Robot_V2.Release+GD32C103CB-cfgcmd.txt b/tmp/Robot_V2.Release+GD32C103CB/tmp/Robot_V2.Release+GD32C103CB-cfgcmd.txt new file mode 100644 index 0000000..e915b55 --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/tmp/Robot_V2.Release+GD32C103CB-cfgcmd.txt @@ -0,0 +1 @@ +cmd='C:/Users/cbb/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/bin/cmake.exe;-G;Ninja;-S;;-B;;-DSOLUTION_ROOT=G:/Robot_v2/BOOT;-DCMSIS_PACK_ROOT=C:/Users/cbb/AppData/Local/arm/packs;-DCMSIS_COMPILER_ROOT=C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc' diff --git a/tmp/Robot_V2.Release+GD32C103CB/tmp/Robot_V2.Release+GD32C103CB-mkdirs.cmake b/tmp/Robot_V2.Release+GD32C103CB/tmp/Robot_V2.Release+GD32C103CB-mkdirs.cmake new file mode 100644 index 0000000..f235e5b --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/tmp/Robot_V2.Release+GD32C103CB-mkdirs.cmake @@ -0,0 +1,27 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +cmake_minimum_required(VERSION ${CMAKE_VERSION}) # this file comes with cmake + +# If CMAKE_DISABLE_SOURCE_CHANGES is set to true and the source directory is an +# existing directory in our source tree, calling file(MAKE_DIRECTORY) on it +# would cause a fatal error, even though it would be a no-op. +if(NOT EXISTS "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB") + file(MAKE_DIRECTORY "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB") +endif() +file(MAKE_DIRECTORY + "G:/Robot_v2/BOOT/tmp/1" + "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB" + "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/tmp" + "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp" + "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src" + "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp" +) + +set(configSubDirs ) +foreach(subDir IN LISTS configSubDirs) + file(MAKE_DIRECTORY "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/${subDir}") +endforeach() +if(cfgdir) + file(MAKE_DIRECTORY "G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp${cfgdir}") # cfgdir has leading slash +endif() diff --git a/tmp/Robot_V2.Release+GD32C103CB/toolchain.cmake b/tmp/Robot_V2.Release+GD32C103CB/toolchain.cmake new file mode 100644 index 0000000..53ea12a --- /dev/null +++ b/tmp/Robot_V2.Release+GD32C103CB/toolchain.cmake @@ -0,0 +1,6 @@ +# toolchain.cmake + +set(REGISTERED_TOOLCHAIN_ROOT "c:/Users/cbb/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/") +set(REGISTERED_TOOLCHAIN_VERSION "6.24.0") +include("${CMSIS_COMPILER_ROOT}/AC6.6.16.2.cmake") + diff --git a/tmp/build.ninja b/tmp/build.ninja new file mode 100644 index 0000000..546fc8f --- /dev/null +++ b/tmp/build.ninja @@ -0,0 +1,272 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Ninja" Generator, CMake Version 3.31 + +# This file contains all the build statements describing the +# compilation DAG. + +# ============================================================================= +# Write statements declared in CMakeLists.txt: +# +# Which is the root file. +# ============================================================================= + +# ============================================================================= +# Project: Robot_V2 +# Configurations: +# ============================================================================= + +############################################# +# Minimal version of Ninja required by this file + +ninja_required_version = 1.5 + +# ============================================================================= +# Include auxiliary files. + + +############################################# +# Include rules file. + +include CMakeFiles\rules.ninja + +# ============================================================================= + +############################################# +# Logical path to working directory; prefix for absolute paths. + +cmake_ninja_workdir = G$:\Robot_v2\BOOT\tmp\ + +############################################# +# Utility command for database + +build database: phony Robot_V2.Release+GD32C103CB-database + + +############################################# +# Utility command for Robot_V2.Release+GD32C103CB + +build Robot_V2.Release+GD32C103CB: phony CMakeFiles\Robot_V2.Release+GD32C103CB CMakeFiles\Robot_V2.Release+GD32C103CB-complete Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-done Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.hex G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf.map Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-executes Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-install Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-test Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB-executes + + +############################################# +# Utility command for Robot_V2.Release+GD32C103CB-build + +build Robot_V2.Release+GD32C103CB-build: phony CMakeFiles\Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.hex G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf.map Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir Robot_V2.Release+GD32C103CB-configure + + +############################################# +# Utility command for Robot_V2.Release+GD32C103CB-configure + +build Robot_V2.Release+GD32C103CB-configure: phony CMakeFiles\Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir + + +############################################# +# Utility command for Robot_V2.Release+GD32C103CB-executes + +build Robot_V2.Release+GD32C103CB-executes: phony CMakeFiles\Robot_V2.Release+GD32C103CB-executes Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-executes Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.hex G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf.map Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir Robot_V2.Release+GD32C103CB-build + + +############################################# +# Utility command for Robot_V2.Release+GD32C103CB-database + +build Robot_V2.Release+GD32C103CB-database: phony CMakeFiles\Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir Robot_V2.Release+GD32C103CB-configure + + +############################################# +# Utility command for edit_cache + +build CMakeFiles\edit_cache.util: CUSTOM_COMMAND + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake-gui.exe -SG:\Robot_v2\BOOT\tmp -BG:\Robot_v2\BOOT\tmp" + DESC = Running CMake cache editor... + pool = console + restat = 1 + +build edit_cache: phony CMakeFiles\edit_cache.util + + +############################################# +# Utility command for rebuild_cache + +build CMakeFiles\rebuild_cache.util: CUSTOM_COMMAND + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe --regenerate-during-build -SG:\Robot_v2\BOOT\tmp -BG:\Robot_v2\BOOT\tmp" + DESC = Running CMake to regenerate build system... + pool = console + restat = 1 + +build rebuild_cache: phony CMakeFiles\rebuild_cache.util + + +############################################# +# Phony custom command for CMakeFiles\Robot_V2.Release+GD32C103CB + +build CMakeFiles\Robot_V2.Release+GD32C103CB | ${cmake_ninja_workdir}CMakeFiles\Robot_V2.Release+GD32C103CB: phony CMakeFiles\Robot_V2.Release+GD32C103CB-complete || Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB-executes + + +############################################# +# Custom command for CMakeFiles\Robot_V2.Release+GD32C103CB-complete + +build CMakeFiles\Robot_V2.Release+GD32C103CB-complete Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-done | ${cmake_ninja_workdir}CMakeFiles\Robot_V2.Release+GD32C103CB-complete ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-done: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-install Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-install Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-test Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-executes Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-database || Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB-executes + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E make_directory G:/Robot_v2/BOOT/tmp/CMakeFiles && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done" + DESC = Completed 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.hex G$:\Robot_v2\BOOT\out\Robot_V2\GD32C103CB\Release\Robot_V2.axf.map | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure || Robot_V2.Release+GD32C103CB-configure + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E echo "Building CMake target 'Robot_V2.Release+GD32C103CB'" && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe --build G:/Robot_v2/BOOT/tmp/1" + DESC = Performing build step for 'Robot_V2.Release+GD32C103CB' + pool = console + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\tmp\Robot_V2.Release+GD32C103CB-cfgcmd.txt Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -P G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure-.cmake && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure" + DESC = Performing configure step for 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-database + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-database | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-database: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure || Robot_V2.Release+GD32C103CB-configure + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -P G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database-.cmake" + DESC = Performing database step for 'Robot_V2.Release+GD32C103CB' + pool = console + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-source_dirinfo.txt Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E echo_append && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-download" + DESC = No download step for 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-executes + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-executes | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-executes: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build || Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB-configure + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E echo_append && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes" + DESC = No executes step for 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-install + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-install | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-install: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build || Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB-executes + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E echo_append" + DESC = No install step for 'Robot_V2.Release+GD32C103CB' + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-mkdir: CUSTOM_COMMAND + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -Dcfgdir= -P G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/tmp/Robot_V2.Release+GD32C103CB-mkdirs.cmake && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-mkdir" + DESC = Creating directories for 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-patch-info.txt Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E echo_append && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch" + DESC = No patch step for 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-test + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-test | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-test: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-install || Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB-configure Robot_V2.Release+GD32C103CB-database Robot_V2.Release+GD32C103CB-executes + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp\1 && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E echo_append && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test" + DESC = No test step for 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Custom command for Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update + +build Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update | ${cmake_ninja_workdir}Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update: CUSTOM_COMMAND Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-update-info.txt Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-download + COMMAND = C:\WINDOWS\system32\cmd.exe /C "cd /D G:\Robot_v2\BOOT\tmp && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E echo_append && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe -E touch G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-update" + DESC = No update step for 'Robot_V2.Release+GD32C103CB' + restat = 1 + + +############################################# +# Phony custom command for CMakeFiles\Robot_V2.Release+GD32C103CB-build + +build CMakeFiles\Robot_V2.Release+GD32C103CB-build | ${cmake_ninja_workdir}CMakeFiles\Robot_V2.Release+GD32C103CB-build: phony Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-build || Robot_V2.Release+GD32C103CB-configure + + +############################################# +# Phony custom command for CMakeFiles\Robot_V2.Release+GD32C103CB-configure + +build CMakeFiles\Robot_V2.Release+GD32C103CB-configure | ${cmake_ninja_workdir}CMakeFiles\Robot_V2.Release+GD32C103CB-configure: phony Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-configure + + +############################################# +# Phony custom command for CMakeFiles\Robot_V2.Release+GD32C103CB-executes + +build CMakeFiles\Robot_V2.Release+GD32C103CB-executes | ${cmake_ninja_workdir}CMakeFiles\Robot_V2.Release+GD32C103CB-executes: phony Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-executes || Robot_V2.Release+GD32C103CB-build Robot_V2.Release+GD32C103CB-configure + + +############################################# +# Phony custom command for CMakeFiles\Robot_V2.Release+GD32C103CB-database + +build CMakeFiles\Robot_V2.Release+GD32C103CB-database | ${cmake_ninja_workdir}CMakeFiles\Robot_V2.Release+GD32C103CB-database: phony Robot_V2.Release+GD32C103CB\src\Robot_V2.Release+GD32C103CB-stamp\Robot_V2.Release+GD32C103CB-database || Robot_V2.Release+GD32C103CB-configure + +# ============================================================================= +# Target aliases. + +# ============================================================================= +# Folder targets. + +# ============================================================================= + +############################################# +# Folder: G:/Robot_v2/BOOT/tmp + +build all: phony Robot_V2.Release+GD32C103CB + +# ============================================================================= +# Built-in targets + + +############################################# +# Re-run CMake if any of its inputs changed. + +build build.ninja: RERUN_CMAKE | C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeGenericSystem.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\PatchInfo.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\RepositoryInfo.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\UpdateInfo.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\cfgcmd.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\mkdirs.cmake.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\shared_internal_commands.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\Platform\Windows.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake CMakeCache.txt CMakeFiles\3.31.5\CMakeSystem.cmake CMakeLists.txt Robot_V2.Release+GD32C103CB\tmp\Robot_V2.Release+GD32C103CB-mkdirs.cmake roots.cmake + pool = console + + +############################################# +# A missing CMake input file is not an error. + +build C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeGenericSystem.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeInitializeConfigs.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeSystemSpecificInformation.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\CMakeSystemSpecificInitialize.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\PatchInfo.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\RepositoryInfo.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\UpdateInfo.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\cfgcmd.txt.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\mkdirs.cmake.in C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\ExternalProject\shared_internal_commands.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\Platform\Windows-Initialize.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\Platform\Windows.cmake C$:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\share\cmake-3.31\Modules\Platform\WindowsPaths.cmake CMakeCache.txt CMakeFiles\3.31.5\CMakeSystem.cmake CMakeLists.txt Robot_V2.Release+GD32C103CB\tmp\Robot_V2.Release+GD32C103CB-mkdirs.cmake roots.cmake: phony + + +############################################# +# Clean all the built files. + +build clean: CLEAN + + +############################################# +# Print all primary targets available. + +build help: HELP + + +############################################# +# Make the all target the default. + +default all diff --git a/tmp/cmake_install.cmake b/tmp/cmake_install.cmake new file mode 100644 index 0000000..a359f93 --- /dev/null +++ b/tmp/cmake_install.cmake @@ -0,0 +1,56 @@ +# Install script for directory: G:/Robot_v2/BOOT/tmp + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Robot_V2") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +if(CMAKE_INSTALL_LOCAL_ONLY) + file(WRITE "G:/Robot_v2/BOOT/tmp/install_local_manifest.txt" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") +endif() +if(CMAKE_INSTALL_COMPONENT) + if(CMAKE_INSTALL_COMPONENT MATCHES "^[a-zA-Z0-9_.+-]+$") + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") + else() + string(MD5 CMAKE_INST_COMP_HASH "${CMAKE_INSTALL_COMPONENT}") + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INST_COMP_HASH}.txt") + unset(CMAKE_INST_COMP_HASH) + endif() +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +if(NOT CMAKE_INSTALL_LOCAL_ONLY) + file(WRITE "G:/Robot_v2/BOOT/tmp/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") +endif() diff --git a/tmp/roots.cmake b/tmp/roots.cmake new file mode 100644 index 0000000..f2477e2 --- /dev/null +++ b/tmp/roots.cmake @@ -0,0 +1,7 @@ +# roots.cmake +set(CMSIS_PACK_ROOT "C:/Users/cbb/AppData/Local/arm/packs" CACHE PATH "CMSIS pack root") +cmake_path(ABSOLUTE_PATH CMSIS_PACK_ROOT NORMALIZE OUTPUT_VARIABLE CMSIS_PACK_ROOT) +set(CMSIS_COMPILER_ROOT "C:/Users/cbb/.vscode/extensions/arm.cmsis-csolution-1.64.1-win32-x64/tools/cmsis-toolbox/etc" CACHE PATH "CMSIS compiler root") +cmake_path(ABSOLUTE_PATH CMSIS_COMPILER_ROOT NORMALIZE OUTPUT_VARIABLE CMSIS_COMPILER_ROOT) +set(SOLUTION_ROOT "G:/Robot_v2/BOOT" CACHE PATH "CMSIS solution root") +cmake_path(ABSOLUTE_PATH SOLUTION_ROOT NORMALIZE OUTPUT_VARIABLE SOLUTION_ROOT) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 0000000..4024b20 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,16 @@ +{ + "registries": [ + { + "name": "arm", + "kind": "artifact", + "location": "https://artifacts.tools.arm.com/vcpkg-registry" + } + ], + "requires": { + "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.12.0", + "arm:tools/kitware/cmake": "3.31.5", + "arm:tools/ninja-build/ninja": "1.12.1", + "arm:tools/arm/mdk-toolbox": "1.1.0", + "arm:compilers/arm/armclang": "6.24.0" + } +} \ No newline at end of file