Compare commits

...

18 Commits

38 changed files with 3745 additions and 3965 deletions

23
.vscode/settings.json vendored
View File

@ -1,6 +1,25 @@
{
"files.associations": {
"rte.h": "c",
"sysdiagdetect.h": "c"
}
"sysdiagdetect.h": "c",
"touch_example.h": "c"
},
"MicroPython.executeButton": [
{
"text": "▶",
"tooltip": "运行",
"alignment": "left",
"command": "extension.executeFile",
"priority": 3.5
}
],
"MicroPython.syncButton": [
{
"text": "$(sync)",
"tooltip": "同步",
"alignment": "left",
"command": "extension.execute",
"priority": 4
}
]
}

View File

@ -2,15 +2,15 @@
manifest_file_version: 1.0.0
project: p417_SWTL
creation_date: 2024-07-03T23:36:01.607+08:00[Asia/Shanghai]
creation_date: 2024-12-02T14:09:42.018+08:00[Asia/Shanghai]
operating_system: Windows 10
mcc_mode: IDE
mcc_mode_version: v6.20
device_name: ATSAME51J19A
compiler: XC32 4.40
compiler: XC32 4.10
mcc_version: 5.5.1
mcc_core_version: 5.7.1
content_manager_version: 5.0.0
content_manager_version: 5.0.1
is_mcc_offline: false
is_using_prerelease_versions: false
mcc_content_registries: https://registry.npmjs.org/

View File

@ -2,15 +2,15 @@
manifest_file_version: 1.0.0
project: p417_SWTL
creation_date: 2024-07-03T23:36:01.335+08:00[Asia/Shanghai]
creation_date: 2024-12-02T14:05:58.700+08:00[Asia/Shanghai]
operating_system: Windows 10
mcc_mode: IDE
mcc_mode_version: v6.20
device_name: ATSAME51J19A
compiler: XC32 4.40
compiler: XC32 4.10
mcc_version: 5.5.1
mcc_core_version: 5.7.1
content_manager_version: 5.0.0
content_manager_version: 5.0.1
is_mcc_offline: false
is_using_prerelease_versions: false
mcc_content_registries: https://registry.npmjs.org/

View File

@ -1,13 +1,13 @@
#
#Thu Jul 04 08:57:29 CST 2024
#Mon Dec 02 16:32:28 CST 2024
mcal.com-microchip-mplab-nbide-toolchain-xc32-XC32LanguageToolchain.md5=1eaf555a844840d91945cb14109201c3
conf.ids=mcal
mcal.languagetoolchain.version=4.40
host.id=2546-oaqf-3d
configurations-xml=661120bd695433875151b59a1b61be69
mcal.Pack.dfplocation=C\:\\Users\\sunbeam\\.mchp_packs\\Microchip\\SAME51_DFP\\3.5.104
mcal.languagetoolchain.version=4.10
host.id=124p-5vo2-40
configurations-xml=640df2878c10379dda3b63efc3e1be79
mcal.Pack.dfplocation=E\:\\Program Files\\Microchip\\MPLABX\\v6.20\\packs\\Microchip\\SAME51_DFP\\3.7.242
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=f612087c95360c842296d189edfe3321
proj.dir=F\:\\work\\P417\\20240702\\P417_SWTL\\firmware\\p417_SWTL.X
proj.dir=F\:\\FCB_project\\P417\\CODE\\20240727HW06\\P417_SWTL\\firmware\\p417_SWTL.X
mcal.platformTool.md5=null
mcal.languagetoolchain.dir=C\:\\Program Files\\Microchip\\xc32\\v4.40\\bin
mcal.languagetoolchain.dir=E\:\\Program Files\\Microchip\\xc32\\v4.10\\bin
host.platform=windows

View File

@ -15,11 +15,11 @@
# $ makeMP_CC="/opt/microchip/mplabc30/v3.30c/bin/pic30-gcc" ...
#
SHELL=cmd.exe
PATH_TO_IDE_BIN=E:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/
PATH_TO_IDE_BIN=E:/Program Files/Microchip/MPLABX/v6.20/mplab_platform/platform/../mplab_ide/modules/../../bin/
# Adding MPLAB X bin directory to path.
PATH:=E:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH)
PATH:=E:/Program Files/Microchip/MPLABX/v6.20/mplab_platform/platform/../mplab_ide/modules/../../bin/:$(PATH)
# Path to java used to run MPLAB X when this makefile was created
MP_JAVA_PATH="E:\Program Files\Microchip\MPLABX\v6.00\sys\java\zulu8.54.0.21-ca-fx-jre8.0.292-win_x64/bin/"
MP_JAVA_PATH="E:\Program Files\Microchip\MPLABX\v6.20\sys\java\zulu8.64.0.19-ca-fx-jre8.0.345-win_x64/bin/"
OS_CURRENT="$(shell uname -s)"
MP_CC="E:\Program Files\Microchip\xc32\v4.10\bin\xc32-gcc.exe"
MP_CPPC="E:\Program Files\Microchip\xc32\v4.10\bin\xc32-g++.exe"
@ -27,13 +27,12 @@ MP_CPPC="E:\Program Files\Microchip\xc32\v4.10\bin\xc32-g++.exe"
MP_AS="E:\Program Files\Microchip\xc32\v4.10\bin\xc32-as.exe"
MP_LD="E:\Program Files\Microchip\xc32\v4.10\bin\xc32-ld.exe"
MP_AR="E:\Program Files\Microchip\xc32\v4.10\bin\xc32-ar.exe"
DEP_GEN=${MP_JAVA_PATH}java -jar "E:/Program Files/Microchip/MPLABX/v6.00/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
DEP_GEN=${MP_JAVA_PATH}java -jar "E:/Program Files/Microchip/MPLABX/v6.20/mplab_platform/platform/../mplab_ide/modules/../../bin/extractobjectdependencies.jar"
MP_CC_DIR="E:\Program Files\Microchip\xc32\v4.10\bin"
MP_CPPC_DIR="E:\Program Files\Microchip\xc32\v4.10\bin"
# MP_BC_DIR is not defined
MP_AS_DIR="E:\Program Files\Microchip\xc32\v4.10\bin"
MP_LD_DIR="E:\Program Files\Microchip\xc32\v4.10\bin"
MP_AR_DIR="E:\Program Files\Microchip\xc32\v4.10\bin"
# MP_BC_DIR is not defined
DFP_DIR=E:/Program Files/Microchip/MPLABX/v6.00/packs/Microchip/SAME51_DFP/3.5.104
CMSIS_DIR=E:/Program Files/Microchip/MPLABX/v6.00/packs/arm/CMSIS/5.4.0
DFP_DIR=E:/Program Files/Microchip/MPLABX/v6.20/packs/Microchip/SAME51_DFP/3.7.242
CMSIS_DIR=C:/Users/dm01/.mchp_packs/ARM/CMSIS/5.8.0

File diff suppressed because it is too large Load Diff

View File

@ -497,8 +497,8 @@
<platform>3</platform>
</toolsSet>
<packs>
<pack name="SAME51_DFP" vendor="Microchip" version="3.5.104"/>
<pack name="CMSIS" vendor="ARM" version="5.4.0"/>
<pack name="SAME51_DFP" vendor="Microchip" version="3.7.242"/>
<pack name="CMSIS" vendor="ARM" version="5.8.0"/>
</packs>
<ScriptingSettings>
</ScriptingSettings>
@ -558,6 +558,7 @@
<C32>
<property key="additional-warnings" value="false"/>
<property key="addresss-attribute-use" value="false"/>
<property key="appendMe" value=""/>
<property key="enable-app-io" value="false"/>
<property key="enable-omit-frame-pointer" value="false"/>
<property key="enable-symbols" value="true"/>
@ -614,6 +615,7 @@
<property key="additional-options-use-response-files" value="false"/>
<property key="additional-options-write-sla" value="false"/>
<property key="allocate-dinit" value="false"/>
<property key="appendMe" value=""/>
<property key="code-dinit" value="false"/>
<property key="ebase-addr" value=""/>
<property key="enable-check-sections" value="false"/>
@ -653,6 +655,7 @@
<C32CPP>
<property key="additional-warnings" value="false"/>
<property key="addresss-attribute-use" value="false"/>
<property key="appendMe" value=""/>
<property key="check-new" value="false"/>
<property key="eh-specs" value="true"/>
<property key="enable-app-io" value="false"/>
@ -681,6 +684,7 @@
<property key="use-indirect-calls" value="false"/>
</C32CPP>
<C32Global>
<property key="appendMe" value=""/>
<property key="common-include-directories" value=""/>
<property key="gp-relative-option" value=""/>
<property key="legacy-libc" value="false"/>

View File

@ -10,7 +10,7 @@
<cpp-extensions/>
<header-extensions>h</header-extensions>
<asminc-extensions/>
<sourceEncoding>ISO-8859-1</sourceEncoding>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects/>
<sourceRootList>
<sourceRootElem>../src</sourceRootElem>

View File

