1.优化上下电时序
2.修改开关FCD_EN时的死机问题 3.修改快速开关FCD_EN信号时出现花屏的问题 4.修改cola_set_event事件参数,都是一个32bit的整数,每个事件占用1个bit 5.将B+高低压ADC判断改为电压mv判断 6.修改lvds lock信号消抖时间 7.修改不接lvds线时,快速开关FCD_EN不进入BIST模式的问题 8.添加A样相关资料
This commit is contained in:
parent
11d318d334
commit
1e21cdb572
40
DP1208/da
40
DP1208/da
@ -1,40 +0,0 @@
|
|||||||
[33mcommit ad53694b3619c35c2a94643a733aebbc70de12dc[m[33m ([m[1;36mHEAD[m[33m -> [m[1;32mmain[m[33m)[m
|
|
||||||
Author: chenming <chenming@dcenzix.com>
|
|
||||||
Date: Thu May 8 17:33:05 2025 +0800
|
|
||||||
|
|
||||||
1.添加了断lvds信号12s时进入bist模式功能
|
|
||||||
|
|
||||||
[33mcommit c8dba04e449b8334369662b61841b14cde821312[m[33m ([m[1;31morigin/main[m[33m, [m[1;31morigin/HEAD[m[33m)[m
|
|
||||||
Author: chenming <chenming@dcenzix.com>
|
|
||||||
Date: Thu May 8 15:14:27 2025 +0800
|
|
||||||
|
|
||||||
通过ADC采样完成高低压处理,当电压低于8.5V或者高于16.5V时,将走下电流程关芯片使能关屏。电压恢复正常时,重新走上电流程供电开屏
|
|
||||||
|
|
||||||
[33mcommit c06702443619a43d8f92a4bf09ca16a2c7802947[m
|
|
||||||
Author: chenming <chenming@dcenzix.com>
|
|
||||||
Date: Wed May 7 17:38:12 2025 +0800
|
|
||||||
|
|
||||||
添加了温度检测功能,当屏幕温度过高时,将降低背光亮度
|
|
||||||
|
|
||||||
[33mcommit 123e704f8c7d90ccc78544b2a307a41c29e1ef04[m
|
|
||||||
Author: chenming <chenming@dcenzix.com>
|
|
||||||
Date: Wed May 7 14:55:39 2025 +0800
|
|
||||||
|
|
||||||
添加了开机自动轮询播放bist模式,5s切换一次
|
|
||||||
|
|
||||||
[33mcommit 4479768b4a7712a408f2da6829cad90235ac213f[m
|
|
||||||
Author: chenming <chenming@dcenzix.com>
|
|
||||||
Date: Tue May 6 16:53:31 2025 +0800
|
|
||||||
|
|
||||||
1.添加tp iic驱动,这样作为从机的948那一路i2c可作为主机来访问触摸数据
|
|
||||||
2.添加tp固件版本读取函数
|
|
||||||
3.fml_tft_write_BIST_mode不能用,否则显示数据会乱,待查
|
|
||||||
4.OUT_TFT_SHLR开机要拉高,否则显示会左右镜像
|
|
||||||
5.打印串口波特率从9600修改成460800,减少对程序正常运行的影响
|
|
||||||
6.升级屏固件,屏显示正常
|
|
||||||
|
|
||||||
[33mcommit 8402eff711f515b281fed48a31cc34c38e2b58e7[m
|
|
||||||
Author: chenming <chenming@dcenzix.com>
|
|
||||||
Date: Tue May 6 15:03:14 2025 +0800
|
|
||||||
|
|
||||||
1.添加DP1208项目mcu_app部分代码
|
|
BIN
DP1208/doc/A样交付资料/12.8寸显示屏A样测试用例.xlsx
Normal file
BIN
DP1208/doc/A样交付资料/12.8寸显示屏A样测试用例.xlsx
Normal file
Binary file not shown.
BIN
DP1208/doc/A样交付资料/12.8屏端A样软件ReleaseNoteV1.0.docx
Normal file
BIN
DP1208/doc/A样交付资料/12.8屏端A样软件ReleaseNoteV1.0.docx
Normal file
Binary file not shown.
BIN
DP1208/doc/A样交付资料/12.8屏端A样软件上下电时序V1.0.docx
Normal file
BIN
DP1208/doc/A样交付资料/12.8屏端A样软件上下电时序V1.0.docx
Normal file
Binary file not shown.
BIN
DP1208/doc/A样交付资料/12.8屏端A样软件概要设计说明书V1.0.docx
Normal file
BIN
DP1208/doc/A样交付资料/12.8屏端A样软件概要设计说明书V1.0.docx
Normal file
Binary file not shown.
BIN
DP1208/doc/A样交付资料/mcu_app[A样软件_V1.0.0].zip
Normal file
BIN
DP1208/doc/A样交付资料/mcu_app[A样软件_V1.0.0].zip
Normal file
Binary file not shown.
@ -35,11 +35,12 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.2018444124" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.2018444124" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.139063735" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.139063735" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1231539446" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1231539446" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
|
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/app}""/>
|
||||||
<listOptionValue builtIn="false" value=""../fml""/>
|
<listOptionValue builtIn="false" value=""../fml""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
@ -115,6 +116,7 @@
|
|||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile.1548727758" name="Script files (-T)" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile" valueType="stringList">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile.1548727758" name="Script files (-T)" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.option.scriptfile" valueType="stringList">
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/Project_Settings/Linker_Files/S32K118_25_flash.ld""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/Project_Settings/Linker_Files/S32K118_25_flash.ld""/>
|
||||||
</option>
|
</option>
|
||||||
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.useprintffloat.1506497620" name="Support print float format for newlib_nano library (-u _printf_float)" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.linker.option.useprintffloat" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||||
<inputType id="com.freescale.s32ds.cross.gnu.tool.c.linker.inputType.scriptfile.86424158" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.inputType.scriptfile"/>
|
<inputType id="com.freescale.s32ds.cross.gnu.tool.c.linker.inputType.scriptfile.86424158" superClass="com.freescale.s32ds.cross.gnu.tool.c.linker.inputType.scriptfile"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.844065084" name="Standard S32DS C++ Linker" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker">
|
<tool id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker.844065084" name="Standard S32DS C++ Linker" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.cpp.linker">
|
||||||
@ -136,10 +138,10 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1650903618" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1650903618" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.178697363" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.178697363" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.698683580" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.698683580" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
@ -235,6 +237,7 @@
|
|||||||
<sourceEntries>
|
<sourceEntries>
|
||||||
<entry excluding="Debugger" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Project_Settings"/>
|
<entry excluding="Debugger" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Project_Settings"/>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="SDK"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="SDK"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="app"/>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="board"/>
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="board"/>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="bsp"/>
|
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="bsp"/>
|
||||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="cola_os"/>
|
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="cola_os"/>
|
||||||
@ -280,10 +283,10 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.1136492126" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.1136492126" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.1033987629" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.1033987629" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1285815828" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1285815828" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
@ -380,10 +383,10 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1074354711" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1074354711" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.1632309429" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.1632309429" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.809906851" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.809906851" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
@ -472,10 +475,10 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.562110248" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.562110248" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.2141574877" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.2141574877" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1325352655" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1325352655" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
@ -572,10 +575,10 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1063813713" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1063813713" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.1479052780" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.1479052780" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.1019363341" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.1019363341" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
@ -664,10 +667,10 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.1632139982" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.1632139982" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries" useByScannerDiscovery="false" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.1036394228" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot.1036394228" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.c.compiler.option.target.sysroot" useByScannerDiscovery="false" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1241005780" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1241005780" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
@ -764,10 +767,10 @@
|
|||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1761669153" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.1761669153" name="Libraries support" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries" value="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.libraries.newlib_nano_noio" valueType="enumerated"/>
|
||||||
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.934915267" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
<option id="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot.934915267" name="Sysroot" superClass="com.nxp.s32ds.cle.arm.mbs.arm32.bare.tool.assembler.option.target.sysroot" value="--sysroot="${S32DS_ARM32_NEWLIB_DIR}"" valueType="string"/>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.2032830847" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.2032830847" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
|
||||||
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
<listOptionValue builtIn="false" value="../SDK/rtos/osif"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/pal/inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/ftm"/>
|
||||||
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
<listOptionValue builtIn="false" value="../SDK/platform/drivers/src/lpuart"/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/board""/>
|
||||||
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
<listOptionValue builtIn="false" value=""${ProjDirPath}/SDK/platform/devices/common""/>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1165920240417889736" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1119501728947462585" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1062631116365500840" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1222790852999851481" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1062631116365500840" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1222790852999851481" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
@ -38,7 +38,7 @@
|
|||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1062631116365500840" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-1222790852999851481" id="com.freescale.s32ds.cross.gnu.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT S32DS Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
3
DP1208/mcu_app/.settings/org.eclipse.cdt.ui.prefs
Normal file
3
DP1208/mcu_app/.settings/org.eclipse.cdt.ui.prefs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
formatter_profile=org.eclipse.cdt.ui.default.allman_profile
|
||||||
|
formatter_settings_version=1
|
@ -3,7 +3,7 @@ encoding//bsp/bsp_register_map.h=UTF-8
|
|||||||
encoding//fml/fml_TFT.c=UTF-8
|
encoding//fml/fml_TFT.c=UTF-8
|
||||||
encoding//fml/fml_adc.c=UTF-8
|
encoding//fml/fml_adc.c=UTF-8
|
||||||
encoding//fml/fml_max25512.c=UTF-8
|
encoding//fml/fml_max25512.c=UTF-8
|
||||||
encoding//logic/logic_app_start.c=UTF-8
|
|
||||||
encoding//logic/logic_diagnose.c=UTF-8
|
encoding//logic/logic_diagnose.c=UTF-8
|
||||||
encoding//logic/logic_public.c=UTF-8
|
encoding//logic/logic_mode_eol.c=UTF-8
|
||||||
encoding//logic/logic_test_mode.c=UTF-8
|
encoding//logic/logic_parse.c=UTF-8
|
||||||
|
encoding/<project>=UTF-8
|
||||||
|
36
DP1208/mcu_app/app/app.c
Normal file
36
DP1208/mcu_app/app/app.c
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* app.c
|
||||||
|
*
|
||||||
|
* Created on: 2025年5月18日
|
||||||
|
* Author: chenm
|
||||||
|
* Description: app调用logic相关模块进行初始化
|
||||||
|
*/
|
||||||
|
#include "cola_init.h"
|
||||||
|
#include "shell_port.h"
|
||||||
|
#include "fml_flash.h"
|
||||||
|
#include "fml_master_iic.h"
|
||||||
|
#include "fml_gpio.h"
|
||||||
|
#include "fml_adc.h"
|
||||||
|
|
||||||
|
extern void logic_power_init(void);
|
||||||
|
extern void logic_parse_init(void);
|
||||||
|
extern void logic_bist_init(void);
|
||||||
|
extern void logic_diagnose_init(void);
|
||||||
|
|
||||||
|
void app_init(void)
|
||||||
|
{
|
||||||
|
fml_shell_init();
|
||||||
|
fml_flash_init();
|
||||||
|
fml_master_init();
|
||||||
|
//fml_ds90ub948_open();
|
||||||
|
//fml_touch_init();
|
||||||
|
fml_gpio_init();
|
||||||
|
fml_adc_init();
|
||||||
|
logic_power_init();
|
||||||
|
//test_mode_open();
|
||||||
|
logic_parse_init();
|
||||||
|
logic_bist_init();
|
||||||
|
//fml_touch_read_version_info();
|
||||||
|
logic_diagnose_init();
|
||||||
|
}
|
||||||
|
app_initcall(app_init);
|
13
DP1208/mcu_app/app/app.h
Normal file
13
DP1208/mcu_app/app/app.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* app.h
|
||||||
|
*
|
||||||
|
* Created on: 2025年5月18日
|
||||||
|
* Author: chenm
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef APP_H_
|
||||||
|
#define APP_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* APP_H_ */
|
@ -69,7 +69,7 @@
|
|||||||
#define DIAG_REG 0x15U
|
#define DIAG_REG 0x15U
|
||||||
typedef enum{
|
typedef enum{
|
||||||
|
|
||||||
LCD_BACKLIGHT = 0x03U,
|
LCD_BACKLIGHT_PWM = 0x03U,
|
||||||
LCD_BACKLIGHT_SWITCH = 0x04U,
|
LCD_BACKLIGHT_SWITCH = 0x04U,
|
||||||
DAY_NIGHT_MODE = 0x07U,
|
DAY_NIGHT_MODE = 0x07U,
|
||||||
TOUCH_RESET = 0x11U,
|
TOUCH_RESET = 0x11U,
|
||||||
|
@ -18,8 +18,12 @@ void bsp_drv_pwm_deinit(void)
|
|||||||
status = PWM_Deinit(&pwm_pal_1_instance);
|
status = PWM_Deinit(&pwm_pal_1_instance);
|
||||||
DEV_ASSERT(status == STATUS_SUCCESS);
|
DEV_ASSERT(status == STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bsp_drv_change_duty(uint32_t duty)
|
void bsp_drv_change_duty(uint32_t duty)
|
||||||
{
|
{
|
||||||
|
int period = pwm_pal_1_configs.pwmChannels[0].period;
|
||||||
|
if(duty > period)
|
||||||
|
duty = period;
|
||||||
uint8_t channel = pwm_pal_1_configs.pwmChannels[0].channel;
|
uint8_t channel = pwm_pal_1_configs.pwmChannels[0].channel;
|
||||||
pwm_pal_1_configs.pwmChannels[0].duty = duty;
|
pwm_pal_1_configs.pwmChannels[0].duty = duty;
|
||||||
status = PWM_UpdateDuty(&pwm_pal_1_instance, channel, duty);
|
status = PWM_UpdateDuty(&pwm_pal_1_instance, channel, duty);
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
* 包含头文件 *
|
* 包含头文件 *
|
||||||
*----------------------------------------------*/
|
*----------------------------------------------*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
#include "cola_os.h"
|
#include "cola_os.h"
|
||||||
|
|
||||||
#include "s32_core_cm0.h"
|
#include "s32_core_cm0.h"
|
||||||
@ -97,7 +98,7 @@ static TASK_LIST_HEAD(task_list);
|
|||||||
* \brief 计时器
|
* \brief 计时器
|
||||||
*/
|
*/
|
||||||
|
|
||||||
volatile unsigned int jiffies = 0;
|
volatile uint32_t jiffies = 0;
|
||||||
|
|
||||||
/** \var jiffies
|
/** \var jiffies
|
||||||
* \brief 计时器
|
* \brief 计时器
|
||||||
|
@ -81,7 +81,7 @@ typedef struct task_s
|
|||||||
/*----------------------------------------------*
|
/*----------------------------------------------*
|
||||||
* 全局变量 *
|
* 全局变量 *
|
||||||
*----------------------------------------------*/
|
*----------------------------------------------*/
|
||||||
extern volatile unsigned int jiffies;
|
extern volatile uint32_t jiffies;
|
||||||
|
|
||||||
/*----------------------------------------------*
|
/*----------------------------------------------*
|
||||||
* 函数原型说明 *
|
* 函数原型说明 *
|
||||||
|
@ -33,7 +33,7 @@ void fml_pmic_init(void)
|
|||||||
g_pDev_pmic_iic = cola_device_find("PMIC_IIC");
|
g_pDev_pmic_iic = cola_device_find("PMIC_IIC");
|
||||||
fml_PAVDD_out_voltage(0x10);//5.8v
|
fml_PAVDD_out_voltage(0x10);//5.8v
|
||||||
cola_delay_ms(10);
|
cola_delay_ms(10);
|
||||||
fml_NAVDD_out_voltage(0x10);//5.8v
|
fml_NAVDD_out_voltage(0x10);//-5.8v
|
||||||
cola_delay_ms(10);
|
cola_delay_ms(10);
|
||||||
fml_VGH_out_voltage(0x06); //10v
|
fml_VGH_out_voltage(0x06); //10v
|
||||||
cola_delay_ms(10);
|
cola_delay_ms(10);
|
||||||
|
@ -11,5 +11,6 @@
|
|||||||
|
|
||||||
extern void fml_pmic_init(void);
|
extern void fml_pmic_init(void);
|
||||||
extern bool fml_PAVDD_out_voltage(uint8_t data);
|
extern bool fml_PAVDD_out_voltage(uint8_t data);
|
||||||
|
extern void fml_pmic_write_to_mtp(void);
|
||||||
|
|
||||||
#endif /* FML_PWM_H_ */
|
#endif /* FML_PWM_H_ */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* fml_adc.c
|
* fml_adc.c
|
||||||
*
|
*
|
||||||
* Created on: 2025骞<EFBFBD>4鏈<EFBFBD>7鏃<EFBFBD>
|
* Created on: 2025年4月7日
|
||||||
* Author: 22332
|
* Author: 22332
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -9,86 +9,145 @@
|
|||||||
#include "cola_os.h"
|
#include "cola_os.h"
|
||||||
#include "cola_device.h"
|
#include "cola_device.h"
|
||||||
#include "fml_adc.h"
|
#include "fml_adc.h"
|
||||||
static task_t gadcTask;
|
#include "fml_public.h"
|
||||||
extern void logWrite(const char *fmt, ...);
|
|
||||||
|
|
||||||
static const cola_device_t *g_pDevadc = NULL;
|
typedef enum BSP_ADC_OPS_TYPE
|
||||||
|
|
||||||
uint16_t adc_temp_value[10];
|
|
||||||
uint16_t adc_batt_value[10];
|
|
||||||
|
|
||||||
uint16_t V_battery_ad = 0;
|
|
||||||
uint16_t adc_temp = 0;
|
|
||||||
float V_battery_ad_3V3;
|
|
||||||
uint16_t adc_filter(uint16_t *adc_values) {
|
|
||||||
uint16_t sum = 0;
|
|
||||||
uint16_t min, max;
|
|
||||||
uint8_t i;
|
|
||||||
|
|
||||||
// 1. 采集10次ADC值(这里需要替换为实际的ADC读取函数)
|
|
||||||
|
|
||||||
// 2. 找出最大值和最小值
|
|
||||||
min = max = adc_values[0];
|
|
||||||
for (i = 1; i < 10; i++) {
|
|
||||||
if (adc_values[i] < min) {
|
|
||||||
min = adc_values[i];
|
|
||||||
}
|
|
||||||
if (adc_values[i] > max) {
|
|
||||||
max = adc_values[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 计算去掉最大最小值后的和
|
|
||||||
uint8_t count = 0;
|
|
||||||
for (i = 0; i < 10; i++) {
|
|
||||||
if (adc_values[i] != min && adc_values[i] != max) {
|
|
||||||
sum += adc_values[i];
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理所有值相同的情况(避免除以0)
|
|
||||||
if (count == 0) {
|
|
||||||
return adc_values[9]; // 如果所有值相同,直接返回平均值
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. 计算平均值并返回
|
|
||||||
return sum / count;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void fml_adc_read_polling(void *arg, uint32_t event)
|
|
||||||
{
|
{
|
||||||
static uint8_t i,j;
|
EN_ADC_OPS_TYPE_MCU = 1, //MCU内部温度(暂未用)
|
||||||
adc_batt_value[i++] = cola_device_read(g_pDevadc,2,0,0);
|
EN_ADC_OPS_TYPE_BAT, //读取B+电压
|
||||||
adc_temp_value[j++] = cola_device_read(g_pDevadc,3,0,0);
|
EN_ADC_OPS_TYPE_NTC, //读取NTC温度值
|
||||||
if((i==10) &&(j==10))
|
} EN_ADC_OPS_TYPE;
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
//小数
|
||||||
|
#define BAT_Rp 37.4 //上拉电阻37.4K
|
||||||
|
#define BAT_R1 4.7 //分压电阻4.7k
|
||||||
|
#define BAT_LOSS 0.5 //二极管损耗0.5v
|
||||||
|
|
||||||
|
#define ADC_VREF (3.3) //ADC参考电压3.3v
|
||||||
|
#define ADC_ACCURACY (1UL << 12U) //12位采样ADC
|
||||||
|
#define ADC_CAL_VOL(adcVal) (float)(((float)(adcVal) * ADC_VREF) / ((float)ADC_ACCURACY))//ADC采集到的电压值
|
||||||
|
|
||||||
|
#define BAT_RATIO (((float)BAT_R1+(float)BAT_Rp)/(float)BAT_R1) //按电阻比例进行分压
|
||||||
|
#define BAT_GET(adcVal) ((BAT_RATIO*(float)ADC_CAL_VOL(adcVal))+BAT_LOSS) //计算板子这端的B+电压
|
||||||
|
#else
|
||||||
|
//整数
|
||||||
|
#define BAT_Rp 374 //上拉电阻37.4K
|
||||||
|
#define BAT_R1 47 //分压电阻4.7k
|
||||||
|
#define BAT_LOSS (500+400) //二极管损耗0.5v
|
||||||
|
|
||||||
|
#define ADC_VREF (3300) //ADC参考电压3.3v
|
||||||
|
#define ADC_ACCURACY (1UL << 12U) //12位采样ADC
|
||||||
|
#define ADC_CAL_VOL(adcVal) adcVal * ADC_VREF / ADC_ACCURACY//ADC采集到的电压值
|
||||||
|
|
||||||
|
#define BAT_RATIO (BAT_R1+BAT_Rp)/BAT_R1 //按电阻比例进行分压
|
||||||
|
#define BAT_GET(adcVal) ((BAT_R1+BAT_Rp)*(adcVal * ADC_VREF)/(BAT_R1*ADC_ACCURACY)+BAT_LOSS)//计算板子这端的B+电压
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static cola_device_t *g_pDevadc = NULL;
|
||||||
|
static uint16_t g_iNTCAd=0; //NTC温度ADC
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : sort
|
||||||
|
* Description : 将数组从小到大进行排序
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
static void sort(uint16_t *pBuf,int len)
|
||||||
|
{
|
||||||
|
uint16_t temp;
|
||||||
|
uint8_t i,j;
|
||||||
|
for(i=0; i<len-1; i++)
|
||||||
{
|
{
|
||||||
V_battery_ad = adc_filter(adc_batt_value);
|
for(j=i+1; j<len; j++)
|
||||||
adc_temp = adc_filter(adc_temp_value);
|
{
|
||||||
i = j = 0;
|
if(pBuf[i]>pBuf[j])
|
||||||
logWrite("V_battery_ad = %d\r\n",V_battery_ad);
|
{
|
||||||
logWrite("adc_temp = %d\r\n",fml_adc_read_once_temp());
|
temp = pBuf[i];
|
||||||
|
pBuf[i] = pBuf[j];
|
||||||
|
pBuf[j] = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : fml_adc_filter
|
||||||
|
* Description : 将数组进行排序后,去掉一个最大和最小值,将剩下的值做平均
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
uint16_t fml_adc_filter(uint16_t *buf,int len)
|
||||||
|
{
|
||||||
|
int sum = 0;
|
||||||
|
sort(buf,len);
|
||||||
|
for(int i=1; i<(len-1); i++)
|
||||||
|
sum+= buf[i];
|
||||||
|
//sum = sum/(len-2);
|
||||||
|
sum = buf[len/2];
|
||||||
|
return sum;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : fml_adc_to_bat_voltage
|
||||||
|
* Description : 将采集的ADC值,根据电阻分压求出B+的电压值
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
uint16_t fml_adc_to_bat_voltage(uint16_t adc)
|
||||||
|
{
|
||||||
|
return BAT_GET(adc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : fml_adc_read_bat_ad
|
||||||
|
* Description : 读BAT检测AD值
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
uint16_t fml_adc_read_bat_ad(void)
|
||||||
|
{
|
||||||
|
uint16_t iBattAd = cola_device_read(g_pDevadc,EN_ADC_OPS_TYPE_BAT,0,0);
|
||||||
|
return iBattAd;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : fml_adc_read_temp_ad
|
||||||
|
* Description : 读NTC检测AD值
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
uint16_t fml_adc_read_temp_ad(void)
|
||||||
|
{
|
||||||
|
uint16_t iBattAd = cola_device_read(g_pDevadc,EN_ADC_OPS_TYPE_NTC,0,0);
|
||||||
|
g_iNTCAd = iBattAd;
|
||||||
|
return iBattAd;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : fml_adc_init
|
||||||
|
* Description : 初始化ADC采集任务
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
void fml_adc_init(void)
|
void fml_adc_init(void)
|
||||||
{
|
{
|
||||||
g_pDevadc = cola_device_find("DEVICE_ADC");
|
g_pDevadc = cola_device_find("DEVICE_ADC");
|
||||||
if(g_pDevadc)
|
if(g_pDevadc)
|
||||||
cola_device_open(g_pDevadc, 0);
|
cola_device_open(g_pDevadc, 0);
|
||||||
V_battery_ad = cola_device_read(g_pDevadc,2,0,0);
|
|
||||||
adc_temp = cola_device_read(g_pDevadc,3,0,0);
|
|
||||||
cola_timer_create(&gadcTask, fml_adc_read_polling, NULL);
|
|
||||||
cola_timer_start(&gadcTask, EN_COLA_TIMER_ALWAYS, 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t fml_adc_read_once_temp(void)
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : fml_convert_ntc_ad_to_temp
|
||||||
|
* Description : 将NTC AD值按协议0x0F命令规则转换成实际温度值给到主机
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
uint8_t fml_convert_ntc_ad_to_temp(void)
|
||||||
{
|
{
|
||||||
//V_temp_ad = cola_device_read(g_pDevadc,3,0,0);
|
uint16_t adc_temp = g_iNTCAd;
|
||||||
if(adc_temp<252)
|
if(adc_temp<252)
|
||||||
return 190;
|
return 190;
|
||||||
else if(adc_temp<257)
|
else if(adc_temp<257)
|
||||||
|
@ -9,7 +9,11 @@
|
|||||||
#define FML_ADC_H_
|
#define FML_ADC_H_
|
||||||
|
|
||||||
extern uint8_t fml_adc_read_once(uint8_t pos);
|
extern uint8_t fml_adc_read_once(uint8_t pos);
|
||||||
extern uint8_t fml_adc_read_once_temp(void);
|
extern uint8_t fml_convert_ntc_ad_to_temp(void);
|
||||||
extern void fml_adc_init(void);
|
extern void fml_adc_init(void);
|
||||||
|
extern uint16_t fml_adc_read_bat_ad(void);
|
||||||
|
extern uint16_t fml_adc_read_temp_ad(void);
|
||||||
|
extern uint16_t fml_adc_filter(uint16_t *buf,int len);
|
||||||
|
extern uint16_t fml_adc_to_bat_voltage(uint16_t adc);
|
||||||
|
|
||||||
#endif /* FML_ADC_H_ */
|
#endif /* FML_ADC_H_ */
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#ifndef FML_FLASH_H_
|
#ifndef FML_FLASH_H_
|
||||||
#define FML_FLASH_H_
|
#define FML_FLASH_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
typedef struct VENDOR_DATA//新增结构体内容时,时刻关注字节对齐问题以及写flash大小必须为8的倍数
|
typedef struct VENDOR_DATA//新增结构体内容时,时刻关注字节对齐问题以及写flash大小必须为8的倍数
|
||||||
{
|
{
|
||||||
uint32_t crc32;
|
uint32_t crc32;
|
||||||
|
@ -9,24 +9,25 @@
|
|||||||
#include "cola_device.h"
|
#include "cola_device.h"
|
||||||
#include "cola_os.h"
|
#include "cola_os.h"
|
||||||
#include "fml_gpio.h"
|
#include "fml_gpio.h"
|
||||||
|
#include <string.h>
|
||||||
extern void logWrite(const char *fmt, ...);
|
extern void logWrite(const char *fmt, ...);
|
||||||
|
|
||||||
static cola_device_t *g_pDevgpio = NULL;
|
static cola_device_t *g_pDevgpio = NULL;
|
||||||
|
|
||||||
int fml_gpio_read(uint8_t pos)
|
bool fml_gpio_read(uint8_t pos)
|
||||||
{
|
{
|
||||||
return cola_device_read(g_pDevgpio,pos,0,0);;
|
return cola_device_read(g_pDevgpio,pos,0,0)?true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fml_gpio_write(uint8_t pos,bool status)
|
void fml_gpio_write(uint8_t pos,bool status)
|
||||||
{
|
{
|
||||||
cola_device_write(g_pDevgpio,pos,0,status);
|
cola_device_write(g_pDevgpio,pos,0,status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fml_gpio_init(void)
|
void fml_gpio_init(void)
|
||||||
{
|
{
|
||||||
g_pDevgpio = cola_device_find("GPIO");
|
g_pDevgpio = cola_device_find("GPIO");
|
||||||
if(g_pDevgpio)
|
if(g_pDevgpio)
|
||||||
cola_device_open(g_pDevgpio, 0);
|
cola_device_open(g_pDevgpio, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,8 +8,10 @@
|
|||||||
#ifndef FML_GPIO_H_
|
#ifndef FML_GPIO_H_
|
||||||
#define FML_GPIO_H_
|
#define FML_GPIO_H_
|
||||||
|
|
||||||
typedef enum{
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
IN_LVDS_UNLOCK = 0x00U,
|
IN_LVDS_UNLOCK = 0x00U,
|
||||||
IN_WAKEUP,
|
IN_WAKEUP,
|
||||||
IN_TFT_ERR,
|
IN_TFT_ERR,
|
||||||
@ -17,10 +19,10 @@ typedef enum{
|
|||||||
IN_SW_3V3_PG,
|
IN_SW_3V3_PG,
|
||||||
IN_PMIC_FLTB,
|
IN_PMIC_FLTB,
|
||||||
IN_BL_ERR,
|
IN_BL_ERR,
|
||||||
|
|
||||||
} gpio_input;
|
} gpio_input;
|
||||||
typedef enum{
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
OUT_BL_PWM = 0x00U,
|
OUT_BL_PWM = 0x00U,
|
||||||
OUT_BL_EN,
|
OUT_BL_EN,
|
||||||
OUT_LVDS_PDB,
|
OUT_LVDS_PDB,
|
||||||
@ -35,9 +37,25 @@ typedef enum{
|
|||||||
OUT_PMIC_EN,
|
OUT_PMIC_EN,
|
||||||
OUT_MCU_INT,
|
OUT_MCU_INT,
|
||||||
OUT_LDO_1V2_EN,
|
OUT_LDO_1V2_EN,
|
||||||
|
|
||||||
} gpio_output;
|
} gpio_output;
|
||||||
extern int fml_gpio_read(uint8_t pos);
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
GPIO_EVENT_RISING,
|
||||||
|
GPIO_EVENT_FALLING,
|
||||||
|
GPIO_EVENT_STABLE
|
||||||
|
} gpio_event_t;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
gpio_input pin;
|
||||||
|
uint8_t debounce_ms;
|
||||||
|
uint8_t last_state;
|
||||||
|
uint32_t timestamp;
|
||||||
|
} gpio_obj_t;
|
||||||
|
|
||||||
|
|
||||||
|
extern bool fml_gpio_read(uint8_t pos);
|
||||||
extern void fml_gpio_write(uint8_t pos,bool status);
|
extern void fml_gpio_write(uint8_t pos,bool status);
|
||||||
extern void fml_gpio_init(void);
|
extern void fml_gpio_init(void);
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "cola_os.h"
|
#include "cola_os.h"
|
||||||
#include "fml_master_iic.h"
|
#include "fml_master_iic.h"
|
||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
|
#include "fml_gpio.h"
|
||||||
|
|
||||||
#define TXBUFFER_LEN 8u
|
#define TXBUFFER_LEN 8u
|
||||||
|
|
||||||
@ -123,6 +124,37 @@ int masteri2c(int argc, char *argv[]) {
|
|||||||
else if(mode == 1)
|
else if(mode == 1)
|
||||||
bEnableWrite = true;
|
bEnableWrite = true;
|
||||||
}
|
}
|
||||||
|
else if(strcmp(pDevStrName,"backlight") == 0)
|
||||||
|
{
|
||||||
|
extern void fml_gpio_write(uint8_t pos,bool status);
|
||||||
|
extern bool fml_Write_ISET(uint8_t value);
|
||||||
|
logWrite("backlight=%d\r\n",mode);
|
||||||
|
fml_gpio_write(1,mode);
|
||||||
|
}
|
||||||
|
else if(strcmp(pDevStrName,"iset") == 0)
|
||||||
|
{
|
||||||
|
extern void fml_gpio_write(uint8_t pos,bool status);
|
||||||
|
extern bool fml_Write_ISET(uint8_t value);
|
||||||
|
logWrite("fml_Write_ISET=%d\r\n",mode);
|
||||||
|
fml_Write_ISET(0x02);
|
||||||
|
}
|
||||||
|
else if(strcmp(pDevStrName,"bist") == 0)
|
||||||
|
{
|
||||||
|
extern void fml_gpio_write(uint8_t pos,bool status);
|
||||||
|
logWrite("OUT_TFT_BIST=%d\r\n",mode);
|
||||||
|
fml_gpio_write(4,mode);
|
||||||
|
}
|
||||||
|
else if(strcmp(pDevStrName,"pdb") == 0)
|
||||||
|
{
|
||||||
|
extern void fml_gpio_write(uint8_t pos,bool status);
|
||||||
|
logWrite("pdb=%d\r\n",mode);
|
||||||
|
fml_gpio_write(2,mode);
|
||||||
|
}
|
||||||
|
else if(strcmp(pDevStrName,"pmic_en") == 0)
|
||||||
|
{
|
||||||
|
logWrite("pmic en=%d\r\n",mode);
|
||||||
|
fml_gpio_write(OUT_BL_EN,false);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//logWrite("not support\r\n");
|
//logWrite("not support\r\n");
|
||||||
|
@ -11,11 +11,11 @@
|
|||||||
#include "cola_os.h"
|
#include "cola_os.h"
|
||||||
#include "bsp_register_map.h"
|
#include "bsp_register_map.h"
|
||||||
#include "shell.h"
|
#include "shell.h"
|
||||||
|
#include "fml_gpio.h"
|
||||||
static cola_device_t *g_pDev_max25512_iic = NULL;
|
static cola_device_t *g_pDev_max25512_iic = NULL;
|
||||||
|
|
||||||
static bool ACK;
|
static bool ACK;
|
||||||
static bool OUT[8] = {0};
|
static bool OUT[8] = {0};
|
||||||
static task_t s_max_task;
|
|
||||||
uint8_t data_receive123[1] ={0};
|
uint8_t data_receive123[1] ={0};
|
||||||
uint8_t data_TRANS123[1] ={0x0F};
|
uint8_t data_TRANS123[1] ={0x0F};
|
||||||
extern void logWrite(const char *fmt, ...);
|
extern void logWrite(const char *fmt, ...);
|
||||||
@ -28,6 +28,7 @@ void fml_Read_Device_ID(uint8_t data_receive)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool fml_Write_ISET(uint8_t value)
|
bool fml_Write_ISET(uint8_t value)
|
||||||
{
|
{
|
||||||
uint8_t address = ISET_REG;
|
uint8_t address = ISET_REG;
|
||||||
@ -35,18 +36,17 @@ bool fml_Write_ISET(uint8_t value)
|
|||||||
return ACK;
|
return ACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fml_max25512_set_bklight_on(bool bON)
|
||||||
|
{
|
||||||
|
fml_gpio_write(OUT_BL_EN,bON);
|
||||||
|
cola_delay_ms(5);
|
||||||
|
if(bON)
|
||||||
|
fml_Write_ISET(0x02);
|
||||||
|
}
|
||||||
|
|
||||||
void fml_max25512_init(void)
|
void fml_max25512_init(void)
|
||||||
{
|
{
|
||||||
bool bACK = false;
|
|
||||||
g_pDev_max25512_iic = cola_device_find("max25512_IIC");
|
g_pDev_max25512_iic = cola_device_find("max25512_IIC");
|
||||||
//bACK = fml_Write_ISET(0x02);// ENA set 1
|
|
||||||
//if(bACK == false)
|
|
||||||
// logWrite("max25512:fml_Write_ISET fail\r\n");
|
|
||||||
|
|
||||||
// fml_Read_Device_ID(data_transfer);
|
|
||||||
// cola_timer_create(&s_max_task, fml_Write_ISET, NULL);
|
|
||||||
// cola_timer_start(&s_max_task, EN_COLA_TIMER_ALWAYS, 50);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
13
DP1208/mcu_app/fml/fml_public.h
Normal file
13
DP1208/mcu_app/fml/fml_public.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* fml_public.h
|
||||||
|
*
|
||||||
|
* Created on: 2025年5月21日
|
||||||
|
* Author: chenm
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FML_PUBLIC_H_
|
||||||
|
#define FML_PUBLIC_H_
|
||||||
|
|
||||||
|
extern void logWrite(const char *fmt, ...);
|
||||||
|
|
||||||
|
#endif /* FML_PUBLIC_H_ */
|
@ -5,14 +5,17 @@
|
|||||||
* Author: 22332
|
* Author: 22332
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "cola_init.h"
|
#include "cola_init.h"
|
||||||
#include "cola_device.h"
|
#include "cola_device.h"
|
||||||
#include "cola_os.h"
|
#include "cola_os.h"
|
||||||
#include "fml_pwm.h"
|
#include "fml_pwm.h"
|
||||||
|
#include "shell.h"
|
||||||
|
|
||||||
extern void logWrite(const char *fmt, ...);
|
extern void logWrite(const char *fmt, ...);
|
||||||
|
|
||||||
static cola_device_t *g_pDevpwm = NULL;
|
static cola_device_t *g_pDevpwm = NULL;
|
||||||
|
static uint8_t g_iHostPWMValue = 240; //主机发过来的PWM值
|
||||||
|
|
||||||
void fml_pwm_init(void)
|
void fml_pwm_init(void)
|
||||||
{
|
{
|
||||||
@ -20,7 +23,56 @@ void fml_pwm_init(void)
|
|||||||
if(g_pDevpwm)
|
if(g_pDevpwm)
|
||||||
cola_device_open(g_pDevpwm, 0);
|
cola_device_open(g_pDevpwm, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fml_pwm_change_duty(uint8_t duty)
|
void fml_pwm_change_duty(uint8_t duty)
|
||||||
{
|
{
|
||||||
|
g_iHostPWMValue = duty;
|
||||||
cola_device_cfg(g_pDevpwm,duty,0);
|
cola_device_cfg(g_pDevpwm,duty,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fml_pwm_adjust(bool bTempHigh)
|
||||||
|
{
|
||||||
|
if(g_iHostPWMValue > 0)
|
||||||
|
{
|
||||||
|
uint8_t value = g_iHostPWMValue;
|
||||||
|
if(bTempHigh)
|
||||||
|
value /= 2;
|
||||||
|
cola_device_cfg(g_pDevpwm,value,0);
|
||||||
|
}
|
||||||
|
//logWrite("fml_pwm_adjust,g_iHostPWMValue=%d\r\n",g_iHostPWMValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fml_pwm_deinit(void)
|
||||||
|
{
|
||||||
|
if(g_pDevpwm)
|
||||||
|
{
|
||||||
|
g_pDevpwm = NULL;
|
||||||
|
cola_device_close(g_pDevpwm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int fml_pwm(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
if (argc < 3)
|
||||||
|
{
|
||||||
|
logWrite("para length must greater than 3\r\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int mode = atoi(argv[1]);
|
||||||
|
int value = atoi(argv[2]);
|
||||||
|
if(mode == 0)
|
||||||
|
{
|
||||||
|
logWrite("pwm_value=%d\r\n",value);
|
||||||
|
fml_pwm_change_duty(value);
|
||||||
|
}
|
||||||
|
else if(mode == 1)
|
||||||
|
{
|
||||||
|
logWrite("g_iHostPWMValue=%d\r\n",g_iHostPWMValue);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN),pwm, fml_pwm, pwm control);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,5 +11,7 @@
|
|||||||
|
|
||||||
extern void fml_pwm_init(void);
|
extern void fml_pwm_init(void);
|
||||||
extern void fml_pwm_change_duty(uint8_t duty);
|
extern void fml_pwm_change_duty(uint8_t duty);
|
||||||
|
extern void fml_pwm_deinit(void);
|
||||||
|
extern void fml_pwm_adjust(bool bTempHigh);
|
||||||
|
|
||||||
#endif /* FML_PWM_H_ */
|
#endif /* FML_PWM_H_ */
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include "cola_init.h"
|
|
||||||
#include "cola_device.h"
|
|
||||||
#include "cola_os.h"
|
|
||||||
#include "../fml/fml_gpio.h"
|
|
||||||
#include "../fml/fml_master_iic.h"
|
|
||||||
#include "../fml/fml_TFT.h"
|
|
||||||
|
|
||||||
static task_t s_bist_task;
|
|
||||||
static task_t s_bist_check_task;
|
|
||||||
extern bool bist_mode;
|
|
||||||
extern bool test_mode_flag;
|
|
||||||
uint32_t last_time = 0;
|
|
||||||
uint8_t style = 0;
|
|
||||||
static bool last_bist_mode = false;
|
|
||||||
void logic_polling_change_pattern(void *arg, uint32_t event)
|
|
||||||
{
|
|
||||||
(void) arg;
|
|
||||||
if((bist_mode == false) && (last_bist_mode != bist_mode))
|
|
||||||
{
|
|
||||||
fml_gpio_write(OUT_TFT_BIST,false);
|
|
||||||
last_bist_mode = bist_mode;
|
|
||||||
}
|
|
||||||
else if ((bist_mode == true) && (last_bist_mode != bist_mode))
|
|
||||||
{
|
|
||||||
fml_gpio_write(OUT_TFT_BIST,true);
|
|
||||||
last_bist_mode = bist_mode;
|
|
||||||
style=0;
|
|
||||||
last_time = jiffies-10000;
|
|
||||||
}
|
|
||||||
if(jiffies-last_time > 5000)
|
|
||||||
{
|
|
||||||
last_time = jiffies;
|
|
||||||
fml_tft_BIST_clear();
|
|
||||||
fml_tft_write_BIST_mode(style);
|
|
||||||
style = style+1;
|
|
||||||
if(style == 24)
|
|
||||||
{
|
|
||||||
style=0;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
void check_LVDS_floating(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(bist_mode == true)
|
|
||||||
{
|
|
||||||
fml_gpio_write(OUT_TFT_BIST,true);
|
|
||||||
fml_Write_ISET(0x02);
|
|
||||||
fml_tft_BIST_clear();
|
|
||||||
last_time = jiffies;
|
|
||||||
cola_timer_create(&s_bist_task, logic_polling_change_pattern, NULL);
|
|
||||||
cola_timer_start(&s_bist_task, EN_COLA_TIMER_ALWAYS, 50);
|
|
||||||
cola_timer_stop(&s_bist_check_task);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void Turn_BIST_init(void)
|
|
||||||
{
|
|
||||||
cola_timer_create(&s_bist_check_task, check_LVDS_floating, NULL);
|
|
||||||
cola_timer_start(&s_bist_check_task, EN_COLA_TIMER_ALWAYS, 100);
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* logic_app_start.c
|
|
||||||
*
|
|
||||||
* Created on: 2025年4月25日
|
|
||||||
* Author: 22332
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "cola_init.h"
|
|
||||||
#include "cola_device.h"
|
|
||||||
#include "cola_os.h"
|
|
||||||
#include "../fml/fml_adc.h"
|
|
||||||
#include "../fml/fml_flash.h"
|
|
||||||
#include "../fml/fml_gpio.h"
|
|
||||||
#include "../fml/fml_master_iic.h"
|
|
||||||
#include "../fml/fml_ds90ub948.h"
|
|
||||||
extern void test_mode_open(void);
|
|
||||||
extern void Turn_BIST_init(void);
|
|
||||||
extern void power_on_manage(void);
|
|
||||||
extern void logic_diagnose_init(void);
|
|
||||||
extern void fml_shell_init(void);
|
|
||||||
extern void fml_touch_init(void);
|
|
||||||
extern void fml_touch_read_version_info(void);
|
|
||||||
extern void logic_init(void);
|
|
||||||
|
|
||||||
void fml_init(void)
|
|
||||||
{
|
|
||||||
fml_shell_init();
|
|
||||||
fml_flash_init();
|
|
||||||
fml_master_init();
|
|
||||||
//fml_ds90ub948_open();
|
|
||||||
//fml_touch_init();
|
|
||||||
fml_gpio_init();
|
|
||||||
fml_adc_init();
|
|
||||||
power_on_manage();
|
|
||||||
//test_mode_open();
|
|
||||||
logic_init();
|
|
||||||
Turn_BIST_init();
|
|
||||||
//fml_touch_read_version_info();
|
|
||||||
logic_diagnose_init();
|
|
||||||
}
|
|
||||||
device_initcall(fml_init);
|
|
@ -1,34 +1,37 @@
|
|||||||
/*
|
/*!
|
||||||
* logic_diagnose.c
|
* @文件名 logic_diagnose.c
|
||||||
*
|
*
|
||||||
* Created on: 2025骞<EFBFBD>4鏈<EFBFBD>18鏃<EFBFBD>
|
* @功能描述
|
||||||
* Author: 22332
|
* 通过GPIO以及寄存器,来检测max25512,pmic,tft的故障原因
|
||||||
*/
|
*/
|
||||||
|
#include "logic_public.h"
|
||||||
|
|
||||||
|
extern task_t s_logic_check_wakeup;
|
||||||
|
extern task_t s_logic_check_lvds;
|
||||||
|
extern task_t s_bist_check_task;
|
||||||
|
static task_t s_diagnose_task;
|
||||||
|
|
||||||
#include "bsp_register_map.h"
|
//-----注意: 温度越大,ADC值越小
|
||||||
#include "cola_init.h"
|
#define NTC_86_D_ADC 947 //NTC对应86度对应的ADC值,查表为[947]
|
||||||
#include "cola_device.h"
|
#define NTC_75_D_ADC 1190 //NTC对应75度对应的ADC值,查表为[1190]
|
||||||
#include "cola_os.h"
|
#define NTC_43_D_ADC 2164 //NTC对应43度对应的ADC值,查表为[2164]
|
||||||
#include <stdio.h>
|
#define NTC_39_D_ADC 2303 //NTC对应39度对应的ADC值,查表为[2303]
|
||||||
#include "../fml/fml_pwm.h"
|
|
||||||
#include "../fml/fml_gpio.h"
|
|
||||||
#include "../fml/fml_adc.h"
|
|
||||||
extern uint16_t V_battery_ad;
|
|
||||||
extern uint16_t adc_temp;
|
|
||||||
|
|
||||||
|
#define NTC_HIGH_TEMP_IN NTC_86_D_ADC
|
||||||
|
#define NTC_HIGH_TEMP_OUT NTC_75_D_ADC
|
||||||
|
|
||||||
static task_t loop_diagnose_task;
|
#define ADC_SAMPLE_CNT 10 //ADC采样次数
|
||||||
extern void logWrite(const char *fmt, ...);
|
static uint16_t g_pAdcTempArray[ADC_SAMPLE_CNT]={0}; //温度AD采集BUF
|
||||||
|
static uint16_t g_pAdcBattArray[ADC_SAMPLE_CNT]={0}; //电压AD采集BUF
|
||||||
|
static uint8_t g_iHostPWMValue = 0x00; //主机发过来的PWM值
|
||||||
|
|
||||||
ST_DIAGNOSE1_DATA Err_status1 = {};
|
ST_DIAGNOSE1_DATA Err_status1 = {};
|
||||||
ST_DIAGNOSE2_DATA Err_status2 = {};
|
ST_DIAGNOSE2_DATA Err_status2 = {};
|
||||||
uint8_t result1,result2;
|
uint8_t result1,result2;
|
||||||
uint8_t convertBoolStruc1ToUint8(ST_DIAGNOSE1_DATA bs) {
|
|
||||||
uint8_t result = 0;
|
|
||||||
|
|
||||||
// 璁剧疆姣忎釜浣<E9879C>
|
uint8_t convertBoolStruc1ToUint8(ST_DIAGNOSE1_DATA bs)
|
||||||
|
{
|
||||||
|
uint8_t result = 0;
|
||||||
if (bs.LOW_VOL_FAIL) result |= (1 << 0);
|
if (bs.LOW_VOL_FAIL) result |= (1 << 0);
|
||||||
if (bs.HIGH_VOL_FAIL) result |= (1 << 1);
|
if (bs.HIGH_VOL_FAIL) result |= (1 << 1);
|
||||||
if (bs.LCD_FAIL) result |= (1 << 2);
|
if (bs.LCD_FAIL) result |= (1 << 2);
|
||||||
@ -37,13 +40,12 @@ uint8_t convertBoolStruc1ToUint8(ST_DIAGNOSE1_DATA bs) {
|
|||||||
if (bs.LCD_NTC_FAIL) result |= (1 << 5);
|
if (bs.LCD_NTC_FAIL) result |= (1 << 5);
|
||||||
if (bs.RESERVER1) result |= (1 << 6);
|
if (bs.RESERVER1) result |= (1 << 6);
|
||||||
if (bs.RESERVER2) result |= (1 << 7);
|
if (bs.RESERVER2) result |= (1 << 7);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
uint8_t convertBoolStruct2ToUint8(ST_DIAGNOSE2_DATA bs) {
|
|
||||||
uint8_t result = 0;
|
|
||||||
|
|
||||||
// 璁剧疆姣忎釜浣<E9879C>
|
uint8_t convertBoolStruct2ToUint8(ST_DIAGNOSE2_DATA bs)
|
||||||
|
{
|
||||||
|
uint8_t result = 0;
|
||||||
if (bs.RESERVER0) result |= (1 << 0);
|
if (bs.RESERVER0) result |= (1 << 0);
|
||||||
if (bs.RESERVER1) result |= (1 << 1);
|
if (bs.RESERVER1) result |= (1 << 1);
|
||||||
if (bs.LOCK_FAIL) result |= (1 << 2);
|
if (bs.LOCK_FAIL) result |= (1 << 2);
|
||||||
@ -52,91 +54,111 @@ uint8_t convertBoolStruct2ToUint8(ST_DIAGNOSE2_DATA bs) {
|
|||||||
if (bs.RESERVER5) result |= (1 << 5);
|
if (bs.RESERVER5) result |= (1 << 5);
|
||||||
if (bs.RESERVER6) result |= (1 << 6);
|
if (bs.RESERVER6) result |= (1 << 6);
|
||||||
if (bs.RESERVER7) result |= (1 << 7);
|
if (bs.RESERVER7) result |= (1 << 7);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
void diagnose_polling(void)
|
|
||||||
{
|
|
||||||
static uint8_t low_vol_cnt = 0;
|
|
||||||
static uint8_t high_vol_cnt = 0;
|
|
||||||
static uint8_t high_temp_cnt = 0;
|
|
||||||
// vol_diagnose
|
|
||||||
if((Err_status1.LOW_VOL_FAIL||Err_status1.HIGH_VOL_FAIL) == 0)
|
|
||||||
{
|
|
||||||
if(V_battery_ad<=1172)//灏忎簬8.5V
|
|
||||||
{
|
|
||||||
low_vol_cnt++;
|
|
||||||
if(low_vol_cnt>=10)//妫<>娴<EFBFBD>100ms
|
|
||||||
{
|
|
||||||
Err_status1.LOW_VOL_FAIL = 1;
|
|
||||||
logWrite("Err_status1.LOW_VOL_FAIL = %d",Err_status1.LOW_VOL_FAIL);
|
|
||||||
|
|
||||||
}
|
/*FUNCTION**********************************************************************
|
||||||
}
|
*
|
||||||
else if(V_battery_ad>=2273)//澶т簬16.5V
|
* Function Name : disgnose_batt_voltage_process
|
||||||
|
* Description : 采集B+电压,处理高低压异常
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
void disgnose_batt_voltage_process(void)
|
||||||
|
{
|
||||||
|
uint16_t iBattAd,iBattVoltage=0;
|
||||||
|
static int i = 0;
|
||||||
|
static eNotifyEvent voltageStatusNow = EN_NOTIFY_VOLTAGE_NORMAL;
|
||||||
|
static eNotifyEvent voltageStatusOld = EN_NOTIFY_VOLTAGE_NORMAL;
|
||||||
|
g_pAdcBattArray[i++] = fml_adc_read_bat_ad();
|
||||||
|
if(i==ADC_SAMPLE_CNT)
|
||||||
{
|
{
|
||||||
high_vol_cnt++;
|
i = 0;
|
||||||
if(high_vol_cnt>=10)//妫<>娴<EFBFBD>100ms
|
iBattAd = fml_adc_filter(g_pAdcBattArray,ADC_SAMPLE_CNT);
|
||||||
|
iBattVoltage = fml_adc_to_bat_voltage(iBattAd);
|
||||||
|
//logWrite("iBattVoltage=%d\r\n",iBattVoltage);
|
||||||
|
if(iBattVoltage > VOLTAGE_HIGH_IN)
|
||||||
{
|
{
|
||||||
Err_status1.HIGH_VOL_FAIL = 1;
|
Err_status1.HIGH_VOL_FAIL = 1;
|
||||||
logWrite("Err_status1.HIGH_VOL_FAIL = %d",Err_status1.HIGH_VOL_FAIL);
|
voltageStatusNow = EN_NOTIFY_VOLTAGE_HIGH;
|
||||||
}
|
}
|
||||||
}
|
else if(iBattVoltage < VOLTAGE_LOW_IN)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
low_vol_cnt = 0;
|
Err_status1.LOW_VOL_FAIL = 1;
|
||||||
high_vol_cnt = 0;
|
voltageStatusNow = EN_NOTIFY_VOLTAGE_LOW;
|
||||||
}
|
}
|
||||||
}
|
else if(iBattVoltage <= VOLTAGE_NORMAL_MAX && iBattVoltage >= VOLTAGE_NORMAL_MIN)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
if((V_battery_ad>=1239)&&(V_battery_ad<=2204))//鐢靛帇鍦<E5B887>9V~16V涔嬮棿
|
|
||||||
{
|
|
||||||
Err_status1.LOW_VOL_FAIL = 0;
|
|
||||||
Err_status1.HIGH_VOL_FAIL = 0;
|
Err_status1.HIGH_VOL_FAIL = 0;
|
||||||
|
Err_status1.LOW_VOL_FAIL = 0;
|
||||||
|
voltageStatusNow = EN_NOTIFY_VOLTAGE_NORMAL;
|
||||||
}
|
}
|
||||||
}
|
if(voltageStatusOld != voltageStatusNow)
|
||||||
//high_temperature_diagnose
|
|
||||||
if(Err_status1.LCD_TEMPERATURE_FAIL == 0)
|
|
||||||
{
|
{
|
||||||
if(adc_temp<2164)//947
|
voltageStatusOld = voltageStatusNow;
|
||||||
{
|
cola_set_event(&s_bist_check_task,voltageStatusNow);
|
||||||
high_temp_cnt++;
|
cola_set_event(&s_logic_check_wakeup,voltageStatusNow);
|
||||||
if(high_temp_cnt>=100)//妫<>娴<EFBFBD>1000ms
|
|
||||||
{
|
|
||||||
Err_status1.LCD_TEMPERATURE_FAIL = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
{
|
|
||||||
high_temp_cnt = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(Err_status1.LCD_TEMPERATURE_FAIL == 1)
|
|
||||||
{
|
|
||||||
if(adc_temp>2303)//1190
|
|
||||||
{
|
|
||||||
high_temp_cnt++;
|
|
||||||
if(high_temp_cnt>=100)//妫<>娴<EFBFBD>1000ms
|
|
||||||
Err_status1.LCD_TEMPERATURE_FAIL = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
high_temp_cnt = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(adc_temp == 0 || adc_temp == 4095)
|
|
||||||
Err_status1.LCD_NTC_FAIL = 1;
|
|
||||||
|
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : disgnose_ntc_voltage_process
|
||||||
|
* Description : 采集屏NTC电压,处理屏高温异常
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
void disgnose_ntc_voltage_process(void)
|
||||||
|
{
|
||||||
|
uint16_t iTempAd=0;
|
||||||
|
static int i;
|
||||||
|
static bool bLCDTempHighNow = false,bLCDTempHighOld = false;
|
||||||
|
g_pAdcTempArray[i++] = fml_adc_read_temp_ad();
|
||||||
|
if(i==ADC_SAMPLE_CNT)
|
||||||
|
{
|
||||||
|
i = 0;
|
||||||
|
iTempAd = fml_adc_filter(g_pAdcTempArray,ADC_SAMPLE_CNT);
|
||||||
|
if(iTempAd<NTC_HIGH_TEMP_IN)
|
||||||
|
bLCDTempHighNow = true;
|
||||||
|
else if(iTempAd>NTC_HIGH_TEMP_OUT)
|
||||||
|
bLCDTempHighNow = false;
|
||||||
|
if(bLCDTempHighOld != bLCDTempHighNow)
|
||||||
|
{
|
||||||
|
bLCDTempHighOld = bLCDTempHighNow;
|
||||||
|
Err_status1.LCD_TEMPERATURE_FAIL = bLCDTempHighNow?1:0;
|
||||||
|
fml_pwm_adjust(bLCDTempHighNow);
|
||||||
|
logWrite("iTempAd=%d,LCD_TEMPERATURE_FAIL=%d\r\n",iTempAd,Err_status1.LCD_TEMPERATURE_FAIL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : diagnose_polling_task
|
||||||
|
* Description : 诊断任务处理函数
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
void diagnose_polling_task(void *arg, uint32_t event)
|
||||||
|
{
|
||||||
|
(void)arg;
|
||||||
|
(void)event;
|
||||||
|
disgnose_batt_voltage_process();
|
||||||
|
disgnose_ntc_voltage_process();
|
||||||
Err_status1.LCD_FAIL = fml_gpio_read(IN_TFT_ERR);
|
Err_status1.LCD_FAIL = fml_gpio_read(IN_TFT_ERR);
|
||||||
Err_status1.BACKLIGHT_FAIL = fml_gpio_read(IN_BL_ERR);
|
Err_status1.BACKLIGHT_FAIL = fml_gpio_read(IN_BL_ERR);
|
||||||
Err_status2.LOCK_FAIL = fml_gpio_read(IN_LVDS_UNLOCK);
|
Err_status2.LOCK_FAIL = fml_gpio_read(IN_LVDS_UNLOCK);
|
||||||
|
|
||||||
result1 = convertBoolStruc1ToUint8(Err_status1);
|
result1 = convertBoolStruc1ToUint8(Err_status1);
|
||||||
result2 = convertBoolStruct2ToUint8(Err_status2);
|
result2 = convertBoolStruct2ToUint8(Err_status2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_diagnose_init
|
||||||
|
* Description : 初始化诊断检测任务
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
void logic_diagnose_init(void)
|
void logic_diagnose_init(void)
|
||||||
{
|
{
|
||||||
cola_timer_create(&loop_diagnose_task, diagnose_polling, NULL);
|
cola_timer_create(&s_diagnose_task, diagnose_polling_task, NULL);
|
||||||
cola_timer_start(&loop_diagnose_task, EN_COLA_TIMER_ALWAYS, 10);
|
cola_timer_start(&s_diagnose_task, EN_COLA_TIMER_ALWAYS, 100);
|
||||||
}
|
}
|
||||||
|
145
DP1208/mcu_app/logic/logic_mode_bist.c
Normal file
145
DP1208/mcu_app/logic/logic_mode_bist.c
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
/*!
|
||||||
|
* @文件名 logic_mode_bist.c
|
||||||
|
*
|
||||||
|
* @功能描述
|
||||||
|
* 通过检测948的LVDS Lock信号,控制屏幕是否进入BIST模式
|
||||||
|
*/
|
||||||
|
#include "logic_public.h"
|
||||||
|
|
||||||
|
#define PERIOD_CHECK_LVDS_LOCK 10 //检测LVDS信号的周期
|
||||||
|
task_t s_bist_check_task; //BIST模式检测
|
||||||
|
extern void logic_power_up_step2(void); //跨模块调用,违背了原则^-^
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : check_lvds_floating
|
||||||
|
* Description : 通过检测LVDS Lock信号,进入BIST模式
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
static void check_lvds_floating(void *arg, uint32_t event)
|
||||||
|
{
|
||||||
|
(void)arg;
|
||||||
|
(void)event;
|
||||||
|
static bool bVoltageNormal = true;
|
||||||
|
static uint8_t style = 0;
|
||||||
|
static bool bBistMode = false;
|
||||||
|
static bool bFirst = true;
|
||||||
|
static bool bLockStatusOld = false;
|
||||||
|
static int iCheckDurCnt = 0, iDlyCnt = 0,iPeriodCnt = 0;
|
||||||
|
if(event > 0)
|
||||||
|
{//事件解析
|
||||||
|
if((event & EN_NOTIFY_SYS_POWER_DOWN) == EN_NOTIFY_SYS_POWER_DOWN)
|
||||||
|
{
|
||||||
|
bFirst = true;
|
||||||
|
logWrite("bist mode rx power down nofity\r\n");
|
||||||
|
}
|
||||||
|
if((event & EN_NOTIFY_VOLTAGE_LOW) == EN_NOTIFY_VOLTAGE_LOW)
|
||||||
|
{
|
||||||
|
bVoltageNormal = false;
|
||||||
|
logWrite("bist mode rx EN_NOTIFY_VOLTAGE_LOW\r\n");
|
||||||
|
}
|
||||||
|
if((event & EN_NOTIFY_VOLTAGE_HIGH) == EN_NOTIFY_VOLTAGE_HIGH)
|
||||||
|
{
|
||||||
|
bVoltageNormal = false;
|
||||||
|
logWrite("bist mode rx EN_NOTIFY_VOLTAGE_HIGH\r\n");
|
||||||
|
}
|
||||||
|
if((event & EN_NOTIFY_VOLTAGE_NORMAL) == EN_NOTIFY_VOLTAGE_NORMAL)
|
||||||
|
{
|
||||||
|
bVoltageNormal = true;
|
||||||
|
logWrite("bist mode rx EN_NOTIFY_VOLTAGE_NORMAL\r\n");
|
||||||
|
if(bBistMode)
|
||||||
|
{
|
||||||
|
logic_power_up_step2();
|
||||||
|
fml_max25512_set_bklight_on(true);
|
||||||
|
fml_gpio_write(OUT_TFT_BIST,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(iCheckDurCnt < 6000)
|
||||||
|
{//前6秒不检测该信号丢失
|
||||||
|
iCheckDurCnt+=PERIOD_CHECK_LVDS_LOCK;
|
||||||
|
bLockStatusOld = !fml_gpio_read(IN_LVDS_UNLOCK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{//读取LVDS Lock信号
|
||||||
|
bool bLockStatus = fml_gpio_read(IN_LVDS_UNLOCK);
|
||||||
|
bool bWakeUpStatus = fml_gpio_read(IN_WAKEUP);
|
||||||
|
if(bWakeUpStatus == false || bVoltageNormal == false)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if((event & EN_NOTIFY_SYS_POWER_UP) == EN_NOTIFY_SYS_POWER_UP)
|
||||||
|
{
|
||||||
|
if(bBistMode)
|
||||||
|
{
|
||||||
|
logWrite("bist mode rx power up nofity\r\n");
|
||||||
|
iPeriodCnt = 0;
|
||||||
|
logic_power_up_step2();
|
||||||
|
fml_max25512_set_bklight_on(true); //开背光
|
||||||
|
fml_gpio_write(OUT_TFT_BIST,true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bLockStatusOld != bLockStatus)
|
||||||
|
{//5次消抖
|
||||||
|
iDlyCnt = 5;
|
||||||
|
bLockStatusOld = bLockStatus;
|
||||||
|
}
|
||||||
|
if(iDlyCnt > 0)
|
||||||
|
{
|
||||||
|
iDlyCnt--;
|
||||||
|
if(0 == iDlyCnt)
|
||||||
|
{
|
||||||
|
style = 0;
|
||||||
|
iPeriodCnt = 0;
|
||||||
|
if(bLockStatus)
|
||||||
|
{//检测到LVDS Lock信号生效
|
||||||
|
bFirst = false;
|
||||||
|
bBistMode = false;
|
||||||
|
logWrite("exit bist\r\n");
|
||||||
|
fml_max25512_set_bklight_on(true); //开背光
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{//检测到LVDS Lock信号丢失
|
||||||
|
bBistMode = true;
|
||||||
|
logWrite("enter bist\r\n");
|
||||||
|
if(bFirst)
|
||||||
|
{//首次上电时,需要进行如下系列供电
|
||||||
|
bFirst = false;
|
||||||
|
iPeriodCnt = 0;
|
||||||
|
logic_power_up_step2();
|
||||||
|
}
|
||||||
|
fml_max25512_set_bklight_on(true); //开背光
|
||||||
|
fml_tft_BIST_clear();//写寄存器清除BIST模式设置
|
||||||
|
}
|
||||||
|
fml_gpio_write(OUT_TFT_BIST,!bLockStatus);//设置Bist模式输出引脚
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bLockStatus == false && bBistMode)
|
||||||
|
{
|
||||||
|
iPeriodCnt+=PERIOD_CHECK_LVDS_LOCK;
|
||||||
|
if(iPeriodCnt > 5000)
|
||||||
|
{//每隔5秒切换一次bist模式
|
||||||
|
//logWrite("iPeriodCnt=%d\r\n",iPeriodCnt);
|
||||||
|
iPeriodCnt = 0;
|
||||||
|
fml_tft_BIST_clear();
|
||||||
|
fml_tft_write_BIST_mode(style);
|
||||||
|
style++;
|
||||||
|
if(style == 24)//切换到第24个模式再从0开始
|
||||||
|
style=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_bist_init
|
||||||
|
* Description : 初始化BIST模式检测任务
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
void logic_bist_init(void)
|
||||||
|
{
|
||||||
|
cola_timer_create(&s_bist_check_task, check_lvds_floating, NULL);
|
||||||
|
cola_timer_start(&s_bist_check_task, EN_COLA_TIMER_ALWAYS, PERIOD_CHECK_LVDS_LOCK);
|
||||||
|
}
|
@ -1,22 +1,10 @@
|
|||||||
/*
|
/*!
|
||||||
* logic_test_mode.c
|
* @文件名 logic_mode_eol.c
|
||||||
*
|
*
|
||||||
* Created on: 2025骞<EFBFBD>4鏈<EFBFBD>23鏃<EFBFBD>
|
* @功能描述
|
||||||
* Author: 22332
|
* 开机一定时间内,如果检测到上位机发来的命令,则进入EOL模式,方便进行下线配置
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include "logic_public.h"
|
||||||
#include "cola_init.h"
|
|
||||||
#include "cola_device.h"
|
|
||||||
#include "cola_os.h"
|
|
||||||
#include "sdk_project_config.h"
|
|
||||||
#include "../fml/fml_ds90ub948.h"
|
|
||||||
#include "../fml/fml_gpio.h"
|
|
||||||
#include "../fml/fml_pwm.h"
|
|
||||||
#include "../fml/fml_adc.h"
|
|
||||||
#include "../fml/fml_TFT.h"
|
|
||||||
#include "../fml/fml_flash.h"
|
|
||||||
#include "bsp_register_map.h"
|
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
#define READ_COMD 0x22
|
#define READ_COMD 0x22
|
||||||
#define WRITE_COMD 0x2E
|
#define WRITE_COMD 0x2E
|
||||||
@ -45,8 +33,7 @@ void (*p_turn_read)(uint8_t*) = fml_ds90ub948_read_commod;
|
|||||||
|
|
||||||
void logic_vendor_task(void *arg, uint32_t event)
|
void logic_vendor_task(void *arg, uint32_t event)
|
||||||
{
|
{
|
||||||
(void) arg;
|
(void)arg;
|
||||||
|
|
||||||
if(event == 1)
|
if(event == 1)
|
||||||
{
|
{
|
||||||
printf("vendor_data_load");
|
printf("vendor_data_load");
|
||||||
@ -57,7 +44,6 @@ void logic_vendor_task(void *arg, uint32_t event)
|
|||||||
printf("vendor_data_save");
|
printf("vendor_data_save");
|
||||||
vendor_data_save();
|
vendor_data_save();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -75,6 +61,7 @@ void check_one_second(void)
|
|||||||
cola_timer_stop(&s_test_task);
|
cola_timer_stop(&s_test_task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_mode_open(void)
|
void test_mode_open(void)
|
||||||
{
|
{
|
||||||
int test_Rx_length = sizeof(test_slaveRxBuffer);
|
int test_Rx_length = sizeof(test_slaveRxBuffer);
|
||||||
@ -95,15 +82,12 @@ void fml_test_mode(uint8_t *pBuf)
|
|||||||
case APP_VERSION:
|
case APP_VERSION:
|
||||||
if(pBuf[0] == READ_COMD)
|
if(pBuf[0] == READ_COMD)
|
||||||
{
|
{
|
||||||
cola_set_event(&s_vendor_task, 1);
|
|
||||||
|
|
||||||
test_slaveTxBuffer[0] = gst_vendor_data.SOFTWARE_VERSION0;
|
test_slaveTxBuffer[0] = gst_vendor_data.SOFTWARE_VERSION0;
|
||||||
test_slaveTxBuffer[1] = gst_vendor_data.SOFTWARE_VERSION1;
|
test_slaveTxBuffer[1] = gst_vendor_data.SOFTWARE_VERSION1;
|
||||||
test_slaveTxBuffer[2] = gst_vendor_data.SOFTWARE_VERSION2;
|
test_slaveTxBuffer[2] = gst_vendor_data.SOFTWARE_VERSION2;
|
||||||
test_slaveTxBuffer[3] = gst_vendor_data.SOFTWARE_VERSION3;
|
test_slaveTxBuffer[3] = gst_vendor_data.SOFTWARE_VERSION3;
|
||||||
test_slaveTxBuffer[4] = gst_vendor_data.SOFTWARE_VERSION4;
|
test_slaveTxBuffer[4] = gst_vendor_data.SOFTWARE_VERSION4;
|
||||||
test_slaveTxBuffer[5] = gst_vendor_data.SOFTWARE_VERSION5;
|
test_slaveTxBuffer[5] = gst_vendor_data.SOFTWARE_VERSION5;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (pBuf[0] == WRITE_COMD)
|
else if (pBuf[0] == WRITE_COMD)
|
||||||
{
|
{
|
||||||
@ -113,17 +97,12 @@ void fml_test_mode(uint8_t *pBuf)
|
|||||||
gst_vendor_data.SOFTWARE_VERSION3 = pBuf[5];
|
gst_vendor_data.SOFTWARE_VERSION3 = pBuf[5];
|
||||||
gst_vendor_data.SOFTWARE_VERSION4 = pBuf[6];
|
gst_vendor_data.SOFTWARE_VERSION4 = pBuf[6];
|
||||||
gst_vendor_data.SOFTWARE_VERSION5 = pBuf[7];
|
gst_vendor_data.SOFTWARE_VERSION5 = pBuf[7];
|
||||||
cola_set_event(&s_vendor_task, 2);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
case PN_VERSION:
|
case PN_VERSION:
|
||||||
if(pBuf[0] == READ_COMD)
|
if(pBuf[0] == READ_COMD)
|
||||||
{
|
{
|
||||||
cola_set_event(&s_vendor_task, 1);
|
|
||||||
|
|
||||||
test_slaveTxBuffer[0] = gst_vendor_data.PN_VERSION0;
|
test_slaveTxBuffer[0] = gst_vendor_data.PN_VERSION0;
|
||||||
test_slaveTxBuffer[1] = gst_vendor_data.PN_VERSION1;
|
test_slaveTxBuffer[1] = gst_vendor_data.PN_VERSION1;
|
||||||
test_slaveTxBuffer[2] = gst_vendor_data.PN_VERSION2;
|
test_slaveTxBuffer[2] = gst_vendor_data.PN_VERSION2;
|
||||||
@ -139,16 +118,12 @@ void fml_test_mode(uint8_t *pBuf)
|
|||||||
gst_vendor_data.PN_VERSION3 = pBuf[5];
|
gst_vendor_data.PN_VERSION3 = pBuf[5];
|
||||||
gst_vendor_data.PN_VERSION4 = pBuf[6];
|
gst_vendor_data.PN_VERSION4 = pBuf[6];
|
||||||
gst_vendor_data.PN_VERSION5 = pBuf[7];
|
gst_vendor_data.PN_VERSION5 = pBuf[7];
|
||||||
cola_set_event(&s_vendor_task, 2);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
case HARDWARE_VERSION:
|
case HARDWARE_VERSION:
|
||||||
if(pBuf[0] == READ_COMD)
|
if(pBuf[0] == READ_COMD)
|
||||||
{
|
{
|
||||||
cola_set_event(&s_vendor_task, 1);
|
|
||||||
|
|
||||||
test_slaveTxBuffer[0] = gst_vendor_data.HARDWARE_VERSION0;
|
test_slaveTxBuffer[0] = gst_vendor_data.HARDWARE_VERSION0;
|
||||||
test_slaveTxBuffer[1] = gst_vendor_data.HARDWARE_VERSION1;
|
test_slaveTxBuffer[1] = gst_vendor_data.HARDWARE_VERSION1;
|
||||||
test_slaveTxBuffer[2] = gst_vendor_data.HARDWARE_VERSION2;
|
test_slaveTxBuffer[2] = gst_vendor_data.HARDWARE_VERSION2;
|
||||||
@ -165,7 +140,6 @@ void fml_test_mode(uint8_t *pBuf)
|
|||||||
gst_vendor_data.HARDWARE_VERSION3 = pBuf[5];
|
gst_vendor_data.HARDWARE_VERSION3 = pBuf[5];
|
||||||
gst_vendor_data.HARDWARE_VERSION4 = pBuf[6];
|
gst_vendor_data.HARDWARE_VERSION4 = pBuf[6];
|
||||||
gst_vendor_data.HARDWARE_VERSION5 = pBuf[7];
|
gst_vendor_data.HARDWARE_VERSION5 = pBuf[7];
|
||||||
cola_set_event(&s_vendor_task, 2);
|
|
||||||
}
|
}
|
||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
@ -179,7 +153,7 @@ void fml_test_mode(uint8_t *pBuf)
|
|||||||
case BLACKLIGHT_EN:
|
case BLACKLIGHT_EN:
|
||||||
if (pBuf[0] == WRITE_COMD)
|
if (pBuf[0] == WRITE_COMD)
|
||||||
{
|
{
|
||||||
fml_gpio_write(OUT_BL_EN,pBuf[2]);
|
fml_max25512_set_bklight_on(pBuf[2]);
|
||||||
}
|
}
|
||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
@ -204,7 +178,7 @@ void fml_test_mode(uint8_t *pBuf)
|
|||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
case TEMP_AD_VALUE:
|
case TEMP_AD_VALUE:
|
||||||
test_slaveTxBuffer[0] = fml_adc_read_once_temp();
|
test_slaveTxBuffer[0] = fml_convert_ntc_ad_to_temp();
|
||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
case TP_POSITION:
|
case TP_POSITION:
|
@ -1,22 +1,10 @@
|
|||||||
/*
|
/*!
|
||||||
* logic_public.c
|
* @文件名 logic_parse.c
|
||||||
*
|
*
|
||||||
* Created on: 2025骞<EFBFBD>4鏈<EFBFBD>14鏃<EFBFBD>
|
* @功能描述
|
||||||
* Author: 22332
|
* 通过解析948发来的I2C读写命令来执行主机对屏的控制动作
|
||||||
*/
|
*/
|
||||||
#include "bsp_register_map.h"
|
#include "logic_public.h"
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
#include "cola_init.h"
|
|
||||||
#include "cola_device.h"
|
|
||||||
#include "cola_os.h"
|
|
||||||
#include "cola_fifo.h"
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "../fml/fml_pwm.h"
|
|
||||||
#include "../fml/fml_gpio.h"
|
|
||||||
#include "../fml/fml_adc.h"
|
|
||||||
#include "../fml/fml_ds90ub948.h"
|
|
||||||
#include "../fml/fml_flash.h"
|
|
||||||
|
|
||||||
extern ST_VENDOR_DATA gst_vendor_data;
|
extern ST_VENDOR_DATA gst_vendor_data;
|
||||||
extern uint8_t result1,result2;
|
extern uint8_t result1,result2;
|
||||||
@ -33,24 +21,13 @@ void (*p_read_commod)(uint8_t*) = fml_ds90ub948_read_commod;
|
|||||||
static task_t s_948_task;
|
static task_t s_948_task;
|
||||||
static cola_fifo_t g_rx_fifo;
|
static cola_fifo_t g_rx_fifo;
|
||||||
static uint8_t g_rx_buf[MAX_RX_SIZE];
|
static uint8_t g_rx_buf[MAX_RX_SIZE];
|
||||||
volatile unsigned int time_tag1 = 0;
|
|
||||||
volatile unsigned int time_tag2 = 0;
|
|
||||||
static int receive_iic = 0;
|
|
||||||
bool bist_mode = false;
|
|
||||||
void logic_read_948_task(void *arg, uint32_t event)
|
void logic_read_948_task(void *arg, uint32_t event)
|
||||||
{
|
{
|
||||||
(void) arg;
|
(void)arg;
|
||||||
|
|
||||||
if(jiffies-time_tag1 > 12000)
|
|
||||||
{
|
|
||||||
bist_mode = true;
|
|
||||||
}
|
|
||||||
if((jiffies-time_tag2 > 3000) && (receive_iic == 1))
|
|
||||||
{
|
|
||||||
bist_mode = true;
|
|
||||||
}
|
|
||||||
if(event == 1)
|
if(event == 1)
|
||||||
{
|
{//接收底层发来的事件
|
||||||
#if 0
|
#if 0
|
||||||
//Here print cause data wrong display
|
//Here print cause data wrong display
|
||||||
for(int i=0; i<sizeof(pub_slaveRxBuffer); i++)
|
for(int i=0; i<sizeof(pub_slaveRxBuffer); i++)
|
||||||
@ -58,10 +35,6 @@ void logic_read_948_task(void *arg, uint32_t event)
|
|||||||
logWrite("\r\n");
|
logWrite("\r\n");
|
||||||
#endif
|
#endif
|
||||||
fml_ds90ub948_read_commod(pub_slaveRxBuffer);
|
fml_ds90ub948_read_commod(pub_slaveRxBuffer);
|
||||||
receive_iic = 1;
|
|
||||||
time_tag1 = jiffies;
|
|
||||||
time_tag2 = jiffies;
|
|
||||||
bist_mode = false;
|
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
else
|
else
|
||||||
@ -76,7 +49,7 @@ void logic_read_948_task(void *arg, uint32_t event)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void logic_init(void)
|
void logic_parse_init(void)
|
||||||
{
|
{
|
||||||
cola_fifo_init(&g_rx_fifo, g_rx_buf, MAX_RX_SIZE);
|
cola_fifo_init(&g_rx_fifo, g_rx_buf, MAX_RX_SIZE);
|
||||||
fml_ds90ub948_init(pub_slaveRxBuffer,Rx_length,pub_slaveTxBuffer,Tx_length,p_read_commod,&s_948_task);
|
fml_ds90ub948_init(pub_slaveRxBuffer,Rx_length,pub_slaveTxBuffer,Tx_length,p_read_commod,&s_948_task);
|
||||||
@ -85,31 +58,40 @@ void logic_init(void)
|
|||||||
|
|
||||||
void fml_ds90ub948_read_commod(uint8_t *pBuf)
|
void fml_ds90ub948_read_commod(uint8_t *pBuf)
|
||||||
{
|
{
|
||||||
cola_fifo_write(&g_rx_fifo, pBuf, 2);
|
static int pwmValue = -1;
|
||||||
|
static int backlightOnOff = -1;
|
||||||
|
//cola_fifo_write(&g_rx_fifo, pBuf, 2);
|
||||||
switch (pBuf[0])
|
switch (pBuf[0])
|
||||||
{
|
{
|
||||||
case LCD_BACKLIGHT:
|
case LCD_BACKLIGHT_PWM:
|
||||||
|
if(pwmValue != pBuf[1])
|
||||||
|
{
|
||||||
|
pwmValue = pBuf[1];
|
||||||
if(Err_status1.LCD_TEMPERATURE_FAIL == 1)
|
if(Err_status1.LCD_TEMPERATURE_FAIL == 1)
|
||||||
{
|
{
|
||||||
fml_pwm_change_duty(pBuf[1]/2);
|
fml_pwm_change_duty(pwmValue/2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fml_pwm_change_duty(pBuf[1]);
|
fml_pwm_change_duty(pwmValue);
|
||||||
|
}
|
||||||
|
//logWrite("pwm=%d\r\n",pwmValue);
|
||||||
}
|
}
|
||||||
/* code */
|
|
||||||
break;
|
break;
|
||||||
case LCD_BACKLIGHT_SWITCH:
|
case LCD_BACKLIGHT_SWITCH:
|
||||||
if(pBuf[1] == 1)
|
if(backlightOnOff != pBuf[1])
|
||||||
{
|
{
|
||||||
fml_gpio_write(OUT_BL_EN,true);
|
backlightOnOff = pBuf[1];
|
||||||
fml_Write_ISET(0x02);
|
if(backlightOnOff == 1)
|
||||||
|
{
|
||||||
|
fml_max25512_set_bklight_on(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fml_gpio_write(OUT_BL_EN,false);
|
fml_max25512_set_bklight_on(false);
|
||||||
|
}
|
||||||
|
//logWrite("backlight=%d\r\n",backlightOnOff);
|
||||||
}
|
}
|
||||||
/* code */
|
|
||||||
break;
|
break;
|
||||||
case DAY_NIGHT_MODE:
|
case DAY_NIGHT_MODE:
|
||||||
/* code */
|
/* code */
|
||||||
@ -144,7 +126,7 @@ void fml_ds90ub948_read_commod(uint8_t *pBuf)
|
|||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
case LCD_TEMPURATURE:
|
case LCD_TEMPURATURE:
|
||||||
pub_slaveTxBuffer[0] = fml_adc_read_once_temp();
|
pub_slaveTxBuffer[0] = fml_convert_ntc_ad_to_temp();
|
||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
case UPDATE_READ:
|
case UPDATE_READ:
|
||||||
@ -264,7 +246,6 @@ void fml_ds90ub948_read_commod(uint8_t *pBuf)
|
|||||||
break;
|
break;
|
||||||
case BOOTLOADER_VERSION:
|
case BOOTLOADER_VERSION:
|
||||||
pub_slaveTxBuffer[0] = BOOTLOADER_VERSION_V;
|
pub_slaveTxBuffer[0] = BOOTLOADER_VERSION_V;
|
||||||
|
|
||||||
/* code */
|
/* code */
|
||||||
break;
|
break;
|
||||||
case I2C_CLASSIFY_FLASH_VERSION_READ:
|
case I2C_CLASSIFY_FLASH_VERSION_READ:
|
303
DP1208/mcu_app/logic/logic_power.c
Normal file
303
DP1208/mcu_app/logic/logic_power.c
Normal file
@ -0,0 +1,303 @@
|
|||||||
|
/*!
|
||||||
|
* @文件名 logic_power.c
|
||||||
|
*
|
||||||
|
* @功能描述
|
||||||
|
* 1.通过检测主机控制的FCD_EN信号,控制系统的上下电
|
||||||
|
* 2.通过检测948的LVDS Lock信号,控制屏幕的显示与关闭
|
||||||
|
* 3.通过硬件机制,保证系统可执行自断电操作,从而不需要进入stop模式
|
||||||
|
*/
|
||||||
|
#include "logic_public.h"
|
||||||
|
|
||||||
|
#define PERIOD_CHECK_WAKEUP 10 //检测FCD_EN信号的周期,10ms
|
||||||
|
#define PERIOD_CHECK_LVDS_LOCK 10 //检测LVDS lock信号的周期,10ms
|
||||||
|
|
||||||
|
static eNotifyEvent g_BattStatus = EN_NOTIFY_VOLTAGE_NORMAL; //电源状态
|
||||||
|
static bool g_bPowerDown = true; //false[已上电] true[已下电]
|
||||||
|
static bool g_bWakeUp = false; //false[系统未唤醒] true[系统已唤醒]
|
||||||
|
static bool bWakeUpStatusOld = false;
|
||||||
|
static bool bLockStatusOld = false;
|
||||||
|
|
||||||
|
extern task_t s_bist_check_task; //bist任务
|
||||||
|
task_t s_logic_check_lvds; //周期检测LVDS lock信号的任务句柄
|
||||||
|
task_t s_logic_check_wakeup; //周期检测Wakup信号的任务句柄(即主机FCD_EN信号)
|
||||||
|
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_power_up_step1
|
||||||
|
* Description : 检测到FCD_EN信号时,先给948等外围器件 供电,以便与解串器实现信号LOCK
|
||||||
|
*
|
||||||
|
* 供电关系说明:
|
||||||
|
* 1.FCD_EN信号->SW_3V3_EN[H]->SW_3V3[H]: AD上拉有了,器件3.3v供电有了,948,max25512,pmic供上电
|
||||||
|
* 2.
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
static void logic_power_up_step1(void)
|
||||||
|
{
|
||||||
|
//1.检测到FCD_EN信号->SW_3V3_EN[H]->SW_3V3[H]: AD上拉有了,器件3.3v供电有了,948,max25512,pmic供上电
|
||||||
|
|
||||||
|
//2.拉高PON_HOLD自锁接管电源
|
||||||
|
fml_gpio_write(OUT_PON_HOLD,true);
|
||||||
|
|
||||||
|
//3.拉高LDO_1V2_EN,使能1.2v电压输出,948有用到1.2v
|
||||||
|
fml_gpio_write(OUT_LDO_1V2_EN,true);
|
||||||
|
|
||||||
|
//4.拉高3V3_TFT_EN,使能TFT_VDD输出,给TDDI供电
|
||||||
|
fml_gpio_write(OUT_3V3_TFT_EN,true);
|
||||||
|
|
||||||
|
//5.使能948 LVDS输出
|
||||||
|
fml_gpio_write(OUT_LVDS_PDB,true);
|
||||||
|
|
||||||
|
//6.拉低TP_RST,将TDDI TP触摸复位
|
||||||
|
fml_gpio_write(OUT_TP_RST,false);
|
||||||
|
|
||||||
|
//7.拉低TFT_RST,将TDDI DP显示复位
|
||||||
|
fml_gpio_write(OUT_TFT_RST,false);
|
||||||
|
logWrite("logic_power_up_step1\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_power_up_step2
|
||||||
|
* Description : 检测到LVDS Lock信号时,输出TFT相关电压,打开背光
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
void logic_power_up_step2(void)
|
||||||
|
{
|
||||||
|
//1.拉高TP_RST
|
||||||
|
fml_gpio_write(OUT_TP_RST,true);
|
||||||
|
|
||||||
|
//2.拉高TFT_RST
|
||||||
|
fml_gpio_write(OUT_TFT_RST,true);
|
||||||
|
|
||||||
|
//3.拉高TFT_SHLR,左右镜像控制
|
||||||
|
fml_gpio_write(OUT_TFT_SHLR,true);
|
||||||
|
|
||||||
|
//4.拉高TFT_SYBYB,TDDI退出Standby模式
|
||||||
|
fml_gpio_write(OUT_TFT_SYBYB,true);
|
||||||
|
|
||||||
|
//5.拉高TFT_DISP,使能显示
|
||||||
|
fml_gpio_write(OUT_TFT_DISP,true);
|
||||||
|
|
||||||
|
//6.拉低TFT_BIST,退出BIST测试模式
|
||||||
|
fml_gpio_write(OUT_TFT_BIST,false);
|
||||||
|
|
||||||
|
//7.拉高PMIC_EN,使能屏电压输出,具体输出还要写寄存器
|
||||||
|
fml_gpio_write(OUT_PMIC_EN,true);
|
||||||
|
|
||||||
|
//8.拉高BL_EN,使能MAX25512背光输出,具体输出还要写寄存器
|
||||||
|
fml_gpio_write(OUT_BL_EN,true);
|
||||||
|
|
||||||
|
//10.找到master i2c这路设备
|
||||||
|
fml_tft_init();
|
||||||
|
cola_delay_ms(10);//必须加延时,否则后面i2c写入会出现失败情况!
|
||||||
|
|
||||||
|
//11.按TFT规格书,i2c配置pmic输出电压:PAVDD,NAVDD,VGH,VGL
|
||||||
|
fml_pmic_init();
|
||||||
|
|
||||||
|
//12.i2c配置max25512背光输出
|
||||||
|
fml_max25512_init();
|
||||||
|
|
||||||
|
//13.输出PWM背光控制(pwm输出放在最后,可避免闪屏!!)
|
||||||
|
fml_pwm_init();
|
||||||
|
|
||||||
|
fml_pwm_adjust(false);
|
||||||
|
logWrite("logic_power_up_step2\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_power_down
|
||||||
|
* Description : 屏端系统下电函数
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
static void logic_power_down(void)
|
||||||
|
{
|
||||||
|
//1.关闭pwm输出
|
||||||
|
fml_pwm_change_duty(0);
|
||||||
|
fml_pwm_deinit();
|
||||||
|
|
||||||
|
//6.拉低TFT_SYBYB,TDDI进入Standby模式
|
||||||
|
fml_gpio_write(OUT_TFT_SYBYB,false);
|
||||||
|
|
||||||
|
cola_delay_ms(50);
|
||||||
|
|
||||||
|
//5.拉低TFT_DISP,关闭显示
|
||||||
|
fml_gpio_write(OUT_TFT_DISP,false);
|
||||||
|
|
||||||
|
cola_delay_ms(16);
|
||||||
|
|
||||||
|
//2.拉低BL_EN,关闭MAX25512背光输出
|
||||||
|
fml_gpio_write(OUT_BL_EN,false);
|
||||||
|
|
||||||
|
//3.拉低PMIC_EN,关闭PMIC给屏的相关供电
|
||||||
|
fml_gpio_write(OUT_PMIC_EN,false);
|
||||||
|
|
||||||
|
//4.拉低TFT_BIST,退出BIST测试模式
|
||||||
|
fml_gpio_write(OUT_TFT_BIST,false);
|
||||||
|
|
||||||
|
//7.拉低TFT_RST,复位DP
|
||||||
|
fml_gpio_write(OUT_TFT_RST,false);
|
||||||
|
|
||||||
|
//8.拉低TP_RST,复位TP
|
||||||
|
fml_gpio_write(OUT_TP_RST,false);
|
||||||
|
|
||||||
|
//9.关闭948 LVDS输出
|
||||||
|
fml_gpio_write(OUT_LVDS_PDB,false);
|
||||||
|
|
||||||
|
//10.拉低3V3_TFT_EN,关闭TFT_VDD输出,给TDDI断电
|
||||||
|
fml_gpio_write(OUT_3V3_TFT_EN,false);
|
||||||
|
|
||||||
|
//11.拉低LDO_1V2_EN,关闭1.2v电压输出
|
||||||
|
fml_gpio_write(OUT_LDO_1V2_EN,false);
|
||||||
|
|
||||||
|
//12.拉低PON_HOLD,MCU关闭整个系统电源,包括自身供电[但电源异常时不能关闭电源]
|
||||||
|
if(g_BattStatus == EN_NOTIFY_VOLTAGE_NORMAL)
|
||||||
|
fml_gpio_write(OUT_PON_HOLD,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_task_check_lvds_lock
|
||||||
|
* Description : 周期检测948 LVDS Lock信号,控制TFT的显示与关闭
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
static void logic_task_check_lvds_lock(void *arg, uint32_t event)
|
||||||
|
{
|
||||||
|
(void)arg;
|
||||||
|
(void)event;
|
||||||
|
static int iDlyCnt = 0;
|
||||||
|
if(g_bWakeUp == false)
|
||||||
|
return;
|
||||||
|
if(g_BattStatus != EN_NOTIFY_VOLTAGE_NORMAL)
|
||||||
|
return;
|
||||||
|
bool bLockStatus = fml_gpio_read(IN_LVDS_UNLOCK);
|
||||||
|
if(bLockStatusOld != bLockStatus)
|
||||||
|
{
|
||||||
|
iDlyCnt = 10;
|
||||||
|
#if 0
|
||||||
|
if(bLockStatus)
|
||||||
|
logWrite("detect bLockStatus = %d,signal match\r\n",bLockStatus);
|
||||||
|
else
|
||||||
|
logWrite("detect bLockStatus = %d,signal lost\r\n",bLockStatus);
|
||||||
|
#endif
|
||||||
|
bLockStatusOld = bLockStatus;
|
||||||
|
}
|
||||||
|
if(iDlyCnt > 0)
|
||||||
|
{
|
||||||
|
iDlyCnt--;
|
||||||
|
if(0 == iDlyCnt)
|
||||||
|
{
|
||||||
|
if(bLockStatus)
|
||||||
|
{//检测lvds锁信号生效
|
||||||
|
if(g_bPowerDown)
|
||||||
|
{
|
||||||
|
g_bPowerDown = false;
|
||||||
|
logic_power_up_step2();
|
||||||
|
logWrite("first lock, power on tft\r\n");
|
||||||
|
if(cola_get_ticker() > 15000)
|
||||||
|
{//用于解决上电没有接lvds线,后面再接上不亮屏的情况
|
||||||
|
logWrite("tft self make bk light on\r\n");
|
||||||
|
fml_max25512_set_bklight_on(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
logWrite("lock signal match,enable backlight\r\n");
|
||||||
|
fml_max25512_set_bklight_on(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{//检测lvds锁信号丢失
|
||||||
|
//fml_max25512_set_bklight_on(false);
|
||||||
|
//logWrite("lock signal lost,disable backlight\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_task_check_wakeup_signal
|
||||||
|
* Description : 周期检测主机给过来的FCD_EN信号,控制系统的上下电
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
static void logic_task_check_wakeup_signal(void *arg, uint32_t event)
|
||||||
|
{
|
||||||
|
(void)arg;
|
||||||
|
(void)event;
|
||||||
|
static int iDlyCnt = 0;
|
||||||
|
bool bWakeUpStatus = fml_gpio_read(IN_WAKEUP);
|
||||||
|
bool bEnable = false;
|
||||||
|
if(bWakeUpStatusOld != bWakeUpStatus)
|
||||||
|
{
|
||||||
|
iDlyCnt = 10;
|
||||||
|
bWakeUpStatusOld = bWakeUpStatus;
|
||||||
|
}
|
||||||
|
if(iDlyCnt > 0)
|
||||||
|
{
|
||||||
|
iDlyCnt--;
|
||||||
|
if(0 == iDlyCnt)
|
||||||
|
{
|
||||||
|
bEnable = true;
|
||||||
|
logWrite("detect fcd_en=%d:",bWakeUpStatus);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(event > 0)
|
||||||
|
{
|
||||||
|
if((event & EN_NOTIFY_VOLTAGE_LOW) == EN_NOTIFY_VOLTAGE_LOW)
|
||||||
|
{
|
||||||
|
bEnable = true;
|
||||||
|
logWrite("detect bat low:");
|
||||||
|
}
|
||||||
|
if((event & EN_NOTIFY_VOLTAGE_HIGH) == EN_NOTIFY_VOLTAGE_HIGH)
|
||||||
|
{
|
||||||
|
bEnable = true;
|
||||||
|
logWrite("detect bat high:");
|
||||||
|
}
|
||||||
|
if((event & EN_NOTIFY_VOLTAGE_NORMAL) == EN_NOTIFY_VOLTAGE_NORMAL)
|
||||||
|
{
|
||||||
|
bEnable = true;
|
||||||
|
logWrite("detect bat normal:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bEnable)
|
||||||
|
{
|
||||||
|
if(g_bWakeUp == false)
|
||||||
|
{//上电
|
||||||
|
logWrite("power up\r\n");
|
||||||
|
g_bWakeUp = true;
|
||||||
|
bLockStatusOld = false;
|
||||||
|
logic_power_up_step1();
|
||||||
|
cola_timer_create(&s_logic_check_lvds, logic_task_check_lvds_lock, NULL);
|
||||||
|
cola_timer_start(&s_logic_check_lvds, EN_COLA_TIMER_ALWAYS, PERIOD_CHECK_LVDS_LOCK);
|
||||||
|
cola_set_event(&s_bist_check_task,EN_NOTIFY_SYS_POWER_UP);
|
||||||
|
}
|
||||||
|
else if(g_bWakeUp == true)
|
||||||
|
{//下电
|
||||||
|
logWrite("power down\r\n");
|
||||||
|
cola_set_event(&s_bist_check_task,EN_NOTIFY_SYS_POWER_DOWN);
|
||||||
|
cola_timer_stop(&s_logic_check_lvds);
|
||||||
|
cola_timer_delete(&s_logic_check_lvds);
|
||||||
|
g_bWakeUp = false;
|
||||||
|
g_bPowerDown = true;
|
||||||
|
logic_power_down();
|
||||||
|
cola_delay_ms(200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*FUNCTION**********************************************************************
|
||||||
|
*
|
||||||
|
* Function Name : logic_power_init
|
||||||
|
* Description : 初始化电源管理检测任务
|
||||||
|
*
|
||||||
|
*END**************************************************************************/
|
||||||
|
void logic_power_init(void)
|
||||||
|
{
|
||||||
|
logWrite("getSoftwareVersion:%s\r\n",getSoftwareVersion());
|
||||||
|
bWakeUpStatusOld = !fml_gpio_read(IN_WAKEUP);
|
||||||
|
cola_timer_create(&s_logic_check_wakeup, logic_task_check_wakeup_signal, NULL);
|
||||||
|
cola_timer_start(&s_logic_check_wakeup, EN_COLA_TIMER_ALWAYS, PERIOD_CHECK_WAKEUP);
|
||||||
|
}
|
@ -1,125 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include "cola_init.h"
|
|
||||||
#include "cola_device.h"
|
|
||||||
#include "cola_os.h"
|
|
||||||
#include "fml_gpio.h"
|
|
||||||
#include "fml_pwm.h"
|
|
||||||
#include "fml_PMIC.h"
|
|
||||||
#include "bsp_register_map.h"
|
|
||||||
|
|
||||||
static task_t gpioTask1;
|
|
||||||
static task_t gpioTask2;
|
|
||||||
static task_t gpioTask3;
|
|
||||||
|
|
||||||
bool wakeup = false;
|
|
||||||
bool lock = false;
|
|
||||||
extern ST_DIAGNOSE1_DATA Err_status1;
|
|
||||||
extern bool bist_mode;
|
|
||||||
|
|
||||||
void lock_detect(void *arg, uint32_t event)
|
|
||||||
{
|
|
||||||
lock = fml_gpio_read(IN_LVDS_UNLOCK);
|
|
||||||
|
|
||||||
if((lock == true)||(bist_mode == true))
|
|
||||||
{
|
|
||||||
cola_delay_ms(200);
|
|
||||||
lock = fml_gpio_read(IN_LVDS_UNLOCK);
|
|
||||||
if((lock == true)||(bist_mode == true))
|
|
||||||
{
|
|
||||||
cola_task_delete(&gpioTask2);
|
|
||||||
fml_gpio_write(OUT_TFT_SHLR,true);
|
|
||||||
fml_gpio_write(OUT_TFT_RST,false);
|
|
||||||
cola_delay_ms(100);
|
|
||||||
fml_gpio_write(OUT_TFT_RST,true);
|
|
||||||
fml_gpio_write(OUT_TFT_SYBYB,true);
|
|
||||||
fml_gpio_write(OUT_TFT_DISP,true);
|
|
||||||
//fml_gpio_write(OUT_TFT_BIST,true);
|
|
||||||
fml_gpio_write(OUT_BL_EN,true);
|
|
||||||
fml_gpio_write(OUT_PMIC_EN,true);
|
|
||||||
fml_pwm_init();
|
|
||||||
cola_delay_ms(10);
|
|
||||||
fml_tft_init();
|
|
||||||
cola_delay_ms(10);
|
|
||||||
fml_pmic_init();
|
|
||||||
fml_max25512_init();
|
|
||||||
power_up_manage();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void power_on_detect(void *arg, uint32_t event)
|
|
||||||
{
|
|
||||||
|
|
||||||
wakeup = fml_gpio_read(IN_WAKEUP);
|
|
||||||
if((wakeup == true)&&(Err_status1.HIGH_VOL_FAIL == 0)&&(Err_status1.LOW_VOL_FAIL==0))
|
|
||||||
{
|
|
||||||
cola_task_delete(&gpioTask1);
|
|
||||||
fml_gpio_write(OUT_TP_RST,true);
|
|
||||||
fml_gpio_write(OUT_PON_HOLD,true);
|
|
||||||
fml_gpio_write(OUT_LDO_1V2_EN,true);
|
|
||||||
fml_gpio_write(OUT_3V3_TFT_EN,true);
|
|
||||||
fml_gpio_write(OUT_LVDS_PDB,true);
|
|
||||||
cola_task_create(&gpioTask2, lock_detect, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//start
|
|
||||||
void power_on_manage(void)
|
|
||||||
{
|
|
||||||
// fml_gpio_write(OUT_TP_RST,true);
|
|
||||||
// fml_gpio_write(OUT_PON_HOLD,true);
|
|
||||||
// fml_gpio_write(OUT_LDO_1V2_EN,true);
|
|
||||||
//
|
|
||||||
// fml_gpio_write(OUT_3V3_TFT_EN,true);
|
|
||||||
// cola_delay_ms(200);
|
|
||||||
// fml_gpio_write(OUT_LVDS_PDB,true);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// fml_gpio_write(OUT_TFT_SHLR,true);
|
|
||||||
// fml_gpio_write(OUT_TFT_RST,false);
|
|
||||||
// cola_delay_ms(200);
|
|
||||||
// fml_gpio_write(OUT_TFT_RST,true);
|
|
||||||
//
|
|
||||||
// fml_gpio_write(OUT_TFT_SYBYB,true);
|
|
||||||
// fml_gpio_write(OUT_TFT_DISP,true);
|
|
||||||
// fml_gpio_write(OUT_BL_EN,true);
|
|
||||||
// fml_pwm_init();
|
|
||||||
// //fml_gpio_write(OUT_TFT_BIST,true);
|
|
||||||
// fml_gpio_write(OUT_PMIC_EN,true);
|
|
||||||
// cola_delay_ms(10);
|
|
||||||
// fml_tft_init();
|
|
||||||
// cola_delay_ms(10);
|
|
||||||
// fml_pmic_init();
|
|
||||||
// fml_max25512_init();
|
|
||||||
//fml_tft_write_BIST_mode(0);
|
|
||||||
cola_task_create(&gpioTask1, power_on_detect, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void power_up_detect(void)
|
|
||||||
{
|
|
||||||
wakeup = fml_gpio_read(IN_WAKEUP);
|
|
||||||
|
|
||||||
if((wakeup == false)||(Err_status1.HIGH_VOL_FAIL == 1)||(Err_status1.LOW_VOL_FAIL==1))
|
|
||||||
{
|
|
||||||
|
|
||||||
cola_delay_ms(200);
|
|
||||||
wakeup = fml_gpio_read(IN_WAKEUP);
|
|
||||||
if((wakeup == false)||(Err_status1.HIGH_VOL_FAIL == 1)||(Err_status1.LOW_VOL_FAIL==1))
|
|
||||||
{
|
|
||||||
cola_task_delete(&gpioTask3);
|
|
||||||
fml_gpio_write(OUT_BL_EN,false);
|
|
||||||
fml_gpio_write(OUT_PMIC_EN,false);
|
|
||||||
fml_gpio_write(OUT_TFT_SYBYB,false);
|
|
||||||
fml_gpio_write(OUT_TFT_DISP,false);
|
|
||||||
fml_gpio_write(OUT_LVDS_PDB,false);
|
|
||||||
fml_gpio_write(OUT_3V3_TFT_EN,false);
|
|
||||||
fml_gpio_write(OUT_LDO_1V2_EN,false);
|
|
||||||
fml_gpio_write(OUT_PON_HOLD,false);
|
|
||||||
power_on_manage();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void power_up_manage(void)
|
|
||||||
{
|
|
||||||
cola_task_create(&gpioTask3, power_up_detect, NULL);
|
|
||||||
}
|
|
64
DP1208/mcu_app/logic/logic_public.h
Normal file
64
DP1208/mcu_app/logic/logic_public.h
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* logic_public.h
|
||||||
|
*
|
||||||
|
* Created on: 2025年5月21日
|
||||||
|
* Author: chenm
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LOGIC_PUBLIC_H_
|
||||||
|
#define LOGIC_PUBLIC_H_
|
||||||
|
#include "bsp_register_map.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "cola_init.h"
|
||||||
|
#include "cola_device.h"
|
||||||
|
#include "cola_os.h"
|
||||||
|
#include "cola_fifo.h"
|
||||||
|
#include "fml_gpio.h"
|
||||||
|
#include "fml_pwm.h"
|
||||||
|
#include "fml_PMIC.h"
|
||||||
|
#include "fml_tft.h"
|
||||||
|
#include "fml_flash.h"
|
||||||
|
#include "fml_adc.h"
|
||||||
|
#include "fml_ds90ub948.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
EN_NOTIFY_NONE = 0,
|
||||||
|
EN_NOTIFY_SYS_POWER_DOWN = 0x01, //通知系统已下电
|
||||||
|
EN_NOTIFY_SYS_POWER_UP = 0x02, //通知系统上电
|
||||||
|
EN_NOTIFY_VOLTAGE_NORMAL = 0x04, //通知系统电压正常
|
||||||
|
EN_NOTIFY_VOLTAGE_HIGH = 0x08, //通知系统高压异常
|
||||||
|
EN_NOTIFY_VOLTAGE_LOW = 0x10, //通知系统低压异常
|
||||||
|
}eNotifyEvent;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
//规范要求值:
|
||||||
|
#define VOLTAGE_LOW_IN 8500 // 低压进入电压
|
||||||
|
#define VOLTAGE_LOW_OUT 9000 // 低压退出电压
|
||||||
|
|
||||||
|
#define VOLTAGE_NORMAL_MIN 9000 // 正常电压最小电压
|
||||||
|
#define VOLTAGE_NORMAL_MAX 16000 // 正常电压最大电压
|
||||||
|
|
||||||
|
#define VOLTAGE_HIGH_IN 16500 // 高压进入电压
|
||||||
|
#define VOLTAGE_HIGH_OUT 16000 // 高压退出电压
|
||||||
|
#else
|
||||||
|
//这几个值用于做实验
|
||||||
|
#define VOLTAGE_LOW_IN 9500 // 低压进入电压
|
||||||
|
#define VOLTAGE_LOW_OUT 10000 // 低压退出电压
|
||||||
|
|
||||||
|
#define VOLTAGE_NORMAL_MIN 10000 // 正常电压最小电压
|
||||||
|
#define VOLTAGE_NORMAL_MAX 15000 // 正常电压最大电压
|
||||||
|
|
||||||
|
#define VOLTAGE_HIGH_IN 15500 // 高压进入电压
|
||||||
|
#define VOLTAGE_HIGH_OUT 15000 // 高压退出电压
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern void logWrite(const char *fmt, ...);
|
||||||
|
extern void fml_max25512_init(void);
|
||||||
|
extern void fml_max25512_set_bklight_on(bool bON);
|
||||||
|
extern void logic_process_bist_mode(bool bEnable);
|
||||||
|
extern void fml_tft_BIST_clear(void);
|
||||||
|
|
||||||
|
#endif /* LOGIC_PUBLIC_H_ */
|
21
DP1208/mcu_app/logic/version.c
Normal file
21
DP1208/mcu_app/logic/version.c
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* version.c
|
||||||
|
*
|
||||||
|
* Created on: 2025年5月20日
|
||||||
|
* Author: chenm
|
||||||
|
*/
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#define HARDWARE_VERSION "V1.0.3" //len=6
|
||||||
|
#define SOFTWARE_VERSION "V1.0.0" //len=6
|
||||||
|
#define PN_VERSION "PN0001" //len=6
|
||||||
|
|
||||||
|
#define I2C_CLASSIFY_VERSION "0001" //len=4
|
||||||
|
#define I2C_CLASSIFY_FBL_VERSION "001" //len=3
|
||||||
|
|
||||||
|
char g_pVersion[] = SOFTWARE_VERSION;
|
||||||
|
|
||||||
|
char * getSoftwareVersion(void)
|
||||||
|
{
|
||||||
|
return SOFTWARE_VERSION;
|
||||||
|
}
|
@ -50,6 +50,6 @@
|
|||||||
#define BOOTLOADER_VERSION_V 0x0FU;
|
#define BOOTLOADER_VERSION_V 0x0FU;
|
||||||
#define FALSH_VERSION 0x01U;
|
#define FALSH_VERSION 0x01U;
|
||||||
|
|
||||||
|
extern char * getSoftwareVersion(void);
|
||||||
|
|
||||||
#endif /* VERSION_H_ */
|
#endif /* VERSION_H_ */
|
||||||
|
@ -36,7 +36,7 @@ void logWrite(const char *fmt, ...)
|
|||||||
#define LOG_BUFFER_SIZE 256
|
#define LOG_BUFFER_SIZE 256
|
||||||
static char logBuffer[LOG_BUFFER_SIZE];
|
static char logBuffer[LOG_BUFFER_SIZE];
|
||||||
va_list vargs;
|
va_list vargs;
|
||||||
int len;
|
volatile int len = 0;
|
||||||
|
|
||||||
va_start(vargs, fmt);
|
va_start(vargs, fmt);
|
||||||
len = vsnprintf(logBuffer, LOG_BUFFER_SIZE - 1, fmt, vargs);
|
len = vsnprintf(logBuffer, LOG_BUFFER_SIZE - 1, fmt, vargs);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef _SHELL_PORT_H_
|
#ifndef _SHELL_PORT_H_
|
||||||
#define _SHELL_PORT_H_
|
#define _SHELL_PORT_H_
|
||||||
//#include "system.h"
|
//#include "system.h"
|
||||||
#include "shell.h"
|
//#include "shell.h"
|
||||||
|
|
||||||
extern Shell shell;
|
|
||||||
void User_Shell_Init(void);
|
|
||||||
|
|
||||||
|
//extern Shell shell;
|
||||||
|
//void User_Shell_Init(void);
|
||||||
|
extern void fml_shell_init(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user