@ -232,6 +232,17 @@
&lt;/Values&gt;
&lt;/adc0&gt;
&lt;/adc0&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="adc0" name="ADC_SAMPCTRL_SAMPLEN"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;adc0&gt;
&lt;adc0 dnOrder=&quot;0&quot; id=&quot;ADC_SAMPCTRL_SAMPLEN&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;4&quot;/&gt;
&lt;/Values&gt;
&lt;/adc0&gt;
&lt;/adc0&gt;
</value>
</entry>
<entry>
@ -837,7 +848,7 @@
&lt;ElementPosition dnOrder=&quot;0&quot; id=&quot;adc0&quot; x=&quot;298&quot; y=&quot;239&quot;/&gt;
&lt;ElementPosition dnOrder=&quot;1&quot; id=&quot;adc1&quot; x=&quot;461&quot; y=&quot;409&quot;/&gt;
&lt;ElementPosition dnOrder=&quot;2&quot; id=&quot;can1&quot; x=&quot;20&quot; y=&quot;213&quot;/&gt;
&lt;ElementPosition dnOrder=&quot;3&quot; id=&quot;cmsis&quot; x=&quot;660&quot; y=&quot;20&quot;/&gt;
&lt;ElementPosition dnOrder=&quot;3&quot; id=&quot;cmsis&quot; x=&quot;350&quot; y=&quot;160&quot;/&gt;
&lt;ElementPosition dnOrder=&quot;4&quot; id=&quot;core&quot; x=&quot;560&quot; y=&quot;19&quot;/&gt;
&lt;ElementPosition dnOrder=&quot;5&quot; id=&quot;dac&quot; x=&quot;25&quot; y=&quot;335&quot;/&gt;
&lt;ElementPosition dnOrder=&quot;6&quot; id=&quot;dfp&quot; x=&quot;340&quot; y=&quot;20&quot;/&gt;
@ -2781,7 +2792,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_10_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y2_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X2_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -2825,7 +2836,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_11_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y3_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X3_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -2869,7 +2880,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_12_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;BL_SNS2&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X4_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -2880,8 +2891,8 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_12_FUNCTION_TYPE&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;ADC1_AIN1&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;ADC0_AIN3/X2/Y2&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;ADC0_AIN3/X2/Y2&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -2914,7 +2925,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_13_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y5_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X5_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -3092,7 +3103,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_16_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y4_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;BL_SNS2&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -3103,7 +3114,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_16_FUNCTION_TYPE&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;ADC0_AIN7/X5/Y5&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;ADC0_AIN7/X5/Y5&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
@ -3871,7 +3882,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_35_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X1_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y1_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -3915,7 +3926,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_36_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X2_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y2_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -3959,7 +3970,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_37_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X3_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y3_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4003,7 +4014,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_38_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X4_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y4_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4114,7 +4125,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_41_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X5_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y5_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4401,7 +4412,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_4_DIR&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Out&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4412,7 +4423,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_4_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Power_AD_Ctrl&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;BL_SNS1&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4424,7 +4435,7 @@
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_4_FUNCTION_TYPE&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;GPIO&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;ADC0_AIN1/X0/Y0/VREFA&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4446,7 +4457,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_4_MODE&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;ANALOG&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4457,7 +4468,18 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_4_PERIPHERAL_FUNCTION&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;GPIO&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;B&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="core" name="PIN_4_PULLEN"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_4_PULLEN&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4871,6 +4893,17 @@
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="core" name="PIN_63_DRVSTR"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_63_DRVSTR&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;0&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
</value>
</entry>
<entry>
@ -4878,7 +4911,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_63_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Y1_SNS&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;Power_AD_Ctrl&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4889,8 +4922,8 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_63_FUNCTION_TYPE&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;ADC0_AIN14/X20/Y20&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;ADC0_AIN14/X20/Y20&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;GPIO&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4912,7 +4945,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_63_MODE&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;ANALOG&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -4923,7 +4956,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_63_PERIPHERAL_FUNCTION&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;B&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;GPIO&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -5057,7 +5090,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_9_FUNCTION_NAME&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;BL_SNS1&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;X1_SNS&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -5068,7 +5101,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PIN_9_FUNCTION_TYPE&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;ADC0_X24/Y24&quot;/&gt;
&lt;User dnOrder=&quot;1&quot; value=&quot;ADC1_AIN8&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
@ -5113,7 +5146,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PORT_GROUP_0_DIR&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x20024cc&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x20024c4&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -5586,7 +5619,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PORT_GROUP_0_PINCFG3&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x0&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x1&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -5938,7 +5971,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PORT_GROUP_0_PMUX1&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x1&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x11&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -6389,7 +6422,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PORT_GROUP_1_PINCFG2&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x1&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x0&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -6741,7 +6774,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;core&gt;
&lt;core dnOrder=&quot;0&quot; id=&quot;PORT_GROUP_1_PMUX1&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x11&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;core&quot; value=&quot;0x10&quot;/&gt;
&lt;/Values&gt;
&lt;/core&gt;
&lt;/core&gt;
@ -8577,6 +8610,17 @@
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="lib_qtouch" name="DEF_CONTACT_THRESHOLD"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;DEF_CONTACT_THRESHOLD&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;120&quot;/&gt;
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
@ -9919,6 +9963,17 @@
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="lib_qtouch" name="ENABLE_FREQ_HOP"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;ENABLE_FREQ_HOP&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;true&quot;/&gt;
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
@ -9972,6 +10027,33 @@
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="lib_qtouch" name="FREQ_HOP_MENU"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;FREQ_HOP_MENU&quot;&gt;
&lt;Attributes dnOrder=&quot;0&quot;&gt;
&lt;Boolean dnOrder=&quot;0&quot; id=&quot;enabled&quot;&gt;
&lt;Value dnOrder=&quot;0&quot;&gt;true&lt;/Value&gt;
&lt;/Boolean&gt;
&lt;Boolean dnOrder=&quot;1&quot; id=&quot;visible&quot;&gt;
&lt;Value dnOrder=&quot;0&quot;&gt;false&lt;/Value&gt;
&lt;/Boolean&gt;
&lt;/Attributes&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="lib_qtouch" name="FREQ_HOP_STEPS"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;FREQ_HOP_STEPS&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;3&quot;/&gt;
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
@ -9990,7 +10072,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;FTL_Y_INFO&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;Y(31),Y(15),Y(17),Y(20),Y(25),Y(1),Y(5),Y(3),Y(10),Y(11),Y(12),Y(13),Y(14),Y(30),Y(21),Y(16)&quot;/&gt;
&lt;Dynamic dnOrder=&quot;0&quot; id=&quot;lib_qtouch&quot; value=&quot;Y(31),Y(15),Y(17),Y(24),Y(25),Y(1),Y(2),Y(3),Y(10),Y(11),Y(12),Y(13),Y(14),Y(30),Y(21),Y(16)&quot;/&gt;
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
@ -10134,7 +10216,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;SELFCAP-INPUT_3&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;20&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;24&quot;/&gt;
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
@ -10167,7 +10249,7 @@
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;SELFCAP-INPUT_6&quot;&gt;
&lt;Values dnOrder=&quot;0&quot;&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;5&quot;/&gt;
&lt;User dnOrder=&quot;0&quot; value=&quot;2&quot;/&gt;
&lt;/Values&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
@ -10639,6 +10721,32 @@
&lt;/Attributes&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="lib_qtouch" name="TOUCH_HOP_HEADER"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;TOUCH_HOP_HEADER&quot;&gt;
&lt;Attributes dnOrder=&quot;0&quot;&gt;
&lt;Boolean dnOrder=&quot;0&quot; id=&quot;enabled&quot;&gt;
&lt;Value dnOrder=&quot;0&quot;&gt;true&lt;/Value&gt;
&lt;/Boolean&gt;
&lt;/Attributes&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="lib_qtouch" name="TOUCH_HOP_LIB"/>
<value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;lib_qtouch&gt;
&lt;lib_qtouch dnOrder=&quot;0&quot; id=&quot;TOUCH_HOP_LIB&quot;&gt;
&lt;Attributes dnOrder=&quot;0&quot;&gt;
&lt;Boolean dnOrder=&quot;0&quot; id=&quot;enabled&quot;&gt;
&lt;Value dnOrder=&quot;0&quot;&gt;true&lt;/Value&gt;
&lt;/Boolean&gt;
&lt;/Attributes&gt;
&lt;/lib_qtouch&gt;
&lt;/lib_qtouch&gt;
</value>
</entry>
<entry>
@ -13219,7 +13327,7 @@
</entry>
<entry>
<file>..\src\config\mcal\definitions.h</file>
<hash>9cbd3ca5ec4eb095b69f02d011146c57a203803096f631317e6ab43683793547</hash>
<hash>fbb6e3f66cce3d8e6c0ba0d7fdf03eec2bf658c523e64e50d327cb9dea68f5ae</hash>
</entry>
<entry>
<file>..\src\config\mcal\device.h</file>
@ -13239,7 +13347,7 @@
</entry>
<entry>
<file>..\src\config\mcal\initialization.c</file>
<hash>634e2706c2ea11a8cf28f1c9edc5fe305ba038d5a2a10d330b8715ec068bc864</hash>
<hash>907ef22262941833932f90f3a4187fedb8c194d5d9507f3c1b4f8f805c1fcbbc</hash>
</entry>
<entry>
<file>..\src\config\mcal\interrupts.c</file>
@ -13335,11 +13443,11 @@
</entry>
<entry>
<file>..\src\config\mcal\peripheral\port\plib_port.c</file>
<hash>120b7e5a5e1a6f667bac3b28dd6f1611223cd5cf87f384de544524c4267344ba</hash>
<hash>8ddc969d7f4902c9705461674abbc8a00dc43760f1107a76b87cfadf8c57ebf4</hash>
</entry>
<entry>
<file>..\src\config\mcal\peripheral\port\plib_port.h</file>
<hash>a1ccf700df0e6b9bbb9f035703f6dfdc031e88ff2b3206b142a307a4102cb447</hash>
<hash>af63ef2161f2af6e8063f5b9b7932555f1246219c7f943e1b8b734705521fb08</hash>
</entry>
<entry>
<file>..\src\config\mcal\peripheral\rtc\plib_rtc.h</file>
@ -13431,7 +13539,7 @@
</entry>
<entry>
<file>..\src\config\mcal\pin_configurations.csv</file>
<hash>f146f81526965692a225cf49d358da18c473bff9eb1c2820e1ab99739cecf113</hash>
<hash>a29e023a26a0fd86bf473152c2ea4e10c9ab330ff7266a9250b1b9b0dd6b5967</hash>
</entry>
<entry>
<file>..\src\config\mcal\startup_xc32.c</file>
@ -13491,7 +13599,7 @@
</entry>
<entry>
<file>..\src\config\mcal\touch\touch.h</file>
<hash>ba956590c9cc24ff3db22526e09459f0064f529b350eeda7213538d6fedf84f8</hash>
<hash>c7758b833a2dc1c2e4346a01cab61a1b806445aa9109f904f59f7d4b4a536972</hash>
</entry>
<entry>
<file>..\src\config\mcal\touch\touch_api_ptc.h</file>

View File

@ -57,7 +57,7 @@
#define GAC_ECU_SN_DEFAULT_VALUE {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20}
#define GAC_APP_SW_LOGICAL_ID {}
#define GAC_BOOT_ID_DEFAULT_VALUE {'4','5','0'}
#define GAC_ECUSW_VERSION_DEFAULT_VALUE {'S','W','0','3','0','3',' ',' ',' ',0x20,0x20,0x20,0x20,0x20,0x20,0x20}
#define GAC_ECUSW_VERSION_DEFAULT_VALUE {'S','W','0','4','0','1',' ',' ',' ',0x20,0x20,0x20,0x20,0x20,0x20,0x20}
#define GAC_APP_SUPPLIER_ID {0x46,0x49,0x43,0x4F,0x53,0x41,0x20,0x49,0x4E,0x54,0x45,0x52,0x4e};

View File

@ -4,6 +4,8 @@
#include "RTE.h"
#include "forcedetect.h"
#include "forceSnsr.h"
#include "Speaker.h"
uint8 Touch_Sensor_Fault=0,Touch_Sensor_Fault_key1=0,Touch_Sensor_Fault_key2=0,Touch_Sensor_Fault_key3=0,Touch_Sensor_Fault_pad=0;
static uint8 Bat_Rng = 0;
static void Battery_Volt_Diag_Task(void)
@ -76,55 +78,90 @@ static void Force_Sensor_Diag_Task(void)
}
// Touch_Sensor_Sts00;
static uint8 Touch_Sensor_Fault = 0;
static void Touch_Sensor_Diag_Task(void)
{
static uint16_t fault_count = 0, fault_count2 = 0;
//uint16 CurrentDiag_Press_signal;
if (Touch_Sensor_delta00 < 200 && Touch_Sensor_delta01 < 200 && Touch_Sensor_delta02 < 200 && Touch_Sensor_delta13 < 200 && Touch_Sensor_delta14 < 200 && Touch_Sensor_delta15 < 200
&& Touch_Sensor_delta03 < 300 && Touch_Sensor_delta04 < 300 && Touch_Sensor_delta05 < 300 && Touch_Sensor_delta06 < 300 && Touch_Sensor_delta07 < 300
static uint16_t fault_countk1 = 0,fault_countk2 = 0,fault_countk3 = 0, fault_countpad = 0;
//恢复
if (Touch_Sensor_delta00 < 200 && Touch_Sensor_delta13 < 200)
{
Touch_Sensor_Fault_key1 = Touch_NoFault;
fault_countk1 = 0;
}
else
{
fault_countk1++;
if (fault_countk1 > 40)
{
fault_countk1 = 40;
Touch_Sensor_Fault_key1 = Touch_Out_Range;
}
}
//巡航
if (Touch_Sensor_delta01 < 200 && Touch_Sensor_delta14 < 200)
{
Touch_Sensor_Fault_key2 = Touch_NoFault;
fault_countk2 = 0;
}
else
{
fault_countk2++;
if (fault_countk2 > 40)
{
fault_countk2 = 40;
Touch_Sensor_Fault_key2 = Touch_Out_Range;
}
}
//取消
if (Touch_Sensor_delta02 < 200 && Touch_Sensor_delta15 < 200)
{
Touch_Sensor_Fault_key3 = Touch_NoFault;
fault_countk3 = 0;
}
else
{
fault_countk3++;
if (fault_countk3 > 40)
{
fault_countk3 = 40;
Touch_Sensor_Fault_key3 = Touch_Out_Range;
}
}
//PAD
if (Touch_Sensor_delta03 < 300 && Touch_Sensor_delta04 < 300 && Touch_Sensor_delta05 < 300 && Touch_Sensor_delta06 < 300 && Touch_Sensor_delta07 < 300
&& Touch_Sensor_delta08 < 300 && Touch_Sensor_delta09 < 300 && Touch_Sensor_delta10 < 300 && Touch_Sensor_delta11 < 300 && Touch_Sensor_delta12 < 300)
{
Touch_Sensor_Fault_pad = Touch_NoFault;
fault_countpad = 0;
}
else
{
fault_countpad++;
if (fault_countpad > 40)
{
fault_countpad = 40;
Touch_Sensor_Fault_pad = Touch_Out_Range;
}
}
if (Touch_Sensor_Fault_key1 == Touch_NoFault &&
Touch_Sensor_Fault_key2 == Touch_NoFault &&
Touch_Sensor_Fault_key3 == Touch_NoFault &&
Touch_Sensor_Fault_pad == Touch_NoFault )
{
Touch_Sensor_Fault = Touch_NoFault;
InitMessage(SIG_DIAGCFAILRTOUCHPANSWTLTOUCHDFLTSTS, &Touch_Sensor_Fault);
fault_count = 0;
}
else
{
Touch_Sensor_Fault = Touch_Out_Range;
InitMessage(SIG_DIAGCFAILRTOUCHPANSWTLTOUCHDFLTSTS, &Touch_Sensor_Fault);
fault_count++;
if (fault_count > 200)
{
fault_count = 0;
//touch_init();
}
}
/*
CurrentDiag_Press_signal = Get_forcedetect_force_value();
if (CurrentDiag_Press_signal < 50)
{
if (Touch_Sensor_delta00 > 10 || Touch_Sensor_delta01 > 10 || Touch_Sensor_delta02 > 10 || Touch_Sensor_delta13 > 10 || Touch_Sensor_delta14 > 10 || Touch_Sensor_delta15 > 10
|| Touch_Sensor_delta03 > 20 || Touch_Sensor_delta04 > 20 || Touch_Sensor_delta05 > 20 || Touch_Sensor_delta06 > 20 || Touch_Sensor_delta07 > 20
|| Touch_Sensor_delta08 > 20 || Touch_Sensor_delta09 > 20 || Touch_Sensor_delta10 > 20 || Touch_Sensor_delta11 > 20 || Touch_Sensor_delta12 > 20)
{
fault_count2++;
if (fault_count2 > 200)
{
fault_count2 = 0;
//touch_init();
}
}
else
{
fault_count2 = 0;
}
}
else
{
fault_count2 = 0;
}
*/
}
extern uint8_t Allow_Touch_flag;//todo
@ -133,25 +170,8 @@ static void Vibration_Diag_Task(void)
{
// AD_data=voltage * 4096/3.3V normal:0-0.01(15) short: 0.15(185)-0.36(448) 0.6(742)-0.7(870) 0.95(1177)-1.05(1305) 1.27(1575)-1.39(1727) open:1.55(1921) - 1.72(2136)
Vibra_Fault = Vibration_Normal;//todo Allow_Touch_flag
Vibra_Fault = Get_Speaker_Fault();//
InitMessage(SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS, &Vibra_Fault);
/*
if(LD_AD_Val>=0 && LD_AD_Val<=15) //normal
{
Vibra_Fault = Vibration_Normal;
InitMessage(SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS, &Vibra_Fault);
}
else if((LD_AD_Val>=185 && LD_AD_Val<=448)||(LD_AD_Val>=742 && LD_AD_Val<=870)||(LD_AD_Val>=1177 && LD_AD_Val<=1305)||(LD_AD_Val>=1575 && LD_AD_Val<=1727))
{
Vibra_Fault = Vibration_Short;
InitMessage(SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS, &Vibra_Fault);
}
else if(LD_AD_Val>=1921 && LD_AD_Val<=2136)
{
Vibra_Fault = Vibration_open;
InitMessage(SIG_DIAGCFAILRTOUCHPANSWTLVIBRATIONFLTSTS, &Vibra_Fault);
}
*/
}
void Sys_Diag_Detcet_Task(void)

View File

@ -17,6 +17,7 @@ extern uint8 Force_Sens_Err;
//extern uint8 Fuction_State ;
//extern uint8 Control_SDZ ;
extern uint8 Touch_Sensor_Fault,Touch_Sensor_Fault_key1,Touch_Sensor_Fault_key2,Touch_Sensor_Fault_key3,Touch_Sensor_Fault_pad;
extern void Sys_Diag_Detcet_Task(void);

View File

@ -223,6 +223,8 @@ typedef unsigned char UI_8;
#define DID_PRESEE_SEN_SIGNAL ((UI_16)0x7021)
#define DID_PRESEE_SEN_PRE_VAL ((UI_16)0x7022)
#define DID_RESET_SOURCE ((UI_16)0x7030)
/*--------------------------- Global variables ---------------------------- */
//#pragma push

View File

@ -78,10 +78,10 @@ typedef struct{
* Private variables
*/
const UI_8 NVM_DID_CD_VIN[DLC_DID_CD_VIN] = GAC_VIN_DEFAULT_VALUE;
const UI_8 NVM_Reprogramming_Date_App[DLC_DID_REPROGRAMMING_DATE] = {0x20,0x24,0x07,0x22};
const UI_8 NVM_DID_CD_SUPPLIER_ID[DLC_SYSTEM_SUPPLIER_ID] = {'2','4','0','7','2','2'};
const UI_8 NVM_Reprogramming_Date_App[DLC_DID_REPROGRAMMING_DATE] = {0x20,0x24,0x12,0x02};
const UI_8 NVM_DID_CD_SUPPLIER_ID[DLC_SYSTEM_SUPPLIER_ID] = {'2','4','1','2','0','2'};
const UI_8 NVM_Repair_Shop_Code[DLC_REPAIR_SHOP_CODE] = GAC_ECU_REPAIR_SHOP_CODE;
const UI_8 NVM_DID_CD_HW_VERSION[DLC_GAC_HW_VERSION] = {'H','W','0','5',0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20};
const UI_8 NVM_DID_CD_HW_VERSION[DLC_GAC_HW_VERSION] = {'H','W','0','6',0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20};
static uint8 RAM_DID_CD_VIN[DLC_DID_CD_VIN];
static uint8 RAM_DID_CD_REPROGRAMMING_DATE[DLC_DID_REPROGRAMMING_DATE];
static uint8 RAM_DID_CD_SUPPLIER_ID[DLC_SYSTEM_SUPPLIER_ID];
@ -570,6 +570,16 @@ t_UDS_ERR Get_DID_Pre_Value(uint8 *data)
return ISO15765_3_POSITIVE_RESPONSE;
}
t_UDS_ERR Get_DID_ResetSource(uint8 *data)
{
uint8_t reset_source_buf[20];
SmartEE_Read(0x400,reset_source_buf,20);
memcpy(data,reset_source_buf,20);
return ISO15765_3_POSITIVE_RESPONSE;
}
t_UDS_ERR Get_DID_Reprogramming_Date(uint8 *data)
{
//memcpy(data, RAM_DID_CD_REPROGRAMMING_DATE, sizeof(RAM_DID_CD_REPROGRAMMING_DATE));
@ -813,7 +823,8 @@ t_UDS_ERR Get_DID_GAC_Repair_Shop_Id(uint8 *data)
{
//memcpy(data, RAM_DID_REPAIR_SHOP_CODE,DLC_REPAIR_SHOP_CODE);
SmartEE_Read(0x51B, data, 16);
return ISO15765_3_POSITIVE_RESPONSE;
return ISO15765_3_POSITIVE_RESPONSE;
}

View File

@ -218,6 +218,7 @@ t_UDSReadDidSubCommands uds_did_read_commands[] =
{ DID_PRESEE_SEN_BASELINE , 2, UDS_DEFAULT_SESSION, Get_DID_PressSen_Baseline },
{ DID_PRESEE_SEN_SIGNAL , 2, UDS_DEFAULT_SESSION, Get_DID_PressSen_Signal },
{ DID_PRESEE_SEN_PRE_VAL , 2, UDS_DEFAULT_SESSION, Get_DID_Pre_Value },
{DID_RESET_SOURCE , 20, UDS_DEFAULT_SESSION , Get_DID_ResetSource },
{DID_FUN1, 2, UDS_DEFAULT_SESSION, Get_DID_Fun1},

View File

@ -159,6 +159,7 @@ t_UDS_ERR Get_DID_TouchSen13_Signal(uint8 *data);
t_UDS_ERR Get_DID_PressSen_Baseline(uint8 *data);
t_UDS_ERR Get_DID_PressSen_Signal(uint8 *data);
t_UDS_ERR Get_DID_Pre_Value(uint8 *data);
t_UDS_ERR Get_DID_ResetSource(uint8 *data);
t_UDS_ERR Get_DID_CD_SYSID_CALIRATION_DATE(uint8 *data);
t_UDS_ERR Set_DID_CD_CALIRATION_DATE(uint8 *data);

View File

@ -1,6 +1,7 @@
#include "FunctionState.h"
#include "plib_port.h"
#include "plib_adc1.h"
#include "plib_adc1.h"
#include "OsekCom.h"
extern uint16 adc[2] ;
uint8 Fuction_State = 1 ;
@ -22,10 +23,13 @@ void FunctionState_Task(void)
if (adcResetFlag == 0)
{
ADC1_Initialize();
ADC1_Enable();
//ADC1_ChannelSelect(ADC_POSINPUT_AIN7, ADC_NEGINPUT_GND);
ADC1_ConversionStart();
return;
}
//InitMessage(SIG_SWTLSENSOR1_BASELINE, &adc[0]);
LD_AD_Val = adc[1];
switch(Fuction_State)

File diff suppressed because it is too large Load Diff

View File

@ -834,5 +834,14 @@ void ResetFlagRxSigDiagnosticFuncAddrReq(void);
void OsekComTask(void);
void OsekComTxReqFrmSwtlPrivateDHUCanFr01(void);
void OsekComTxReqFrmSwtlPrivateDHUCanFr02(void);
#endif
void OsekComSetFR09data(uint8_t data[]);
void OsekComSetFR0Adata(uint8_t data[]);
void OsekComSetFR0Bdata(uint8_t data[]);
void OsekComSetFR0Cdata(uint8_t data[]);
#endif

View File

@ -49,7 +49,7 @@ typedef unsigned char uint8_T;
typedef short int16_T;
typedef unsigned short uint16_T;
typedef int int32_T;
typedef unsigned int uint32_T;
typedef long unsigned int uint32_T;
typedef float real32_T;
typedef double real64_T;

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,7 @@ STATE_UINT16 speaker_cycle_u16;
speaker_ctrl_Str speaker_ctrl_buf_str;
static uint8_t DAC_Initialize_status = 0;
static uint8_t DAC_Initialize_RetryCnt = 3;
static uint8_t speaker_fault_status = 0;
/************************************
Get Sw Fifo empty condition
************************************/
@ -166,6 +167,8 @@ void speaker_MainTask(void)
//SA51024_Set_State(SA51024_STOP,speaker_ctrl_buf_str.strenght);
PORT_PinWrite(PORT_PIN_PA13,0);/*SHUTDOWN = 1turn on chip*/
PORT_PinWrite(PORT_PIN_PA25,0);
PORT_PinPeripheralFunctionConfig(PORT_PIN_PA02,PERIPHERAL_FUNCTION_B);
DAC_REGS->DAC_CTRLA |= DAC_CTRLA_ENABLE_Msk;
speaker_set_strenght(SA51024_STRENGTH_LEVEL0);
speaker_main_state_str = SPEAKER_INIT_CYCLE;
speaker_cycle_u16 = 0;
@ -178,7 +181,7 @@ void speaker_MainTask(void)
if(speaker_cycle_u16++ >= ((SPEAKER_INTERVAL_CYCLE_TIMES)/(SPEAKER_TASK_PERIOD)))
{
DAC_REGS->DAC_CTRLA &= ~DAC_CTRLA_ENABLE_Msk;
//DAC_REGS->DAC_CTRLA &= ~DAC_CTRLA_ENABLE_Msk;
PORT_PinGPIOConfig(PORT_PIN_PA02);
speaker_main_state_str = SPEAKER_IDLE;
}
@ -211,9 +214,9 @@ void speaker_MainTask(void)
case SPEAKER_START:
{
PORT_PinPeripheralFunctionConfig(PORT_PIN_PA02,PERIPHERAL_FUNCTION_B);
PORT_PinWrite(PORT_PIN_PA25,0);
DAC_REGS->DAC_CTRLA |= DAC_CTRLA_ENABLE_Msk;
SA51024_Set_State(SA51024_WORKING,speaker_ctrl_buf_str.strenght);
speaker_cycle_u16 = 0;
speaker_main_state_str = SPEAKER_UPDATE_CYCLE;
@ -225,7 +228,14 @@ void speaker_MainTask(void)
if(speaker_cycle_u16 >= SA51024_WAVE_MAX_NUM)
{
speaker_main_state_str = SPEAKER_STOP;
speaker_fault_status = 0;
}
if (PORT_PinRead(FAULT_OUT_PIN) == false)
{
speaker_main_state_str = SPEAKER_STOP;
speaker_fault_status = 1;
}
break;
default:
@ -240,7 +250,7 @@ void speaker_MainTask(void)
/* Disable DAC */
// DAC_REGS->DAC_CTRLA &= ~DAC_CTRLA_ENABLE_Msk;
PORT_PinGPIOConfig(PORT_PIN_PA02);
//PORT_PinGPIOConfig(PORT_PIN_PA02);
}
break;
@ -282,5 +292,9 @@ Speaker_main_e_typ Get_Speaker_Main_State(void)
return speaker_main_state_str;
}
uint8_t Get_Speaker_Fault(void)
{
return speaker_fault_status;
}

View File

@ -51,7 +51,7 @@ extern void speaker_Init(void);
extern void speaker_MainTask(void);
extern STATE_UINT8 speeker_Tig_Once(uint16_t cycle_time,FA51024_ctrl_e_typ level);
extern Speaker_main_e_typ Get_Speaker_Main_State(void);
extern uint8_t Get_Speaker_Fault(void);
/***************************extern function end************************************/

View File

@ -36,15 +36,15 @@
#define CW_BUS_CTRL_2 (0x0) /*decimal 0*/
#define CW_GPIO_CTRL (0x0) /*decimal 0*/
#define CW_GPIO_CTRL (0x24) /*decimal 36*/
#define CW_HS_CTRL1 (0x0) /*decimal 0*/
#define CW_HS_CTRL2 (0x0) /*decimal 0*/
#define CW_HW_CTRL (0x80) /*decimal 128*/
#define CW_HW_CTRL (0x9) /*decimal 9*/
#define CW_M_S_CTRL (0x18) /*decimal 8*/
#define CW_M_S_CTRL (0x1C) /*decimal 28*/
#define CW_PWM1_CTRL (0x0) /*decimal 0*/
@ -92,15 +92,15 @@
#define CW_TIMER2_CTRL (0x0) /*decimal 0*/
#define CW_WD_CTRL (0x4) /*decimal 4*/
#define CW_WD_CTRL (0x84) /*decimal 132*/
#define CW_WK_CTRL_1 (0x0) /*decimal 0*/
#define CW_WK_CTRL_2 (0x7) /*decimal 7*/
#define CW_WK_CTRL_2 (0x0) /*decimal 0*/
#define CW_WK_FLT_CTRL (0x0) /*decimal 0*/
#define CW_WK_PUPD_CTRL (0x3F) /*decimal 63*/
#define CW_WK_PUPD_CTRL (0x0) /*decimal 0*/
#define LED_EXTENDED_ID (0x1) /*decimal 1*/
@ -120,6 +120,6 @@
#define UI_SWK_MASK_IDx_CTRL 0x00000000
#define UI_VARIANT (0x3) /*decimal 3*/
#define UI_VARIANT (0x5) /*decimal 5*/
#endif /* SBC_TLE926X_H */

View File

@ -206,11 +206,14 @@ SBC_ErrorCode sbc_init(void) {
/* Describes initialization sequence.
init Sequence containing {reg_address, reg_value}*/
uint8_t initSequence[4][2] = {
uint8_t initSequence[8][2] = {
{SBC_WD_CTRL, WD_CTRL},//0x04 TimeOut; 200ms period
{SBC_M_S_CTRL, CW_M_S_CTRL},//0x18 SBC normal;vcc3off;vcc2 on in normal;
{SBC_BUS_CTRL_1, CW_BUS_CTRL_1},//0x03 lin off; can normal
{SBC_WK_CTRL_2, CW_WK_CTRL_2},
{SBC_HW_CTRL, CW_HW_CTRL},
{SBC_GPIO_CTRL, CW_GPIO_CTRL},
{SBC_WK_PUPD_CTRL, CW_WK_PUPD_CTRL},
/* End Configuration */
{0x00U, 0x00U}
};

View File

@ -1,24 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<icwpxml version="2.6.4">
<checksum>938a5187cdcc759f78b6bae262f689a50c384e539a95618defe57f554fa7fafd</checksum>
<checksum>b31f5011f3959a9e7cc2c9ca70f9a9d697b17587a54185c423e628478807656e</checksum>
<XmlFile>TLE926x_Lib.xml</XmlFile>
<XmlVersion>V0.0.1</XmlVersion>
<ActiveElements>
<CheckBox>
<define>CW.M_S_CTRL[2]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<ComboBox>
<define>CW.M_S_CTRL[1:0]</define>
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<CheckBox>
<define>CW.HW_CTRL[3]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.HW_CTRL[1]</define>
<value>0</value>
@ -34,21 +24,11 @@
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<CheckBox>
<define>CW.BUS_CTRL_1[5]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<CheckBox>
<define>CW.BUS_CTRL_1[6]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.BUS_CTRL_1[7]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>MATH.EN_PN</define>
<value>0</value>
@ -79,11 +59,6 @@
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<Slider>
<define>CW.SWK_BTL2_CTRL[5:0]</define>
<value>0</value>
<dispValue>0</dispValue>
</Slider>
<CheckBox>
<define>CW.SWK_ID0_CTRL[0]</define>
<value>0</value>
@ -114,16 +89,6 @@
<value>0x00000000</value>
<dispValue>0x00000000</dispValue>
</LineEdit>
<ComboBox>
<define>CW.GPIO_CTRL[2:0]</define>
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<ComboBox>
<define>CW.GPIO_CTRL[5:3]</define>
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<ComboBox>
<define>CW.GPIO_CTRL[7:6]</define>
<value>0</value>
@ -134,11 +99,6 @@
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.HW_CTRL[0]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.HW_CTRL[5]</define>
<value>0</value>
@ -164,21 +124,6 @@
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.WK_CTRL_2[0]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<CheckBox>
<define>CW.WK_CTRL_2[1]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<CheckBox>
<define>CW.WK_CTRL_2[2]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<ComboBox>
<define>CW.WK_FLT_CTRL[1:0]</define>
<value>0</value>
@ -279,50 +224,105 @@
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<ButtonGroup>
<define>UI.VARIANT</define>
<value>3</value>
<dispValue>3</dispValue>
</ButtonGroup>
<ButtonGroup>
<define>CW.M_S_CTRL[4:3]</define>
<value>1</value>
<dispValue>1</dispValue>
</ButtonGroup>
<ComboBox>
<define>CW.BUS_CTRL_1[2:0]</define>
<value>3</value>
<dispValue>3</dispValue>
</ComboBox>
<ComboBox>
<define>CW.BUS_CTRL_1[4:3]</define>
<value>3</value>
<dispValue>3</dispValue>
</ComboBox>
<ComboBox>
<define>CW.WD_CTRL[2:0]</define>
<value>6</value>
<dispValue>6</dispValue>
</ComboBox>
<CheckBox>
<define>CW.HW_CTRL[7]</define>
<value>1</value>
<dispValue>0</dispValue>
</CheckBox>
<ComboBox>
<define>CW.BUS_CTRL_1[4:3]</define>
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<ButtonGroup>
<define>UI.VARIANT</define>
<value>5</value>
<dispValue>5</dispValue>
</ButtonGroup>
<ComboBox>
<define>CW.GPIO_CTRL[2:0]</define>
<value>4</value>
<dispValue>4</dispValue>
</ComboBox>
<ComboBox>
<define>CW.GPIO_CTRL[5:3]</define>
<value>4</value>
<dispValue>4</dispValue>
</ComboBox>
<CheckBox>
<define>CW.M_S_CTRL[2]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<ButtonGroup>
<define>CW.M_S_CTRL[4:3]</define>
<value>3</value>
<dispValue>3</dispValue>
</ButtonGroup>
<CheckBox>
<define>CW.HW_CTRL[3]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<CheckBox>
<define>CW.BUS_CTRL_1[5]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.BUS_CTRL_1[7]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<Slider>
<define>CW.SWK_BTL2_CTRL[5:0]</define>
<value>52</value>
<dispValue>52</dispValue>
</Slider>
<CheckBox>
<define>CW.HW_CTRL[0]</define>
<value>1</value>
<dispValue>1</dispValue>
</CheckBox>
<ComboBox>
<define>CW.WD_CTRL[2:0]</define>
<value>4</value>
<dispValue>4</dispValue>
</ComboBox>
<CheckBox>
<define>CW.WK_CTRL_2[0]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.WK_CTRL_2[1]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<CheckBox>
<define>CW.WK_CTRL_2[2]</define>
<value>0</value>
<dispValue>0</dispValue>
</CheckBox>
<ComboBox>
<define>CW.WK_PUPD_CTRL[1:0]</define>
<value>3</value>
<dispValue>3</dispValue>
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<ComboBox>
<define>CW.WK_PUPD_CTRL[3:2]</define>
<value>3</value>
<dispValue>3</dispValue>
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
<ComboBox>
<define>CW.WK_PUPD_CTRL[5:4]</define>
<value>3</value>
<dispValue>3</dispValue>
<value>0</value>
<dispValue>0</dispValue>
</ComboBox>
</ActiveElements>
</icwpxml>

File diff suppressed because it is too large Load Diff

View File

@ -23,25 +23,11 @@
#define TOUCH_KET_ON 1
#define TOUCH_KET_OFF 0
typedef enum
{
TP_SlideDirection_NONE = 0,
TP_SlideDirection_ShortUP,
TP_SlideDirection_LongUP,
TP_SlideDirection_ShortDOWN,
TP_SlideDirection_LongDOWN,
TP_SlideDirection_ShortLEFT,
TP_SlideDirection_LongLEFT,
TP_SlideDirection_ShortRIGHT,
TP_SlideDirection_LongRIGHT
} TP_SlideDirection_Enum;
typedef enum{
TOUCH_PANEL_NONE_EVENT = 0,
TOUCH_PANEL_PRESS_EVENT,
TOUCH_PANEL_RES_EVENT,
TOUCH_PANEL_MOVE_EVENT,
TOUCH_PANEL_BERR_EVENT
}TouchPanel_EventType;
typedef enum{
@ -51,24 +37,8 @@ typedef enum{
}PanelPress_LevelType;
typedef struct{
boolean Event;
uint32 keep_cycle;
TP_SlideDirection_Enum Direction;
}TouchSlideEvent_type;
typedef struct{
uint8 x_position;
uint8 y_position;
uint8 origin_x_pos;
uint8 origin_y_pos;
uint8 end_x_pos;
uint8 end_y_pos;
TouchPanel_EventType Event;
uint32 CheckCycle;
uint32 TouchCycle;
}TouchSurface_type;
typedef struct{
uint8 convert_x;
@ -122,7 +92,7 @@ void TouchPanel_init(void);
void GetSurface_Position(uint8 *x, uint8 *y);
Buttons_SignalType TouchPanel_BtnSignalRead(Buttons_ChType ChId);
void TouchPanel_MainFunction(void);
TP_SlideDirection_Enum TouchPanel_SlideEventRead(void);
Buttons_SignalType TouchSurface_XY_StsRead(void);
PanelPress_LevelType TouchPanel_PressLevelRead(void);
boolean TouchSurface_is_TouchActive(void);

View File

@ -50,8 +50,8 @@
#include <stdbool.h>
#include "peripheral/nvmctrl/plib_nvmctrl.h"
#include "peripheral/sercom/i2c_master/plib_sercom1_i2c_master.h"
#include "peripheral/evsys/plib_evsys.h"
#include "peripheral/sercom/spi_master/plib_sercom0_spi_master.h"
#include "peripheral/evsys/plib_evsys.h"
#include "peripheral/can/plib_can1.h"
#include "peripheral/port/plib_port.h"
#include "peripheral/clock/plib_clock.h"
@ -60,9 +60,9 @@
#include "peripheral/wdt/plib_wdt.h"
#include "peripheral/cmcc/plib_cmcc.h"
#include "peripheral/tc/plib_tc1.h"
#include "touch/touch.h"
#include "peripheral/rtc/plib_rtc.h"
#include "peripheral/tc/plib_tc0.h"
#include "touch/touch.h"
#include "peripheral/tc/plib_tc2.h"
#include "peripheral/dac/plib_dac.h"
#include "peripheral/tcc/plib_tcc0.h"

View File

@ -4,14 +4,14 @@
project: P417_SWTL
creation_date: 2024-07-03T23:36:01.380+08:00[Asia/Shanghai] # ISO 8601 format: https://www.w3.org/TR/NOTE-datetime
creation_date: 2024-12-02T14:05:58.826+08:00[Asia/Shanghai] # ISO 8601 format: https://www.w3.org/TR/NOTE-datetime
operating_system: Windows 10
mcc_mode: IDE # [IDE|Standalone|Headless]
mcc_version: v5.5.1
mcc_core_version: v5.7.1
mplabx_version: v6.20 # if MPLAB X plugin only
harmony_version: v1.5.2
compiler: XC32 4.40
compiler: XC32 4.10
modules:
- {name: "csp", version: "v3.18.5"}

View File

@ -140,10 +140,10 @@ void SYS_Initialize ( void* data )
SERCOM1_I2C_Initialize();
EVSYS_Initialize();
SERCOM0_SPI_Initialize();
EVSYS_Initialize();
CAN1_Initialize();
SYSTICK_TimerInitialize();

View File

@ -71,12 +71,12 @@
void PORT_Initialize(void)
{
/************************** GROUP 0 Initialization *************************/
PORT_REGS->GROUP[0].PORT_DIR = 0x20024ccU;
PORT_REGS->GROUP[0].PORT_DIR = 0x20024c4U;
PORT_REGS->GROUP[0].PORT_OUT = 0x2000400U;
PORT_REGS->GROUP[0].PORT_PINCFG[0] = 0x1U;
PORT_REGS->GROUP[0].PORT_PINCFG[1] = 0x1U;
PORT_REGS->GROUP[0].PORT_PINCFG[2] = 0x1U;
PORT_REGS->GROUP[0].PORT_PINCFG[3] = 0x0U;
PORT_REGS->GROUP[0].PORT_PINCFG[3] = 0x1U;
PORT_REGS->GROUP[0].PORT_PINCFG[4] = 0x1U;
PORT_REGS->GROUP[0].PORT_PINCFG[5] = 0x1U;
PORT_REGS->GROUP[0].PORT_PINCFG[6] = 0x1U;
@ -98,7 +98,7 @@ void PORT_Initialize(void)
PORT_REGS->GROUP[0].PORT_PINCFG[25] = 0x0U;
PORT_REGS->GROUP[0].PORT_PMUX[0] = 0x33U;
PORT_REGS->GROUP[0].PORT_PMUX[1] = 0x1U;
PORT_REGS->GROUP[0].PORT_PMUX[1] = 0x11U;
PORT_REGS->GROUP[0].PORT_PMUX[2] = 0x41U;
PORT_REGS->GROUP[0].PORT_PMUX[3] = 0x14U;
PORT_REGS->GROUP[0].PORT_PMUX[4] = 0x22U;
@ -114,7 +114,7 @@ void PORT_Initialize(void)
PORT_REGS->GROUP[1].PORT_DIR = 0x4000c004U;
PORT_REGS->GROUP[1].PORT_PINCFG[0] = 0x3U;
PORT_REGS->GROUP[1].PORT_PINCFG[1] = 0x1U;
PORT_REGS->GROUP[1].PORT_PINCFG[2] = 0x1U;
PORT_REGS->GROUP[1].PORT_PINCFG[2] = 0x0U;
PORT_REGS->GROUP[1].PORT_PINCFG[3] = 0x3U;
PORT_REGS->GROUP[1].PORT_PINCFG[4] = 0x1U;
PORT_REGS->GROUP[1].PORT_PINCFG[5] = 0x1U;
@ -131,7 +131,7 @@ void PORT_Initialize(void)
PORT_REGS->GROUP[1].PORT_PINCFG[31] = 0x3U;
PORT_REGS->GROUP[1].PORT_PMUX[0] = 0x11U;
PORT_REGS->GROUP[1].PORT_PMUX[1] = 0x11U;
PORT_REGS->GROUP[1].PORT_PMUX[1] = 0x10U;
PORT_REGS->GROUP[1].PORT_PMUX[2] = 0x11U;
PORT_REGS->GROUP[1].PORT_PMUX[3] = 0x11U;
PORT_REGS->GROUP[1].PORT_PMUX[4] = 0x11U;

View File

@ -77,14 +77,9 @@
#define INP_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 2U)) & 0x01U)
#define INP_PIN PORT_PIN_PA02
/*** Macros for Power_AD_Ctrl pin ***/
#define Power_AD_Ctrl_Set() (PORT_REGS->GROUP[0].PORT_OUTSET = ((uint32_t)1U << 3U))
#define Power_AD_Ctrl_Clear() (PORT_REGS->GROUP[0].PORT_OUTCLR = ((uint32_t)1U << 3U))
#define Power_AD_Ctrl_Toggle() (PORT_REGS->GROUP[0].PORT_OUTTGL = ((uint32_t)1U << 3U))
#define Power_AD_Ctrl_OutputEnable() (PORT_REGS->GROUP[0].PORT_DIRSET = ((uint32_t)1U << 3U))
#define Power_AD_Ctrl_InputEnable() (PORT_REGS->GROUP[0].PORT_DIRCLR = ((uint32_t)1U << 3U))
#define Power_AD_Ctrl_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 3U)) & 0x01U)
#define Power_AD_Ctrl_PIN PORT_PIN_PA03
/*** Macros for BL_SNS1 pin ***/
#define BL_SNS1_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 3U)) & 0x01U)
#define BL_SNS1_PIN PORT_PIN_PA03
/*** Macros for AD_LDO pin ***/
#define AD_LDO_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 4U)) & 0x01U)
@ -94,25 +89,25 @@
#define LD_OUT_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 5U)) & 0x01U)
#define LD_OUT_PIN PORT_PIN_PB05
/*** Macros for BL_SNS1 pin ***/
#define BL_SNS1_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 6U)) & 0x01U)
#define BL_SNS1_PIN PORT_PIN_PB06
/*** Macros for X1_SNS pin ***/
#define X1_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 6U)) & 0x01U)
#define X1_SNS_PIN PORT_PIN_PB06
/*** Macros for Y2_SNS pin ***/
#define Y2_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 7U)) & 0x01U)
#define Y2_SNS_PIN PORT_PIN_PB07
/*** Macros for X2_SNS pin ***/
#define X2_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 7U)) & 0x01U)
#define X2_SNS_PIN PORT_PIN_PB07
/*** Macros for Y3_SNS pin ***/
#define Y3_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 8U)) & 0x01U)
#define Y3_SNS_PIN PORT_PIN_PB08
/*** Macros for X3_SNS pin ***/
#define X3_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 8U)) & 0x01U)
#define X3_SNS_PIN PORT_PIN_PB08
/*** Macros for BL_SNS2 pin ***/
#define BL_SNS2_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 9U)) & 0x01U)
#define BL_SNS2_PIN PORT_PIN_PB09
/*** Macros for X4_SNS pin ***/
#define X4_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 9U)) & 0x01U)
#define X4_SNS_PIN PORT_PIN_PB09
/*** Macros for Y5_SNS pin ***/
#define Y5_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 4U)) & 0x01U)
#define Y5_SNS_PIN PORT_PIN_PA04
/*** Macros for X5_SNS pin ***/
#define X5_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 4U)) & 0x01U)
#define X5_SNS_PIN PORT_PIN_PA04
/*** Macros for TJP_EN_PWM pin ***/
#define TJP_EN_PWM_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 5U)) & 0x01U)
@ -122,9 +117,9 @@
#define CANCEL_EN_PWM_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 6U)) & 0x01U)
#define CANCEL_EN_PWM_PIN PORT_PIN_PA06
/*** Macros for Y4_SNS pin ***/
#define Y4_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 7U)) & 0x01U)
#define Y4_SNS_PIN PORT_PIN_PA07
/*** Macros for BL_SNS2 pin ***/
#define BL_SNS2_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 7U)) & 0x01U)
#define BL_SNS2_PIN PORT_PIN_PA07
/*** Macros for MOSI pin ***/
#define MOSI_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 8U)) & 0x01U)
@ -190,25 +185,25 @@
#define SDZ_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 13U)) & 0x01U)
#define SDZ_PIN PORT_PIN_PA13
/*** Macros for X1_SNS pin ***/
#define X1_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 16U)) & 0x01U)
#define X1_SNS_PIN PORT_PIN_PA16
/*** Macros for Y1_SNS pin ***/
#define Y1_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 16U)) & 0x01U)
#define Y1_SNS_PIN PORT_PIN_PA16
/*** Macros for X2_SNS pin ***/
#define X2_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 17U)) & 0x01U)
#define X2_SNS_PIN PORT_PIN_PA17
/*** Macros for Y2_SNS pin ***/
#define Y2_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 17U)) & 0x01U)
#define Y2_SNS_PIN PORT_PIN_PA17
/*** Macros for X3_SNS pin ***/
#define X3_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 18U)) & 0x01U)
#define X3_SNS_PIN PORT_PIN_PA18
/*** Macros for Y3_SNS pin ***/
#define Y3_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 18U)) & 0x01U)
#define Y3_SNS_PIN PORT_PIN_PA18
/*** Macros for X4_SNS pin ***/
#define X4_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 19U)) & 0x01U)
#define X4_SNS_PIN PORT_PIN_PA19
/*** Macros for Y4_SNS pin ***/
#define Y4_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 19U)) & 0x01U)
#define Y4_SNS_PIN PORT_PIN_PA19
/*** Macros for X5_SNS pin ***/
#define X5_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 20U)) & 0x01U)
#define X5_SNS_PIN PORT_PIN_PA20
/*** Macros for Y5_SNS pin ***/
#define Y5_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 20U)) & 0x01U)
#define Y5_SNS_PIN PORT_PIN_PA20
/*** Macros for CAP_RES1_SNS pin ***/
#define CAP_RES1_SNS_Get() (((PORT_REGS->GROUP[0].PORT_IN >> 21U)) & 0x01U)
@ -247,9 +242,14 @@
#define CAP_TJP1_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 1U)) & 0x01U)
#define CAP_TJP1_SNS_PIN PORT_PIN_PB01
/*** Macros for Y1_SNS pin ***/
#define Y1_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 2U)) & 0x01U)
#define Y1_SNS_PIN PORT_PIN_PB02
/*** Macros for Power_AD_Ctrl pin ***/
#define Power_AD_Ctrl_Set() (PORT_REGS->GROUP[1].PORT_OUTSET = ((uint32_t)1U << 2U))
#define Power_AD_Ctrl_Clear() (PORT_REGS->GROUP[1].PORT_OUTCLR = ((uint32_t)1U << 2U))
#define Power_AD_Ctrl_Toggle() (PORT_REGS->GROUP[1].PORT_OUTTGL = ((uint32_t)1U << 2U))
#define Power_AD_Ctrl_OutputEnable() (PORT_REGS->GROUP[1].PORT_DIRSET = ((uint32_t)1U << 2U))
#define Power_AD_Ctrl_InputEnable() (PORT_REGS->GROUP[1].PORT_DIRCLR = ((uint32_t)1U << 2U))
#define Power_AD_Ctrl_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 2U)) & 0x01U)
#define Power_AD_Ctrl_PIN PORT_PIN_PB02
/*** Macros for CAP_RES2_SNS pin ***/
#define CAP_RES2_SNS_Get() (((PORT_REGS->GROUP[1].PORT_IN >> 3U)) & 0x01U)

View File

@ -2,17 +2,17 @@ Pin Number,Pin ID,Custom Name,Function,Mode, Direction,Latch,Pull Up,Pull Down,D
1,PA00,SDA,SERCOM1_PAD0,Digital,High Impedance,n/a,No,No,NORMAL
2,PA01,SCL,SERCOM1_PAD1,Digital,High Impedance,n/a,No,No,NORMAL
3,PA02,INP,DAC_VOUT0,Analog,Out,Low,,,NORMAL
4,PA03,Power_AD_Ctrl,GPIO,Digital,Out,Low,,,NORMAL
4,PA03,BL_SNS1,ADC0_AIN1/X0/Y0/VREFA,Analog,High Impedance,n/a,,,NORMAL
5,PB04,AD_LDO,ADC1_AIN6,Analog,High Impedance,n/a,,,NORMAL
6,PB05,LD_OUT,ADC1_AIN7,Analog,High Impedance,n/a,,,NORMAL
9,PB06,BL_SNS1,ADC1_AIN8,Analog,High Impedance,n/a,,,NORMAL
10,PB07,Y2_SNS,ADC0_X25/Y25,Analog,High Impedance,n/a,,,NORMAL
11,PB08,Y3_SNS,ADC0_AIN2/X1/Y1,Analog,High Impedance,n/a,,,NORMAL
12,PB09,BL_SNS2,ADC1_AIN1,Analog,High Impedance,n/a,,,NORMAL
13,PA04,Y5_SNS,ADC0_AIN4/X3/Y3/VREFB,Analog,High Impedance,n/a,,,NORMAL
9,PB06,X1_SNS,ADC1_AIN8,Analog,High Impedance,n/a,,,NORMAL
10,PB07,X2_SNS,ADC0_X25/Y25,Analog,High Impedance,n/a,,,NORMAL
11,PB08,X3_SNS,ADC0_AIN2/X1/Y1,Analog,High Impedance,n/a,,,NORMAL
12,PB09,X4_SNS,ADC0_AIN3/X2/Y2,Analog,High Impedance,n/a,,,NORMAL
13,PA04,X5_SNS,ADC0_AIN4/X3/Y3/VREFB,Analog,High Impedance,n/a,,,NORMAL
14,PA05,TJP_EN_PWM,TC0_WO1,Digital,High Impedance,n/a,No,No,NORMAL
15,PA06,CANCEL_EN_PWM,TC1_WO0,Digital,Out,Low,,,NORMAL
16,PA07,Y4_SNS,ADC0_AIN7/X5/Y5,Analog,Out,Low,,,NORMAL
16,PA07,BL_SNS2,ADC0_AIN7/X5/Y5,Analog,Out,Low,,,NORMAL
17,PA08,MOSI,SERCOM0_PAD0,Digital,High Impedance,n/a,No,No,NORMAL
18,PA09,CLK,SERCOM0_PAD1,Digital,High Impedance,n/a,No,No,NORMAL
19,PA10,Spi_Software_Trigger,GPIO,Digital,Out,High,,,NORMAL
@ -27,13 +27,13 @@ Pin Number,Pin ID,Custom Name,Function,Mode, Direction,Latch,Pull Up,Pull Down,D
30,PA13,SDZ,GPIO,Digital,Out,Low,,,NORMAL
31,PA14,,Available,,,,,,NORMAL
32,PA15,,Available,,,,,,NORMAL
35,PA16,X1_SNS,ADC0_X10/Y10,Analog,High Impedance,n/a,,,NORMAL
36,PA17,X2_SNS,ADC0_X11/Y11,Analog,High Impedance,n/a,,,NORMAL
37,PA18,X3_SNS,ADC0_X12/Y12,Analog,High Impedance,n/a,,,NORMAL
38,PA19,X4_SNS,ADC0_X13/Y13,Analog,High Impedance,n/a,,,NORMAL
35,PA16,Y1_SNS,ADC0_X10/Y10,Analog,High Impedance,n/a,,,NORMAL
36,PA17,Y2_SNS,ADC0_X11/Y11,Analog,High Impedance,n/a,,,NORMAL
37,PA18,Y3_SNS,ADC0_X12/Y12,Analog,High Impedance,n/a,,,NORMAL
38,PA19,Y4_SNS,ADC0_X13/Y13,Analog,High Impedance,n/a,,,NORMAL
39,PB16,,Available,,,,,,NORMAL
40,PB17,,Available,,,,,,NORMAL
41,PA20,X5_SNS,ADC0_X14/Y14,Analog,High Impedance,n/a,,,NORMAL
41,PA20,Y5_SNS,ADC0_X14/Y14,Analog,High Impedance,n/a,,,NORMAL
42,PA21,CAP_RES1_SNS,ADC0_X15/Y15,Analog,High Impedance,n/a,,,NORMAL
43,PA22,CAP_CANCEL2_SNS,ADC0_X16/Y16,Analog,High Impedance,n/a,,,NORMAL
44,PA23,CAP_CANCEL1_SNS,ADC0_X17/Y17,Analog,High Impedance,n/a,,,NORMAL
@ -48,5 +48,5 @@ Pin Number,Pin ID,Custom Name,Function,Mode, Direction,Latch,Pull Up,Pull Down,D
60,PB31,INTB_PRSS,EIC_EXTINT15,Digital,In,n/a,No,No,NORMAL
61,PB00,CAP_TJP2_SNS,ADC0_AIN12/X30/Y30,Analog,In,n/a,,,NORMAL
62,PB01,CAP_TJP1_SNS,ADC0_AIN13/X31/Y31,Analog,High Impedance,n/a,,,NORMAL
63,PB02,Y1_SNS,ADC0_AIN14/X20/Y20,Analog,Out,Low,,,NORMAL
63,PB02,Power_AD_Ctrl,GPIO,Digital,Out,Low,,,NORMAL
64,PB03,CAP_RES2_SNS,ADC0_AIN15/X21/Y21,Analog,In,n/a,,,NORMAL

1 Pin Number Pin ID Custom Name Function Mode Direction Latch Pull Up Pull Down Drive Strength
2 1 PA00 SDA SERCOM1_PAD0 Digital High Impedance n/a No No NORMAL
3 2 PA01 SCL SERCOM1_PAD1 Digital High Impedance n/a No No NORMAL
4 3 PA02 INP DAC_VOUT0 Analog Out Low NORMAL
5 4 PA03 Power_AD_Ctrl BL_SNS1 GPIO ADC0_AIN1/X0/Y0/VREFA Digital Analog Out High Impedance Low n/a NORMAL
6 5 PB04 AD_LDO ADC1_AIN6 Analog High Impedance n/a NORMAL
7 6 PB05 LD_OUT ADC1_AIN7 Analog High Impedance n/a NORMAL
8 9 PB06 BL_SNS1 X1_SNS ADC1_AIN8 Analog High Impedance n/a NORMAL
9 10 PB07 Y2_SNS X2_SNS ADC0_X25/Y25 Analog High Impedance n/a NORMAL
10 11 PB08 Y3_SNS X3_SNS ADC0_AIN2/X1/Y1 Analog High Impedance n/a NORMAL
11 12 PB09 BL_SNS2 X4_SNS ADC1_AIN1 ADC0_AIN3/X2/Y2 Analog High Impedance n/a NORMAL
12 13 PA04 Y5_SNS X5_SNS ADC0_AIN4/X3/Y3/VREFB Analog High Impedance n/a NORMAL
13 14 PA05 TJP_EN_PWM TC0_WO1 Digital High Impedance n/a No No NORMAL
14 15 PA06 CANCEL_EN_PWM TC1_WO0 Digital Out Low NORMAL
15 16 PA07 Y4_SNS BL_SNS2 ADC0_AIN7/X5/Y5 Analog Out Low NORMAL
16 17 PA08 MOSI SERCOM0_PAD0 Digital High Impedance n/a No No NORMAL
17 18 PA09 CLK SERCOM0_PAD1 Digital High Impedance n/a No No NORMAL
18 19 PA10 Spi_Software_Trigger GPIO Digital Out High NORMAL
27 30 PA13 SDZ GPIO Digital Out Low NORMAL
28 31 PA14 Available NORMAL
29 32 PA15 Available NORMAL
30 35 PA16 X1_SNS Y1_SNS ADC0_X10/Y10 Analog High Impedance n/a NORMAL
31 36 PA17 X2_SNS Y2_SNS ADC0_X11/Y11 Analog High Impedance n/a NORMAL
32 37 PA18 X3_SNS Y3_SNS ADC0_X12/Y12 Analog High Impedance n/a NORMAL
33 38 PA19 X4_SNS Y4_SNS ADC0_X13/Y13 Analog High Impedance n/a NORMAL
34 39 PB16 Available NORMAL
35 40 PB17 Available NORMAL
36 41 PA20 X5_SNS Y5_SNS ADC0_X14/Y14 Analog High Impedance n/a NORMAL
37 42 PA21 CAP_RES1_SNS ADC0_X15/Y15 Analog High Impedance n/a NORMAL
38 43 PA22 CAP_CANCEL2_SNS ADC0_X16/Y16 Analog High Impedance n/a NORMAL
39 44 PA23 CAP_CANCEL1_SNS ADC0_X17/Y17 Analog High Impedance n/a NORMAL
48 60 PB31 INTB_PRSS EIC_EXTINT15 Digital In n/a No No NORMAL
49 61 PB00 CAP_TJP2_SNS ADC0_AIN12/X30/Y30 Analog In n/a NORMAL
50 62 PB01 CAP_TJP1_SNS ADC0_AIN13/X31/Y31 Analog High Impedance n/a NORMAL
51 63 PB02 Y1_SNS Power_AD_Ctrl ADC0_AIN14/X20/Y20 GPIO Analog Digital Out Low NORMAL
52 64 PB03 CAP_RES2_SNS ADC0_AIN15/X21/Y21 Analog In n/a NORMAL

View File

@ -64,7 +64,7 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
* Range: 1 to 255.
* Default value: 20.
*/
#define DEF_TOUCH_MEASUREMENT_PERIOD_MS 4u
#define DEF_TOUCH_MEASUREMENT_PERIOD_MS 18u
/* Defines the Type of sensor
* Default value: NODE_MUTUAL.
@ -118,67 +118,67 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
#define NODE_0_PARAMS \
{ \
X_NONE, Y(31), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(31), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_1_PARAMS \
{ \
X_NONE, Y(15), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(15), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_2_PARAMS \
{ \
X_NONE, Y(17), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(17), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_3_PARAMS \
{ \
X_NONE, Y(20), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(24), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_4_PARAMS \
{ \
X_NONE, Y(25), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(25), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_5_PARAMS \
{ \
X_NONE, Y(1), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(1), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_6_PARAMS \
{ \
X_NONE, Y(5), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(2), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_7_PARAMS \
{ \
X_NONE, Y(3), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(3), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_8_PARAMS \
{ \
X_NONE, Y(10), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(10), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_9_PARAMS \
{ \
X_NONE, Y(11), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(11), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_10_PARAMS \
{ \
X_NONE, Y(12), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(12), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_11_PARAMS \
{ \
X_NONE, Y(13), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(13), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_12_PARAMS \
{ \
X_NONE, Y(14), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(14), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_4), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_13_PARAMS \
{ \
X_NONE, Y(30), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(30), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_14_PARAMS \
{ \
X_NONE, Y(21), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(21), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
#define NODE_15_PARAMS \
{ \
X_NONE, Y(16), 0,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_32 \
X_NONE, Y(16), 8,(uint8_t)PRSC_DIV_SEL_8, NODE_GAIN(GAIN_1, GAIN_8), (uint8_t)FILTER_LEVEL_16 \
}
/**********************************************************/
@ -196,97 +196,97 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
#define KEY_0_PARAMS \
{ \
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
59u, (uint8_t)RECAL_50, (uint8_t)NO_AKS_GROUP \
}
#define KEY_1_PARAMS \
{ \
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
59u, (uint8_t)RECAL_50, (uint8_t)NO_AKS_GROUP \
}
#define KEY_2_PARAMS \
{ \
54u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
52u, (uint8_t)RECAL_50, (uint8_t)NO_AKS_GROUP \
}
#define KEY_3_PARAMS \
{ \
61u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
62u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_4_PARAMS \
{ \
60u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
60u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_5_PARAMS \
{ \
57u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
62u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_6_PARAMS \
{ \
63u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
64u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_7_PARAMS \
{ \
72u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
60u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_8_PARAMS \
{ \
49u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
56u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_9_PARAMS \
{ \
54u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
59u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_10_PARAMS \
{ \
47u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
57u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_11_PARAMS \
{ \
55u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
59u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_12_PARAMS \
{ \
59u, (uint8_t)HYST_12_5, (uint8_t)AKS_GROUP_1 \
59u, (uint8_t)RECAL_50, (uint8_t)AKS_GROUP_1 \
}
#define KEY_13_PARAMS \
{ \
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
54u, (uint8_t)RECAL_50, (uint8_t)NO_AKS_GROUP \
}
#define KEY_14_PARAMS \
{ \
48u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
58u, (uint8_t)RECAL_50, (uint8_t)NO_AKS_GROUP \
}
#define KEY_15_PARAMS \
{ \
60u, (uint8_t)HYST_12_5, (uint8_t)NO_AKS_GROUP \
52u, (uint8_t)RECAL_50, (uint8_t)NO_AKS_GROUP \
}
@ -301,13 +301,13 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
* Range: 0 to 255.
* Default value: 5.
*/
#define DEF_ANTI_TCH_DET_INT 3u
#define DEF_ANTI_TCH_DET_INT 0u
/* Threshold beyond with automatic sensor recalibration is initiated.
* Range: RECAL_100/ RECAL_50 / RECAL_25 / RECAL_12_5 / RECAL_6_25 / MAX_RECAL
* Default value: RECAL_100.
*/
#define DEF_ANTI_TCH_RECAL_THRSHLD (uint8_t)RECAL_50
#define DEF_ANTI_TCH_RECAL_THRSHLD (uint8_t)RECAL_100
/* Rate at which sensor reference value is adjusted towards sensor signal value
* when signal value is greater than reference.
@ -342,7 +342,7 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
* Range: 0-255
* Default value: 0
*/
#define DEF_MAX_ON_DURATION 250u
#define DEF_MAX_ON_DURATION 0u
/**********************************************************/
@ -397,7 +397,7 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
* The minimum contact size measurement for persistent contact tracking.
* Contact size is the sum of neighbouring keys' touch deltas forming the touch contact.
*/
#define SURFACE_CS_MIN_CONTACT 140u
#define SURFACE_CS_MIN_CONTACT 120u
/**********************************************************/

View File

@ -15,7 +15,8 @@ extern forcesnsr_RxReg_un_type forcesnsr_reg_state_un_bak;
static volatile STATE_UINT8 forcedetect_btn_val;
detectforce_Reg_Cfg_Main_Str_typ detectforce_Reg_Str;
static uint8_t press_allowed_send_signal_flag = 0;
static uint16_t send_signal_flag_count = 0;
/***************************static function define end ************************************/
/*combind 8bit and 4bit data to uint16
*/
@ -72,7 +73,23 @@ void forcedetect_MainTask(void)
{
detectforce_Reg_Str.btn_state = FALSE;
}
if (detectforce_Reg_Str.raw > 50 && detectforce_Reg_Str.raw < 2048)
{
press_allowed_send_signal_flag = 1;
send_signal_flag_count = 0;
}
else
{
if (send_signal_flag_count < 50)//2ms*50
{
send_signal_flag_count++;
}
else
{
press_allowed_send_signal_flag = 0;
}
}
}
/***************************main function define end ************************************/
@ -106,3 +123,7 @@ STATE_UINT8 Get_forcedetect_preload_value(void)
return detectforce_Reg_Str.preload;
}
STATE_UINT8 Get_forcedetect_allowed_send_flag(void)
{
return press_allowed_send_signal_flag;
}

View File

@ -63,6 +63,8 @@ extern STATE_UINT8 Get_forcedetect_SNSERR_value(void);
extern STATE_UINT8 Get_forcedetect_preload_value(void);
extern STATE_UINT8 Get_forcedetect_allowed_send_flag(void);
/***************************extern function end************************************/

View File

@ -22,10 +22,10 @@
// *****************************************************************************
// *****************************************************************************
#include <stddef.h> // Defines NULL
#include <stdbool.h> // Defines true
#include <stdlib.h> // Defines EXIT_FAILURE
#include "definitions.h" // SYS function prototypes
#include <stddef.h> // Defines NULL
#include <stdbool.h> // Defines true
#include <stdlib.h> // Defines EXIT_FAILURE
#include "definitions.h" // SYS function prototypes
#include "OsekCom/OsekCom.h"
#include "Speaker/Speaker.h"
#include "P417_SWTL_App_ert_rtw/P417_SWTL_App.h"
@ -42,10 +42,10 @@
#include "calib_public.h"
#include "smartee.h"
#include "FunctionState.h"
#include "SysDiagDetect.h"
#include "FunctionState.h"
#include "SysDiagDetect.h"
/* System tick */
uint32_t SysTick_1ms_Period = 0;
uint32_t SysTick_1ms_Period = 0;
uint32_t SysTick_Cur_Counter = 0;
volatile uint32_t SysTick_Elapse = 0;
uint32_t CyclicTskSchM_CurTime = 0;
@ -53,21 +53,20 @@ uint8_t Test_frame_On = 0;
uint8_t SDZ_init_flag = 0;
uint8_t SDZ_first_delay = 0;
void OS_TimerCallback(uintptr_t context)
{
SysTick_Elapse++;
}
void CyclicTskSchM_TimerSync (void)
void CyclicTskSchM_TimerSync(void)
{
CyclicTskSchM_CurTime+= 1;
CyclicTskSchM_CurTime += 1;
while (SysTick_Elapse < CyclicTskSchM_CurTime)
{
/* TimerSync */
}
CyclicTskSchM_CurTime = SysTick_Elapse;
}
/* PWM */
@ -76,46 +75,44 @@ uint32_t duty = 7999;
uint32_t period = 0;
/* ADC1 */
#define ADC1_CH_AD_LDO_SNS 0
#define ADC1_CH_LD_OUT_SNS 1
#define ADC1_CH_MAX 2
#define ADC1_CH_AD_LDO_SNS 0
#define ADC1_CH_LD_OUT_SNS 1
#define ADC1_CH_MAX 2
uint8_t adc_ch_sel = 0;
uint8_t adc_ch_sel = 0;
uint16_t adc_result = 0;
uint16_t adc[ADC1_CH_MAX] = {0};
void ADC1_ConversionCallback (ADC_STATUS status, uintptr_t context)
void ADC1_ConversionCallback(ADC_STATUS status, uintptr_t context)
{
if(status == ADC_STATUS_RESRDY) {
if (status == ADC_STATUS_RESRDY)
{
adc_result = ADC1_ConversionResultGet();
//adc[adc_ch_sel - 1] = adc_result & 0xFFF;
// adc[adc_ch_sel - 1] = adc_result & 0xFFF;
adc[adc_ch_sel] = adc_result & 0xFFF;
switch (adc_ch_sel)
{
case ADC1_CH_AD_LDO_SNS:
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
adc_ch_sel= ADC1_CH_LD_OUT_SNS;
ADC1_ConversionStart();
break;
case ADC1_CH_LD_OUT_SNS:
ADC1_ChannelSelect(ADC_POSINPUT_AIN7, ADC_NEGINPUT_GND);
adc_ch_sel= ADC1_CH_AD_LDO_SNS;
ADC1_Disable();
break;
default:
break;
}
//adc_ch_sel++;
//if (adc_ch_sel > ADC1_CH_MAX) {
// adc_ch_sel = ADC1_CH_AD_LDO_SNS + 1;
//}
ADC1_ConversionStart();
}
}
/* CAN1 */
bool Can1BusErrFlag = false;
uint8_t Can1MessageRAM[CAN1_MESSAGE_RAM_CONFIG_SIZE] __attribute__((aligned (32)));
uint8_t Can1MessageRAM[CAN1_MESSAGE_RAM_CONFIG_SIZE] __attribute__((aligned(32)));
uint32_t Received_id[8] = {0};
typedef struct
{
@ -128,7 +125,7 @@ typedef struct
CAN_Received_Buffer Received_buf[8] = {0};
#define WRITE_ID(id) (id << 18)
#define READ_ID(id) (id >> 18)
#define READ_ID(id) (id >> 18)
static uint8_t canTxBuffer[CAN1_TX_FIFO_BUFFER_SIZE];
static uint8_t canRxBuffer[CAN1_RX_FIFO0_SIZE];
@ -137,29 +134,29 @@ CAN_TX_BUFFER *CanTxBuffer = NULL;
uint32_t CanBufQueryIdTp(void)
{
return Received_buf[0].id;
return Received_buf[0].id;
}
uint32_t CanBufQueryIdTp_Tx(void)
{
return CanTxBuffer->id;
return CanTxBuffer->id;
}
uint8_t CanBufQueryDataByte(uint8_t hdl, uint8_t index)
{
uint8_t byte;
uint8_t byte;
byte = (uint8_t)Received_buf[0].data[index];
return byte;
return byte;
}
void CAN_Rx_FIFO0_CALLBACK(uint8_t numberOfMessage, uintptr_t context)
{
uint8_t MessageNumer = 0;
CAN1_MessageReceiveFifo(CAN_RX_FIFO_0, numberOfMessage, (CAN_RX_BUFFER *)canRxBuffer);
CanRxBuf_t = (CAN_RX_BUFFER *)canRxBuffer;
for (;MessageNumer < numberOfMessage; MessageNumer++)
CAN1_MessageReceiveFifo(CAN_RX_FIFO_0, numberOfMessage, (CAN_RX_BUFFER *)(uintptr_t)canRxBuffer);
CanRxBuf_t = (CAN_RX_BUFFER *)(uintptr_t)canRxBuffer;
for (; MessageNumer < numberOfMessage; MessageNumer++)
{
Received_buf[MessageNumer].id = READ_ID(CanRxBuf_t[MessageNumer].id);
memcpy(Received_buf[MessageNumer].data, CanRxBuf_t[MessageNumer].data, 8);
@ -169,7 +166,7 @@ void CAN_Rx_FIFO0_CALLBACK(uint8_t numberOfMessage, uintptr_t context)
void CAN_Tx_FIFO0_CALLBACK(uintptr_t context)
{
OsekComTxNotifCallbackSWTL(0);
OsekComTxNotifCallbackSWTL(0);
}
/* CAN handlers definition */
@ -178,29 +175,31 @@ void CanTx(t_can_handler can_handler, bool notif, uint32_t idtp, uint16_t len, t
uint8_t loop_count = 0;
memset(canTxBuffer, 0x00, CAN1_TX_FIFO_BUFFER_ELEMENT_SIZE);
CanTxBuffer = (CAN_TX_BUFFER *)canTxBuffer;
CanTxBuffer = (CAN_TX_BUFFER *)(uintptr_t)canTxBuffer;
CanTxBuffer->id = WRITE_ID(idtp);
CanTxBuffer->dlc = len;
for (loop_count = 0; loop_count < len; loop_count++){
for (loop_count = 0; loop_count < len; loop_count++)
{
CanTxBuffer->data[loop_count] = can_data[loop_count];
}
}
if (CAN1_MessageTransmitFifo(1, CanTxBuffer) == true)
{
;
{
;
}
else
{
;
}
}
}
uint8_t Msg30_timeout_flag = 0;
void IhuPrivateDHUCanFr01_CALLBACK(void)
{
;
Msg30_timeout_flag = 0;
}
void IhuPrivateDHUCanFr01_Timeout_CALLBACK(void)
{
;
Msg30_timeout_flag = 1;
}
// *****************************************************************************
@ -209,15 +208,46 @@ void IhuPrivateDHUCanFr01_Timeout_CALLBACK(void)
// *****************************************************************************
// *****************************************************************************
static uint32_t status = 0;
uint8_t g_SBC_STATUS[8] = {0};
int main ( void )
void GetResetSource(void)
{
uint8_t reset_source_buf[25];
g_SBC_STATUS[0] = (uint8_t)sbc_read_reg(SBC_SUP_STAT_2);
g_SBC_STATUS[1] = (uint8_t)sbc_read_reg(SBC_SUP_STAT_1);
g_SBC_STATUS[2] = (uint8_t)sbc_read_reg(SBC_DEV_STAT);
g_SBC_STATUS[3] = RSTC_REGS->RSTC_RCAUSE;
g_SBC_STATUS[4] = RSTC_REGS->RSTC_BKUPEXIT;
g_SBC_STATUS[5] = 0x00;
g_SBC_STATUS[6] = 0x00;
g_SBC_STATUS[7] = 0x00;
CanTx(0, true, 0x420, 8, g_SBC_STATUS);
if (g_SBC_STATUS[1] == 0x80 && g_SBC_STATUS[3] == 0x01)
{
//正常上电
}
else
{
//异常复位
SmartEE_Read(0x400,reset_source_buf,20);
reset_source_buf[20] = g_SBC_STATUS[0];
reset_source_buf[21] = g_SBC_STATUS[1];
reset_source_buf[22] = g_SBC_STATUS[2];
reset_source_buf[23] = g_SBC_STATUS[3];
reset_source_buf[24] = g_SBC_STATUS[4];
SmartEE_Write(0x400,&reset_source_buf[5],20);
}
}
int main(void)
{
uint32_t loop_counter = 0;
/* Initialize all modules */
SYS_Initialize ( NULL );
SYS_Initialize(NULL);
Calib_Init();
WDT_TimeoutPeriodSet(3);
SysTick_1ms_Period = SYSTICK_TimerPeriodGet() + 1;
SYSTICK_TimerCallbackSet(OS_TimerCallback, 0);
@ -233,24 +263,25 @@ int main ( void )
StartPeriodic();
speaker_Init();
forcedetect_Init();
TouchPanel_init();
Tle9263_Init();
//touch_init();//test:11ms
//sbc_wd_trigger();
TouchPanel_init();
// sbc_write_reg(SBC_M_S_CTRL,0x18,0);
Tle9263_Init();
// touch_init();//test:11ms
// sbc_wd_trigger();
ADC1_Enable();
ADC1_CallbackRegister(ADC1_ConversionCallback, 0);
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
ADC1_ConversionStart();
P417_SWTL_App_initialize();
TC0_CompareStart();
TC1_CompareStart();
TC0_Compare8bitMatch1Set(0);
TC1_Compare8bitMatch0Set(0);
WDT_Enable();
@ -258,88 +289,78 @@ int main ( void )
InicialitzaIso15765_3Task();
Dem_Init();
UDS_DID_initNVM();
PORT_PinWrite(PORT_PIN_PA03,1);//battery voltage detection on
PORT_PinWrite(PORT_PIN_PA13,0);/*init turn off SDZ*/
SmartEE_Read(0x783, &Test_frame_On , 1);
PORT_PinWrite(PORT_PIN_PB02, 1); // battery voltage detection onPB02
PORT_PinWrite(PORT_PIN_PA13, 0); /*init turn off SDZ*/
SmartEE_Read(0x783, &Test_frame_On, 1);
if (Test_frame_On > 1)
{
Test_frame_On = 1;
}
GetResetSource();
Fuction_State = Function_State_A;
while ( true )
while (true)
{
/* Maintain state machines of all polled MPLAB Harmony modules. */
SYS_Tasks ( );
ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
ADC1_ConversionStart();
SYS_Tasks();
// ADC1_ChannelSelect(ADC_POSINPUT_AIN6, ADC_NEGINPUT_GND);
// ADC1_ConversionStart();
if (!(loop_counter % 2))
{
//(void)TCC0_PWM24bitDutySet(TCC0_CHANNEL0, duty);
OsekComTask();
Tle9263_MainTask();
/* call touch process function */
if(Fuction_State == Function_State_A)
if (Fuction_State == Function_State_A)
{
TouchPanel_MainFunction();
speaker_MainTask();
forcedetect_MainTask();
//TCC0_PWM24bitDutySet(TCC0_CHANNEL0,6999);
RTE_Set_All_Test_Value();
TouchPanel_MainFunction();
speaker_MainTask();
forcedetect_MainTask();
// TCC0_PWM24bitDutySet(TCC0_CHANNEL0,6999);
RTE_Set_All_Test_Value();
}
else
{
//(void)TCC0_PWM24bitDutySet(TCC0_CHANNEL0, 0); //turn off led
//TC0_Compare8bitMatch1Set(0);//turn off led
//TC1_Compare8bitMatch0Set(0);//turn off led
//(void)TCC0_PWM24bitDutySet(TCC0_CHANNEL0, 0); //turn off led
// TC0_Compare8bitMatch1Set(0);//turn off led
// TC1_Compare8bitMatch0Set(0);//turn off led
}
if(Fuction_State != Function_State_C)
if (Fuction_State != Function_State_C)
{
TPTask(ISO15765_2_REPROGONCAN_HANDLER);
Iso15765_3Task();
Dem_MainFunction();
TPTask(ISO15765_2_REPROGONCAN_HANDLER);
Iso15765_3Task();
Dem_MainFunction();
}
Calib_Task();
//SBC VCC2 always on Setting
sbc_write_reg(SBC_M_S_CTRL,0x18,0);
Calib_Task();
// SBC VCC2 always on Setting
sbc_write_reg(SBC_M_S_CTRL, 0x18, 0);
}
if (!(loop_counter % 5))
{
FunctionState_Task();
Sys_Diag_Detcet_Task();
}
/* Check CAN Status */
status = CAN1_ErrorGet();
WDT_Clear();
//if(Fuction_State == Function_State_A)
//{
P417_SWTL_App_step();
//}
P417_SWTL_App_step();
CyclicTskSchM_TimerSync();
loop_counter++;
}
/* Execution should not come here during normal operation */
return ( EXIT_FAILURE );
return (EXIT_FAILURE);
}
/*******************************************************************************
End of File
*/