Compare commits
No commits in common. "sriram-feat-display" and "stable" have entirely different histories.
sriram-fea
...
stable
15
.cproject
15
.cproject
|
|
@ -73,7 +73,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="bs_touchAndLcd|mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
|
@ -191,7 +191,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="bs_touchAndLcd|mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
|
@ -310,7 +310,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="bs_touchAndLcd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
|
@ -359,7 +359,6 @@
|
|||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.TMS470_GNU_9.0.compilerID.INCLUDE_PATH.1406977247" name="Include paths (-I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_GNU_9.0.compilerID.INCLUDE_PATH" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="${COM_TI_MSPM0_SDK_INCLUDE_PATH}"/>
|
||||
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/ivec_BSW/ivec_bsw_display/inc}"/>
|
||||
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/ivec_cmplx_vframe/inc}"/>
|
||||
<listOptionValue builtIn="false" value="${SYSCONFIG_TOOL_INCLUDE_PATH}"/>
|
||||
<listOptionValue builtIn="false" value="${workspace_loc:/${ProjName}/ivec_ECU/ivec_ecu_nfc/inc}"/>
|
||||
|
|
@ -440,7 +439,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="driverlib|m0p|lib|.meta|mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
|
||||
<entry excluding="driverlib|m0p|lib|.meta|mspm0g3507.cmd|bs_touchAndLcd" flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name=""/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="driverlib"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="lib"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="m0p"/>
|
||||
|
|
@ -562,7 +561,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="bs_touchAndLcd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
|
@ -685,7 +684,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="bs_touchAndLcd|mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
|
@ -804,7 +803,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry excluding="bs_touchAndLcd|mspm0g3507.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@
|
|||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.MSPM0G3507.ccxml.SEGGER J-Link Emulator_0/CORTEX_M0P" value="mspm0g3507_mcal"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.MSPM0G3507.ccxml.Texas Instruments XDS110 USB Debug Probe/CORTEX_M0P" value="mspm0g3507_mcal"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.MSPM0G3507.ccxml.Texas Instruments XDS110 USB Debug Probe_0/CORTEX_M0P" value="mspm0g3507_mcal"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${workspace_loc:/mspm0g3507_mcal/targetConfigs/MSPM0G3507.ccxml}"/>
|
||||
<booleanAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_USE_DEFAULT_TARGET_CONFIG" value="false"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:mspm0g3507_mcal}"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.MSPM0G3507.ccxml.SEGGER J-Link Emulator_0/CORTEX_M0P" value="${build_artifact:mspm0g3507_mcal}"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.MSPM0G3507.ccxml.Texas Instruments XDS110 USB Debug Probe/CORTEX_M0P" value="${build_artifact:mspm0g3507_mcal}"/>
|
||||
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.MSPM0G3507.ccxml.Texas Instruments XDS110 USB Debug Probe_0/CORTEX_M0P" value="${build_artifact:mspm0g3507_mcal}"/>
|
||||
|
|
|
|||
|
|
@ -26,14 +26,104 @@ encoding//AAR/subdir_rules.mk=UTF-8
|
|||
encoding//AAR/subdir_vars.mk=UTF-8
|
||||
encoding//AAR/utils/subdir_rules.mk=UTF-8
|
||||
encoding//AAR/utils/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/Core/Source/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/Core/Source/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/Generated\ Codes/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/Generated\ Codes/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/LCD_1604/interface/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/LCD_1604/interface/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/LCD_1604/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/LCD_1604/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/SDK/drivers/Src/timers/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/SDK/drivers/Src/timers/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/TM1650_SDK/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/TM1650_SDK/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0c110x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0c110x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0g1x0x_g3x0x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0g1x0x_g3x0x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0gx51x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0gx51x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0h321x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0h321x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0l111x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0l111x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0l11xx_l13xx/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0l11xx_l13xx/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0l122x_l222x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/gcc/m0p/mspm0l122x_l222x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0c110x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0c110x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0g1x0x_g3x0x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0g1x0x_g3x0x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0gx51x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0gx51x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0h321x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0h321x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0l111x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0l111x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0l11xx_l13xx/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0l11xx_l13xx/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0l122x_l222x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/iar/m0p/mspm0l122x_l222x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0c110x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0c110x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0g1x0x_g3x0x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0g1x0x_g3x0x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0gx51x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0gx51x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0h321x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0h321x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0l111x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0l111x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0l11xx_l13xx/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0l11xx_l13xx/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0l122x_l222x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/keil/m0p/mspm0l122x_l222x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0c110x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0c110x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0g1x0x_g3x0x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0g1x0x_g3x0x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0gx51x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0gx51x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0h321x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0h321x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0l111x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0l111x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0l11xx_l13xx/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0l11xx_l13xx/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0l122x_l222x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/lib/ticlang/m0p/mspm0l122x_l222x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/m0p/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/m0p/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/m0p/sysctl/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/m0p/sysctl/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/driverlib/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/driverlib/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_APP/ivec_cmplx_gptimer/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_APP/ivec_cmplx_gptimer/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_APP/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_APP/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_BSW/ivec_bsw_common/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_BSW/ivec_bsw_common/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_BSW/ivec_bsw_nfc/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_BSW/ivec_bsw_nfc/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_can/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_can/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_common/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_common/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_nfc/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_nfc/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_uart/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_ECU/ivec_ecu_uart/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_ESDK/ivec_cmplx_gptimer/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_ESDK/ivec_cmplx_gptimer/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_ESDK/ivec_esdk_nfc_pn532/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_ESDK/ivec_esdk_nfc_pn532/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_RTE/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_RTE/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/ivec_cmplx_vframe/src/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/ivec_cmplx_vframe/src/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/lib/gcc/m0p/mspm0c110x/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/lib/gcc/m0p/mspm0c110x/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/lib/gcc/m0p/mspm0g1x0x_g3x0x/subdir_rules.mk=UTF-8
|
||||
|
|
@ -86,6 +176,13 @@ encoding//Debug/m0p/subdir_rules.mk=UTF-8
|
|||
encoding//Debug/m0p/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/m0p/sysctl/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/m0p/sysctl/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/makefile=UTF-8
|
||||
encoding//Debug/objects.mk=UTF-8
|
||||
encoding//Debug/sources.mk=UTF-8
|
||||
encoding//Debug/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/subdir_vars.mk=UTF-8
|
||||
encoding//Debug/utils/subdir_rules.mk=UTF-8
|
||||
encoding//Debug/utils/subdir_vars.mk=UTF-8
|
||||
encoding//Test__GNU/Core/Source/subdir_rules.mk=UTF-8
|
||||
encoding//Test__GNU/Core/Source/subdir_vars.mk=UTF-8
|
||||
encoding//Test__GNU/Generated\ Codes/subdir_rules.mk=UTF-8
|
||||
|
|
@ -166,8 +263,6 @@ encoding//Test__GNU/ivec_APP/src/subdir_rules.mk=UTF-8
|
|||
encoding//Test__GNU/ivec_APP/src/subdir_vars.mk=UTF-8
|
||||
encoding//Test__GNU/ivec_BSW/ivec_bsw_common/src/subdir_rules.mk=UTF-8
|
||||
encoding//Test__GNU/ivec_BSW/ivec_bsw_common/src/subdir_vars.mk=UTF-8
|
||||
encoding//Test__GNU/ivec_BSW/ivec_bsw_display/src/subdir_rules.mk=UTF-8
|
||||
encoding//Test__GNU/ivec_BSW/ivec_bsw_display/src/subdir_vars.mk=UTF-8
|
||||
encoding//Test__GNU/ivec_BSW/ivec_bsw_nfc/src/subdir_rules.mk=UTF-8
|
||||
encoding//Test__GNU/ivec_BSW/ivec_bsw_nfc/src/subdir_vars.mk=UTF-8
|
||||
encoding//Test__GNU/ivec_ECU/ivec_ecu_can/src/subdir_rules.mk=UTF-8
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* ivec_TM1650.h
|
||||
*
|
||||
* Created on: 16-Jul-2024
|
||||
* Author: Vecmocon Technology
|
||||
*/
|
||||
|
||||
#ifndef IVEC_TM1650_H_
|
||||
#define IVEC_TM1650_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#if SEV_SEG_DB == 1
|
||||
#define NUM_OF_DIGITS 3
|
||||
#endif
|
||||
/***********************Data Command Settings enumerations***********************/
|
||||
typedef enum{
|
||||
TM_1650_SYSTEM_CMD = 0x48,
|
||||
TM_1650_READ_KEY_CMD = 0x4F,
|
||||
}TM_1650_DataCommandSettings_t;
|
||||
/********************************************************************************/
|
||||
|
||||
|
||||
/***********************System parameter setting enumerations***********************/
|
||||
typedef enum {
|
||||
TM_1650_BRIGHT_1 = 0x10,
|
||||
TM_1650_BRIGHT_2 = 0x20,
|
||||
TM_1650_BRIGHT_3 = 0x30,
|
||||
TM_1650_BRIGHT_4 = 0x40,
|
||||
TM_1650_BRIGHT_5 = 0x50,
|
||||
TM_1650_BRIGHT_6 = 0x60,
|
||||
TM_1650_BRIGHT_7 = 0x70,
|
||||
TM_1650_BRIGHT_8 = 0x00,
|
||||
}TM_1650_Brightness_t;
|
||||
|
||||
typedef enum {
|
||||
TM_1650_Segment_8 = 0x00,
|
||||
TM_1650_Segment_7 = 0x08,
|
||||
}TM_1650_Segement_t;
|
||||
|
||||
typedef enum {
|
||||
TM_1650_Normal_Mode = 0x00,
|
||||
TM_1650_Standby_Mode = 0x04,
|
||||
}TM_1650_OperatingMode_t;
|
||||
|
||||
typedef enum {
|
||||
TM_1650_Screen_OFF = 0x00,
|
||||
TM_1650_Screen_ON = 0x01,
|
||||
}TM_1650_SwitchMode_t;
|
||||
/***********************************************************************************/
|
||||
|
||||
/****************************Memory address enumerations****************************/
|
||||
typedef enum {
|
||||
TM_1650_DIG_1 = 0x68,
|
||||
TM_1650_DIG_2 = 0x6A,
|
||||
TM_1650_DIG_3 = 0x6C,
|
||||
TM_1650_DIG_4 = 0x6E,
|
||||
}TM_1650_Digit_t;
|
||||
|
||||
typedef enum {
|
||||
TM_1650_DISPLAY_0 = 0x3F,
|
||||
TM_1650_DISPLAY_1 = 0x06,
|
||||
}TM_1650_DisplayVal_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
TM_1650_Brightness_t brightness;
|
||||
TM_1650_Segement_t segment;
|
||||
TM_1650_OperatingMode_t opMode;
|
||||
TM_1650_SwitchMode_t switchMode;
|
||||
TM_1650_Digit_t digitsToUse;
|
||||
void (*dat_set_fn)(uint8_t state);
|
||||
void (*clk_set_fn)(uint8_t state);
|
||||
uint8_t (*read_data_fn)(void);
|
||||
} tm1650_drv_t;
|
||||
|
||||
typedef enum{
|
||||
TM1650_SUCCESS = 0,
|
||||
TM1650_ERROR = 1,
|
||||
TM1650_OUT_OF_BOUNDS = 2,
|
||||
}TM1650_Status_T;
|
||||
|
||||
/******************************__________API__________******************************/
|
||||
TM1650_Status_T tm1650_Init(TM_1650_Brightness_t brightness, TM_1650_Segement_t segment, \
|
||||
TM_1650_OperatingMode_t opMode, TM_1650_SwitchMode_t switchMode, \
|
||||
TM_1650_Digit_t digits, void (*dataPin)(), void (*clkPin)(), uint8_t (*readData)());
|
||||
|
||||
TM1650_Status_T tm1650_changeBrightness(TM_1650_Brightness_t brightness);
|
||||
|
||||
TM1650_Status_T tm1650_changeOPMode(TM_1650_OperatingMode_t opMode);
|
||||
|
||||
TM1650_Status_T tm1650_changeSegmentMode(TM_1650_Segement_t segment);
|
||||
|
||||
TM1650_Status_T tm1650_displaySwitch(TM_1650_SwitchMode_t switchMode);
|
||||
|
||||
TM1650_Status_T tm1650_showNum(TM_1650_Digit_t digit, uint8_t num);
|
||||
|
||||
TM1650_Status_T tm1650_showAlphabet(TM_1650_Digit_t digit, char * alpha);
|
||||
|
||||
TM1650_Status_T tm1650_showDot(TM_1650_Digit_t digit, bool dotFlag);
|
||||
|
||||
TM1650_Status_T tm1650_removeDot(TM_1650_Digit_t digit);
|
||||
/***********************************************************************************/
|
||||
|
||||
#endif /* IVEC_TM1650_H_ */
|
||||
|
|
@ -0,0 +1,332 @@
|
|||
/*
|
||||
* TM1650.c
|
||||
*
|
||||
* Created on: 09-Jan-2023
|
||||
* Author: Vecmocon Technology
|
||||
*/
|
||||
|
||||
#include "../TM1650_SDK/inc/ivec_TM1650.h"
|
||||
|
||||
#define NUM_OF_DIGITS 4
|
||||
|
||||
static tm1650_drv_t tm1650_drv = {0};
|
||||
|
||||
static uint8_t numericDisplayArray[10] = { 0x3F, 0x06, 0x5B, 0x4F, 0x66, \
|
||||
0x6D, 0x7D, 0x07, 0x7F, 0x6F
|
||||
};
|
||||
|
||||
#define NS 0x2D
|
||||
|
||||
|
||||
static uint8_t alphabetDisplayArray[26] = { 0x77, 0x7C, 0x39, 0x5E, 0x79, \
|
||||
0x71, 0x3D, 0x76, 0x30, 0x1E, \
|
||||
NS , 0x38, NS , NS , 0x3F, \
|
||||
0x73, NS , NS , 0x6D, NS , \
|
||||
0x3E, NS , NS , NS , NS , \
|
||||
NS
|
||||
};
|
||||
|
||||
static uint8_t currentNum[NUM_OF_DIGITS] = {0};
|
||||
|
||||
static volatile uint8_t digitDot[NUM_OF_DIGITS] = {0};
|
||||
|
||||
static void TM1650_Start(tm1650_drv_t *drv);
|
||||
static void TM1650_End(tm1650_drv_t *drv);
|
||||
static TM1650_Status_T TM1650_SendByte(tm1650_drv_t *drv, uint8_t byte);
|
||||
|
||||
static TM1650_Status_T tm1650_Configure(void);
|
||||
|
||||
/************************************Static_functions_START************************************/
|
||||
static void TM1650_Free(tm1650_drv_t *drv){
|
||||
drv->clk_set_fn(1);
|
||||
drv->dat_set_fn(1);
|
||||
}
|
||||
|
||||
static void TM1650_Start(tm1650_drv_t *drv){
|
||||
drv->clk_set_fn(1);
|
||||
drv->dat_set_fn(0);
|
||||
drv->clk_set_fn(0);
|
||||
}
|
||||
|
||||
static void TM1650_End(tm1650_drv_t *drv){
|
||||
drv->clk_set_fn(1);
|
||||
drv->dat_set_fn(1);
|
||||
// drv->clk_set_fn(0);
|
||||
}
|
||||
|
||||
|
||||
// uint8_t bitTosendArr[8] = {0};
|
||||
/**
|
||||
* Sends a byte to the TM1650.
|
||||
*
|
||||
* @param drv The TM1650 driver.
|
||||
* @param byte The byte to send.
|
||||
*
|
||||
* @returns The status of the operation.
|
||||
*/
|
||||
static TM1650_Status_T TM1650_SendByte(tm1650_drv_t *drv, uint8_t byte)
|
||||
{
|
||||
drv->clk_set_fn(0);
|
||||
uint8_t mask = 0x80;
|
||||
for(int32_t i = 7; i >= 0; i--, mask >>= 1) {
|
||||
uint8_t bitTosend = 0;
|
||||
bitTosend = (mask & byte) >> i;
|
||||
// bitTosendArr[7-i] = bitTosend;
|
||||
|
||||
drv->dat_set_fn(bitTosend);
|
||||
drv->clk_set_fn(1);
|
||||
drv->clk_set_fn(0);
|
||||
drv->dat_set_fn(0);
|
||||
}
|
||||
|
||||
TM1650_Status_T ackBuff = TM1650_ERROR;
|
||||
drv->clk_set_fn(1);
|
||||
ackBuff = (TM1650_Status_T)drv->read_data_fn();
|
||||
drv->clk_set_fn(0);
|
||||
|
||||
return ackBuff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures the TM1650 display.
|
||||
*
|
||||
* @returns None
|
||||
*/
|
||||
static TM1650_Status_T tm1650_Configure(void){
|
||||
uint8_t txBuff = 0;
|
||||
TM1650_Status_T retVal = TM1650_ERROR;
|
||||
|
||||
txBuff = tm1650_drv.brightness + \
|
||||
tm1650_drv.segment + \
|
||||
tm1650_drv.opMode + \
|
||||
tm1650_drv.switchMode;
|
||||
|
||||
TM1650_Free(&tm1650_drv);
|
||||
TM1650_Start(&tm1650_drv);
|
||||
retVal = (TM1650_Status_T)TM1650_SendByte(&tm1650_drv, TM_1650_SYSTEM_CMD);
|
||||
if(retVal == TM1650_SUCCESS){
|
||||
retVal = TM1650_SendByte(&tm1650_drv, txBuff);
|
||||
}
|
||||
TM1650_End(&tm1650_drv);
|
||||
return retVal;
|
||||
}
|
||||
/************************************Static_functions_END************************************/
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the TM1650 driver.
|
||||
*
|
||||
* @param brightness The brightness of the display.
|
||||
* @param segment The segment of the display to use.
|
||||
* @param opMode The operating mode of the display.
|
||||
* @param switchMode The switch mode of the display.
|
||||
* @param digits The number of digits to use.
|
||||
* @param dataPin The function to use for the data line.
|
||||
* @param clkPin The function to use for the clock line.
|
||||
* @param readData The function to use to read the data line.
|
||||
*
|
||||
* @returns The status of the initialization.
|
||||
*/
|
||||
TM1650_Status_T tm1650_Init(TM_1650_Brightness_t brightness, TM_1650_Segement_t segment, \
|
||||
TM_1650_OperatingMode_t opMode, TM_1650_SwitchMode_t switchMode, \
|
||||
TM_1650_Digit_t digits, void (*dataPin)(), void (*clkPin)(), uint8_t (*readData)()){
|
||||
|
||||
tm1650_drv.brightness = brightness;
|
||||
tm1650_drv.segment = segment;
|
||||
tm1650_drv.switchMode = switchMode;
|
||||
tm1650_drv.opMode = opMode;
|
||||
tm1650_drv.digitsToUse = digits;
|
||||
tm1650_drv.dat_set_fn = (void *)dataPin;
|
||||
tm1650_drv.clk_set_fn = (void *)clkPin;
|
||||
tm1650_drv.read_data_fn = readData;
|
||||
|
||||
|
||||
return tm1650_Configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the brightness of the display.
|
||||
*
|
||||
* @param brightness The brightness of the display.
|
||||
*
|
||||
* @returns None
|
||||
*/
|
||||
TM1650_Status_T tm1650_changeBrightness(TM_1650_Brightness_t brightness){
|
||||
tm1650_drv.brightness = brightness;
|
||||
return tm1650_Configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the operating mode of the TM1650.
|
||||
*
|
||||
* @param opMode The new operating mode.
|
||||
*
|
||||
* @returns The status of the operation.
|
||||
*/
|
||||
TM1650_Status_T tm1650_changeOPMode(TM_1650_OperatingMode_t opMode){
|
||||
tm1650_drv.opMode = opMode;
|
||||
return tm1650_Configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes the segment mode of the TM1650.
|
||||
*
|
||||
* @param segment The new segment mode.
|
||||
*
|
||||
* @returns The status of the operation.
|
||||
*/
|
||||
TM1650_Status_T tm1650_changeSegmentMode(TM_1650_Segement_t segment){
|
||||
tm1650_drv.segment = segment;
|
||||
return tm1650_Configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures the switchMode of the display.
|
||||
*
|
||||
* @param switchMode The desired mode.
|
||||
*
|
||||
* @returns The status of the operation.
|
||||
*/
|
||||
TM1650_Status_T tm1650_displaySwitch(TM_1650_SwitchMode_t switchMode){
|
||||
tm1650_drv.switchMode = switchMode;
|
||||
return tm1650_Configure();
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a number on the TM1650 LED display.
|
||||
*
|
||||
* @param digit The digit to display the number on.
|
||||
* @param num The number to display.
|
||||
*
|
||||
* @returns TM1650_SUCCESS if the number was successfully displayed.
|
||||
*/
|
||||
TM1650_Status_T tm1650_showNum(TM_1650_Digit_t digit, uint8_t num)
|
||||
{
|
||||
TM1650_Status_T retVal = TM1650_ERROR;
|
||||
if(num > 9)
|
||||
return TM1650_OUT_OF_BOUNDS;
|
||||
TM1650_Free(&tm1650_drv);
|
||||
TM1650_Start(&tm1650_drv);
|
||||
retVal = TM1650_SendByte(&tm1650_drv, digit);
|
||||
if(retVal == 0)
|
||||
{
|
||||
retVal = TM1650_SendByte(&tm1650_drv, numericDisplayArray[num]);
|
||||
}
|
||||
// | digitDot[(digit - TM_1650_DIG_1)/2]
|
||||
TM1650_End(&tm1650_drv);
|
||||
if(retVal == TM1650_SUCCESS)
|
||||
{
|
||||
currentNum[digit - TM_1650_DIG_1] = digit;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Displays an alphabet on the TM1650 LED display.
|
||||
*
|
||||
* @param digit The digit to display the alphabet on.
|
||||
* @param alpha The alphabet to display.
|
||||
*
|
||||
* @returns TM1650_SUCCESS if the operation was successful.
|
||||
*/
|
||||
TM1650_Status_T tm1650_showAlphabet(TM_1650_Digit_t digit, char * alpha)
|
||||
{
|
||||
TM1650_Status_T retVal = TM1650_ERROR;
|
||||
uint8_t index = 0;
|
||||
index = (*alpha);
|
||||
if((uint8_t)(*alpha) > 90 || (uint8_t)(*alpha) < 65)
|
||||
return TM1650_OUT_OF_BOUNDS;
|
||||
TM1650_Free(&tm1650_drv);
|
||||
TM1650_Start(&tm1650_drv);
|
||||
retVal = TM1650_SendByte(&tm1650_drv, digit);
|
||||
if(retVal == 0)
|
||||
{
|
||||
index -= 65;
|
||||
retVal = TM1650_SendByte(&tm1650_drv, alphabetDisplayArray[index]);
|
||||
}
|
||||
|
||||
// | digitDot[(digit - TM_1650_DIG_1)/2]
|
||||
|
||||
TM1650_End(&tm1650_drv);
|
||||
if(retVal == TM1650_SUCCESS)
|
||||
{
|
||||
currentNum[digit - TM_1650_DIG_1] = digit;
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Displays and Removes the dot on a specific digit on TM1650 LED display.
|
||||
*
|
||||
* @param digit The digit to display on.
|
||||
* @param dotFlag To Turn the Dot ON or OFF
|
||||
*
|
||||
* @returns None
|
||||
*/
|
||||
TM1650_Status_T tm1650_showDot(TM_1650_Digit_t digit, bool dotFlag)
|
||||
{
|
||||
switch(digit)
|
||||
{
|
||||
case TM_1650_DIG_1:
|
||||
|
||||
if(dotFlag == true)
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x80;
|
||||
else
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x00;
|
||||
break;
|
||||
|
||||
case TM_1650_DIG_2:
|
||||
|
||||
if(dotFlag == true)
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x80;
|
||||
else
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x00;
|
||||
|
||||
break;
|
||||
|
||||
case TM_1650_DIG_3:
|
||||
|
||||
if(dotFlag == true)
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x80;
|
||||
else
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x00;
|
||||
|
||||
break;
|
||||
|
||||
case TM_1650_DIG_4:
|
||||
|
||||
if(dotFlag == true)
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x80;
|
||||
else
|
||||
digitDot[(digit - TM_1650_DIG_1)/2] = 0x00;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* *********************************************************FUNCTION DISCONTINUED***************************************************************************************
|
||||
* Removes the dot from a specific digit.
|
||||
*
|
||||
* @param digit The digit to remove the dot from.
|
||||
*
|
||||
* @returns None
|
||||
*/
|
||||
TM1650_Status_T tm1650_removeDot(TM_1650_Digit_t digit)
|
||||
{
|
||||
TM1650_Status_T retVal = TM1650_ERROR;
|
||||
TM1650_Free(&tm1650_drv);
|
||||
TM1650_Start(&tm1650_drv);
|
||||
retVal = TM1650_SendByte(&tm1650_drv, digit);
|
||||
if(retVal == 0)
|
||||
{
|
||||
retVal = TM1650_SendByte(&tm1650_drv, numericDisplayArray[currentNum[digit]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
|
@ -0,0 +1,132 @@
|
|||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_:
|
||||
|
||||
|
||||
BO_ 8 New_Message_10: 8 Vector__XXX
|
||||
SG_ New_Signal_67 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 7 New_Message_9: 8 Vector__XXX
|
||||
SG_ New_Signal_66 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 6 New_Message_8: 8 Vector__XXX
|
||||
SG_ New_Signal_65 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 5 New_Message_7: 8 Vector__XXX
|
||||
SG_ New_Signal_64 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 4 New_Message_6: 8 Vector__XXX
|
||||
SG_ New_Signal_63 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 3 New_Message_5: 8 Vector__XXX
|
||||
SG_ New_Signal_62 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 2 New_Message_4: 8 Vector__XXX
|
||||
SG_ New_Signal_61 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 1 New_Message_3: 8 Vector__XXX
|
||||
SG_ New_Signal_60 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 0 New_Message_2: 8 Vector__XXX
|
||||
SG_ New_Signal_59 : 0|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
|
||||
BO_ 2368323178 superMaxxMsg: 8 Vector__XXX
|
||||
SG_ mosfetTemp m7 : 23|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ ambientSensor m7 : 15|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ underTemp m8 : 12|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ soh m2 : 15|8@0+ (1,0) [0|255] "%" Vector__XXX
|
||||
SG_ soc m2 : 23|8@0+ (1,0) [0|255] "%" Vector__XXX
|
||||
SG_ shortCircuitProtection m8 : 15|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ PKT_Nb M : 7|8@0+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ pack_UV m8 : 14|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ pack_OV m8 : 13|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ overTemp m8 : 11|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ overCurrent m8 : 10|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ NTC_9 m5 : 23|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_8 m5 : 15|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_7 m4 : 63|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_6 m4 : 55|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_5 m4 : 47|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_4 m4 : 39|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_3 m4 : 31|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_2 m4 : 23|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_16 m6 : 23|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_15 m6 : 15|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_14 m5 : 63|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_13 m5 : 55|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_12 m5 : 47|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_11 m5 : 39|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_10 m5 : 31|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ NTC_1 m4 : 15|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ dischargingMosfet m3 : 8|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ chargingMosfet m3 : 9|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ chargingCycle m2 : 31|16@0+ (1,0) [0|65535] "" Vector__XXX
|
||||
SG_ cellVoltage_9 m11 : 47|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_8 m11 : 31|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_7 m11 : 15|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_6 m10 : 47|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_5 m10 : 31|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_4 m10 : 15|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_3 m9 : 47|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_2 m9 : 31|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_16 m14 : 15|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_15 m13 : 47|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_14 m13 : 31|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_13 m13 : 15|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_12 m12 : 47|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_11 m12 : 31|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_10 m12 : 15|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellVoltage_1 m9 : 15|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ cellUnderVoltage m8 : 9|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ cellOverVoltage m8 : 8|1@0+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ bmsId_4 m0 : 47|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ bmsId_3 m0 : 39|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ bmsId_2 m0 : 31|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ bmsId_1 m0 : 23|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ bmsId_0 m0 : 15|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ battVoltage m1 : 15|16@0+ (1,0) [0|65535] "mV" Vector__XXX
|
||||
SG_ battTemperature m1 : 47|8@0- (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ battLoadStatus m1 : 55|8@0+ (1,0) [-128|127] "" Vector__XXX
|
||||
SG_ battCurrent m1 : 31|16@0- (1,0) [-32768|32767] "mA" Vector__XXX
|
||||
SG_ battCapacity m2 : 47|16@0+ (1,0) [0|65535] "" Vector__XXX
|
||||
|
||||
|
||||
|
||||
BA_DEF_ "MultiplexExtEnabled" ENUM "No","Yes";
|
||||
BA_DEF_ "BusType" STRING ;
|
||||
BA_DEF_DEF_ "MultiplexExtEnabled" "No";
|
||||
BA_DEF_DEF_ "BusType" "CAN";
|
||||
|
||||
|
|
@ -0,0 +1,530 @@
|
|||
/*
|
||||
* File: canReceive.c
|
||||
*
|
||||
*
|
||||
* --- THIS FILE GENERATED BY S-FUNCTION BUILDER: 3.0 ---
|
||||
*
|
||||
* This file is an S-function produced by the S-Function
|
||||
* Builder which only recognizes certain fields. Changes made
|
||||
* outside these fields will be lost the next time the block is
|
||||
* used to load, edit, and resave this file. This file will be overwritten
|
||||
* by the S-function Builder block. If you want to edit this file by hand,
|
||||
* you must change it only in the area defined as:
|
||||
*
|
||||
* %%%-SFUNWIZ_defines_Changes_BEGIN
|
||||
* #define NAME 'replacement text'
|
||||
* %%% SFUNWIZ_defines_Changes_END
|
||||
*
|
||||
* DO NOT change NAME--Change the 'replacement text' only.
|
||||
*
|
||||
* For better compatibility with the Simulink Coder, the
|
||||
* "wrapper" S-function technique is used. This is discussed
|
||||
* in the Simulink Coder's Manual in the Chapter titled,
|
||||
* "Wrapper S-functions".
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
* | See matlabroot/simulink/src/sfuntmpl_doc.c for a more detailed template |
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Created: Mon Oct 28 13:36:38 2024
|
||||
*/
|
||||
|
||||
#define S_FUNCTION_LEVEL 2
|
||||
#define S_FUNCTION_NAME canReceive
|
||||
|
||||
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
|
||||
/* %%%-SFUNWIZ_defines_Changes_BEGIN --- EDIT HERE TO _END */
|
||||
#define NUM_INPUTS 3
|
||||
|
||||
/* Input Port 0 */
|
||||
#define IN_PORT_0_NAME id
|
||||
#define INPUT_0_DIMS_ND {1,1}
|
||||
#define INPUT_0_NUM_ELEMS 1
|
||||
#define INPUT_0_WIDTH 1
|
||||
#define INPUT_DIMS_0_COL 1
|
||||
#define INPUT_0_DTYPE uint32_T
|
||||
#define INPUT_0_COMPLEX COMPLEX_NO
|
||||
#define IN_0_BUS_BASED 0
|
||||
#define IN_0_BUS_NAME
|
||||
#define IN_0_DIMS 1-D
|
||||
#define INPUT_0_FEEDTHROUGH 1
|
||||
#define IN_0_ISSIGNED 0
|
||||
#define IN_0_WORDLENGTH 8
|
||||
#define IN_0_FIXPOINTSCALING 1
|
||||
#define IN_0_FRACTIONLENGTH 9
|
||||
#define IN_0_BIAS 0
|
||||
#define IN_0_SLOPE 0.125
|
||||
|
||||
/* Input Port 1 */
|
||||
#define IN_PORT_1_NAME dlc
|
||||
#define INPUT_1_DIMS_ND {1,1}
|
||||
#define INPUT_1_NUM_ELEMS 1
|
||||
#define INPUT_1_WIDTH 1
|
||||
#define INPUT_DIMS_1_COL 1
|
||||
#define INPUT_1_DTYPE uint8_T
|
||||
#define INPUT_1_COMPLEX COMPLEX_NO
|
||||
#define IN_1_BUS_BASED 0
|
||||
#define IN_1_BUS_NAME
|
||||
#define IN_1_DIMS 1-D
|
||||
#define INPUT_1_FEEDTHROUGH 1
|
||||
#define IN_1_ISSIGNED 0
|
||||
#define IN_1_WORDLENGTH 8
|
||||
#define IN_1_FIXPOINTSCALING 1
|
||||
#define IN_1_FRACTIONLENGTH 9
|
||||
#define IN_1_BIAS 0
|
||||
#define IN_1_SLOPE 0.125
|
||||
|
||||
/* Input Port 2 */
|
||||
#define IN_PORT_2_NAME data
|
||||
#define INPUT_2_DIMS_ND {8,1}
|
||||
#define INPUT_2_NUM_ELEMS 8
|
||||
#define INPUT_2_WIDTH 8
|
||||
#define INPUT_DIMS_2_COL 1
|
||||
#define INPUT_2_DTYPE uint8_T
|
||||
#define INPUT_2_COMPLEX COMPLEX_NO
|
||||
#define IN_2_BUS_BASED 0
|
||||
#define IN_2_BUS_NAME
|
||||
#define IN_2_DIMS 2-D
|
||||
#define INPUT_2_FEEDTHROUGH 1
|
||||
#define IN_2_ISSIGNED 0
|
||||
#define IN_2_WORDLENGTH 8
|
||||
#define IN_2_FIXPOINTSCALING 1
|
||||
#define IN_2_FRACTIONLENGTH 9
|
||||
#define IN_2_BIAS 0
|
||||
#define IN_2_SLOPE 0.125
|
||||
#define NUM_OUTPUTS 1
|
||||
|
||||
/* Output Port 0 */
|
||||
#define OUT_PORT_0_NAME canFrame
|
||||
#define OUTPUT_0_DIMS_ND {1,1}
|
||||
#define OUTPUT_0_NUM_ELEMS 1
|
||||
#define OUTPUT_0_WIDTH 1
|
||||
#define OUTPUT_DIMS_0_COL 1
|
||||
#define OUTPUT_0_DTYPE uint8_T
|
||||
#define OUTPUT_0_COMPLEX COMPLEX_NO
|
||||
#define OUT_0_BUS_BASED 1
|
||||
#define OUT_0_BUS_NAME CAN_MESSAGE_BUS
|
||||
#define OUT_0_DIMS 1-D
|
||||
#define OUT_0_ISSIGNED 1
|
||||
#define OUT_0_WORDLENGTH 8
|
||||
#define OUT_0_FIXPOINTSCALING 1
|
||||
#define OUT_0_FRACTIONLENGTH 3
|
||||
#define OUT_0_BIAS 0
|
||||
#define OUT_0_SLOPE 0.125
|
||||
#define NPARAMS 0
|
||||
#define SAMPLE_TIME_0 INHERITED_SAMPLE_TIME
|
||||
#define NUM_DISC_STATES 0
|
||||
#define DISC_STATES_IC [0]
|
||||
#define NUM_CONT_STATES 0
|
||||
#define CONT_STATES_IC [0]
|
||||
#define SFUNWIZ_GENERATE_TLC 1
|
||||
#define SOURCEFILES "__SFB__"
|
||||
#define PANELINDEX N/A
|
||||
#define USE_SIMSTRUCT 0
|
||||
#define SHOW_COMPILE_STEPS 0
|
||||
#define CREATE_DEBUG_MEXFILE 0
|
||||
#define SAVE_CODE_ONLY 0
|
||||
#define SFUNWIZ_REVISION 3.0
|
||||
|
||||
/* %%%-SFUNWIZ_defines_Changes_END --- EDIT HERE TO _BEGIN */
|
||||
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
|
||||
#include "simstruc.h"
|
||||
#include "canReceive_bus.h"
|
||||
|
||||
/*
|
||||
* Code Generation Environment flag (simulation or standalone target).
|
||||
*/
|
||||
static int_T isSimulationTarget;
|
||||
|
||||
/* Utility function prototypes. */
|
||||
static int_T GetRTWEnvironmentMode(SimStruct *S);
|
||||
|
||||
/* Macro used to check if Simulation mode is set to accelerator */
|
||||
#define isBusDWorkPresent ( ( ( !ssRTWGenIsCodeGen(S) || isSimulationTarget ) && !ssIsExternalSim(S) ) || ssIsRapidAcceleratorActive(S) )
|
||||
|
||||
typedef struct {
|
||||
int_T offset;
|
||||
int_T elemSize;
|
||||
int_T numElems;
|
||||
} busInfoStruct;
|
||||
|
||||
extern void canReceive_Outputs_wrapper(const uint32_T *id,
|
||||
const uint8_T *dlc,
|
||||
const uint8_T *data,
|
||||
CAN_MESSAGE_BUS *canFrame);
|
||||
|
||||
/*====================*
|
||||
* S-function methods *
|
||||
*====================*/
|
||||
/* Function: mdlInitializeSizes ===============================================
|
||||
* Abstract:
|
||||
* Setup sizes of the various vectors.
|
||||
*/
|
||||
static void mdlInitializeSizes(SimStruct *S)
|
||||
{
|
||||
DECL_AND_INIT_DIMSINFO(inputDimsInfo);
|
||||
ssSetNumSFcnParams(S, NPARAMS);
|
||||
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
|
||||
return; /* Parameter mismatch will be reported by Simulink */
|
||||
}
|
||||
|
||||
ssSetArrayLayoutForCodeGen(S, SS_COLUMN_MAJOR);
|
||||
ssSetOperatingPointCompliance(S, USE_DEFAULT_OPERATING_POINT);
|
||||
ssSetNumContStates(S, NUM_CONT_STATES);
|
||||
ssSetNumDiscStates(S, NUM_DISC_STATES);
|
||||
if (!ssSetNumInputPorts(S, NUM_INPUTS))
|
||||
return;
|
||||
|
||||
/* Input Port 0 */
|
||||
ssSetInputPortWidth(S, 0, INPUT_0_NUM_ELEMS);
|
||||
ssSetInputPortDataType(S, 0, SS_UINT32);
|
||||
ssSetInputPortComplexSignal(S, 0, INPUT_0_COMPLEX);
|
||||
ssSetInputPortDirectFeedThrough(S, 0, INPUT_0_FEEDTHROUGH);
|
||||
ssSetInputPortRequiredContiguous(S, 0, 1);/*direct input signal access*/
|
||||
|
||||
/* Input Port 1 */
|
||||
ssSetInputPortWidth(S, 1, INPUT_1_NUM_ELEMS);
|
||||
ssSetInputPortDataType(S, 1, SS_UINT8);
|
||||
ssSetInputPortComplexSignal(S, 1, INPUT_1_COMPLEX);
|
||||
ssSetInputPortDirectFeedThrough(S, 1, INPUT_1_FEEDTHROUGH);
|
||||
ssSetInputPortRequiredContiguous(S, 1, 1);/*direct input signal access*/
|
||||
|
||||
/* Input Port 2 */
|
||||
ssAllowSignalsWithMoreThan2D(S);
|
||||
inputDimsInfo.numDims = 2;
|
||||
inputDimsInfo.width = INPUT_2_NUM_ELEMS;
|
||||
int_T in2Dims[] = INPUT_2_DIMS_ND;
|
||||
inputDimsInfo.dims = in2Dims;
|
||||
ssSetInputPortDimensionInfo(S, 2, &inputDimsInfo);
|
||||
ssSetInputPortDataType(S, 2, SS_UINT8);
|
||||
ssSetInputPortComplexSignal(S, 2, INPUT_2_COMPLEX);
|
||||
ssSetInputPortDirectFeedThrough(S, 2, INPUT_2_FEEDTHROUGH);
|
||||
ssSetInputPortRequiredContiguous(S, 2, 1);/*direct input signal access*/
|
||||
if (!ssSetNumOutputPorts(S, NUM_OUTPUTS))
|
||||
return;
|
||||
|
||||
/* Output Port 0 */
|
||||
|
||||
/* Register CAN_MESSAGE_BUS datatype for Output port 0 */
|
||||
#if defined(MATLAB_MEX_FILE)
|
||||
|
||||
if (ssGetSimMode(S) != SS_SIMMODE_SIZES_CALL_ONLY) {
|
||||
DTypeId dataTypeIdReg;
|
||||
ssRegisterTypeFromNamedObject(S, "CAN_MESSAGE_BUS", &dataTypeIdReg);
|
||||
if (dataTypeIdReg == INVALID_DTYPE_ID)
|
||||
return;
|
||||
ssSetOutputPortDataType(S, 0, dataTypeIdReg);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ssSetOutputPortWidth(S, 0, OUTPUT_0_NUM_ELEMS);
|
||||
ssSetBusOutputObjectName(S, 0, (void *) "CAN_MESSAGE_BUS");
|
||||
ssSetOutputPortComplexSignal(S, 0, OUTPUT_0_COMPLEX);
|
||||
ssSetBusOutputAsStruct(S, 0,OUT_0_BUS_BASED);
|
||||
ssSetOutputPortBusMode(S, 0, SL_BUS_MODE);
|
||||
if (ssRTWGenIsCodeGen(S)) {
|
||||
isSimulationTarget = GetRTWEnvironmentMode(S);
|
||||
if (isSimulationTarget == -1) {
|
||||
ssSetLocalErrorStatus(S,
|
||||
" Unable to determine a valid code generation environment mode");
|
||||
return;
|
||||
}
|
||||
|
||||
isSimulationTarget |= ssRTWGenIsModelReferenceSimTarget(S);
|
||||
}
|
||||
|
||||
/* Set the number of dworks */
|
||||
if (!ssSetNumDWork(S, 1))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Configure the dwork 0 (canFrameBUS)
|
||||
*/
|
||||
#if defined(MATLAB_MEX_FILE)
|
||||
|
||||
if (ssGetSimMode(S) != SS_SIMMODE_SIZES_CALL_ONLY) {
|
||||
DTypeId dataTypeIdReg;
|
||||
ssRegisterTypeFromNamedObject(S, "CAN_MESSAGE_BUS", &dataTypeIdReg);
|
||||
if (dataTypeIdReg == INVALID_DTYPE_ID)
|
||||
return;
|
||||
if (isBusDWorkPresent) {
|
||||
ssSetDWorkDataType(S, 0, dataTypeIdReg);
|
||||
} else {
|
||||
ssSetDWorkDataType(S, 0, SS_POINTER);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ssSetDWorkUsageType(S, 0, SS_DWORK_USED_AS_DWORK);
|
||||
ssSetDWorkName(S, 0, "canFrameBUS");
|
||||
ssSetDWorkWidth(S, 0, DYNAMICALLY_SIZED);
|
||||
ssSetDWorkComplexSignal(S, 0, COMPLEX_NO);
|
||||
ssSetNumPWork(S, 0);
|
||||
ssSetNumSampleTimes(S, 1);
|
||||
ssSetNumRWork(S, 0);
|
||||
ssSetNumIWork(S, 0);
|
||||
ssSetNumModes(S, 0);
|
||||
ssSetNumNonsampledZCs(S, 0);
|
||||
ssSetSimulinkVersionGeneratedIn(S, "23.2");
|
||||
|
||||
/* Take care when specifying exception free code - see sfuntmpl_doc.c */
|
||||
ssSetRuntimeThreadSafetyCompliance(S, RUNTIME_THREAD_SAFETY_COMPLIANCE_FALSE);
|
||||
ssSetOptions(S, (SS_OPTION_EXCEPTION_FREE_CODE |
|
||||
SS_OPTION_USE_TLC_WITH_ACCELERATOR |
|
||||
SS_OPTION_WORKS_WITH_CODE_REUSE));
|
||||
}
|
||||
|
||||
#if defined(MATLAB_MEX_FILE)
|
||||
#define MDL_SET_INPUT_PORT_DIMENSION_INFO
|
||||
|
||||
static void mdlSetInputPortDimensionInfo(SimStruct *S,
|
||||
int_T port,
|
||||
const DimsInfo_T *dimsInfo)
|
||||
{
|
||||
if (!ssSetInputPortDimensionInfo(S, port, dimsInfo))
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define MDL_SET_OUTPUT_PORT_DIMENSION_INFO
|
||||
#if defined(MDL_SET_OUTPUT_PORT_DIMENSION_INFO)
|
||||
|
||||
static void mdlSetOutputPortDimensionInfo(SimStruct *S,
|
||||
int_T port,
|
||||
const DimsInfo_T *dimsInfo)
|
||||
{
|
||||
if (!ssSetOutputPortDimensionInfo(S, port, dimsInfo))
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define MDL_SET_DEFAULT_PORT_DIMENSION_INFO
|
||||
|
||||
static void mdlSetDefaultPortDimensionInfo(SimStruct *S)
|
||||
{
|
||||
DECL_AND_INIT_DIMSINFO(portDimsInfo);
|
||||
int_T dims[2];
|
||||
|
||||
/* Setting default dimensions for input port 2 */
|
||||
portDimsInfo.width = INPUT_2_NUM_ELEMS;
|
||||
dims[0] = INPUT_2_NUM_ELEMS;
|
||||
dims[1] = 1;
|
||||
portDimsInfo.dims = dims;
|
||||
portDimsInfo.numDims = 2;
|
||||
if (ssGetInputPortWidth(S, 2) == DYNAMICALLY_SIZED) {
|
||||
ssSetInputPortMatrixDimensions(S, 2, 1 , 1);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* Function: mdlInitializeSampleTimes =========================================
|
||||
* Abstract:
|
||||
* Specifiy the sample time.
|
||||
*/
|
||||
static void mdlInitializeSampleTimes(SimStruct *S)
|
||||
{
|
||||
ssSetSampleTime(S, 0, SAMPLE_TIME_0);
|
||||
ssSetModelReferenceSampleTimeDefaultInheritance(S);
|
||||
ssSetOffsetTime(S, 0, 0.0);
|
||||
}
|
||||
|
||||
#define MDL_SET_INPUT_PORT_DATA_TYPE
|
||||
|
||||
static void mdlSetInputPortDataType(SimStruct *S, int port, DTypeId dType)
|
||||
{
|
||||
ssSetInputPortDataType(S, 0, dType);
|
||||
}
|
||||
|
||||
#define MDL_SET_OUTPUT_PORT_DATA_TYPE
|
||||
|
||||
static void mdlSetOutputPortDataType(SimStruct *S, int port, DTypeId dType)
|
||||
{
|
||||
ssSetOutputPortDataType(S, 0, dType);
|
||||
}
|
||||
|
||||
#define MDL_SET_DEFAULT_PORT_DATA_TYPES
|
||||
|
||||
static void mdlSetDefaultPortDataTypes(SimStruct *S)
|
||||
{
|
||||
ssSetInputPortDataType(S, 0, SS_DOUBLE);
|
||||
ssSetOutputPortDataType(S, 0, SS_DOUBLE);
|
||||
}
|
||||
|
||||
#define MDL_SET_WORK_WIDTHS
|
||||
#if defined(MDL_SET_WORK_WIDTHS) && defined(MATLAB_MEX_FILE)
|
||||
|
||||
static void mdlSetWorkWidths(SimStruct *S)
|
||||
{
|
||||
/* Set the width of DWork(s) used for marshalling the IOs */
|
||||
if (isBusDWorkPresent) {
|
||||
/* Update dwork 0 */
|
||||
ssSetDWorkWidth(S, 0, ssGetOutputPortWidth(S, 0));
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define MDL_START /* Change to #undef to remove function */
|
||||
#if defined(MDL_START)
|
||||
|
||||
/* Function: mdlStart =======================================================
|
||||
* Abstract:
|
||||
* This function is called once at start of model execution. If you
|
||||
* have states that should be initialized once, this is the place
|
||||
* to do it.
|
||||
*/
|
||||
static void mdlStart(SimStruct *S)
|
||||
{
|
||||
/* Bus Information */
|
||||
slDataTypeAccess *dta = ssGetDataTypeAccess(S);
|
||||
const char *bpath = ssGetPath(S);
|
||||
DTypeId CAN_MESSAGE_BUSId = ssGetDataTypeId(S,"CAN_MESSAGE_BUS");
|
||||
busInfoStruct *busInfo = (busInfoStruct *)malloc(8*sizeof(busInfoStruct));
|
||||
if (busInfo==NULL) {
|
||||
ssSetLocalErrorStatus(S, "Memory allocation failure");
|
||||
return;
|
||||
}
|
||||
|
||||
/*offsets info for all unique bus structures*/
|
||||
busInfo[0].offset = dtaGetDataTypeElementOffset(dta, bpath, CAN_MESSAGE_BUSId,
|
||||
0);
|
||||
busInfo[0].elemSize = dtaGetDataTypeSize(dta, bpath, SS_UINT8);
|
||||
busInfo[0].numElems = 1;
|
||||
busInfo[1].offset = dtaGetDataTypeElementOffset(dta, bpath, CAN_MESSAGE_BUSId,
|
||||
1);
|
||||
busInfo[1].elemSize = dtaGetDataTypeSize(dta, bpath, SS_UINT8);
|
||||
busInfo[1].numElems = 1;
|
||||
busInfo[2].offset = dtaGetDataTypeElementOffset(dta, bpath, CAN_MESSAGE_BUSId,
|
||||
2);
|
||||
busInfo[2].elemSize = dtaGetDataTypeSize(dta, bpath, SS_UINT8);
|
||||
busInfo[2].numElems = 1;
|
||||
busInfo[3].offset = dtaGetDataTypeElementOffset(dta, bpath, CAN_MESSAGE_BUSId,
|
||||
3);
|
||||
busInfo[3].elemSize = dtaGetDataTypeSize(dta, bpath, SS_UINT8);
|
||||
busInfo[3].numElems = 1;
|
||||
busInfo[4].offset = dtaGetDataTypeElementOffset(dta, bpath, CAN_MESSAGE_BUSId,
|
||||
4);
|
||||
busInfo[4].elemSize = dtaGetDataTypeSize(dta, bpath, SS_UINT32);
|
||||
busInfo[4].numElems = 1;
|
||||
busInfo[5].offset = dtaGetDataTypeElementOffset(dta, bpath, CAN_MESSAGE_BUSId,
|
||||
5);
|
||||
busInfo[5].elemSize = dtaGetDataTypeSize(dta, bpath, SS_DOUBLE);
|
||||
busInfo[5].numElems = 1;
|
||||
busInfo[6].offset = dtaGetDataTypeElementOffset(dta, bpath, CAN_MESSAGE_BUSId,
|
||||
6);
|
||||
busInfo[6].elemSize = dtaGetDataTypeSize(dta, bpath, SS_UINT8);
|
||||
busInfo[6].numElems = 8;
|
||||
busInfo[7].elemSize = dtaGetDataTypeSize(dta, bpath, CAN_MESSAGE_BUSId);
|
||||
busInfo[7].numElems = ssGetOutputPortWidth(S, 0);
|
||||
ssSetUserData(S, busInfo);
|
||||
|
||||
/* Allocate memory for arrays or nested arrays of buses DWork pointers */
|
||||
}
|
||||
|
||||
#endif /* MDL_START */
|
||||
|
||||
/* Function: mdlOutputs =======================================================
|
||||
*
|
||||
*/
|
||||
static void mdlOutputs(SimStruct *S, int_T tid)
|
||||
{
|
||||
const uint32_T *id = (uint32_T *) ssGetInputPortRealSignal(S, 0);
|
||||
const uint8_T *dlc = (uint8_T *) ssGetInputPortRealSignal(S, 1);
|
||||
const uint8_T *data = (uint8_T *) ssGetInputPortRealSignal(S, 2);
|
||||
char *canFrame = (char *) ssGetOutputPortSignal(S, 0);
|
||||
busInfoStruct* busInfo = (busInfoStruct *) ssGetUserData(S);
|
||||
|
||||
/* Temporary bus copy declarations */
|
||||
CAN_MESSAGE_BUS _canFrameBUS;
|
||||
slDataTypeAccess *dta = ssGetDataTypeAccess(S);
|
||||
const char *bpath = ssGetPath(S);
|
||||
|
||||
/*Copy from Simulink to bus structure*/
|
||||
canReceive_Outputs_wrapper(id, dlc, data, &_canFrameBUS);
|
||||
|
||||
/*Copy from bus structure to Simulink*/
|
||||
|
||||
/*Copy from _canFrameBUS to Simulink for Output port 0*/
|
||||
*((uint8_T*)((char *) canFrame + busInfo[0].offset)) = (_canFrameBUS).Extended;
|
||||
*((uint8_T*)((char *) canFrame + busInfo[1].offset)) = (_canFrameBUS).Length;
|
||||
*((uint8_T*)((char *) canFrame + busInfo[2].offset)) = (_canFrameBUS).Remote;
|
||||
*((uint8_T*)((char *) canFrame + busInfo[3].offset)) = (_canFrameBUS).Error;
|
||||
*((uint32_T*)((char *) canFrame + busInfo[4].offset)) = (_canFrameBUS).ID;
|
||||
*((real_T*)((char *) canFrame + busInfo[5].offset)) = (_canFrameBUS).Timestamp;
|
||||
(void) memcpy((char *) canFrame + busInfo[6].offset, (_canFrameBUS).Data, 8*
|
||||
busInfo[6].elemSize);
|
||||
}
|
||||
|
||||
/* Function: mdlTerminate =====================================================
|
||||
* Abstract:
|
||||
* In this function, you should perform any actions that are necessary
|
||||
* at the termination of a simulation. For example, if memory was
|
||||
* allocated in mdlStart, this is the place to free it.
|
||||
*/
|
||||
static void mdlTerminate(SimStruct *S)
|
||||
{
|
||||
/* Free stored bus information */
|
||||
busInfoStruct *busInfo = (busInfoStruct *) ssGetUserData(S);
|
||||
if (busInfo != NULL) {
|
||||
free(busInfo);
|
||||
}
|
||||
|
||||
if (!isBusDWorkPresent) {
|
||||
}
|
||||
}
|
||||
|
||||
static int_T GetRTWEnvironmentMode(SimStruct *S)
|
||||
{
|
||||
int_T status = -1;
|
||||
mxArray *plhs[1];
|
||||
mxArray *prhs[1];
|
||||
mxArray * err;
|
||||
|
||||
/*
|
||||
* Get the name of the Simulink block diagram
|
||||
*/
|
||||
prhs[0] = mxCreateString(ssGetBlockDiagramName(S));
|
||||
plhs[0] = NULL;
|
||||
|
||||
/*
|
||||
* Call "isSimulationTarget = rtwenvironmentmode(modelName)" in MATLAB
|
||||
*/
|
||||
err = mexCallMATLABWithTrap(1, plhs, 1, prhs, "rtwenvironmentmode");
|
||||
mxDestroyArray(prhs[0]);
|
||||
|
||||
/*
|
||||
* Set the error status if an error occurred
|
||||
*/
|
||||
if (err) {
|
||||
if (plhs[0]) {
|
||||
mxDestroyArray(plhs[0]);
|
||||
plhs[0] = NULL;
|
||||
}
|
||||
|
||||
ssSetLocalErrorStatus(S,
|
||||
"Unknown error during call to 'rtwenvironmentmode'.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the value returned by rtwenvironmentmode(modelName)
|
||||
*/
|
||||
if (plhs[0]) {
|
||||
status = (int_T) (mxGetScalar(plhs[0]) != 0);
|
||||
mxDestroyArray(plhs[0]);
|
||||
plhs[0] = NULL;
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
|
||||
#ifdef MATLAB_MEX_FILE /* Is this file being compiled as a MEX-file? */
|
||||
#include "simulink.c" /* MEX-file interface mechanism */
|
||||
#else
|
||||
#include "cg_sfun.h" /* Code generation registration function */
|
||||
#endif
|
||||
Binary file not shown.
|
|
@ -0,0 +1,142 @@
|
|||
%% File : canReceive.tlc
|
||||
%% Created : Mon Oct 28 13:36:38 2024
|
||||
%%
|
||||
%% Description:
|
||||
%% Simulink Coder wrapper functions interface generated for
|
||||
%% S-function "canReceive.c".
|
||||
%%
|
||||
%% File generated by S-function Builder Block
|
||||
%%
|
||||
%% For more information on using the Target Language with the
|
||||
%% Simulink Coder, see the Target Language Compiler manual
|
||||
%% (under Simulink Coder) in the "Inlining S-Functions"
|
||||
%% chapter under the section and subsection:
|
||||
%% "Writing Block Target Files to Inline S-Functions",
|
||||
%% "Function-Based or Wrappered Code".
|
||||
%%
|
||||
%implements canReceive "C"
|
||||
%% Function: BlockTypeSetup ===================================================
|
||||
%%
|
||||
%% Purpose:
|
||||
%% Set up external references for wrapper functions in the
|
||||
%% generated code.
|
||||
%%
|
||||
%function BlockTypeSetup(block, system) Output
|
||||
%assign uint32Type = LibGetDataTypeNameFromId(::CompiledModel.tSS_UINT32)
|
||||
%assign charType = LibGetDataTypeNameFromId(::CompiledModel.tSS_CHAR)
|
||||
%assign uint8Type = LibGetDataTypeNameFromId(::CompiledModel.tSS_UINT8)
|
||||
|
||||
%if IsModelReferenceSimTarget() || CodeFormat == "S-Function" || ::isRAccel
|
||||
%assign hFileName = "canReceive_accel_wrapper"
|
||||
%assign hFileNameMacro = FEVAL("upper", hFileName)
|
||||
%openfile hFile = "%<hFileName>.h"
|
||||
%selectfile hFile
|
||||
#ifndef _%<hFileNameMacro>_H_
|
||||
#define _%<hFileNameMacro>_H_
|
||||
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
#include "tmwtypes.h"
|
||||
#else
|
||||
%<LibEmitPlatformTypeIncludes()>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
#define SFB_EXTERN_C extern "C"
|
||||
#else
|
||||
#define SFB_EXTERN_C extern
|
||||
#endif
|
||||
SFB_EXTERN_C void canReceive_Outputs_wrapper_accel(const %<uint32Type> *id,
|
||||
const %<uint8Type> *dlc,
|
||||
const %<uint8Type> *data,
|
||||
void *canFrame, void *__canFrameBUS);
|
||||
#undef SFB_EXTERN_C
|
||||
#endif
|
||||
%closefile hFile
|
||||
|
||||
%assign cFileName = "canReceive_accel_wrapper"
|
||||
%openfile cFile = "%<cFileName>.c"
|
||||
%selectfile cFile
|
||||
#include <string.h>
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
#include "tmwtypes.h"
|
||||
#else
|
||||
%<LibEmitPlatformTypeIncludes()>
|
||||
#endif
|
||||
#include "%<hFileName>.h"
|
||||
#include "canReceive_bus.h"
|
||||
|
||||
|
||||
extern void canReceive_Start_wrapper(void);
|
||||
extern void canReceive_Outputs_wrapper(const %<uint32Type> *id,
|
||||
const %<uint8Type> *dlc,
|
||||
const %<uint8Type> *data,
|
||||
CAN_MESSAGE_BUS *canFrame);
|
||||
extern void canReceive_Terminate_wrapper(void);
|
||||
void canReceive_Outputs_wrapper_accel(const %<uint32Type> *id,
|
||||
const %<uint8Type> *dlc,
|
||||
const %<uint8Type> *data,
|
||||
void *canFrame, void *__canFrameBUS){
|
||||
canReceive_Outputs_wrapper(id,
|
||||
dlc,
|
||||
data,
|
||||
(CAN_MESSAGE_BUS *) __canFrameBUS);
|
||||
|
||||
%assign dTypeId = LibBlockOutputSignalDataTypeId(0)
|
||||
%<SLibAssignUserStructToSLStruct(dTypeId, "(%<charType> *) canFrame", "(*(CAN_MESSAGE_BUS *) __canFrameBUS)", 0)>
|
||||
}
|
||||
|
||||
%closefile cFile
|
||||
|
||||
%<LibAddToCommonIncludes("%<hFileName>.h")>
|
||||
|
||||
%else
|
||||
%openfile externs
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define SFB_EXTERN_C extern "C"
|
||||
#else
|
||||
#define SFB_EXTERN_C extern
|
||||
#endif
|
||||
|
||||
SFB_EXTERN_C void canReceive_Start_wrapper(void);
|
||||
|
||||
SFB_EXTERN_C void canReceive_Outputs_wrapper(const %<uint32Type> *id,
|
||||
const %<uint8Type> *dlc,
|
||||
const %<uint8Type> *data,
|
||||
CAN_MESSAGE_BUS *canFrame);
|
||||
|
||||
SFB_EXTERN_C void canReceive_Terminate_wrapper(void);
|
||||
|
||||
#undef SFB_EXTERN_C
|
||||
%closefile externs
|
||||
%<LibCacheExtern(externs)>
|
||||
|
||||
%endif
|
||||
%%
|
||||
%endfunction
|
||||
|
||||
|
||||
%% Function: Outputs ==========================================================
|
||||
%%
|
||||
%% Purpose:
|
||||
%% Code generation rules for mdlOutputs function.
|
||||
%%
|
||||
%function Outputs(block, system) Output
|
||||
%%
|
||||
%assign pu0 = LibBlockInputSignalAddr(0, "", "", 0)
|
||||
%assign pu1 = LibBlockInputSignalAddr(1, "", "", 0)
|
||||
%assign pu2 = LibBlockInputSignalAddr(2, "", "", 0)
|
||||
%assign py0 = LibBlockOutputSignalAddr(0, "", "", 0)
|
||||
|
||||
%if IsModelReferenceSimTarget() || CodeFormat == "S-Function" || ::isRAccel
|
||||
%assign canFrameBUS_ptr = LibBlockDWorkAddr(canFrameBUS, "", "", 0)
|
||||
canReceive_Outputs_wrapper_accel(%<pu0>, %<pu1>, %<pu2>, %<py0>, %<canFrameBUS_ptr>);
|
||||
%else
|
||||
canReceive_Outputs_wrapper(%<pu0>, %<pu1>, %<pu2>, %<py0>);
|
||||
%endif
|
||||
|
||||
%%
|
||||
%endfunction
|
||||
|
||||
|
||||
%% [EOF] canReceive.tlc
|
||||
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
/* Generated by S-function Builder */
|
||||
#ifndef _CANRECEIVE_BUS_H_
|
||||
#define _CANRECEIVE_BUS_H_
|
||||
/* Read only - STARTS */
|
||||
#ifdef MATLAB_MEX_FILE
|
||||
#include "tmwtypes.h"
|
||||
#else
|
||||
#include "rtwtypes.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef DEFINED_TYPEDEF_FOR_CAN_MESSAGE_BUS_
|
||||
#define DEFINED_TYPEDEF_FOR_CAN_MESSAGE_BUS_
|
||||
typedef struct {
|
||||
uint8_T Extended;
|
||||
uint8_T Length;
|
||||
uint8_T Remote;
|
||||
uint8_T Error;
|
||||
uint32_T ID;
|
||||
real_T Timestamp;
|
||||
uint8_T Data[8];
|
||||
} CAN_MESSAGE_BUS;
|
||||
#endif
|
||||
|
||||
/* Read only - ENDS */
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
|
||||
/*
|
||||
* Include Files
|
||||
*
|
||||
*/
|
||||
#if defined(MATLAB_MEX_FILE)
|
||||
#include "tmwtypes.h"
|
||||
#include "simstruc_types.h"
|
||||
#else
|
||||
#define SIMPLIFIED_RTWTYPES_COMPATIBILITY
|
||||
#include "rtwtypes.h"
|
||||
#undef SIMPLIFIED_RTWTYPES_COMPATIBILITY
|
||||
#endif
|
||||
|
||||
#include "canReceive_bus.h"
|
||||
|
||||
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
|
||||
#include <math.h>
|
||||
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
|
||||
#define u_width 1
|
||||
#define u_1_width 1
|
||||
#define u_2_width 8
|
||||
#define y_width 1
|
||||
|
||||
/*
|
||||
* Create external references here.
|
||||
*
|
||||
*/
|
||||
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
|
||||
/* extern double func(double a); */
|
||||
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
|
||||
|
||||
/*
|
||||
* Output function
|
||||
*
|
||||
*/
|
||||
void canReceive_Outputs_wrapper(const uint32_T *id,
|
||||
const uint8_T *dlc,
|
||||
const uint8_T *data,
|
||||
CAN_MESSAGE_BUS *canFrame)
|
||||
{
|
||||
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
|
||||
/* This sample sets the output equal to the input
|
||||
y0[0] = u0[0];
|
||||
For complex signals use: y0[0].re = u0[0].re;
|
||||
y0[0].im = u0[0].im;
|
||||
y1[0].re = u1[0].re;
|
||||
y1[0].im = u1[0].im;
|
||||
*/
|
||||
canFrame->ID = *(id);
|
||||
canFrame->Length = *(dlc);
|
||||
for(int ijk = 0; ijk < (*dlc); ijk++)
|
||||
canFrame->Data[ijk] = data[ijk];
|
||||
if( canFrame->ID > 0x7FF )
|
||||
canFrame->Extended = 1;
|
||||
else
|
||||
canFrame->Extended = 0;
|
||||
|
||||
// memcpy(canFrame->Data, data, *(dlc));
|
||||
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
function makeInfo=rtwmakecfg()
|
||||
%RTWMAKECFG.m adds include and source directories to rtw make files.
|
||||
% makeInfo=RTWMAKECFG returns a structured array containing
|
||||
% following field:
|
||||
% makeInfo.includePath - cell array containing additional include
|
||||
% directories. Those directories will be
|
||||
% expanded into include instructions of Simulink
|
||||
% Coder generated make files.
|
||||
%
|
||||
% makeInfo.sourcePath - cell array containing additional source
|
||||
% directories. Those directories will be
|
||||
% expanded into rules of Simulink Coder generated
|
||||
% make files.
|
||||
makeInfo.includePath = {};
|
||||
makeInfo.sourcePath = {};
|
||||
makeInfo.linkLibsObjs = {};
|
||||
|
||||
%<Generated by S-Function Builder 3.0. DO NOT REMOVE>
|
||||
|
||||
sfBuilderBlocksByMaskType = find_system(bdroot,'FollowLinks','on','LookUnderMasks','on','MaskType','S-Function Builder');
|
||||
sfBuilderBlocksByCallback = find_system(bdroot,'OpenFcn','sfunctionwizard(gcbh)');
|
||||
sfBuilderBlocksDeployed = find_system(bdroot,'BlockType','S-Function','SFunctionDeploymentMode','on');
|
||||
sfBuilderBlocks = {sfBuilderBlocksByMaskType{:} sfBuilderBlocksByCallback{:} sfBuilderBlocksDeployed{:}};
|
||||
sfBuilderBlocks = unique(sfBuilderBlocks);
|
||||
if isempty(sfBuilderBlocks)
|
||||
return;
|
||||
end
|
||||
sfBuilderBlockNameMATFile = cell(1, length(sfBuilderBlocks));
|
||||
for idx = 1:length(sfBuilderBlocks)
|
||||
sfBuilderBlockNameMATFile{idx} = get_param(sfBuilderBlocks{idx},'FunctionName');
|
||||
sfBuilderBlockNameMATFile{idx} = ['.' filesep 'SFB__' char(sfBuilderBlockNameMATFile{idx}) '__SFB.mat'];
|
||||
end
|
||||
sfBuilderBlockNameMATFile = unique(sfBuilderBlockNameMATFile);
|
||||
for idx = 1:length(sfBuilderBlockNameMATFile)
|
||||
if exist(sfBuilderBlockNameMATFile{idx}, 'file')
|
||||
loadedData = load(sfBuilderBlockNameMATFile{idx});
|
||||
if isfield(loadedData,'SFBInfoStruct')
|
||||
makeInfo = UpdateMakeInfo(makeInfo,loadedData.SFBInfoStruct);
|
||||
clear loadedData;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function updatedMakeInfo = UpdateMakeInfo(makeInfo,SFBInfoStruct)
|
||||
updatedMakeInfo = {};
|
||||
if isfield(makeInfo,'includePath')
|
||||
if isfield(SFBInfoStruct,'includePath')
|
||||
updatedMakeInfo.includePath = {makeInfo.includePath{:} SFBInfoStruct.includePath{:}};
|
||||
else
|
||||
updatedMakeInfo.includePath = {makeInfo.includePath{:}};
|
||||
end
|
||||
end
|
||||
if isfield(makeInfo,'sourcePath')
|
||||
if isfield(SFBInfoStruct,'sourcePath')
|
||||
updatedMakeInfo.sourcePath = {makeInfo.sourcePath{:} SFBInfoStruct.sourcePath{:}};
|
||||
else
|
||||
updatedMakeInfo.sourcePath = {makeInfo.sourcePath{:}};
|
||||
end
|
||||
end
|
||||
if isfield(makeInfo,'linkLibsObjs')
|
||||
if isfield(SFBInfoStruct,'additionalLibraries')
|
||||
updatedMakeInfo.linkLibsObjs = {makeInfo.linkLibsObjs{:} SFBInfoStruct.additionalLibraries{:}};
|
||||
else
|
||||
updatedMakeInfo.linkLibsObjs = {makeInfo.linkLibsObjs{:}};
|
||||
end
|
||||
end
|
||||
Binary file not shown.
|
|
@ -0,0 +1,39 @@
|
|||
%implements "chartSource" "C"
|
||||
%function ChartConfig(block, system) void
|
||||
%createrecord chartConfiguration { ...
|
||||
executeAtInitialization 0 ...
|
||||
}
|
||||
%return chartConfiguration
|
||||
%endfunction
|
||||
%function ChartDataMap(block, system) void
|
||||
%createrecord ChartDataElements {\
|
||||
NumChartData 3 \
|
||||
ChartDataDefaults {\
|
||||
RecordType "ChartData"\
|
||||
Dimensions []\
|
||||
IsTestPoint 0\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "is_active_c1_socTouchDisplay"\
|
||||
Description "StateIsActive"\
|
||||
SFName ""\
|
||||
Path ""\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "is_c1_socTouchDisplay"\
|
||||
Description "StateActiveChild"\
|
||||
SFName ""\
|
||||
Path ""\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "durationCounter_1"\
|
||||
Description ""\
|
||||
SFName ""\
|
||||
Path "bmsPresent"\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
}
|
||||
%return ChartDataElements
|
||||
%endfunction
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
%implements "chartSource" "C"
|
||||
%function ChartConfig(block, system) void
|
||||
%createrecord chartConfiguration { ...
|
||||
executeAtInitialization 0 ...
|
||||
}
|
||||
%return chartConfiguration
|
||||
%endfunction
|
||||
%function ChartDataMap(block, system) void
|
||||
%createrecord ChartDataElements {\
|
||||
NumChartData 5 \
|
||||
ChartDataDefaults {\
|
||||
RecordType "ChartData"\
|
||||
Dimensions []\
|
||||
IsTestPoint 0\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "is_active_c3_socTouchDisplay"\
|
||||
Description "StateIsActive"\
|
||||
SFName ""\
|
||||
Path ""\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "is_c3_socTouchDisplay"\
|
||||
Description "StateActiveChild"\
|
||||
SFName ""\
|
||||
Path ""\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "temporalCounter_i1"\
|
||||
Description "TemporalCounter"\
|
||||
SFName ""\
|
||||
Path ""\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "durationCounter_1"\
|
||||
Description ""\
|
||||
SFName ""\
|
||||
Path "touchNotDetected"\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
ChartData {\
|
||||
Name "durationCounter_2"\
|
||||
Description ""\
|
||||
SFName ""\
|
||||
Path "touchNotDetected"\
|
||||
SrcLocation ""\
|
||||
}\
|
||||
}
|
||||
%return ChartDataElements
|
||||
%endfunction
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
%implements "machineSource" "C"
|
||||
%function CacheMachineDefinitions(block,system) void
|
||||
%openfile tmpFcnBuf
|
||||
%closefile tmpFcnBuf
|
||||
%<SLibCacheCodeToFile("sf_machine_data_defn",tmpFcnBuf)>\
|
||||
|
||||
%endfunction
|
||||
%function DumpMachineInitializer(block) Output
|
||||
|
||||
%openfile tmpFcnBuf
|
||||
|
||||
%closefile tmpFcnBuf
|
||||
%if !WHITE_SPACE(tmpFcnBuf)
|
||||
|
||||
/* Machine initializer */
|
||||
%<tmpFcnBuf>\
|
||||
%endif
|
||||
%endfunction
|
||||
%function GlobalMachineInitializer(block) void
|
||||
%openfile tmpFcnBuf
|
||||
%<DumpMachineInitializer(block)>\
|
||||
%closefile tmpFcnBuf
|
||||
%return tmpFcnBuf
|
||||
%endfunction %% GlobalMachineInitializer
|
||||
|
||||
%function DumpMachineTerminator(block) Output
|
||||
%openfile tmpFcnBuf
|
||||
|
||||
%closefile tmpFcnBuf
|
||||
%if !WHITE_SPACE(tmpFcnBuf)
|
||||
|
||||
/* Machine initializer */
|
||||
%<tmpFcnBuf>\
|
||||
%endif
|
||||
%endfunction
|
||||
%function GlobalMachineTerminator(block) void
|
||||
%openfile tmpFcnBuf
|
||||
%<DumpMachineTerminator(block)>\
|
||||
%closefile tmpFcnBuf
|
||||
%return tmpFcnBuf
|
||||
%endfunction %% GlobalMachineTerminator
|
||||
|
||||
%function CacheMachineFunctions(block,system) void
|
||||
%openfile tmpFcnBuf
|
||||
|
||||
|
||||
%closefile tmpFcnBuf
|
||||
%<SLibCacheCodeToFile("sf_machine_fcn_defn",tmpFcnBuf)>
|
||||
%endfunction
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
%implements "machineHeader" "C"
|
||||
%function CacheOutputs(block,system) void
|
||||
%assign srcFileName = SLibGetFullFileNameForSystemCode("sys_src_incl", system.SystemIdx)
|
||||
%assign isWithinReusableSubsys = (LibSystemIsReusedLibraryFcn(System[system.SystemIdx]) || LibSystemIsReusedLibraryFcn(System[System[system.SystemIdx].NonInlinedParentSystemIdx]))
|
||||
%openfile typedefsBuf
|
||||
|
||||
%closefile typedefsBuf
|
||||
%<SLibCacheCodeToFile("sf_machine_typedef",typedefsBuf)>
|
||||
%if !isWithinReusableSubsys && !WHITE_SPACE(typedefsBuf)
|
||||
%<SLibUpdateHeadersNeededByFile(srcFileName, SLibGetFullFileNameForCode("sf_machine_typedef"))>
|
||||
%endif
|
||||
%openfile definesBuf
|
||||
%closefile definesBuf
|
||||
%<SLibCacheCodeToFile("sf_machine_data_define",definesBuf)>
|
||||
%if !isWithinReusableSubsys && !WHITE_SPACE(definesBuf)
|
||||
%<SLibUpdateHeadersNeededByFile(srcFileName, SLibGetFullFileNameForCode("sf_machine_data_define"))>
|
||||
%endif
|
||||
%openfile externDataBuf
|
||||
%closefile externDataBuf
|
||||
%<SLibCacheCodeToFile("sf_machine_extern_data_decl",externDataBuf)>
|
||||
%if !isWithinReusableSubsys && !WHITE_SPACE(externDataBuf)
|
||||
%<SLibUpdateHeadersNeededByFile(srcFileName, SLibGetFullFileNameForCode("sf_machine_extern_data_decl"))>
|
||||
%endif
|
||||
%openfile externDataBuf
|
||||
%closefile externDataBuf
|
||||
%<SLibCacheCodeToFile("sf_machine_public_extern_data_decl",externDataBuf)>
|
||||
%if !isWithinReusableSubsys && !WHITE_SPACE(externDataBuf)
|
||||
%<SLibUpdateHeadersNeededByFile(srcFileName, SLibGetFullFileNameForCode("sf_machine_public_extern_data_decl"))>
|
||||
%endif
|
||||
%openfile externDataBuf
|
||||
|
||||
|
||||
|
||||
%closefile externDataBuf
|
||||
%<SLibCacheCodeToFile("sf_machine_extern_fcn_decl",externDataBuf)>
|
||||
%if !isWithinReusableSubsys && !WHITE_SPACE(externDataBuf)
|
||||
%<SLibUpdateHeadersNeededByFile(srcFileName, SLibGetFullFileNameForCode("sf_machine_extern_fcn_decl"))>
|
||||
%endif
|
||||
%endfunction %% CacheOutputs
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,633 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MF0 version="1.1" packageUris="http://schema.mathworks.com/mf0/ci/19700101 http://schema.mathworks.com/mf0/sl_data_duplicateandconsistencycheck/R2022b http://schema.mathworks.com/mf0/sl_modelref_info/R2023b http://schema.mathworks.com/mf0/slexec_mm_sto/R2023a_202208151321 http://schema.mathworks.com/mf0/sltp_mm/R2023a_202209151115">
|
||||
<ModelRefInfoRepo.ModelRefInfoRoot type="ModelRefInfoRepo.ModelRefInfoRoot" uuid="06330d8d-0b1f-42a7-ae66-18118dd967df">
|
||||
<JITEngines>sJSjS2nhFB3Qcky7Q7UDQFE</JITEngines>
|
||||
<JITEngines>sKuRTaq5s8EZI5Gj28zXs2E</JITEngines>
|
||||
<calibrationData type="ModelRefInfoRepo.CalibrationData" uuid="3cc64475-251f-4ff3-a920-279e74c2a96c">
|
||||
<InternalData>[{"Name":"","Profile":""}]</InternalData>
|
||||
<ModelName>socTouchDisplay</ModelName>
|
||||
<RootIOData>[{"Name":"in_bTouchDetected","Profile":""},{"Name":"ip_u32TouchDuration_msec","Profile":""},{"Name":"ip_u32DisplayDuration_msec","Profile":""},{"Name":"Input","Profile":""},{"Name":"ip_u32canId","Profile":""},{"Name":"op_bDisplayStatus","Profile":""},{"Name":"op_bErrorStatus","Profile":""},{"Name":"op_u8HundredsPlace","Profile":""},{"Name":"op_u8TensPlace","Profile":""},{"Name":"op_u8OnesPlace","Profile":""}]</RootIOData>
|
||||
</calibrationData>
|
||||
<childModelRefInfo type="ModelRefInfoRepo.ChildModelRefInfo" uuid="f25ea66c-054e-4214-98cb-b2b70e582e67">
|
||||
<modelName>socTouchDisplay</modelName>
|
||||
<modelPath>socTouchDisplay</modelPath>
|
||||
</childModelRefInfo>
|
||||
<compiledTFinal>100.0</compiledTFinal>
|
||||
<dataDictionary>socTouchDisplay.sldd</dataDictionary>
|
||||
<dataDictionarySet>socTouchDisplay.sldd</dataDictionarySet>
|
||||
<dataDictionarySetForDataTypeCheck>socTouchDisplay.sldd</dataDictionarySetForDataTypeCheck>
|
||||
<dataSourceInfo type="ModelRefInfoRepo.DataSourceInfo" uuid="b42a231a-3218-4971-9c5d-50824744d12a">
|
||||
<dataSources type="ModelRefInfoRepo.SourceInfo" uuid="9a8ef6ee-cd60-402d-ac89-914ca9273d25">
|
||||
<includeAllSections>true</includeAllSections>
|
||||
<sourceName>socTouchDisplay.sldd</sourceName>
|
||||
<type>DataDictionary</type>
|
||||
</dataSources>
|
||||
<dataSources type="ModelRefInfoRepo.SourceInfo" uuid="16035acd-f82b-414e-b1a1-ee6b9af935d8">
|
||||
<includeAllSections>true</includeAllSections>
|
||||
<sourceName>base workspace</sourceName>
|
||||
<type>BaseWorkspace</type>
|
||||
</dataSources>
|
||||
<modelName>socTouchDisplay</modelName>
|
||||
</dataSourceInfo>
|
||||
<dataTransferInfos>AAFJTQAAAAAOAAAAOAAAAAYAAAAIAAAAAgAAAAAAAAAFAAAACAAAAAAAAAABAAAAAQAAAAAAAAAFAAQAAQAAAAEAAAAAAAAA</dataTransferInfos>
|
||||
<defaultsCMapping>{"Inports":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","Outports":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","ParameterArguments":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","LocalParameters":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","GlobalParameters":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","InternalData":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","SharedLocalDataStores":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","GlobalDataStores":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","Constants":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","DataTransfers":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","ModelData":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","InitializeTerminate":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","Execution":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}","SharedUtility":"{\"Name\":\"Default\",\"Checksum\":\"Default\",\"PerInstancePropertiesChecksum\":\"\",\"MemorySectionName\":\"None\",\"MemorySectionChecksum\":\"None\"}"}</defaultsCMapping>
|
||||
<fastestNoncontSigFeedingDerivPorts>-1.0</fastestNoncontSigFeedingDerivPorts>
|
||||
<fundamentalSampleTimePeriod>.1</fundamentalSampleTimePeriod>
|
||||
<globalVariables>#CAN_MESSAGE_BUS#socTouchDisplay.sldd#</globalVariables>
|
||||
<globalVariables>#MAX_CAN_MESSAGE_INSTANCE#socTouchDisplay.sldd#</globalVariables>
|
||||
<hasBlockWithPeriodicDiscreteSampleTime>true</hasBlockWithPeriodicDiscreteSampleTime>
|
||||
<hasBwsAccessed>true</hasBwsAccessed>
|
||||
<hasBwsAccessedByAnyModel>true</hasBwsAccessedByAnyModel>
|
||||
<hasNonVirtualConstantTs>true</hasNonVirtualConstantTs>
|
||||
<hasStatesModifiedInOutputUpdate>true</hasStatesModifiedInOutputUpdate>
|
||||
<inports type="ModelRefInfoRepo.InportInformation" uuid="04d81b25-c474-4e9c-8c09-2319e02a45b1">
|
||||
<isNotDerivPort>true</isNotDerivPort>
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<indexType>2</indexType>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.InputExecutionInterface" uuid="4b52b55a-ea9b-41a7-8e79-8ea03f0cc9c9"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="0cd45c6a-812e-44bd-ab6c-0d0a5512fbd9"/>
|
||||
</inports>
|
||||
<inports type="ModelRefInfoRepo.InportInformation" uuid="2b667d6d-639f-4383-9bca-da5bcddf3c65">
|
||||
<isNotDerivPort>true</isNotDerivPort>
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<indexType>2</indexType>
|
||||
<originalPortNumber>1</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.InputExecutionInterface" uuid="9d9b3b4e-d610-4212-a446-4c969ea60437"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="f3309e88-67cd-450d-8adc-201037b7c178"/>
|
||||
</inports>
|
||||
<inports type="ModelRefInfoRepo.InportInformation" uuid="296946d2-5a11-4635-81c4-d4f31c47447b">
|
||||
<isNotDerivPort>true</isNotDerivPort>
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<indexType>2</indexType>
|
||||
<originalPortNumber>2</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.InputExecutionInterface" uuid="8ac87951-0a5f-4e8f-a2ab-1a435f81c2f7"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="a0f3e557-cbac-43aa-919e-8d34587b5ba2"/>
|
||||
</inports>
|
||||
<inports type="ModelRefInfoRepo.InportInformation" uuid="38b825ec-62d3-449a-8fdb-7011b4bec927">
|
||||
<isNotDerivPort>true</isNotDerivPort>
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<indexType>2</indexType>
|
||||
<originalPortNumber>3</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.InputExecutionInterface" uuid="40b70236-15c8-4b09-b0df-7048497f8243"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="0798ea4d-1f6a-4f31-a884-80069f17da1d"/>
|
||||
</inports>
|
||||
<inports type="ModelRefInfoRepo.InportInformation" uuid="722a749d-4325-4303-b88e-e33cd9299693">
|
||||
<isNotDerivPort>true</isNotDerivPort>
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<indexType>2</indexType>
|
||||
<originalPortNumber>4</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.InputExecutionInterface" uuid="13a0fa05-25db-4d4c-b6f6-552797705d3a"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="c0d48622-ab23-4464-8fc3-a3132dc39274"/>
|
||||
</inports>
|
||||
<isBdInSimModeForSimCodegenVariants>false</isBdInSimModeForSimCodegenVariants>
|
||||
<isInlineParamsOn>true</isInlineParamsOn>
|
||||
<isOrigInportVirtualBus>false</isOrigInportVirtualBus>
|
||||
<isOrigInportVirtualBus>false</isOrigInportVirtualBus>
|
||||
<isOrigInportVirtualBus>false</isOrigInportVirtualBus>
|
||||
<isOrigInportVirtualBus>false</isOrigInportVirtualBus>
|
||||
<isOrigInportVirtualBus>false</isOrigInportVirtualBus>
|
||||
<isOrigOutportVirtualBus>false</isOrigOutportVirtualBus>
|
||||
<isOrigOutportVirtualBus>false</isOrigOutportVirtualBus>
|
||||
<isOrigOutportVirtualBus>false</isOrigOutportVirtualBus>
|
||||
<isOrigOutportVirtualBus>false</isOrigOutportVirtualBus>
|
||||
<isOrigOutportVirtualBus>false</isOrigOutportVirtualBus>
|
||||
<loggingSaveFormat>2</loggingSaveFormat>
|
||||
<maxFreqHz>-1.0</maxFreqHz>
|
||||
<numDataInputPorts>5</numDataInputPorts>
|
||||
<numLoggableJacobianDStates>0</numLoggableJacobianDStates>
|
||||
<origInportBusType></origInportBusType>
|
||||
<origInportBusType></origInportBusType>
|
||||
<origInportBusType></origInportBusType>
|
||||
<origInportBusType></origInportBusType>
|
||||
<origInportBusType></origInportBusType>
|
||||
<origOutportBusOutputAsStruct>false</origOutportBusOutputAsStruct>
|
||||
<origOutportBusOutputAsStruct>false</origOutportBusOutputAsStruct>
|
||||
<origOutportBusOutputAsStruct>false</origOutportBusOutputAsStruct>
|
||||
<origOutportBusOutputAsStruct>false</origOutportBusOutputAsStruct>
|
||||
<origOutportBusOutputAsStruct>false</origOutportBusOutputAsStruct>
|
||||
<origOutportBusType></origOutportBusType>
|
||||
<origOutportBusType></origOutportBusType>
|
||||
<origOutportBusType></origOutportBusType>
|
||||
<origOutportBusType></origOutportBusType>
|
||||
<origOutportBusType></origOutportBusType>
|
||||
<outports type="ModelRefInfoRepo.OutportInformation" uuid="d11e053e-e358-47f5-9cbf-3f9e0b447db9">
|
||||
<hasSystemInitMethod>true</hasSystemInitMethod>
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.OutputExecutionInterface" uuid="a9bb6cb9-90c8-4d88-bd00-1c418c545113"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="6bd078e3-61f5-4e8b-ad02-722734612027"/>
|
||||
</outports>
|
||||
<outports type="ModelRefInfoRepo.OutportInformation" uuid="66f29f9c-235f-41f6-9566-cfc8c591436a">
|
||||
<hasSystemInitMethod>true</hasSystemInitMethod>
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<originalPortNumber>1</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.OutputExecutionInterface" uuid="afc0a88f-2cda-45eb-a5e7-f78aa7dab6c7"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="1c61affe-d9a1-430a-b89f-d60cbaff6b88"/>
|
||||
</outports>
|
||||
<outports type="ModelRefInfoRepo.OutportInformation" uuid="0ad18af4-34db-4b9a-b8c2-748f5c70b7d4">
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<originalPortNumber>2</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.OutputExecutionInterface" uuid="ba736367-0eca-48a5-be28-e90c5fcedadc"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="0b1fd699-8283-4ae3-b65d-8ad6a8a68132"/>
|
||||
</outports>
|
||||
<outports type="ModelRefInfoRepo.OutportInformation" uuid="8770e933-fafa-4a10-b5a8-176d897755ad">
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<originalPortNumber>3</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.OutputExecutionInterface" uuid="98e330e2-d543-4bab-8574-c928dc41616e"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="8eb2ff12-adb6-43d4-8310-553ff0eba64c"/>
|
||||
</outports>
|
||||
<outports type="ModelRefInfoRepo.OutportInformation" uuid="73a1d0ff-1e45-42d4-991d-264721f7ac5e">
|
||||
<designMax>inf</designMax>
|
||||
<designMin>-inf</designMin>
|
||||
<originalPortNumber>4</originalPortNumber>
|
||||
<rateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</rateInfos>
|
||||
<resolvedSignalObject></resolvedSignalObject>
|
||||
<executionInterface type="ModelRefInfoRepo.OutputExecutionInterface" uuid="9062923e-af0a-45c4-9cb0-fc981c8b46e0"/>
|
||||
<sigNameToEMVCEMap type="ModelRefInfoRepo.SigNameEMVCEInfo" uuid="8e9f5f6f-1c67-43fb-8638-17a5c6a26f47"/>
|
||||
</outports>
|
||||
<removeResetFunc>true</removeResetFunc>
|
||||
<runtimeNonFcnCallRateInfos type="ModelRefInfoRepo.RateInfo">
|
||||
<compiled>true</compiled>
|
||||
<nonFcnCallPartitionName>D1</nonFcnCallPartitionName>
|
||||
<period>.1</period>
|
||||
<priority>40</priority>
|
||||
<rateIdx>0</rateIdx>
|
||||
</runtimeNonFcnCallRateInfos>
|
||||
<sampleTimeInheritanceRule>2</sampleTimeInheritanceRule>
|
||||
<solverStatusFlags>323</solverStatusFlags>
|
||||
<timingAndTaskingRegistry><?xml version="1.0"?>
|
||||
<slexec_sto version="1.1" packageUris="http://schema.mathworks.com/mf0/slexec_mm_sto/R2023a_202208151321">
|
||||
<sto.Registry type="sto.Registry" uuid="cd25431f-875e-462e-90e6-77aba17625d3">
|
||||
<executionSpec>Undetermined</executionSpec>
|
||||
<identifier>socTouchDisplay</identifier>
|
||||
<clockRegistry type="sto.ClockRegistry" uuid="dd27bfe6-2f41-4359-8706-c010ed9dc578">
|
||||
<clocks type="sto.Timer" uuid="23b6ef5b-2cde-4de5-8f5c-41238b19192e">
|
||||
<clockTickConstraint>PeriodicWithFixedResolution</clockTickConstraint>
|
||||
<computedFundamentalDiscretePeriod>.1</computedFundamentalDiscretePeriod>
|
||||
<fastestDiscreteRate type="sto.ClassicPeriodicDiscreteRate" uuid="a4a85346-4500-496a-b655-7c0b2e0a41ce"/>
|
||||
<isDefaultTimer>true</isDefaultTimer>
|
||||
<resolution>.1</resolution>
|
||||
<timeAdvanceMode>FixedStep</timeAdvanceMode>
|
||||
<identifier>socTouchDisplay::defaultTimer</identifier>
|
||||
<rates type="sto.ClassicPeriodicDiscreteRate" uuid="a4a85346-4500-496a-b655-7c0b2e0a41ce">
|
||||
<annotation>D1</annotation>
|
||||
<clockId>socTouchDisplay::defaultTimer</clockId>
|
||||
<description>Discrete 1</description>
|
||||
<taskId>_task0</taskId>
|
||||
<rateSpec type="sto.RateSpec" uuid="e2802860-1cd7-4f78-a3ea-f71eeea3095b">
|
||||
<period>.1</period>
|
||||
<rateType>ClassicPeriodicDiscrete</rateType>
|
||||
</rateSpec>
|
||||
</rates>
|
||||
<baseRate type="sto.ClassicPeriodicDiscreteRate" uuid="83ac6bc7-b933-4c64-aaa4-c68795b13cf0">
|
||||
<annotation>D1</annotation>
|
||||
<clockId>socTouchDisplay::defaultTimer</clockId>
|
||||
<description>Discrete 1</description>
|
||||
<taskId>_task0</taskId>
|
||||
<rateSpec type="sto.RateSpec" uuid="a04f93e4-1521-445e-8894-e52d5e91ab8e">
|
||||
<period>.1</period>
|
||||
<rateType>ClassicPeriodicDiscrete</rateType>
|
||||
</rateSpec>
|
||||
</baseRate>
|
||||
</clocks>
|
||||
<clocks type="sto.Event" uuid="885722a5-c5f4-4bd2-9701-8e7be9b9e22e">
|
||||
<eventType>PARAMETER_CHANGE_EVENT</eventType>
|
||||
<cNum>1</cNum>
|
||||
<clockType>Event</clockType>
|
||||
<identifier>ParameterChangeEvent</identifier>
|
||||
<rates type="sto.ModelWideEventRate" uuid="936e84dc-3ded-47f7-8ab3-c85ff31937e5">
|
||||
<clockId>ParameterChangeEvent</clockId>
|
||||
<rateIdx>-1</rateIdx>
|
||||
<taskId>ModelWideParameterChangeEvent</taskId>
|
||||
<useForExecution>NotForExecution</useForExecution>
|
||||
<rateSpec type="sto.RateSpec" uuid="19ce4db5-4ab9-480c-b5ec-8fffafc7135e">
|
||||
<period>inf</period>
|
||||
<rateType>ModelWideParameterChangeEvent</rateType>
|
||||
</rateSpec>
|
||||
</rates>
|
||||
</clocks>
|
||||
<timeAdvanceMode>FixedStep</timeAdvanceMode>
|
||||
</clockRegistry>
|
||||
<taskRegistry type="sto.TaskRegistry" uuid="0d993ee2-3b65-4573-8898-5196aac386ca">
|
||||
<rootTaskHierarchyElements type="sto.Task" uuid="7a8d6f06-f507-4752-b49d-2d40b196b835">
|
||||
<isExplicit>true</isExplicit>
|
||||
<rates type="sto.ModelWideEventRate" uuid="e25b0b14-78dd-4492-8e0f-646a47ceb794">
|
||||
<clockId>ParameterChangeEvent</clockId>
|
||||
<rateIdx>-1</rateIdx>
|
||||
<taskId>ModelWideParameterChangeEvent</taskId>
|
||||
<useForExecution>NotForExecution</useForExecution>
|
||||
<rateSpec type="sto.RateSpec" uuid="f3a4db8e-6eb5-4170-b182-f2fb8ee48e34">
|
||||
<period>inf</period>
|
||||
<rateType>ModelWideParameterChangeEvent</rateType>
|
||||
</rateSpec>
|
||||
</rates>
|
||||
<schedulingClockId>ParameterChangeEvent</schedulingClockId>
|
||||
<timeKeeperClockId>socTouchDisplay::defaultTimer</timeKeeperClockId>
|
||||
<elementType>Task</elementType>
|
||||
<identifier>ModelWideParameterChangeEvent</identifier>
|
||||
<priority>-1</priority>
|
||||
</rootTaskHierarchyElements>
|
||||
<rootTaskHierarchyElements type="sto.Task" uuid="d3bf08c5-2444-421e-8164-08c71bb6edf8">
|
||||
<isExecutable>true</isExecutable>
|
||||
<orderIndex>1</orderIndex>
|
||||
<rates type="sto.ClassicPeriodicDiscreteRate" uuid="f3a57984-7593-41ca-8198-978ffde0f85d">
|
||||
<annotation>D1</annotation>
|
||||
<clockId>socTouchDisplay::defaultTimer</clockId>
|
||||
<description>Discrete 1</description>
|
||||
<taskId>_task0</taskId>
|
||||
<rateSpec type="sto.RateSpec" uuid="d6123553-da2e-4156-bc60-26c4ac2e0a35">
|
||||
<period>.1</period>
|
||||
<rateType>ClassicPeriodicDiscrete</rateType>
|
||||
</rateSpec>
|
||||
</rates>
|
||||
<schedulingClockId>socTouchDisplay::defaultTimer</schedulingClockId>
|
||||
<timeKeeperClockId>socTouchDisplay::defaultTimer</timeKeeperClockId>
|
||||
<elementType>Task</elementType>
|
||||
<identifier>_task0</identifier>
|
||||
<priority>40</priority>
|
||||
</rootTaskHierarchyElements>
|
||||
<taskDependencyGraph type="sto.SerializedTaskConnectionList" uuid="f2944dc6-df54-41da-8274-72899cb2e2c9">
|
||||
<clockIdentifier>socTouchDisplay::defaultTimer</clockIdentifier>
|
||||
<taskIdentifier>_task0</taskIdentifier>
|
||||
</taskDependencyGraph>
|
||||
<taskDependencyGraph type="sto.SerializedTaskConnectionList" uuid="e0cf3055-a235-4970-a1cf-fff869fdec18">
|
||||
<clockIdentifier>ParameterChangeEvent</clockIdentifier>
|
||||
<taskIdentifier>ModelWideParameterChangeEvent</taskIdentifier>
|
||||
</taskDependencyGraph>
|
||||
<taskPriorityDirection>HighNumberLast</taskPriorityDirection>
|
||||
</taskRegistry>
|
||||
</sto.Registry>
|
||||
</slexec_sto></timingAndTaskingRegistry>
|
||||
<zeroInternalMemoryAtStartupUnchecked>true</zeroInternalMemoryAtStartupUnchecked>
|
||||
<FMUBlockMap type="ModelRefInfoRepo.FMUBlockInfo" uuid="3e8b716c-9243-4ffc-9573-dbe5a7704f57"/>
|
||||
<codeGenInfo type="ModelRefInfoRepo.CodeGenInformation" uuid="a2756deb-d404-4389-b200-b09a703dc57c"/>
|
||||
<compiledVariantInfos type="ModelRefInfoRepo.CompiledVariantInfoMap" uuid="64d47c18-6cd8-4fba-b9c1-26d4a8d02673"/>
|
||||
<configSettingsForConsistencyChecks type="ModelRefInfoRepo.ConfigSettingsForConsistencyChecks" uuid="e0f2fd7e-9e9a-4569-b6ea-f3c554c5c137">
|
||||
<consistentOutportInitialization>true</consistentOutportInitialization>
|
||||
<fixedStepSize>.1</fixedStepSize>
|
||||
<frameDiagnosticSetting>2</frameDiagnosticSetting>
|
||||
<hasHybridSampleTime>true</hasHybridSampleTime>
|
||||
<optimizedInitCode>true</optimizedInitCode>
|
||||
<signalLoggingSaveFormat>2</signalLoggingSaveFormat>
|
||||
<simSIMDOptimization>1</simSIMDOptimization>
|
||||
<solverName>FixedStepDiscrete</solverName>
|
||||
<solverType>SOLVER_TYPE_FIXEDSTEP</solverType>
|
||||
<hardwareSettings type="ModelRefInfoRepo.HardwareSettings" uuid="f91b372c-4d10-4c2e-a9e3-20226af61a22">
|
||||
<prodBitPerChar>8</prodBitPerChar>
|
||||
<prodBitPerDouble>64</prodBitPerDouble>
|
||||
<prodBitPerFloat>32</prodBitPerFloat>
|
||||
<prodBitPerInt>32</prodBitPerInt>
|
||||
<prodBitPerLong>32</prodBitPerLong>
|
||||
<prodBitPerLongLong>64</prodBitPerLongLong>
|
||||
<prodBitPerPointer>64</prodBitPerPointer>
|
||||
<prodBitPerPtrDiffT>64</prodBitPerPtrDiffT>
|
||||
<prodBitPerShort>16</prodBitPerShort>
|
||||
<prodBitPerSizeT>64</prodBitPerSizeT>
|
||||
<prodEndianess>1</prodEndianess>
|
||||
<prodShiftRight>true</prodShiftRight>
|
||||
<prodWordSize>64</prodWordSize>
|
||||
</hardwareSettings>
|
||||
</configSettingsForConsistencyChecks>
|
||||
<controllableInputRatesMap type="ModelRefInfoRepo.VarTsUIDMap" uuid="fcebf00d-ba3c-47e6-9c59-baf579ac3d84"/>
|
||||
<controllableOutputRatesMap type="ModelRefInfoRepo.VarTsUIDMap" uuid="dc22734d-1f30-4a67-a8c8-77c50a021870"/>
|
||||
<dataPortGroup type="ModelRefInfoRepo.DataPortGroup" uuid="df4e46cd-befa-4229-ae78-a022b917ba1d">
|
||||
<compDataInputPorts>0</compDataInputPorts>
|
||||
<compDataInputPorts>1</compDataInputPorts>
|
||||
<compDataInputPorts>2</compDataInputPorts>
|
||||
<compDataInputPorts>3</compDataInputPorts>
|
||||
<compDataInputPorts>4</compDataInputPorts>
|
||||
<compDataOutputPorts>0</compDataOutputPorts>
|
||||
<compDataOutputPorts>1</compDataOutputPorts>
|
||||
<compDataOutputPorts>2</compDataOutputPorts>
|
||||
<compDataOutputPorts>3</compDataOutputPorts>
|
||||
<compDataOutputPorts>4</compDataOutputPorts>
|
||||
<dataInputPorts>0</dataInputPorts>
|
||||
<dataInputPorts>1</dataInputPorts>
|
||||
<dataInputPorts>2</dataInputPorts>
|
||||
<dataInputPorts>3</dataInputPorts>
|
||||
<dataInputPorts>4</dataInputPorts>
|
||||
<dataOutputPorts>0</dataOutputPorts>
|
||||
<dataOutputPorts>1</dataOutputPorts>
|
||||
<dataOutputPorts>2</dataOutputPorts>
|
||||
<dataOutputPorts>3</dataOutputPorts>
|
||||
<dataOutputPorts>4</dataOutputPorts>
|
||||
</dataPortGroup>
|
||||
<expFcnUnconnectedDataPortGroup type="ModelRefInfoRepo.DataPortGroup" uuid="55f0dca5-8780-44ea-8b0c-80cab8b94d43"/>
|
||||
<interfaceParameterInfo type="ModelRefInfoRepo.InterfaceParameterInfo" uuid="639db967-aa0d-4c0a-8211-8648e0126245"/>
|
||||
<messageInfo type="ModelRefInfoRepo.MessageInformation" uuid="a8103aa5-7ba4-45d6-9994-ad82749265db"/>
|
||||
<methodInfo type="ModelRefInfoRepo.MethodExistenceInfo" uuid="1f87407e-afbb-4d35-a77b-0ddb2fe0462a">
|
||||
<hasEnableMethod>true</hasEnableMethod>
|
||||
<hasSystemInitializeMethod>true</hasSystemInitializeMethod>
|
||||
<hasSystemResetMethod>true</hasSystemResetMethod>
|
||||
<hasTerminateMethod>true</hasTerminateMethod>
|
||||
<hasUpdateMethod>true</hasUpdateMethod>
|
||||
</methodInfo>
|
||||
<periodicEventPortUnsupportedBlockInfo type="ModelRefInfoRepo.PeriodicEventPortUnsupportedBlockInfo" uuid="14206dc0-1fd6-4dba-8c74-dd99a845570e"/>
|
||||
<portGroupsRequireSameRate type="ModelRefInfoRepo.PortGroupsRequireSameRate" uuid="59052a57-cbe4-4463-83d9-41146784d92f">
|
||||
<DSMPortGroups type="ModelRefInfoRepo.NameToPortGroupIdxVectMap" uuid="c6117d1e-18f0-4b5f-aa4f-223d9b0d2383"/>
|
||||
<GlobalDSMPortGroups type="ModelRefInfoRepo.NameToPortGroupIdxVectMap" uuid="f78ef5ea-a1be-4233-ad7b-86e4091dab6f"/>
|
||||
<mergedPortGroups type="ModelRefInfoRepo.NameToPortGroupIdxVectMap" uuid="1b2928e2-9c91-4ab4-9ba2-604d814052a7"/>
|
||||
</portGroupsRequireSameRate>
|
||||
<rateBasedMdlGlobalDSMRateSpec type="ModelRefInfoRepo.GlobalDSMRateSpecMap" uuid="c5c17c96-96d2-495c-b462-ee039088a145"/>
|
||||
<rateSpecOfGlobalDSMAccessedByDescExpFcnMdlMap type="ModelRefInfoRepo.GlobalDSMRateSpecMap" uuid="e5d0c96b-d583-466f-a4dc-7313b276fa4a"/>
|
||||
<rootBlockDiagramInterface type="ci.Model" uuid="f9aa547e-87b9-4a50-89de-ad733cfc8358">
|
||||
<p_RootComponentInterface type="ci.ComponentInterface" uuid="b12fc1fe-b6e0-422f-a979-cfd08ffff44c">
|
||||
<p_InputPorts type="ci.SignalInterface" uuid="288fd37a-5572-433c-afa5-132c04394ef8">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_Name>in_bTouchDetected</p_Name>
|
||||
</p_InputPorts>
|
||||
<p_InputPorts type="ci.SignalInterface" uuid="12ff4a35-82b6-4cf6-842b-0877dc1d5209">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_Name>ip_u32TouchDuration_msec</p_Name>
|
||||
</p_InputPorts>
|
||||
<p_InputPorts type="ci.SignalInterface" uuid="cff393c9-d93f-4727-9243-b7b7be826450">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_Name>ip_u32DisplayDuration_msec</p_Name>
|
||||
</p_InputPorts>
|
||||
<p_InputPorts type="ci.SignalInterface" uuid="260520bf-4fbf-49d9-ae62-38cf75c4de46">
|
||||
<p_ComputedNumericDimensions>10.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_ComputedType>CAN_MESSAGE_BUS</p_ComputedType>
|
||||
<p_Name>Input</p_Name>
|
||||
</p_InputPorts>
|
||||
<p_InputPorts type="ci.SignalInterface" uuid="aebccee6-adcc-4ecb-886d-dc95a9d1520c">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_ComputedType>uint32</p_ComputedType>
|
||||
<p_Name>ip_u32canId</p_Name>
|
||||
</p_InputPorts>
|
||||
<p_Name>socTouchDisplay</p_Name>
|
||||
<p_OutputPorts type="ci.SignalInterface" uuid="c5bef65f-2e96-4186-900c-b3bb4aba9989">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_ComputedType>boolean</p_ComputedType>
|
||||
<p_Name>op_bDisplayStatus</p_Name>
|
||||
</p_OutputPorts>
|
||||
<p_OutputPorts type="ci.SignalInterface" uuid="a2addc16-d6d5-4b5e-8e70-877f7f9a557b">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_ComputedType>boolean</p_ComputedType>
|
||||
<p_Name>op_bErrorStatus</p_Name>
|
||||
</p_OutputPorts>
|
||||
<p_OutputPorts type="ci.SignalInterface" uuid="615aaec8-58b0-4ba0-a870-e05720b3773a">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_ComputedType>uint8</p_ComputedType>
|
||||
<p_Name>op_u8HundredsPlace</p_Name>
|
||||
</p_OutputPorts>
|
||||
<p_OutputPorts type="ci.SignalInterface" uuid="c0fdcbb2-942c-4639-af9a-95c6eec04845">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_ComputedType>uint8</p_ComputedType>
|
||||
<p_Name>op_u8TensPlace</p_Name>
|
||||
</p_OutputPorts>
|
||||
<p_OutputPorts type="ci.SignalInterface" uuid="0c95a3fd-f88a-4c9c-b98e-9f6fa2d41109">
|
||||
<p_ComputedNumericDimensions>1.0</p_ComputedNumericDimensions>
|
||||
<p_ComputedSampleTime>.1</p_ComputedSampleTime>
|
||||
<p_ComputedSampleTime>0.0</p_ComputedSampleTime>
|
||||
<p_ComputedType>uint8</p_ComputedType>
|
||||
<p_Name>op_u8OnesPlace</p_Name>
|
||||
</p_OutputPorts>
|
||||
<p_Type>ROOT</p_Type>
|
||||
</p_RootComponentInterface>
|
||||
</rootBlockDiagramInterface>
|
||||
<simulinkFunctions type="ModelRefInfoRepo.SimulinkFunctions" uuid="40b4b019-7b2f-4041-83bb-22b4b7e0ac38">
|
||||
<compSimulinkFunctionCatalog></compSimulinkFunctionCatalog>
|
||||
</simulinkFunctions>
|
||||
<sltpContext type="sltp.mm.core.Context" uuid="9163d92d-0590-41fc-b13d-3bf36253804b">
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="42611fd8-e3a2-4dc0-89c8-8e4153b92cfd">
|
||||
<dataName>portInput</dataName>
|
||||
<type>RootInport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="41c82017-f51b-468b-9ae5-dbd4907744db">
|
||||
<dataName>portOutput</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="b231d36b-b68c-41ef-af57-0f468fc22682">
|
||||
<dataName>portcanMsg</dataName>
|
||||
<type>RootInport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="b2397954-3496-4a8d-9ff2-fae2f9cdf143">
|
||||
<dataName>portin_bTouchDetected</dataName>
|
||||
<type>RootInport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="6896bf39-3cf5-460f-a776-1b3153a19172">
|
||||
<dataName>portip_u32DisplayDuration_msec</dataName>
|
||||
<type>RootInport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="3ea6aa04-741f-4a7c-a1ff-4bdd4cb11a4e">
|
||||
<dataName>portip_u32TouchDuration_msec</dataName>
|
||||
<type>RootInport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="adc4eccc-5298-47f0-8d61-7a766ff78265">
|
||||
<dataName>portip_u32canId</dataName>
|
||||
<type>RootInport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="77d0d2a5-4fc8-4b05-8e88-88c7d9f48503">
|
||||
<dataName>portop_bDisplayStatus</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="6f7a122b-0e66-4db4-85e0-4b17b9fa028c">
|
||||
<dataName>portop_bErrorStatus</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="89ab29d0-c2ab-420c-8b8f-dfc119e8a504">
|
||||
<dataName>portop_bFotaTriggerFromBms</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="099f7a9a-8dc5-426a-9a28-eca6891dd3a3">
|
||||
<dataName>portop_bFotaTriggerFromBms1</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="1943db94-10b9-4089-9ea3-2c833da80784">
|
||||
<dataName>portop_chErrHundIdx</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="dadbbfdc-0f0d-4df0-a8a2-6587a8b95d7b">
|
||||
<dataName>portop_chErrOnesIdx</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="3cc5f9a1-ea69-481d-9422-38ec73fe2a6e">
|
||||
<dataName>portop_chErrTensIdx</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="d546afbb-3db5-4cd2-b410-4e9015e6e751">
|
||||
<dataName>portop_errIdx0</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="501449b7-6b75-492a-872d-e3a63843a7f8">
|
||||
<dataName>portop_errIdx1</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="3f449a97-a627-4bed-939b-7d9561156d3d">
|
||||
<dataName>portop_errIdx2</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="cd5b1921-0b7a-4c16-ab48-98459e908506">
|
||||
<dataName>portop_u8HundredsPlace</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="5cf9abe9-eebe-47bd-8b29-3d33b6d7ddc2">
|
||||
<dataName>portop_u8OnesPlace</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<globalData type="sltp.mm.core.GlobalData" uuid="1270f267-892b-4df5-8522-f5dfc42e3760">
|
||||
<dataName>portop_u8TensPlace</dataName>
|
||||
<type>RootOutport</type>
|
||||
</globalData>
|
||||
<priorityDirection>HighNumberLast</priorityDirection>
|
||||
<defaultEventBehavior type="sltp.mm.core.EventBehavior" uuid="20acfb17-c6b5-4a78-9c36-261814a06c6d"/>
|
||||
<editorState type="sltp.mm.core.EditorState" uuid="ef1cfea2-484a-420d-ae76-3d2ab30b0402">
|
||||
<isSynchronized>true</isSynchronized>
|
||||
<panelState type="sltp.mm.core.EditorPanelState" uuid="0bb34eb9-3f07-403c-a299-ffd7020be893"/>
|
||||
</editorState>
|
||||
<rootTask type="sltp.mm.core.Task" uuid="59365742-cebd-49a8-88f4-2a1a60c73799">
|
||||
<context type="sltp.mm.core.Context" uuid="9163d92d-0590-41fc-b13d-3bf36253804b"/>
|
||||
<explicit>false</explicit>
|
||||
<name>Default</name>
|
||||
<priority>-2147483648</priority>
|
||||
<subgraph type="sltp.mm.core.Graph" uuid="8211f6f3-6456-4fdd-9fdd-6db8c05fb759">
|
||||
<tasks type="sltp.mm.core.Task" uuid="24568a26-1283-42aa-8b86-8a1958dad40b">
|
||||
<context type="sltp.mm.core.Context" uuid="9163d92d-0590-41fc-b13d-3bf36253804b"/>
|
||||
<explicit>false</explicit>
|
||||
<id>1</id>
|
||||
<isTimed>true</isTimed>
|
||||
<name>D1</name>
|
||||
<priority>40</priority>
|
||||
<rates type="sltp.mm.core.Rate" uuid="beb9f6f0-2ae0-4fca-8dd3-e473f2873d06">
|
||||
<annotation>D1</annotation>
|
||||
<color>-12240129</color>
|
||||
<hasBlocks>true</hasBlocks>
|
||||
<identifier>ClassicPeriodicDiscrete0.10</identifier>
|
||||
<rateIndex>0</rateIndex>
|
||||
<rateSpec type="sltp.mm.core.RateSpec">
|
||||
<period>.1</period>
|
||||
</rateSpec>
|
||||
<sti>0</sti>
|
||||
</rates>
|
||||
</tasks>
|
||||
</subgraph>
|
||||
</rootTask>
|
||||
</sltpContext>
|
||||
<stateWriterToOwnerMap type="ModelRefInfoRepo.StateWriterInfo" uuid="d4596d5a-82a2-4fbf-a6bd-240b84e32d12"/>
|
||||
<stoClientDataRegistry type="sto.ClientDataRegistry" uuid="6cf327a2-1192-4222-abbf-2eb55ba5e358">
|
||||
<dataSets type="sto.ClientClockNamedDataSet" uuid="39f73b00-9d41-460a-a9a8-7e71df411ef6">
|
||||
<tag>sltpEvents</tag>
|
||||
</dataSets>
|
||||
<dataSets type="sto.ClientTaskHierarchyElementNamedDataSet" uuid="da47f9da-a730-42f7-9f37-617ade1e4b4d">
|
||||
<tag>sltpTaskGroups</tag>
|
||||
</dataSets>
|
||||
<dataSets type="sto.ClientTaskHierarchyElementNamedDataSet" uuid="0068dcf7-d91f-4494-9a94-cffdd92acdb1">
|
||||
<dSet type="ModelRefInfoRepo.SltpTaskData" uuid="133a0a07-2b63-44b7-b58e-998084ea0e7f"/>
|
||||
<tSet type="ModelRefInfoRepo.SltpTaskData" uuid="133a0a07-2b63-44b7-b58e-998084ea0e7f">
|
||||
<dataName>D1</dataName>
|
||||
<linkedSet type="sto.ClientTaskHierarchyElementNamedDataSet" uuid="0068dcf7-d91f-4494-9a94-cffdd92acdb1"/>
|
||||
<id type="sto.TaskHierarchyElementId">
|
||||
<clockId>socTouchDisplay::defaultTimer</clockId>
|
||||
<id>_task0</id>
|
||||
</id>
|
||||
</tSet>
|
||||
<tag>sltpTasks</tag>
|
||||
</dataSets>
|
||||
</stoClientDataRegistry>
|
||||
<varTsUIDMap type="ModelRefInfoRepo.VarTsUIDMap" uuid="2725448d-e310-4475-8ae8-ec6f113d2b9f"/>
|
||||
</ModelRefInfoRepo.ModelRefInfoRoot>
|
||||
</MF0>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
Simulink Coder project marker file. Please don't change it.
|
||||
slprjVersion: 23.2_091
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,101 @@
|
|||
/*
|
||||
* File: ert_main.c
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.111
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Thu Nov 7 22:32:36 2024
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdio.h> /* This example main program uses printf/fflush */
|
||||
#include "socTouchDisplay.h" /* Model header file */
|
||||
|
||||
/*
|
||||
* Associating rt_OneStep with a real-time clock or interrupt service routine
|
||||
* is what makes the generated code "real-time". The function rt_OneStep is
|
||||
* always associated with the base rate of the model. Subrates are managed
|
||||
* by the base rate from inside the generated code. Enabling/disabling
|
||||
* interrupts and floating point context switches are target specific. This
|
||||
* example code indicates where these should take place relative to executing
|
||||
* the generated code step function. Overrun behavior should be tailored to
|
||||
* your application needs. This example simply sets an error status in the
|
||||
* real-time model and returns from rt_OneStep.
|
||||
*/
|
||||
void rt_OneStep(void);
|
||||
void rt_OneStep(void)
|
||||
{
|
||||
static boolean_T OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
|
||||
/* Check for overrun */
|
||||
if (OverrunFlag) {
|
||||
rtmSetErrorStatus(socTouchDisplay_M, "Overrun");
|
||||
return;
|
||||
}
|
||||
|
||||
OverrunFlag = true;
|
||||
|
||||
/* Save FPU context here (if necessary) */
|
||||
/* Re-enable timer or interrupt here */
|
||||
/* Set model inputs here */
|
||||
|
||||
/* Step the model */
|
||||
socTouchDisplay_step();
|
||||
|
||||
/* Get model outputs here */
|
||||
|
||||
/* Indicate task complete */
|
||||
OverrunFlag = false;
|
||||
|
||||
/* Disable interrupts here */
|
||||
/* Restore FPU context here (if necessary) */
|
||||
/* Enable interrupts here */
|
||||
}
|
||||
|
||||
/*
|
||||
* The example main function illustrates what is required by your
|
||||
* application code to initialize, execute, and terminate the generated code.
|
||||
* Attaching rt_OneStep to a real-time clock is target specific. This example
|
||||
* illustrates how you do this relative to initializing the model.
|
||||
*/
|
||||
int_T main(int_T argc, const char *argv[])
|
||||
{
|
||||
/* Unused arguments */
|
||||
(void)(argc);
|
||||
(void)(argv);
|
||||
|
||||
/* Initialize model */
|
||||
socTouchDisplay_initialize();
|
||||
|
||||
/* Attach rt_OneStep to a timer or interrupt service routine with
|
||||
* period 0.1 seconds (base rate of the model) here.
|
||||
* The call syntax for rt_OneStep is
|
||||
*
|
||||
* rt_OneStep();
|
||||
*/
|
||||
printf("Warning: The simulation will run forever. "
|
||||
"Generated ERT main won't simulate model step behavior. "
|
||||
"To change this behavior select the 'MAT-file logging' option.\n");
|
||||
fflush((NULL));
|
||||
while (rtmGetErrorStatus(socTouchDisplay_M) == (NULL)) {
|
||||
/* Perform application tasks here */
|
||||
}
|
||||
|
||||
/* Terminate model */
|
||||
socTouchDisplay_terminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Simulink Coder project for socTouchDisplay using . MATLAB root = C:\Program Files\MATLAB\R2023b. SimStruct date: 02-Aug-2023 01:53:32
|
||||
This file is generated by Simulink Coder for use by the make utility
|
||||
to determine when to rebuild objects when the name of the current Simulink Coder project changes.
|
||||
The rtwinfomat located at: ..\slprj\ert\socTouchDisplay\tmwinternal\binfo.mat
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
/*
|
||||
* File: rtwtypes.h
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.111
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Thu Nov 7 22:32:36 2024
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTWTYPES_H
|
||||
#define RTWTYPES_H
|
||||
|
||||
/* Logical type definitions */
|
||||
#if (!defined(__cplusplus))
|
||||
#ifndef false
|
||||
#define false (0U)
|
||||
#endif
|
||||
|
||||
#ifndef true
|
||||
#define true (1U)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*=======================================================================*
|
||||
* Target hardware information
|
||||
* Device type: Intel->x86-64 (Windows64)
|
||||
* Number of bits: char: 8 short: 16 int: 32
|
||||
* long: 32
|
||||
* native word size: 64
|
||||
* Byte ordering: LittleEndian
|
||||
* Signed integer division rounds to: Zero
|
||||
* Shift right on a signed integer as arithmetic shift: on
|
||||
*=======================================================================*/
|
||||
|
||||
/*=======================================================================*
|
||||
* Fixed width word size data types: *
|
||||
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
|
||||
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
|
||||
* real32_T, real64_T - 32 and 64 bit floating point numbers *
|
||||
*=======================================================================*/
|
||||
typedef signed char int8_T;
|
||||
typedef unsigned char uint8_T;
|
||||
typedef short int16_T;
|
||||
typedef unsigned short uint16_T;
|
||||
typedef int int32_T;
|
||||
typedef unsigned int uint32_T;
|
||||
typedef float real32_T;
|
||||
typedef double real64_T;
|
||||
|
||||
/*===========================================================================*
|
||||
* Generic type definitions: boolean_T, char_T, byte_T, int_T, uint_T, *
|
||||
* real_T, time_T, ulong_T. *
|
||||
*===========================================================================*/
|
||||
typedef double real_T;
|
||||
typedef double time_T;
|
||||
typedef unsigned char boolean_T;
|
||||
typedef int int_T;
|
||||
typedef unsigned int uint_T;
|
||||
typedef unsigned long ulong_T;
|
||||
typedef char char_T;
|
||||
typedef unsigned char uchar_T;
|
||||
typedef char_T byte_T;
|
||||
|
||||
/*===========================================================================*
|
||||
* Complex number type definitions *
|
||||
*===========================================================================*/
|
||||
#define CREAL_T
|
||||
|
||||
typedef struct {
|
||||
real32_T re;
|
||||
real32_T im;
|
||||
} creal32_T;
|
||||
|
||||
typedef struct {
|
||||
real64_T re;
|
||||
real64_T im;
|
||||
} creal64_T;
|
||||
|
||||
typedef struct {
|
||||
real_T re;
|
||||
real_T im;
|
||||
} creal_T;
|
||||
|
||||
#define CINT8_T
|
||||
|
||||
typedef struct {
|
||||
int8_T re;
|
||||
int8_T im;
|
||||
} cint8_T;
|
||||
|
||||
#define CUINT8_T
|
||||
|
||||
typedef struct {
|
||||
uint8_T re;
|
||||
uint8_T im;
|
||||
} cuint8_T;
|
||||
|
||||
#define CINT16_T
|
||||
|
||||
typedef struct {
|
||||
int16_T re;
|
||||
int16_T im;
|
||||
} cint16_T;
|
||||
|
||||
#define CUINT16_T
|
||||
|
||||
typedef struct {
|
||||
uint16_T re;
|
||||
uint16_T im;
|
||||
} cuint16_T;
|
||||
|
||||
#define CINT32_T
|
||||
|
||||
typedef struct {
|
||||
int32_T re;
|
||||
int32_T im;
|
||||
} cint32_T;
|
||||
|
||||
#define CUINT32_T
|
||||
|
||||
typedef struct {
|
||||
uint32_T re;
|
||||
uint32_T im;
|
||||
} cuint32_T;
|
||||
|
||||
/*=======================================================================*
|
||||
* Min and Max: *
|
||||
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
|
||||
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
|
||||
*=======================================================================*/
|
||||
#define MAX_int8_T ((int8_T)(127))
|
||||
#define MIN_int8_T ((int8_T)(-128))
|
||||
#define MAX_uint8_T ((uint8_T)(255U))
|
||||
#define MAX_int16_T ((int16_T)(32767))
|
||||
#define MIN_int16_T ((int16_T)(-32768))
|
||||
#define MAX_uint16_T ((uint16_T)(65535U))
|
||||
#define MAX_int32_T ((int32_T)(2147483647))
|
||||
#define MIN_int32_T ((int32_T)(-2147483647-1))
|
||||
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU))
|
||||
|
||||
/* Block D-Work pointer type */
|
||||
typedef void * pointer_T;
|
||||
|
||||
#endif /* RTWTYPES_H */
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
set "MINGW_ROOT=C:\PROGRA~3\MATLAB\SUPPOR~1\R2023b\3P778C~1.INS\MINGW_~1.INS\bin"
|
||||
@set "PATH=%PATH%;%MINGW_ROOT%"
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
call "setup_mingw.bat"
|
||||
|
||||
cd .
|
||||
|
||||
if "%1"=="" ("%MINGW_ROOT%\mingw32-make.exe" -f socTouchDisplay.mk all) else ("%MINGW_ROOT%\mingw32-make.exe" -f socTouchDisplay.mk %1)
|
||||
@if errorlevel 1 goto error_exit
|
||||
|
||||
exit /B 0
|
||||
|
||||
:error_exit
|
||||
echo The make command returned an error of %errorlevel%
|
||||
exit /B 1
|
||||
|
|
@ -0,0 +1,326 @@
|
|||
/*
|
||||
* File: socTouchDisplay.c
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.111
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Thu Nov 7 22:32:36 2024
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#include "socTouchDisplay.h"
|
||||
#include "rtwtypes.h"
|
||||
#include <math.h>
|
||||
#include "socTouchDisplay_private.h"
|
||||
|
||||
/* Named constants for Chart: '<Root>/Chart' */
|
||||
#define socTouchDi_IN_waitTillNextTouch ((uint8_T)4U)
|
||||
#define socTouchDis_IN_touchNotDetected ((uint8_T)3U)
|
||||
#define socTouchDisplay_IN_displayError ((uint8_T)1U)
|
||||
#define socTouchDisplay_IN_displaySoc ((uint8_T)2U)
|
||||
|
||||
/* Named constants for Chart: '<Root>/Chart1' */
|
||||
#define socTouchDisplay_IN_bmsPresent ((uint8_T)1U)
|
||||
#define socTouchDisplay_IN_init ((uint8_T)2U)
|
||||
|
||||
/* Block signals (default storage) */
|
||||
B_socTouchDisplay_T socTouchDisplay_B;
|
||||
|
||||
/* Block states (default storage) */
|
||||
DW_socTouchDisplay_T socTouchDisplay_DW;
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
ExtU_socTouchDisplay_T socTouchDisplay_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
ExtY_socTouchDisplay_T socTouchDisplay_Y;
|
||||
|
||||
/* Real-time model */
|
||||
static RT_MODEL_socTouchDisplay_T socTouchDisplay_M_;
|
||||
RT_MODEL_socTouchDisplay_T *const socTouchDisplay_M = &socTouchDisplay_M_;
|
||||
|
||||
/* Model step function */
|
||||
void socTouchDisplay_step(void)
|
||||
{
|
||||
int32_T i;
|
||||
int32_T s3_iter;
|
||||
uint32_T tmp;
|
||||
uint8_T rtb_Cast;
|
||||
boolean_T Memory_PreviousInput;
|
||||
boolean_T rtb_Equal;
|
||||
boolean_T rtb_Memory;
|
||||
|
||||
/* Outputs for Iterator SubSystem: '<Root>/canMsgDecode' incorporates:
|
||||
* ForIterator: '<S3>/For Iterator'
|
||||
*/
|
||||
/* InitializeConditions for Memory: '<S3>/Memory' */
|
||||
Memory_PreviousInput = false;
|
||||
for (s3_iter = 0; s3_iter < 10; s3_iter++) {
|
||||
/* Selector: '<S3>/Selector' incorporates:
|
||||
* Inport: '<Root>/Input'
|
||||
*/
|
||||
socTouchDisplay_B.Selector = socTouchDisplay_U.Input[s3_iter];
|
||||
|
||||
/* S-Function (canReceive): '<S3>/S-Function' */
|
||||
canReceive_Outputs_wrapper(&socTouchDisplay_B.Selector.ID,
|
||||
&socTouchDisplay_B.Selector.Length, &socTouchDisplay_B.Selector.Data[0],
|
||||
&socTouchDisplay_B.SFunction);
|
||||
|
||||
/* RelationalOperator: '<S3>/Equal' incorporates:
|
||||
* Inport: '<Root>/ip_u32canId'
|
||||
*/
|
||||
rtb_Equal = (socTouchDisplay_B.SFunction.ID == socTouchDisplay_U.ip_u32canId);
|
||||
|
||||
/* Outputs for Enabled SubSystem: '<S3>/Enabled Subsystem' incorporates:
|
||||
* EnablePort: '<S5>/Enable'
|
||||
*/
|
||||
/* Logic: '<S3>/AND' incorporates:
|
||||
* Constant: '<S3>/Constant'
|
||||
* RelationalOperator: '<S3>/Equal1'
|
||||
*/
|
||||
if ((socTouchDisplay_B.SFunction.Data[0] == 2) && rtb_Equal) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
/* SignalConversion generated from: '<S5>/In1' */
|
||||
socTouchDisplay_B.In1[i] = socTouchDisplay_B.SFunction.Data[i];
|
||||
}
|
||||
}
|
||||
|
||||
/* End of Logic: '<S3>/AND' */
|
||||
/* End of Outputs for SubSystem: '<S3>/Enabled Subsystem' */
|
||||
|
||||
/* DataTypeConversion: '<S3>/Cast' */
|
||||
rtb_Cast = socTouchDisplay_B.In1[2];
|
||||
|
||||
/* Memory: '<S3>/Memory' */
|
||||
rtb_Memory = Memory_PreviousInput;
|
||||
|
||||
/* Update for Memory: '<S3>/Memory' incorporates:
|
||||
* Logic: '<S3>/OR'
|
||||
*/
|
||||
Memory_PreviousInput = (rtb_Equal || Memory_PreviousInput);
|
||||
}
|
||||
|
||||
/* End of Outputs for SubSystem: '<Root>/canMsgDecode' */
|
||||
|
||||
/* Chart: '<Root>/Chart1' */
|
||||
if (socTouchDisplay_DW.is_active_c1_socTouchDisplay == 0U) {
|
||||
socTouchDisplay_DW.is_active_c1_socTouchDisplay = 1U;
|
||||
socTouchDisplay_DW.is_c1_socTouchDisplay = socTouchDisplay_IN_init;
|
||||
Memory_PreviousInput = false;
|
||||
} else if (socTouchDisplay_DW.is_c1_socTouchDisplay ==
|
||||
socTouchDisplay_IN_bmsPresent) {
|
||||
Memory_PreviousInput = true;
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1 = 0U;
|
||||
}
|
||||
|
||||
if (socTouchDisplay_DW.durationCounter_1 > 150U) {
|
||||
socTouchDisplay_DW.is_c1_socTouchDisplay = socTouchDisplay_IN_init;
|
||||
Memory_PreviousInput = false;
|
||||
}
|
||||
} else {
|
||||
/* case IN_init: */
|
||||
Memory_PreviousInput = false;
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1 = 0U;
|
||||
socTouchDisplay_DW.is_c1_socTouchDisplay = socTouchDisplay_IN_bmsPresent;
|
||||
Memory_PreviousInput = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1++;
|
||||
} else {
|
||||
socTouchDisplay_DW.durationCounter_1 = 0U;
|
||||
}
|
||||
|
||||
/* End of Chart: '<Root>/Chart1' */
|
||||
|
||||
/* Chart: '<Root>/Chart' incorporates:
|
||||
* Inport: '<Root>/in_bTouchDetected'
|
||||
* Inport: '<Root>/ip_u32DisplayDuration_msec'
|
||||
* Inport: '<Root>/ip_u32TouchDuration_msec'
|
||||
*/
|
||||
if (socTouchDisplay_DW.temporalCounter_i1 < MAX_uint32_T) {
|
||||
socTouchDisplay_DW.temporalCounter_i1++;
|
||||
}
|
||||
|
||||
if (socTouchDisplay_DW.is_active_c3_socTouchDisplay == 0U) {
|
||||
socTouchDisplay_DW.is_active_c3_socTouchDisplay = 1U;
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
socTouchDisplay_DW.durationCounter_1_g = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay = socTouchDis_IN_touchNotDetected;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
} else {
|
||||
switch (socTouchDisplay_DW.is_c3_socTouchDisplay) {
|
||||
case socTouchDisplay_IN_displayError:
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = true;
|
||||
if ((uint32_T)((int32_T)socTouchDisplay_DW.temporalCounter_i1 * 100) >=
|
||||
(uint32_T)ceil(socTouchDisplay_U.ip_u32DisplayDuration_msec)) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDi_IN_waitTillNextTouch;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case socTouchDisplay_IN_displaySoc:
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = true;
|
||||
if ((uint32_T)((int32_T)socTouchDisplay_DW.temporalCounter_i1 * 100) >=
|
||||
(uint32_T)ceil(socTouchDisplay_U.ip_u32DisplayDuration_msec)) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDi_IN_waitTillNextTouch;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case socTouchDis_IN_touchNotDetected:
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
rtb_Memory = !(socTouchDisplay_U.in_bTouchDetected == 1.0);
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
}
|
||||
|
||||
tmp = (uint32_T)ceil(socTouchDisplay_U.ip_u32TouchDuration_msec);
|
||||
if (((uint32_T)((int32_T)socTouchDisplay_DW.durationCounter_2 * 100) > tmp)
|
||||
&& Memory_PreviousInput) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay = socTouchDisplay_IN_displaySoc;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = true;
|
||||
} else {
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1_g = 0U;
|
||||
}
|
||||
|
||||
if (((uint32_T)((int32_T)socTouchDisplay_DW.durationCounter_1_g * 100) >
|
||||
tmp) && (!Memory_PreviousInput)) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDisplay_IN_displayError;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
/* case IN_waitTillNextTouch: */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
if (socTouchDisplay_DW.temporalCounter_i1 >= 100U) {
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
socTouchDisplay_DW.durationCounter_1_g = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDis_IN_touchNotDetected;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (socTouchDisplay_U.in_bTouchDetected == 1.0) {
|
||||
socTouchDisplay_DW.durationCounter_1_g++;
|
||||
socTouchDisplay_DW.durationCounter_2++;
|
||||
} else {
|
||||
socTouchDisplay_DW.durationCounter_1_g = 0U;
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
}
|
||||
|
||||
/* End of Chart: '<Root>/Chart' */
|
||||
|
||||
/* Outputs for Atomic SubSystem: '<Root>/displayData' */
|
||||
/* Switch: '<S4>/Switch1' incorporates:
|
||||
* Outport: '<Root>/op_bErrorStatus'
|
||||
* Switch: '<S4>/Switch'
|
||||
* Switch: '<S4>/Switch2'
|
||||
*/
|
||||
if (socTouchDisplay_Y.op_bErrorStatus) {
|
||||
/* Outport: '<Root>/op_u8TensPlace' incorporates:
|
||||
* Constant: '<S4>/Constant3'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8TensPlace = 114U;
|
||||
|
||||
/* Outport: '<Root>/op_u8OnesPlace' incorporates:
|
||||
* Constant: '<S4>/Constant4'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8OnesPlace = 114U;
|
||||
|
||||
/* Outport: '<Root>/op_u8HundredsPlace' incorporates:
|
||||
* Constant: '<S4>/Constant2'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8HundredsPlace = 69U;
|
||||
} else {
|
||||
/* Outport: '<Root>/op_u8TensPlace' incorporates:
|
||||
* Constant: '<S4>/Constant'
|
||||
* Math: '<S4>/Mod1'
|
||||
* Product: '<S4>/Divide'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8TensPlace = (uint8_T)((int32_T)(rtb_Cast / 10U) % 10);
|
||||
|
||||
/* Outport: '<Root>/op_u8OnesPlace' incorporates:
|
||||
* Math: '<S4>/Mod2'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8OnesPlace = (uint8_T)(rtb_Cast % 10);
|
||||
|
||||
/* Outport: '<Root>/op_u8HundredsPlace' incorporates:
|
||||
* Constant: '<S4>/Constant1'
|
||||
* Math: '<S4>/Mod'
|
||||
* Product: '<S4>/Divide1'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8HundredsPlace = (uint8_T)((int32_T)(rtb_Cast / 100U) %
|
||||
10);
|
||||
}
|
||||
|
||||
/* End of Switch: '<S4>/Switch1' */
|
||||
/* End of Outputs for SubSystem: '<Root>/displayData' */
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void socTouchDisplay_initialize(void)
|
||||
{
|
||||
/* (no initialization code required) */
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void socTouchDisplay_terminate(void)
|
||||
{
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
* File: socTouchDisplay.h
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.111
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Thu Nov 7 22:32:36 2024
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_socTouchDisplay_h_
|
||||
#define RTW_HEADER_socTouchDisplay_h_
|
||||
#ifndef socTouchDisplay_COMMON_INCLUDES_
|
||||
#define socTouchDisplay_COMMON_INCLUDES_
|
||||
#include "rtwtypes.h"
|
||||
#endif /* socTouchDisplay_COMMON_INCLUDES_ */
|
||||
|
||||
#include "socTouchDisplay_types.h"
|
||||
#include "ivec_rte_dummy.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef rtmGetErrorStatus
|
||||
#define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetErrorStatus
|
||||
#define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
/* Block signals (default storage) */
|
||||
typedef struct {
|
||||
CAN_MESSAGE_BUS Selector; /* '<S3>/Selector' */
|
||||
CAN_MESSAGE_BUS SFunction; /* '<S3>/S-Function' */
|
||||
uint8_T In1[8]; /* '<S5>/In1' */
|
||||
} B_socTouchDisplay_T;
|
||||
|
||||
/* Block states (default storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
void* SFunction_canFrameBUS; /* '<S3>/S-Function' */
|
||||
uint32_T durationCounter_1; /* '<Root>/Chart1' */
|
||||
uint32_T temporalCounter_i1; /* '<Root>/Chart' */
|
||||
uint32_T durationCounter_1_g; /* '<Root>/Chart' */
|
||||
uint32_T durationCounter_2; /* '<Root>/Chart' */
|
||||
uint8_T is_active_c1_socTouchDisplay;/* '<Root>/Chart1' */
|
||||
uint8_T is_c1_socTouchDisplay; /* '<Root>/Chart1' */
|
||||
uint8_T is_active_c3_socTouchDisplay;/* '<Root>/Chart' */
|
||||
uint8_T is_c3_socTouchDisplay; /* '<Root>/Chart' */
|
||||
} DW_socTouchDisplay_T;
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
typedef struct {
|
||||
real_T in_bTouchDetected; /* '<Root>/in_bTouchDetected' */
|
||||
real_T ip_u32TouchDuration_msec; /* '<Root>/ip_u32TouchDuration_msec' */
|
||||
real_T ip_u32DisplayDuration_msec; /* '<Root>/ip_u32DisplayDuration_msec' */
|
||||
CAN_MESSAGE_BUS Input[MAX_CAN_MESSAGE_INSTANCE];/* '<Root>/Input' */
|
||||
uint32_T ip_u32canId; /* '<Root>/ip_u32canId' */
|
||||
} ExtU_socTouchDisplay_T;
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
typedef struct {
|
||||
boolean_T op_bDisplayStatus; /* '<Root>/op_bDisplayStatus' */
|
||||
boolean_T op_bErrorStatus; /* '<Root>/op_bErrorStatus' */
|
||||
uint8_T op_u8HundredsPlace; /* '<Root>/op_u8HundredsPlace' */
|
||||
uint8_T op_u8TensPlace; /* '<Root>/op_u8TensPlace' */
|
||||
uint8_T op_u8OnesPlace; /* '<Root>/op_u8OnesPlace' */
|
||||
} ExtY_socTouchDisplay_T;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct tag_RTM_socTouchDisplay_T {
|
||||
const char_T * volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block signals (default storage) */
|
||||
extern B_socTouchDisplay_T socTouchDisplay_B;
|
||||
|
||||
/* Block states (default storage) */
|
||||
extern DW_socTouchDisplay_T socTouchDisplay_DW;
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
extern ExtU_socTouchDisplay_T socTouchDisplay_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
extern ExtY_socTouchDisplay_T socTouchDisplay_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
extern void socTouchDisplay_initialize(void);
|
||||
extern void socTouchDisplay_step(void);
|
||||
extern void socTouchDisplay_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern RT_MODEL_socTouchDisplay_T *const socTouchDisplay_M;
|
||||
|
||||
/*-
|
||||
* These blocks were eliminated from the model due to optimizations:
|
||||
*
|
||||
* Block '<S4>/Cast' : Eliminate redundant data type conversion
|
||||
* Block '<S4>/Cast1' : Eliminate redundant data type conversion
|
||||
* Block '<S4>/Cast2' : Eliminate redundant data type conversion
|
||||
*/
|
||||
|
||||
/*-
|
||||
* The generated code includes comments that allow you to trace directly
|
||||
* back to the appropriate location in the model. The basic format
|
||||
* is <system>/block_name, where system is the system number (uniquely
|
||||
* assigned by Simulink) and block_name is the name of the block.
|
||||
*
|
||||
* Use the MATLAB hilite_system command to trace the generated code back
|
||||
* to the model. For example,
|
||||
*
|
||||
* hilite_system('<S3>') - opens system 3
|
||||
* hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
*
|
||||
* Here is the system hierarchy for this model
|
||||
*
|
||||
* '<Root>' : 'socTouchDisplay'
|
||||
* '<S1>' : 'socTouchDisplay/Chart'
|
||||
* '<S2>' : 'socTouchDisplay/Chart1'
|
||||
* '<S3>' : 'socTouchDisplay/canMsgDecode'
|
||||
* '<S4>' : 'socTouchDisplay/displayData'
|
||||
* '<S5>' : 'socTouchDisplay/canMsgDecode/Enabled Subsystem'
|
||||
*/
|
||||
#endif /* RTW_HEADER_socTouchDisplay_h_ */
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,567 @@
|
|||
###########################################################################
|
||||
## Makefile generated for component 'socTouchDisplay'.
|
||||
##
|
||||
## Makefile : socTouchDisplay.mk
|
||||
## Generated on : Thu Nov 07 22:32:48 2024
|
||||
## Final product: $(RELATIVE_PATH_TO_ANCHOR)/socTouchDisplay.exe
|
||||
## Product type : executable
|
||||
##
|
||||
###########################################################################
|
||||
|
||||
###########################################################################
|
||||
## MACROS
|
||||
###########################################################################
|
||||
|
||||
# Macro Descriptions:
|
||||
# PRODUCT_NAME Name of the system to build
|
||||
# MAKEFILE Name of this makefile
|
||||
# COMPILER_COMMAND_FILE Compiler command listing model reference header paths
|
||||
# CMD_FILE Command file
|
||||
|
||||
PRODUCT_NAME = socTouchDisplay
|
||||
MAKEFILE = socTouchDisplay.mk
|
||||
MATLAB_ROOT = C:/PROGRA~1/MATLAB/R2023b
|
||||
MATLAB_BIN = C:/PROGRA~1/MATLAB/R2023b/bin
|
||||
MATLAB_ARCH_BIN = $(MATLAB_BIN)/win64
|
||||
START_DIR = D:/AAR/cantouart_ti/bs_touchAndLcd
|
||||
SOLVER =
|
||||
SOLVER_OBJ =
|
||||
CLASSIC_INTERFACE = 0
|
||||
TGT_FCN_LIB = ISO_C
|
||||
MODEL_HAS_DYNAMICALLY_LOADED_SFCNS = 0
|
||||
RELATIVE_PATH_TO_ANCHOR = ..
|
||||
COMPILER_COMMAND_FILE = socTouchDisplay_comp.rsp
|
||||
CMD_FILE = socTouchDisplay.rsp
|
||||
C_STANDARD_OPTS = -fwrapv
|
||||
CPP_STANDARD_OPTS = -fwrapv
|
||||
|
||||
###########################################################################
|
||||
## TOOLCHAIN SPECIFICATIONS
|
||||
###########################################################################
|
||||
|
||||
# Toolchain Name: MinGW64 | gmake (64-bit Windows)
|
||||
# Supported Version(s): 8.x
|
||||
# ToolchainInfo Version: 2023b
|
||||
# Specification Revision: 1.0
|
||||
#
|
||||
#-------------------------------------------
|
||||
# Macros assumed to be defined elsewhere
|
||||
#-------------------------------------------
|
||||
|
||||
# C_STANDARD_OPTS
|
||||
# CPP_STANDARD_OPTS
|
||||
# MINGW_ROOT
|
||||
# MINGW_C_STANDARD_OPTS
|
||||
|
||||
#-----------
|
||||
# MACROS
|
||||
#-----------
|
||||
|
||||
WARN_FLAGS = -Wall -W -Wwrite-strings -Winline -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Wcast-align
|
||||
WARN_FLAGS_MAX = $(WARN_FLAGS) -Wcast-qual -Wshadow
|
||||
CPP_WARN_FLAGS = -Wall -W -Wwrite-strings -Winline -Wpointer-arith -Wcast-align
|
||||
CPP_WARN_FLAGS_MAX = $(CPP_WARN_FLAGS) -Wcast-qual -Wshadow
|
||||
MW_EXTERNLIB_DIR = $(MATLAB_ROOT)/extern/lib/win64/mingw64
|
||||
SHELL = %SystemRoot%/system32/cmd.exe
|
||||
|
||||
TOOLCHAIN_SRCS =
|
||||
TOOLCHAIN_INCS =
|
||||
TOOLCHAIN_LIBS = -lws2_32
|
||||
|
||||
#------------------------
|
||||
# BUILD TOOL COMMANDS
|
||||
#------------------------
|
||||
|
||||
# C Compiler: GNU C Compiler
|
||||
CC_PATH = $(MINGW_ROOT)
|
||||
CC = "$(CC_PATH)/gcc"
|
||||
|
||||
# Linker: GNU Linker
|
||||
LD_PATH = $(MINGW_ROOT)
|
||||
LD = "$(LD_PATH)/g++"
|
||||
|
||||
# C++ Compiler: GNU C++ Compiler
|
||||
CPP_PATH = $(MINGW_ROOT)
|
||||
CPP = "$(CPP_PATH)/g++"
|
||||
|
||||
# C++ Linker: GNU C++ Linker
|
||||
CPP_LD_PATH = $(MINGW_ROOT)
|
||||
CPP_LD = "$(CPP_LD_PATH)/g++"
|
||||
|
||||
# Archiver: GNU Archiver
|
||||
AR_PATH = $(MINGW_ROOT)
|
||||
AR = "$(AR_PATH)/ar"
|
||||
|
||||
# MEX Tool: MEX Tool
|
||||
MEX_PATH = $(MATLAB_ARCH_BIN)
|
||||
MEX = "$(MEX_PATH)/mex"
|
||||
|
||||
# Download: Download
|
||||
DOWNLOAD =
|
||||
|
||||
# Execute: Execute
|
||||
EXECUTE = $(PRODUCT)
|
||||
|
||||
# Builder: GMAKE Utility
|
||||
MAKE_PATH = $(MINGW_ROOT)
|
||||
MAKE = "$(MAKE_PATH)/mingw32-make.exe"
|
||||
|
||||
|
||||
#-------------------------
|
||||
# Directives/Utilities
|
||||
#-------------------------
|
||||
|
||||
CDEBUG = -g
|
||||
C_OUTPUT_FLAG = -o
|
||||
LDDEBUG = -g
|
||||
OUTPUT_FLAG = -o
|
||||
CPPDEBUG = -g
|
||||
CPP_OUTPUT_FLAG = -o
|
||||
CPPLDDEBUG = -g
|
||||
OUTPUT_FLAG = -o
|
||||
ARDEBUG =
|
||||
STATICLIB_OUTPUT_FLAG =
|
||||
MEX_DEBUG = -g
|
||||
RM = @del
|
||||
ECHO = @echo
|
||||
MV = @move
|
||||
RUN =
|
||||
|
||||
#----------------------------------------
|
||||
# "Faster Builds" Build Configuration
|
||||
#----------------------------------------
|
||||
|
||||
ARFLAGS = ruvs
|
||||
CFLAGS = -c $(MINGW_C_STANDARD_OPTS) -m64 \
|
||||
-O0
|
||||
CPPFLAGS = -c $(CPP_STANDARD_OPTS) -m64 \
|
||||
-O0
|
||||
CPP_LDFLAGS = -static -m64
|
||||
CPP_SHAREDLIB_LDFLAGS = -shared -Wl,--no-undefined \
|
||||
-Wl,--out-implib,$(notdir $(basename $(PRODUCT))).lib
|
||||
DOWNLOAD_FLAGS =
|
||||
EXECUTE_FLAGS =
|
||||
LDFLAGS = -static -m64
|
||||
MEX_CPPFLAGS =
|
||||
MEX_CPPLDFLAGS =
|
||||
MEX_CFLAGS =
|
||||
MEX_LDFLAGS =
|
||||
MAKE_FLAGS = -f $(MAKEFILE)
|
||||
SHAREDLIB_LDFLAGS = -shared -Wl,--no-undefined \
|
||||
-Wl,--out-implib,$(notdir $(basename $(PRODUCT))).lib
|
||||
|
||||
|
||||
|
||||
###########################################################################
|
||||
## OUTPUT INFO
|
||||
###########################################################################
|
||||
|
||||
PRODUCT = $(RELATIVE_PATH_TO_ANCHOR)/socTouchDisplay.exe
|
||||
PRODUCT_TYPE = "executable"
|
||||
BUILD_TYPE = "Top-Level Standalone Executable"
|
||||
|
||||
###########################################################################
|
||||
## INCLUDE PATHS
|
||||
###########################################################################
|
||||
|
||||
INCLUDES_BUILDINFO =
|
||||
|
||||
INCLUDES = $(INCLUDES_BUILDINFO)
|
||||
|
||||
###########################################################################
|
||||
## DEFINES
|
||||
###########################################################################
|
||||
|
||||
DEFINES_BUILD_ARGS = -DCLASSIC_INTERFACE=0 -DALLOCATIONFCN=0 -DTERMFCN=1 -DONESTEPFCN=1 -DMAT_FILE=0 -DMULTI_INSTANCE_CODE=0 -DINTEGER_CODE=0 -DMT=0
|
||||
DEFINES_CUSTOM =
|
||||
DEFINES_OPTS = -DTID01EQ=0
|
||||
DEFINES_STANDARD = -DMODEL=socTouchDisplay -DNUMST=1 -DNCSTATES=0 -DHAVESTDIO -DMODEL_HAS_DYNAMICALLY_LOADED_SFCNS=0
|
||||
|
||||
DEFINES = $(DEFINES_BUILD_ARGS) $(DEFINES_CUSTOM) $(DEFINES_OPTS) $(DEFINES_STANDARD)
|
||||
|
||||
###########################################################################
|
||||
## SOURCE FILES
|
||||
###########################################################################
|
||||
|
||||
SRCS = $(START_DIR)/socTouchDisplay_ert_rtw/socTouchDisplay.c
|
||||
|
||||
MAIN_SRC = $(START_DIR)/socTouchDisplay_ert_rtw/ert_main.c
|
||||
|
||||
ALL_SRCS = $(SRCS) $(MAIN_SRC)
|
||||
|
||||
###########################################################################
|
||||
## OBJECTS
|
||||
###########################################################################
|
||||
|
||||
OBJS = socTouchDisplay.obj
|
||||
|
||||
MAIN_OBJ = ert_main.obj
|
||||
|
||||
ALL_OBJS = $(OBJS) $(MAIN_OBJ)
|
||||
|
||||
###########################################################################
|
||||
## PREBUILT OBJECT FILES
|
||||
###########################################################################
|
||||
|
||||
PREBUILT_OBJS =
|
||||
|
||||
###########################################################################
|
||||
## LIBRARIES
|
||||
###########################################################################
|
||||
|
||||
LIBS =
|
||||
|
||||
###########################################################################
|
||||
## SYSTEM LIBRARIES
|
||||
###########################################################################
|
||||
|
||||
SYSTEM_LIBS =
|
||||
|
||||
###########################################################################
|
||||
## ADDITIONAL TOOLCHAIN FLAGS
|
||||
###########################################################################
|
||||
|
||||
#---------------
|
||||
# C Compiler
|
||||
#---------------
|
||||
|
||||
CFLAGS_TFL = -msse2
|
||||
CFLAGS_BASIC = $(DEFINES) $(INCLUDES) @$(COMPILER_COMMAND_FILE)
|
||||
|
||||
CFLAGS += $(CFLAGS_TFL) $(CFLAGS_BASIC)
|
||||
|
||||
#-----------------
|
||||
# C++ Compiler
|
||||
#-----------------
|
||||
|
||||
CPPFLAGS_TFL = -msse2
|
||||
CPPFLAGS_BASIC = $(DEFINES) $(INCLUDES) @$(COMPILER_COMMAND_FILE)
|
||||
|
||||
CPPFLAGS += $(CPPFLAGS_TFL) $(CPPFLAGS_BASIC)
|
||||
|
||||
#---------------------
|
||||
# MEX C++ Compiler
|
||||
#---------------------
|
||||
|
||||
MEX_CPP_Compiler_BASIC = @$(COMPILER_COMMAND_FILE)
|
||||
|
||||
MEX_CPPFLAGS += $(MEX_CPP_Compiler_BASIC)
|
||||
|
||||
#-----------------
|
||||
# MEX Compiler
|
||||
#-----------------
|
||||
|
||||
MEX_Compiler_BASIC = @$(COMPILER_COMMAND_FILE)
|
||||
|
||||
MEX_CFLAGS += $(MEX_Compiler_BASIC)
|
||||
|
||||
###########################################################################
|
||||
## INLINED COMMANDS
|
||||
###########################################################################
|
||||
|
||||
|
||||
MINGW_C_STANDARD_OPTS = $(C_STANDARD_OPTS)
|
||||
|
||||
|
||||
###########################################################################
|
||||
## PHONY TARGETS
|
||||
###########################################################################
|
||||
|
||||
.PHONY : all build buildobj clean info prebuild download execute
|
||||
|
||||
|
||||
all : build
|
||||
@echo "### Successfully generated all binary outputs."
|
||||
|
||||
|
||||
build : prebuild $(PRODUCT)
|
||||
|
||||
|
||||
buildobj : prebuild $(OBJS) $(PREBUILT_OBJS)
|
||||
@echo "### Successfully generated all binary outputs."
|
||||
|
||||
|
||||
prebuild :
|
||||
|
||||
|
||||
download : $(PRODUCT)
|
||||
|
||||
|
||||
execute : download
|
||||
@echo "### Invoking postbuild tool "Execute" ..."
|
||||
$(EXECUTE) $(EXECUTE_FLAGS)
|
||||
@echo "### Done invoking postbuild tool."
|
||||
|
||||
|
||||
###########################################################################
|
||||
## FINAL TARGET
|
||||
###########################################################################
|
||||
|
||||
#-------------------------------------------
|
||||
# Create a standalone executable
|
||||
#-------------------------------------------
|
||||
|
||||
$(PRODUCT) : $(OBJS) $(PREBUILT_OBJS) $(MAIN_OBJ)
|
||||
@echo "### Creating standalone executable "$(PRODUCT)" ..."
|
||||
$(LD) $(LDFLAGS) -o $(PRODUCT) @$(CMD_FILE) $(SYSTEM_LIBS) $(TOOLCHAIN_LIBS)
|
||||
@echo "### Created: $(PRODUCT)"
|
||||
|
||||
|
||||
###########################################################################
|
||||
## INTERMEDIATE TARGETS
|
||||
###########################################################################
|
||||
|
||||
#---------------------
|
||||
# SOURCE-TO-OBJECT
|
||||
#---------------------
|
||||
|
||||
%.obj : %.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : %.cpp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : %.cc
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : %.cp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : %.cxx
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : %.CPP
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : %.c++
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(RELATIVE_PATH_TO_ANCHOR)/%.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(RELATIVE_PATH_TO_ANCHOR)/%.cpp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(RELATIVE_PATH_TO_ANCHOR)/%.cc
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(RELATIVE_PATH_TO_ANCHOR)/%.cp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(RELATIVE_PATH_TO_ANCHOR)/%.cxx
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(RELATIVE_PATH_TO_ANCHOR)/%.CPP
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(RELATIVE_PATH_TO_ANCHOR)/%.c++
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/%.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/%.cpp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/%.cc
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/%.cp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/%.cxx
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/%.CPP
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/%.c++
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/socTouchDisplay_ert_rtw/%.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/socTouchDisplay_ert_rtw/%.cpp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/socTouchDisplay_ert_rtw/%.cc
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/socTouchDisplay_ert_rtw/%.cp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/socTouchDisplay_ert_rtw/%.cxx
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/socTouchDisplay_ert_rtw/%.CPP
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(START_DIR)/socTouchDisplay_ert_rtw/%.c++
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/rtw/c/src/%.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/rtw/c/src/%.cpp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/rtw/c/src/%.cc
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/rtw/c/src/%.cp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/rtw/c/src/%.cxx
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/rtw/c/src/%.CPP
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/rtw/c/src/%.c++
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/simulink/src/%.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/simulink/src/%.cpp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/simulink/src/%.cc
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/simulink/src/%.cp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/simulink/src/%.cxx
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/simulink/src/%.CPP
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/simulink/src/%.c++
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/toolbox/simulink/blocks/src/%.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/toolbox/simulink/blocks/src/%.cpp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/toolbox/simulink/blocks/src/%.cc
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/toolbox/simulink/blocks/src/%.cp
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/toolbox/simulink/blocks/src/%.cxx
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/toolbox/simulink/blocks/src/%.CPP
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
%.obj : $(MATLAB_ROOT)/toolbox/simulink/blocks/src/%.c++
|
||||
$(CPP) $(CPPFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
ert_main.obj : $(START_DIR)/socTouchDisplay_ert_rtw/ert_main.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
socTouchDisplay.obj : $(START_DIR)/socTouchDisplay_ert_rtw/socTouchDisplay.c
|
||||
$(CC) $(CFLAGS) -o "$@" "$<"
|
||||
|
||||
|
||||
###########################################################################
|
||||
## DEPENDENCIES
|
||||
###########################################################################
|
||||
|
||||
$(ALL_OBJS) : rtw_proj.tmw $(COMPILER_COMMAND_FILE) $(MAKEFILE)
|
||||
|
||||
|
||||
###########################################################################
|
||||
## MISCELLANEOUS TARGETS
|
||||
###########################################################################
|
||||
|
||||
info :
|
||||
@echo "### PRODUCT = $(PRODUCT)"
|
||||
@echo "### PRODUCT_TYPE = $(PRODUCT_TYPE)"
|
||||
@echo "### BUILD_TYPE = $(BUILD_TYPE)"
|
||||
@echo "### INCLUDES = $(INCLUDES)"
|
||||
@echo "### DEFINES = $(DEFINES)"
|
||||
@echo "### ALL_SRCS = $(ALL_SRCS)"
|
||||
@echo "### ALL_OBJS = $(ALL_OBJS)"
|
||||
@echo "### LIBS = $(LIBS)"
|
||||
@echo "### MODELREF_LIBS = $(MODELREF_LIBS)"
|
||||
@echo "### SYSTEM_LIBS = $(SYSTEM_LIBS)"
|
||||
@echo "### TOOLCHAIN_LIBS = $(TOOLCHAIN_LIBS)"
|
||||
@echo "### CFLAGS = $(CFLAGS)"
|
||||
@echo "### LDFLAGS = $(LDFLAGS)"
|
||||
@echo "### SHAREDLIB_LDFLAGS = $(SHAREDLIB_LDFLAGS)"
|
||||
@echo "### CPPFLAGS = $(CPPFLAGS)"
|
||||
@echo "### CPP_LDFLAGS = $(CPP_LDFLAGS)"
|
||||
@echo "### CPP_SHAREDLIB_LDFLAGS = $(CPP_SHAREDLIB_LDFLAGS)"
|
||||
@echo "### ARFLAGS = $(ARFLAGS)"
|
||||
@echo "### MEX_CFLAGS = $(MEX_CFLAGS)"
|
||||
@echo "### MEX_CPPFLAGS = $(MEX_CPPFLAGS)"
|
||||
@echo "### MEX_LDFLAGS = $(MEX_LDFLAGS)"
|
||||
@echo "### MEX_CPPLDFLAGS = $(MEX_CPPLDFLAGS)"
|
||||
@echo "### DOWNLOAD_FLAGS = $(DOWNLOAD_FLAGS)"
|
||||
@echo "### EXECUTE_FLAGS = $(EXECUTE_FLAGS)"
|
||||
@echo "### MAKE_FLAGS = $(MAKE_FLAGS)"
|
||||
|
||||
|
||||
clean :
|
||||
$(ECHO) "### Deleting all derived files ..."
|
||||
$(RM) $(subst /,\,$(PRODUCT))
|
||||
$(RM) $(subst /,\,$(ALL_OBJS))
|
||||
$(ECHO) "### Deleted all derived files."
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
ert_main.obj
|
||||
socTouchDisplay.obj
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
-ID:/AAR/cantouart_ti/bs_touchAndLcd
|
||||
-ID:/AAR/cantouart_ti/bs_touchAndLcd/socTouchDisplay_ert_rtw
|
||||
-IC:/Program\ Files/MATLAB/R2023b/extern/include
|
||||
-IC:/Program\ Files/MATLAB/R2023b/simulink/include
|
||||
-IC:/Program\ Files/MATLAB/R2023b/rtw/c/src
|
||||
-IC:/Program\ Files/MATLAB/R2023b/rtw/c/src/ext_mode/common
|
||||
-IC:/Program\ Files/MATLAB/R2023b/rtw/c/ert
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* File: socTouchDisplay_private.h
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.111
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Thu Nov 7 22:32:36 2024
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_socTouchDisplay_private_h_
|
||||
#define RTW_HEADER_socTouchDisplay_private_h_
|
||||
#include "rtwtypes.h"
|
||||
#include "socTouchDisplay_types.h"
|
||||
#ifdef __cplusplus
|
||||
#define SFB_EXTERN_C extern "C"
|
||||
#else
|
||||
#define SFB_EXTERN_C extern
|
||||
#endif
|
||||
|
||||
SFB_EXTERN_C void canReceive_Start_wrapper(void);
|
||||
SFB_EXTERN_C void canReceive_Outputs_wrapper(const uint32_T *id,
|
||||
const uint8_T *dlc,
|
||||
const uint8_T *data,
|
||||
CAN_MESSAGE_BUS *canFrame);
|
||||
SFB_EXTERN_C void canReceive_Terminate_wrapper(void);
|
||||
|
||||
#undef SFB_EXTERN_C
|
||||
#endif /* RTW_HEADER_socTouchDisplay_private_h_ */
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* File: socTouchDisplay_types.h
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.111
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Thu Nov 7 22:32:36 2024
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_socTouchDisplay_types_h_
|
||||
#define RTW_HEADER_socTouchDisplay_types_h_
|
||||
#include "rtwtypes.h"
|
||||
|
||||
/* Includes for objects with custom storage classes */
|
||||
#include "ivec_rte_dummy.h"
|
||||
|
||||
/*
|
||||
* Check that imported macros with storage class "ImportedDefine" are defined
|
||||
*/
|
||||
#ifndef MAX_CAN_MESSAGE_INSTANCE
|
||||
#error The value of parameter "MAX_CAN_MESSAGE_INSTANCE" is not defined
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Registered constraints for dimension variants
|
||||
*/
|
||||
/* Constraint 'MAX_CAN_MESSAGE_INSTANCE == 10' registered by:
|
||||
* '<S3>/ip_xCanMsg'
|
||||
*/
|
||||
#if MAX_CAN_MESSAGE_INSTANCE != 10
|
||||
# error "The preprocessor definition 'MAX_CAN_MESSAGE_INSTANCE' must be equal to '10'"
|
||||
#endif
|
||||
|
||||
#ifndef DEFINED_TYPEDEF_FOR_CAN_MESSAGE_BUS_
|
||||
#define DEFINED_TYPEDEF_FOR_CAN_MESSAGE_BUS_
|
||||
|
||||
typedef struct {
|
||||
uint8_T Extended;
|
||||
uint8_T Length;
|
||||
uint8_T Remote;
|
||||
uint8_T Error;
|
||||
uint32_T ID;
|
||||
real_T Timestamp;
|
||||
uint8_T Data[8];
|
||||
} CAN_MESSAGE_BUS;
|
||||
|
||||
#endif
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct tag_RTM_socTouchDisplay_T RT_MODEL_socTouchDisplay_T;
|
||||
|
||||
#endif /* RTW_HEADER_socTouchDisplay_types_h_ */
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<MF0 version="1.1" packageUris="http://schema.mathworks.com/mf0/SlCache/19700101">
|
||||
<slcache.FileAttributes type="slcache.FileAttributes" uuid="9dbe2b40-75ce-4910-952e-94ba17cbac94">
|
||||
<checksum>8bTFSfmqHVlYhNqKtSda3c/Kq/qLr9+hTAYNegrcsTT+6h7F5vQznuwmUe5uezw4aTCxAwaPBDr/BUHto5jDVQ==</checksum>
|
||||
</slcache.FileAttributes>
|
||||
</MF0>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* File: socTouchDisplay.h
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.140
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Mon Jan 20 13:31:03 2025
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_socTouchDisplay_h_
|
||||
#define RTW_HEADER_socTouchDisplay_h_
|
||||
#ifndef socTouchDisplay_COMMON_INCLUDES_
|
||||
#define socTouchDisplay_COMMON_INCLUDES_
|
||||
#include "rtwtypes.h"
|
||||
#endif /* socTouchDisplay_COMMON_INCLUDES_ */
|
||||
|
||||
#include "socTouchDisplay_types.h"
|
||||
#include "ivec_rte_dummy.h"
|
||||
|
||||
/* Macros for accessing real-time model data structure */
|
||||
#ifndef rtmGetErrorStatus
|
||||
#define rtmGetErrorStatus(rtm) ((rtm)->errorStatus)
|
||||
#endif
|
||||
|
||||
#ifndef rtmSetErrorStatus
|
||||
#define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val))
|
||||
#endif
|
||||
|
||||
/* Block signals (default storage) */
|
||||
typedef struct {
|
||||
CAN_MESSAGE_BUS Selector; /* '<S3>/Selector' */
|
||||
CAN_MESSAGE_BUS SFunction; /* '<S3>/S-Function' */
|
||||
uint8_T In1[8]; /* '<S5>/In1' */
|
||||
boolean_T Compare; /* '<S7>/Compare' */
|
||||
} B_socTouchDisplay_T;
|
||||
|
||||
/* Block states (default storage) for system '<Root>' */
|
||||
typedef struct {
|
||||
void* SFunction_canFrameBUS; /* '<S3>/S-Function' */
|
||||
uint32_T durationCounter_1; /* '<Root>/Chart1' */
|
||||
uint32_T temporalCounter_i1; /* '<Root>/Chart' */
|
||||
uint32_T durationCounter_1_l; /* '<Root>/Chart' */
|
||||
uint32_T durationCounter_2; /* '<Root>/Chart' */
|
||||
uint32_T durationCounter_1_a; /* '<Root>/Chart' */
|
||||
uint8_T is_active_c1_socTouchDisplay;/* '<Root>/Chart1' */
|
||||
uint8_T is_c1_socTouchDisplay; /* '<Root>/Chart1' */
|
||||
uint8_T is_active_c3_socTouchDisplay;/* '<Root>/Chart' */
|
||||
uint8_T is_c3_socTouchDisplay; /* '<Root>/Chart' */
|
||||
uint8_T is_chargingMode; /* '<Root>/Chart' */
|
||||
} DW_socTouchDisplay_T;
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
typedef struct {
|
||||
real_T in_bTouchDetected; /* '<Root>/in_bTouchDetected' */
|
||||
real_T ip_u32TouchDuration_msec; /* '<Root>/ip_u32TouchDuration_msec' */
|
||||
real_T ip_u32DisplayDuration_msec; /* '<Root>/ip_u32DisplayDuration_msec' */
|
||||
CAN_MESSAGE_BUS Input[MAX_CAN_MESSAGE_INSTANCE];/* '<Root>/Input' */
|
||||
uint32_T ip_u32canId; /* '<Root>/ip_u32canId' */
|
||||
} ExtU_socTouchDisplay_T;
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
typedef struct {
|
||||
boolean_T op_bDisplayStatus; /* '<Root>/op_bDisplayStatus' */
|
||||
boolean_T op_bErrorStatus; /* '<Root>/op_bErrorStatus' */
|
||||
uint8_T op_u8HundredsPlace; /* '<Root>/op_u8HundredsPlace' */
|
||||
uint8_T op_u8TensPlace; /* '<Root>/op_u8TensPlace' */
|
||||
uint8_T op_u8OnesPlace; /* '<Root>/op_u8OnesPlace' */
|
||||
} ExtY_socTouchDisplay_T;
|
||||
|
||||
/* Real-time Model Data Structure */
|
||||
struct tag_RTM_socTouchDisplay_T {
|
||||
const char_T * volatile errorStatus;
|
||||
};
|
||||
|
||||
/* Block signals (default storage) */
|
||||
extern B_socTouchDisplay_T socTouchDisplay_B;
|
||||
|
||||
/* Block states (default storage) */
|
||||
extern DW_socTouchDisplay_T socTouchDisplay_DW;
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
extern ExtU_socTouchDisplay_T socTouchDisplay_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
extern ExtY_socTouchDisplay_T socTouchDisplay_Y;
|
||||
|
||||
/* Model entry point functions */
|
||||
extern void socTouchDisplay_initialize(void);
|
||||
extern void socTouchDisplay_step(void);
|
||||
extern void socTouchDisplay_terminate(void);
|
||||
|
||||
/* Real-time Model object */
|
||||
extern RT_MODEL_socTouchDisplay_T *const socTouchDisplay_M;
|
||||
|
||||
/*-
|
||||
* These blocks were eliminated from the model due to optimizations:
|
||||
*
|
||||
* Block '<S4>/Cast' : Eliminate redundant data type conversion
|
||||
* Block '<S4>/Cast1' : Eliminate redundant data type conversion
|
||||
* Block '<S4>/Cast2' : Eliminate redundant data type conversion
|
||||
*/
|
||||
|
||||
/*-
|
||||
* The generated code includes comments that allow you to trace directly
|
||||
* back to the appropriate location in the model. The basic format
|
||||
* is <system>/block_name, where system is the system number (uniquely
|
||||
* assigned by Simulink) and block_name is the name of the block.
|
||||
*
|
||||
* Use the MATLAB hilite_system command to trace the generated code back
|
||||
* to the model. For example,
|
||||
*
|
||||
* hilite_system('<S3>') - opens system 3
|
||||
* hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
|
||||
*
|
||||
* Here is the system hierarchy for this model
|
||||
*
|
||||
* '<Root>' : 'socTouchDisplay'
|
||||
* '<S1>' : 'socTouchDisplay/Chart'
|
||||
* '<S2>' : 'socTouchDisplay/Chart1'
|
||||
* '<S3>' : 'socTouchDisplay/canMsgDecode'
|
||||
* '<S4>' : 'socTouchDisplay/displayData'
|
||||
* '<S5>' : 'socTouchDisplay/canMsgDecode/Enabled Subsystem'
|
||||
* '<S6>' : 'socTouchDisplay/canMsgDecode/Enabled Subsystem1'
|
||||
* '<S7>' : 'socTouchDisplay/canMsgDecode/Enabled Subsystem1/Compare To Constant'
|
||||
*/
|
||||
#endif /* RTW_HEADER_socTouchDisplay_h_ */
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* File: socTouchDisplay_private.h
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.133
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Sat Jan 18 20:05:13 2025
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_socTouchDisplay_private_h_
|
||||
#define RTW_HEADER_socTouchDisplay_private_h_
|
||||
#include "rtwtypes.h"
|
||||
#include "socTouchDisplay_types.h"
|
||||
#ifdef __cplusplus
|
||||
#define SFB_EXTERN_C extern "C"
|
||||
#else
|
||||
#define SFB_EXTERN_C extern
|
||||
#endif
|
||||
|
||||
SFB_EXTERN_C void canReceive_Start_wrapper(void);
|
||||
SFB_EXTERN_C void canReceive_Outputs_wrapper(const uint32_T *id,
|
||||
const uint8_T *dlc,
|
||||
const uint8_T *data,
|
||||
CAN_MESSAGE_BUS *canFrame);
|
||||
SFB_EXTERN_C void canReceive_Terminate_wrapper(void);
|
||||
|
||||
#undef SFB_EXTERN_C
|
||||
#endif /* RTW_HEADER_socTouchDisplay_private_h_ */
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* File: socTouchDisplay_types.h
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.133
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Sat Jan 18 20:05:13 2025
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#ifndef RTW_HEADER_socTouchDisplay_types_h_
|
||||
#define RTW_HEADER_socTouchDisplay_types_h_
|
||||
#include "rtwtypes.h"
|
||||
|
||||
/* Includes for objects with custom storage classes */
|
||||
#include "ivec_rte_dummy.h"
|
||||
|
||||
/*
|
||||
* Check that imported macros with storage class "ImportedDefine" are defined
|
||||
*/
|
||||
#ifndef MAX_CAN_MESSAGE_INSTANCE
|
||||
#error The value of parameter "MAX_CAN_MESSAGE_INSTANCE" is not defined
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Registered constraints for dimension variants
|
||||
*/
|
||||
/* Constraint 'MAX_CAN_MESSAGE_INSTANCE == 10' registered by:
|
||||
* '<S3>/ip_xCanMsg'
|
||||
*/
|
||||
#if MAX_CAN_MESSAGE_INSTANCE != 10
|
||||
# error "The preprocessor definition 'MAX_CAN_MESSAGE_INSTANCE' must be equal to '10'"
|
||||
#endif
|
||||
|
||||
#ifndef DEFINED_TYPEDEF_FOR_CAN_MESSAGE_BUS_
|
||||
#define DEFINED_TYPEDEF_FOR_CAN_MESSAGE_BUS_
|
||||
|
||||
typedef struct {
|
||||
uint8_T Extended;
|
||||
uint8_T Length;
|
||||
uint8_T Remote;
|
||||
uint8_T Error;
|
||||
uint32_T ID;
|
||||
real_T Timestamp;
|
||||
uint8_T Data[8];
|
||||
} CAN_MESSAGE_BUS;
|
||||
|
||||
#endif
|
||||
|
||||
/* Forward declaration for rtModel */
|
||||
typedef struct tag_RTM_socTouchDisplay_T RT_MODEL_socTouchDisplay_T;
|
||||
|
||||
#endif /* RTW_HEADER_socTouchDisplay_types_h_ */
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -0,0 +1,397 @@
|
|||
/*
|
||||
* File: socTouchDisplay.c
|
||||
*
|
||||
* Code generated for Simulink model 'socTouchDisplay'.
|
||||
*
|
||||
* Model version : 1.140
|
||||
* Simulink Coder version : 23.2 (R2023b) 01-Aug-2023
|
||||
* C/C++ source code generated on : Mon Jan 20 13:31:03 2025
|
||||
*
|
||||
* Target selection: ert.tlc
|
||||
* Embedded hardware selection: Intel->x86-64 (Windows64)
|
||||
* Code generation objectives: Unspecified
|
||||
* Validation result: Not run
|
||||
*/
|
||||
|
||||
#include "socTouchDisplay.h"
|
||||
#include "rtwtypes.h"
|
||||
#include <math.h>
|
||||
#include "socTouchDisplay_private.h"
|
||||
|
||||
/* Named constants for Chart: '<Root>/Chart' */
|
||||
#define socTouchDis_IN_touchNotDetected ((uint8_T)4U)
|
||||
#define socTouchDisp_IN_NO_ACTIVE_CHILD ((uint8_T)0U)
|
||||
#define socTouchDisplay_IN_HideSoc ((uint8_T)1U)
|
||||
#define socTouchDisplay_IN_chargingMode ((uint8_T)1U)
|
||||
#define socTouchDisplay_IN_dispalySoc ((uint8_T)2U)
|
||||
#define socTouchDisplay_IN_displayError ((uint8_T)2U)
|
||||
#define socTouchDisplay_IN_displaySoc ((uint8_T)3U)
|
||||
|
||||
/* Named constants for Chart: '<Root>/Chart1' */
|
||||
#define socTouchDisplay_IN_bmsPresent ((uint8_T)1U)
|
||||
#define socTouchDisplay_IN_init ((uint8_T)2U)
|
||||
|
||||
/* Block signals (default storage) */
|
||||
B_socTouchDisplay_T socTouchDisplay_B = {0};
|
||||
|
||||
/* Block states (default storage) */
|
||||
DW_socTouchDisplay_T socTouchDisplay_DW;
|
||||
|
||||
/* External inputs (root inport signals with default storage) */
|
||||
ExtU_socTouchDisplay_T socTouchDisplay_U;
|
||||
|
||||
/* External outputs (root outports fed by signals with default storage) */
|
||||
ExtY_socTouchDisplay_T socTouchDisplay_Y;
|
||||
|
||||
/* Real-time model */
|
||||
static RT_MODEL_socTouchDisplay_T socTouchDisplay_M_;
|
||||
RT_MODEL_socTouchDisplay_T *const socTouchDisplay_M = &socTouchDisplay_M_;
|
||||
|
||||
/* Model step function */
|
||||
void socTouchDisplay_step(void)
|
||||
{
|
||||
int32_T i;
|
||||
int32_T s3_iter;
|
||||
uint32_T tmp;
|
||||
uint8_T rtb_Cast;
|
||||
boolean_T Memory_PreviousInput;
|
||||
boolean_T rtb_AND;
|
||||
boolean_T rtb_Equal;
|
||||
boolean_T rtb_Memory;
|
||||
|
||||
/* Outputs for Iterator SubSystem: '<Root>/canMsgDecode' incorporates:
|
||||
* ForIterator: '<S3>/For Iterator'
|
||||
*/
|
||||
/* InitializeConditions for Memory: '<S3>/Memory' */
|
||||
Memory_PreviousInput = false;
|
||||
for (s3_iter = 0; s3_iter < 10; s3_iter++) {
|
||||
/* Selector: '<S3>/Selector' incorporates:
|
||||
* Inport: '<Root>/Input'
|
||||
*/
|
||||
socTouchDisplay_B.Selector = socTouchDisplay_U.Input[s3_iter];
|
||||
|
||||
/* S-Function (canReceive): '<S3>/S-Function' */
|
||||
canReceive_Outputs_wrapper(&socTouchDisplay_B.Selector.ID,
|
||||
&socTouchDisplay_B.Selector.Length, &socTouchDisplay_B.Selector.Data[0],
|
||||
&socTouchDisplay_B.SFunction);
|
||||
|
||||
/* RelationalOperator: '<S3>/Equal' incorporates:
|
||||
* Inport: '<Root>/ip_u32canId'
|
||||
*/
|
||||
rtb_Equal = (socTouchDisplay_B.SFunction.ID == socTouchDisplay_U.ip_u32canId);
|
||||
|
||||
/* Logic: '<S3>/AND' incorporates:
|
||||
* Constant: '<S3>/Constant'
|
||||
* RelationalOperator: '<S3>/Equal1'
|
||||
*/
|
||||
rtb_AND = (rtb_Equal && (socTouchDisplay_B.SFunction.Data[0] == 2));
|
||||
|
||||
/* Memory: '<S3>/Memory' */
|
||||
rtb_Memory = Memory_PreviousInput;
|
||||
|
||||
/* Outputs for Enabled SubSystem: '<S3>/Enabled Subsystem' incorporates:
|
||||
* EnablePort: '<S5>/Enable'
|
||||
*/
|
||||
if (rtb_AND) {
|
||||
for (i = 0; i < 8; i++) {
|
||||
/* SignalConversion generated from: '<S5>/In1' */
|
||||
socTouchDisplay_B.In1[i] = socTouchDisplay_B.SFunction.Data[i];
|
||||
}
|
||||
}
|
||||
|
||||
/* End of Outputs for SubSystem: '<S3>/Enabled Subsystem' */
|
||||
|
||||
/* DataTypeConversion: '<S3>/Cast' */
|
||||
rtb_Cast = socTouchDisplay_B.In1[2];
|
||||
|
||||
/* Outputs for Enabled SubSystem: '<S3>/Enabled Subsystem1' incorporates:
|
||||
* EnablePort: '<S6>/Enable'
|
||||
*/
|
||||
/* Logic: '<S3>/AND1' incorporates:
|
||||
* Constant: '<S3>/Constant1'
|
||||
* RelationalOperator: '<S3>/Equal2'
|
||||
*/
|
||||
if (rtb_Equal && (socTouchDisplay_B.SFunction.Data[0] == 1)) {
|
||||
/* RelationalOperator: '<S7>/Compare' incorporates:
|
||||
* Constant: '<S7>/Constant'
|
||||
*/
|
||||
socTouchDisplay_B.Compare = (socTouchDisplay_B.SFunction.Data[6] == 4);
|
||||
}
|
||||
|
||||
/* End of Logic: '<S3>/AND1' */
|
||||
/* End of Outputs for SubSystem: '<S3>/Enabled Subsystem1' */
|
||||
|
||||
/* Update for Memory: '<S3>/Memory' incorporates:
|
||||
* Logic: '<S3>/OR'
|
||||
*/
|
||||
Memory_PreviousInput = (rtb_AND || Memory_PreviousInput);
|
||||
}
|
||||
|
||||
/* End of Outputs for SubSystem: '<Root>/canMsgDecode' */
|
||||
|
||||
/* Chart: '<Root>/Chart1' */
|
||||
if (socTouchDisplay_DW.is_active_c1_socTouchDisplay == 0U) {
|
||||
socTouchDisplay_DW.is_active_c1_socTouchDisplay = 1U;
|
||||
socTouchDisplay_DW.is_c1_socTouchDisplay = socTouchDisplay_IN_init;
|
||||
Memory_PreviousInput = false;
|
||||
} else if (socTouchDisplay_DW.is_c1_socTouchDisplay ==
|
||||
socTouchDisplay_IN_bmsPresent) {
|
||||
Memory_PreviousInput = true;
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1 = 0U;
|
||||
}
|
||||
|
||||
if (socTouchDisplay_DW.durationCounter_1 > 150U) {
|
||||
socTouchDisplay_DW.is_c1_socTouchDisplay = socTouchDisplay_IN_init;
|
||||
Memory_PreviousInput = false;
|
||||
}
|
||||
} else {
|
||||
/* case IN_init: */
|
||||
Memory_PreviousInput = false;
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1 = 0U;
|
||||
socTouchDisplay_DW.is_c1_socTouchDisplay = socTouchDisplay_IN_bmsPresent;
|
||||
Memory_PreviousInput = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1++;
|
||||
} else {
|
||||
socTouchDisplay_DW.durationCounter_1 = 0U;
|
||||
}
|
||||
|
||||
/* End of Chart: '<Root>/Chart1' */
|
||||
|
||||
/* Chart: '<Root>/Chart' incorporates:
|
||||
* Inport: '<Root>/in_bTouchDetected'
|
||||
* Inport: '<Root>/ip_u32DisplayDuration_msec'
|
||||
* Inport: '<Root>/ip_u32TouchDuration_msec'
|
||||
*/
|
||||
if (socTouchDisplay_DW.temporalCounter_i1 < MAX_uint32_T) {
|
||||
socTouchDisplay_DW.temporalCounter_i1++;
|
||||
}
|
||||
|
||||
if (socTouchDisplay_DW.is_active_c3_socTouchDisplay == 0U) {
|
||||
socTouchDisplay_DW.is_active_c3_socTouchDisplay = 1U;
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
socTouchDisplay_DW.durationCounter_1_l = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay = socTouchDis_IN_touchNotDetected;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
} else {
|
||||
switch (socTouchDisplay_DW.is_c3_socTouchDisplay) {
|
||||
case socTouchDisplay_IN_chargingMode:
|
||||
if (socTouchDisplay_B.Compare) {
|
||||
socTouchDisplay_DW.durationCounter_1_a = 0U;
|
||||
}
|
||||
|
||||
if ((socTouchDisplay_DW.durationCounter_1_a > 20U) ||
|
||||
(!Memory_PreviousInput)) {
|
||||
socTouchDisplay_DW.is_chargingMode = socTouchDisp_IN_NO_ACTIVE_CHILD;
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
socTouchDisplay_DW.durationCounter_1_l = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDis_IN_touchNotDetected;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
} else if (socTouchDisplay_DW.is_chargingMode ==
|
||||
socTouchDisplay_IN_HideSoc) {
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
if (socTouchDisplay_DW.temporalCounter_i1 >= 20U) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_chargingMode = socTouchDisplay_IN_dispalySoc;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = true;
|
||||
}
|
||||
} else {
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
/* case IN_dispalySoc: */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = true;
|
||||
if (socTouchDisplay_DW.temporalCounter_i1 >= 20U) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_chargingMode = socTouchDisplay_IN_HideSoc;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case socTouchDisplay_IN_displayError:
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = true;
|
||||
if ((uint32_T)((int32_T)socTouchDisplay_DW.temporalCounter_i1 * 100) >=
|
||||
(uint32_T)ceil(socTouchDisplay_U.ip_u32DisplayDuration_msec)) {
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
socTouchDisplay_DW.durationCounter_1_l = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDis_IN_touchNotDetected;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case socTouchDisplay_IN_displaySoc:
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = true;
|
||||
if ((uint32_T)((int32_T)socTouchDisplay_DW.temporalCounter_i1 * 100) >=
|
||||
(uint32_T)ceil(socTouchDisplay_U.ip_u32DisplayDuration_msec)) {
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
socTouchDisplay_DW.durationCounter_1_l = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDis_IN_touchNotDetected;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
/* case IN_touchNotDetected: */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = false;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = false;
|
||||
if (socTouchDisplay_B.Compare && Memory_PreviousInput) {
|
||||
socTouchDisplay_DW.durationCounter_1_a = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDisplay_IN_chargingMode;
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_chargingMode = socTouchDisplay_IN_dispalySoc;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = true;
|
||||
} else {
|
||||
rtb_Memory = !(socTouchDisplay_U.in_bTouchDetected == 1.0);
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
}
|
||||
|
||||
tmp = (uint32_T)ceil(socTouchDisplay_U.ip_u32TouchDuration_msec);
|
||||
if (((uint32_T)((int32_T)socTouchDisplay_DW.durationCounter_2 * 100) >
|
||||
tmp) && Memory_PreviousInput) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDisplay_IN_displaySoc;
|
||||
|
||||
/* Outport: '<Root>/op_bDisplayStatus' */
|
||||
socTouchDisplay_Y.op_bDisplayStatus = true;
|
||||
} else {
|
||||
if (rtb_Memory) {
|
||||
socTouchDisplay_DW.durationCounter_1_l = 0U;
|
||||
}
|
||||
|
||||
if (((uint32_T)((int32_T)socTouchDisplay_DW.durationCounter_1_l * 100)
|
||||
> tmp) && (!Memory_PreviousInput)) {
|
||||
socTouchDisplay_DW.temporalCounter_i1 = 0U;
|
||||
socTouchDisplay_DW.is_c3_socTouchDisplay =
|
||||
socTouchDisplay_IN_displayError;
|
||||
|
||||
/* Outport: '<Root>/op_bErrorStatus' */
|
||||
socTouchDisplay_Y.op_bErrorStatus = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (socTouchDisplay_U.in_bTouchDetected == 1.0) {
|
||||
socTouchDisplay_DW.durationCounter_1_l++;
|
||||
socTouchDisplay_DW.durationCounter_2++;
|
||||
} else {
|
||||
socTouchDisplay_DW.durationCounter_1_l = 0U;
|
||||
socTouchDisplay_DW.durationCounter_2 = 0U;
|
||||
}
|
||||
|
||||
if (!socTouchDisplay_B.Compare) {
|
||||
socTouchDisplay_DW.durationCounter_1_a++;
|
||||
} else {
|
||||
socTouchDisplay_DW.durationCounter_1_a = 0U;
|
||||
}
|
||||
|
||||
/* End of Chart: '<Root>/Chart' */
|
||||
|
||||
/* Outputs for Atomic SubSystem: '<Root>/displayData' */
|
||||
/* Switch: '<S4>/Switch1' incorporates:
|
||||
* Outport: '<Root>/op_bErrorStatus'
|
||||
* Switch: '<S4>/Switch'
|
||||
* Switch: '<S4>/Switch2'
|
||||
*/
|
||||
if (socTouchDisplay_Y.op_bErrorStatus) {
|
||||
/* Outport: '<Root>/op_u8TensPlace' incorporates:
|
||||
* Constant: '<S4>/Constant3'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8TensPlace = 114U;
|
||||
|
||||
/* Outport: '<Root>/op_u8OnesPlace' incorporates:
|
||||
* Constant: '<S4>/Constant4'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8OnesPlace = 114U;
|
||||
|
||||
/* Outport: '<Root>/op_u8HundredsPlace' incorporates:
|
||||
* Constant: '<S4>/Constant2'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8HundredsPlace = 69U;
|
||||
} else {
|
||||
/* Outport: '<Root>/op_u8TensPlace' incorporates:
|
||||
* Constant: '<S4>/Constant'
|
||||
* Math: '<S4>/Mod1'
|
||||
* Product: '<S4>/Divide'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8TensPlace = (uint8_T)((int32_T)(rtb_Cast / 10U) % 10);
|
||||
|
||||
/* Outport: '<Root>/op_u8OnesPlace' incorporates:
|
||||
* Math: '<S4>/Mod2'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8OnesPlace = (uint8_T)(rtb_Cast % 10);
|
||||
|
||||
/* Outport: '<Root>/op_u8HundredsPlace' incorporates:
|
||||
* Constant: '<S4>/Constant1'
|
||||
* Math: '<S4>/Mod'
|
||||
* Product: '<S4>/Divide1'
|
||||
*/
|
||||
socTouchDisplay_Y.op_u8HundredsPlace = (uint8_T)((int32_T)(rtb_Cast / 100U) %
|
||||
10);
|
||||
}
|
||||
|
||||
/* End of Switch: '<S4>/Switch1' */
|
||||
/* End of Outputs for SubSystem: '<Root>/displayData' */
|
||||
}
|
||||
|
||||
/* Model initialize function */
|
||||
void socTouchDisplay_initialize(void)
|
||||
{
|
||||
/* (no initialization code required) */
|
||||
}
|
||||
|
||||
/* Model terminate function */
|
||||
void socTouchDisplay_terminate(void)
|
||||
{
|
||||
/* (no terminate code required) */
|
||||
}
|
||||
|
||||
/*
|
||||
* File trailer for generated code.
|
||||
*
|
||||
* [EOF]
|
||||
*/
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
#ifndef IVEC_BSW_DISPLAY_H
|
||||
#define IVEC_BSW_DISPLAY_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DISPLAY_STATUS_OK = 0,
|
||||
DISPLAY_STATUS_INVALID_PARAM,
|
||||
DISPLAY_STATUS_NOT_INITIALIZED,
|
||||
DISPLAY_STATUS_WRITE_FAIL,
|
||||
DISPLAY_STATUS_FRAME_TOO_LONG
|
||||
} IVEC_BswDisplayStatus_e;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
void *pvUart; /* ECU UART handle (any port) */
|
||||
bool bInit;
|
||||
bool bFlushBeforeWrite;
|
||||
uint8_t u8WriteCmd;
|
||||
} BswDisplayCtx_s;
|
||||
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_Init(BswDisplayCtx_s *ctx, void *uart_handle, bool flush_before_write);
|
||||
void IVEC_BswDisplay_SetHandle(BswDisplayCtx_s *ctx, void *uart_handle);
|
||||
void IVEC_BswDisplay_Deinit(BswDisplayCtx_s *ctx);
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteRaw(BswDisplayCtx_s *ctx, const uint8_t *buf, uint16_t len);
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteFrame(BswDisplayCtx_s *ctx, uint8_t cmd, uint8_t addr_hi, uint8_t addr_lo, const uint8_t *payload, uint16_t payload_len);
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteSOC(BswDisplayCtx_s *ctx, uint8_t slot, uint8_t soc);
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteSOC9(BswDisplayCtx_s *ctx, const uint8_t soc9[9]);
|
||||
|
||||
#endif /* IVEC_BSW_DISPLAY_H */
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
#include <ivec_BSW/ivec_bsw_display/inc/ivec_bsw_display.h>
|
||||
#include <ivec_ECU/ivec_ecu_uart/inc/ivec_ecu_uart.h>
|
||||
|
||||
#define BSW_DISP_MAX_FRAME 260
|
||||
|
||||
extern int32_t i32MCAL_getTicks(void);
|
||||
#define BSW_DISP_TIMEOUT_MS 2000
|
||||
|
||||
static uint32_t s_lastSeenTickPerSlot[10] = {0};
|
||||
static uint8_t s_zeroAlreadySentForSlot[10] = {0};
|
||||
static uint32_t s_displayStartTick = 0;
|
||||
static uint8_t s_startTickInitialized = 0;
|
||||
|
||||
IVEC_BswDisplayStatus_e prv_write(BswDisplayCtx_s *ctx, const uint8_t *buf, uint16_t len)
|
||||
{
|
||||
if ((ctx == NULL) || (ctx->bInit == false) || (ctx->pvUart == NULL)) return DISPLAY_STATUS_NOT_INITIALIZED;
|
||||
if ((buf == NULL) || (len == 0)) return DISPLAY_STATUS_INVALID_PARAM;
|
||||
if (ctx->bFlushBeforeWrite) vECU_UartFlush(ctx->pvUart);
|
||||
return (IVEC_ECUUartWrite(ctx->pvUart, buf, (uint32_t)len) == commonMCAL_SUCCESS) ? DISPLAY_STATUS_OK : DISPLAY_STATUS_WRITE_FAIL;
|
||||
}
|
||||
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_Init(BswDisplayCtx_s *ctx, void *uart_handle, bool flush_before_write)
|
||||
{
|
||||
if ((ctx == NULL) || (uart_handle == NULL)) return DISPLAY_STATUS_INVALID_PARAM;
|
||||
ctx->pvUart = uart_handle;
|
||||
ctx->bInit = true;
|
||||
ctx->bFlushBeforeWrite = flush_before_write;
|
||||
ctx->u8WriteCmd = 0x82;
|
||||
return DISPLAY_STATUS_OK;
|
||||
}
|
||||
|
||||
void IVEC_BswDisplay_SetHandle(BswDisplayCtx_s *ctx, void *uart_handle)
|
||||
{
|
||||
if ((ctx == NULL) || (uart_handle == NULL)) return;
|
||||
ctx->pvUart = uart_handle;
|
||||
}
|
||||
|
||||
void IVEC_BswDisplay_Deinit(BswDisplayCtx_s *ctx)
|
||||
{
|
||||
if (ctx != NULL) { ctx->pvUart = NULL; ctx->bInit = false; }
|
||||
}
|
||||
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteRaw(BswDisplayCtx_s *ctx, const uint8_t *buf, uint16_t len)
|
||||
{
|
||||
return prv_write(ctx, buf, len);
|
||||
}
|
||||
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteFrame(BswDisplayCtx_s *ctx, uint8_t cmd, uint8_t addr_hi, uint8_t addr_lo, const uint8_t *payload, uint16_t payload_len)
|
||||
{
|
||||
if (ctx == NULL) return DISPLAY_STATUS_INVALID_PARAM;
|
||||
if ((payload_len > 0) && (payload == NULL)) return DISPLAY_STATUS_INVALID_PARAM;
|
||||
|
||||
uint16_t body_len = (uint16_t)(3 + payload_len);
|
||||
uint16_t total = (uint16_t)(3 + body_len);
|
||||
if (total > BSW_DISP_MAX_FRAME) return DISPLAY_STATUS_FRAME_TOO_LONG;
|
||||
|
||||
uint8_t buf[BSW_DISP_MAX_FRAME];
|
||||
uint16_t i = 0;
|
||||
|
||||
buf[i++] = 0x5A;
|
||||
buf[i++] = 0xA5;
|
||||
buf[i++] = (uint8_t)(body_len & 0xFF);
|
||||
buf[i++] = cmd;
|
||||
buf[i++] = addr_hi;
|
||||
buf[i++] = addr_lo;
|
||||
for (uint16_t j = 0; j < payload_len; j++) buf[i++] = payload[j];
|
||||
|
||||
return prv_write(ctx, buf, i);
|
||||
}
|
||||
|
||||
|
||||
IVEC_BswDisplayStatus_e IVEC_BswDisplay_WriteSOC(BswDisplayCtx_s * ctx, uint8_t slot, uint8_t soc) {
|
||||
if ((ctx == NULL) || (ctx -> bInit == false) || (ctx -> pvUart == NULL)) return DISPLAY_STATUS_NOT_INITIALIZED;
|
||||
if ((slot < 1) || (slot > 9)) return DISPLAY_STATUS_INVALID_PARAM;
|
||||
|
||||
if (s_startTickInitialized == 0) {
|
||||
s_displayStartTick = (uint32_t) i32MCAL_getTicks();
|
||||
s_startTickInitialized = 1;
|
||||
}
|
||||
|
||||
/* 1) Write the requested slot's SOC */
|
||||
{
|
||||
uint8_t address = (uint8_t)((slot << 4) | slot);
|
||||
uint8_t payload[2];
|
||||
payload[0] = 0x00;
|
||||
payload[1] = (soc > 100) ? 100 : soc;
|
||||
|
||||
IVEC_BswDisplayStatus_e st = IVEC_BswDisplay_WriteFrame(ctx, ctx -> u8WriteCmd, address, address, payload, (uint16_t) sizeof payload);
|
||||
if (st != DISPLAY_STATUS_OK) return st;
|
||||
|
||||
s_lastSeenTickPerSlot[slot] = (uint32_t) i32MCAL_getTicks();
|
||||
s_zeroAlreadySentForSlot[slot] = 0;
|
||||
}
|
||||
|
||||
/* 2) In the same call, zero any slots that have timed out (>2s) */
|
||||
{
|
||||
uint32_t nowTick = (uint32_t) i32MCAL_getTicks();
|
||||
IVEC_BswDisplayStatus_e firstError = DISPLAY_STATUS_OK;
|
||||
|
||||
for (uint8_t slotNumber = 1; slotNumber <= 9; slotNumber++) {
|
||||
uint32_t lastSeen = s_lastSeenTickPerSlot[slotNumber];
|
||||
|
||||
if (lastSeen == 0) {
|
||||
if ((nowTick - s_displayStartTick) > BSW_DISP_TIMEOUT_MS && s_zeroAlreadySentForSlot[slotNumber] == 0) {
|
||||
uint8_t addr = (uint8_t)((slotNumber << 4) | slotNumber);
|
||||
uint8_t zeroPayload[2];
|
||||
zeroPayload[0] = 0x00;
|
||||
zeroPayload[1] = 0;
|
||||
IVEC_BswDisplayStatus_e st = IVEC_BswDisplay_WriteFrame(ctx, ctx -> u8WriteCmd, addr, addr, zeroPayload, (uint16_t) sizeof zeroPayload);
|
||||
if (st == DISPLAY_STATUS_OK) s_zeroAlreadySentForSlot[slotNumber] = 1;
|
||||
else if (firstError == DISPLAY_STATUS_OK) firstError = st;
|
||||
}
|
||||
} else {
|
||||
if ((nowTick - lastSeen) > BSW_DISP_TIMEOUT_MS && s_zeroAlreadySentForSlot[slotNumber] == 0) {
|
||||
uint8_t addr = (uint8_t)((slotNumber << 4) | slotNumber);
|
||||
uint8_t zeroPayload[2];
|
||||
zeroPayload[0] = 0x00;
|
||||
zeroPayload[1] = 0;
|
||||
IVEC_BswDisplayStatus_e st = IVEC_BswDisplay_WriteFrame(ctx, ctx -> u8WriteCmd, addr, addr, zeroPayload, (uint16_t) sizeof zeroPayload);
|
||||
if (st == DISPLAY_STATUS_OK) s_zeroAlreadySentForSlot[slotNumber] = 1;
|
||||
else if (firstError == DISPLAY_STATUS_OK) firstError = st;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (firstError != DISPLAY_STATUS_OK) return firstError;
|
||||
}
|
||||
|
||||
return DISPLAY_STATUS_OK;
|
||||
}
|
||||
|
|
@ -10,8 +10,6 @@ bool bBSW_NfcTest();
|
|||
bool bBSW_NfcInit();
|
||||
bool bBSW_NfcMifareClassicDataRead(uint8_t *pu8Uid,uint8_t u8UidLen,uint32_t u32BlockAddr,uint8_t *pu8Key, uint8_t u8keyType,uint8_t *pu8Data );
|
||||
bool bBSW_NfcConfigure();
|
||||
bool bBSW_NfcGetStatus();
|
||||
int i328BSW_NfcScanMIFARE(uint8_t *pu8Uid);
|
||||
int i328BSW_NfcAutoPollMIFARE();
|
||||
int i328BSW_NfcInListPassiveMIFARE();
|
||||
#endif /* IVEC_BSW_NFC_H */
|
||||
|
|
|
|||
|
|
@ -115,19 +115,10 @@ int i328BSW_NfcAutoPollMIFARE()
|
|||
{
|
||||
return auto_poll_command(&__gprv_pn532) == PN532_STATUS_OK;
|
||||
}
|
||||
//int i328BSW_NfcInListPassiveMIFARE()
|
||||
//{
|
||||
// return in_list_passive(&__gprv_pn532) == PN532_STATUS_OK;
|
||||
//}
|
||||
bool bBSW_NfcConfigure()//call it after test success
|
||||
{
|
||||
return configure_sam(&__gprv_pn532) == PN532_STATUS_OK;
|
||||
}
|
||||
bool bBSW_NfcGetStatus()
|
||||
{
|
||||
uint8_t pu8Buff[56] = { 0 };
|
||||
return get_status(&__gprv_pn532, pu8Buff, 4) == PN532_STATUS_OK;
|
||||
}
|
||||
bool bBSW_NfcMifareClassicDataRead(uint8_t* pu8Uid, uint8_t u8UidLen, uint32_t u32BlockAddr, uint8_t* pu8Key, uint8_t u8keyType, uint8_t* pu8Data)
|
||||
{
|
||||
if (UART_MifareClassicAuthenticateBlock(&__gprv_pn532, pu8Uid, u8UidLen, (u32BlockAddr / 4) * 4, u8keyType, pu8Key) == PN532_STATUS_OK)
|
||||
|
|
|
|||
|
|
@ -268,7 +268,6 @@ bool PN532_ReadGpioI(PN532* pn532, uint8_t pin_number);
|
|||
int PN532_WriteGpio(PN532* pn532, uint8_t* pins_state);
|
||||
int PN532_WriteGpioP(PN532* pn532, uint8_t pin_number, bool pin_state);
|
||||
int get_firmware(PN532* pn532,uint8_t *response_buffer,uint8_t response_len);
|
||||
int get_status(PN532* pn532, uint8_t *response_buffer, uint8_t response_len);
|
||||
void send_wakeup(PN532 *pn532);
|
||||
int configure_sam(PN532* pn532);
|
||||
int auto_poll_command(PN532* pn532) ;
|
||||
|
|
|
|||
|
|
@ -498,8 +498,17 @@ int PN532_WriteGpioP(PN532* pn532, uint8_t pin_number, bool pin_state) {
|
|||
params, sizeof(params), PN532_DEFAULT_TIMEOUT);
|
||||
}
|
||||
|
||||
|
||||
// Command arrays
|
||||
|
||||
uint8_t rf_config_command[] = { 0x00, 0xFF, 0x06, 0xFA, 0xD4, 0x32, 0x05, 0xFF, 0xFF, 0x02, 0xF5, 0x00 };
|
||||
|
||||
uint8_t get_status_command[] = { 0x00, 0xFF, 0x02, 0xFE, 0xD4, 0x04, 0x28, 0x00 };
|
||||
uint8_t in_list_passive_command[] = { 0x00, 0xFF, 0x04, 0xFC, 0xD4, 0x4A, 0x01, 0x00, 0xE1, 0x00 };
|
||||
|
||||
|
||||
// Response buffers
|
||||
uint8_t response_buffer[32];
|
||||
//uint8_t response_buffer[32];
|
||||
|
||||
|
||||
|
||||
|
|
@ -546,6 +555,8 @@ int send_command(PN532* pn532, const uint8_t* command, uint8_t length, uint8_t*
|
|||
}
|
||||
// The the number of bytes read
|
||||
return frame_len - 2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Specific command functions
|
||||
|
|
@ -557,51 +568,37 @@ void send_wakeup(PN532* pn532) {
|
|||
|
||||
int get_firmware(PN532* pn532,uint8_t *response_buffer,uint8_t response_len) {
|
||||
pn532->log("Sending get firmware command...");
|
||||
|
||||
uint8_t get_firmware_command[] = {0x00, 0x00, 0xFF, 0x02, 0xFE, 0xD4, 0x02, 0x2A, 0x00 };
|
||||
return send_command(pn532, get_firmware_command, sizeof(get_firmware_command), response_buffer, response_len, 0);
|
||||
return send_command(pn532, get_firmware_command, sizeof(get_firmware_command), response_buffer, response_len,0);
|
||||
|
||||
}
|
||||
|
||||
//void configure_rf(PN532* pn532) {
|
||||
// pn532->log("Sending RF configuration command...");
|
||||
// uint8_t rf_config_command[] = { 0x00, 0x00, 0xFF, 0x06, 0xFA, 0xD4, 0x32, 0x05, 0xFF, 0xFF, 0x02, 0xF5, 0x00 };
|
||||
// return send_command(pn532, rf_config_command, sizeof(rf_config_command), NULL,0,1);
|
||||
//}
|
||||
void configure_rf(PN532* pn532) {
|
||||
pn532->log("Sending RF configuration command...");
|
||||
// send_command(pn532, rf_config_command, sizeof(rf_config_command), response_buffer, 15);
|
||||
}
|
||||
|
||||
int configure_sam(PN532* pn532) {
|
||||
pn532->log("Sending SAM configuration command...");
|
||||
uint8_t sam_config_command[] = {0x00, 0x00, 0xFF, 0x03, 0xFD, 0xD4, 0x14, 0x01, 0x17, 0x00 };
|
||||
return send_command(pn532, sam_config_command, sizeof(sam_config_command), NULL, 0, 0);
|
||||
return send_command(pn532, sam_config_command, sizeof(sam_config_command), NULL, 0,0);
|
||||
}
|
||||
|
||||
int get_status(PN532* pn532, uint8_t *response_buffer, uint8_t response_len) {
|
||||
pn532->log("Sending GetGeneralStatus command...");
|
||||
uint8_t get_status_command[] = {0x00, 0x00, 0xFF, 0x02, 0xFE, 0xD4, 0x04, 0x28, 0x00};
|
||||
int received_length = send_command(pn532, get_status_command, sizeof(get_status_command), response_buffer, response_len, 0);
|
||||
|
||||
if (received_length < 4) {
|
||||
pn532->log("GetGeneralStatus: invalid or short response");
|
||||
return PN532_STATUS_ERROR;
|
||||
}
|
||||
|
||||
uint8_t error_code = response_buffer[0];
|
||||
uint8_t sam_configuration = response_buffer[3];
|
||||
|
||||
if (error_code == 0x2A && sam_configuration == 0x80) {
|
||||
return PN532_STATUS_OK;
|
||||
} else {
|
||||
return PN532_STATUS_ERROR;
|
||||
}
|
||||
void get_status(PN532* pn532) {
|
||||
pn532->log("Sending get status command...");
|
||||
// send_command(pn532, get_status_command, sizeof(get_status_command), response_buffer, 19);
|
||||
}
|
||||
|
||||
void in_list_passive(PN532* pn532) {
|
||||
pn532->log("Sending in list passive command...");
|
||||
uint8_t in_list_passive_command[] = { 0x00, 0x00, 0xFF, 0x04, 0xFC, 0xD4, 0x4A, 0x01, 0x00, 0xE1, 0x00 };
|
||||
return send_command(pn532, in_list_passive_command, sizeof(in_list_passive_command), NULL, 0, 2);
|
||||
// send_command(pn532, in_list_passive_command, sizeof(in_list_passive_command), response_buffer, 25);
|
||||
}
|
||||
|
||||
int auto_poll_command(PN532* pn532) {
|
||||
pn532->log("Sending auto poll command...");
|
||||
uint8_t auto_poll[] = { 0x00, 0x00, 0xFF, 0x05, 0xFB, 0xD4, 0x60, 0xFF, 0x01, 0x10, 0xBC, 0x00};
|
||||
return send_command(pn532, auto_poll, sizeof(auto_poll), NULL, 0, 2);
|
||||
return send_command(pn532, auto_poll, sizeof(auto_poll), NULL, 0,2);
|
||||
}
|
||||
|
||||
int UART_MifareClassicAuthenticateBlock(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,5 @@ void vRTE_AppRun(void);
|
|||
void vRTE_InitUartCanEcho(void);
|
||||
void vRTE_ProcessUartData(void);
|
||||
void vRTE_ProcessCanData(void);
|
||||
void vRte_InitDisplayUart(void);
|
||||
void vRte_Display(void);
|
||||
#define IVEC_RTE_LOG(x, ...)
|
||||
#endif /* IVEC_RTE_INC_IVEC_RTE_H_ */
|
||||
|
|
|
|||
|
|
@ -2,49 +2,61 @@
|
|||
* ivec_rte.c
|
||||
*
|
||||
* Created on: 28-Oct-2024
|
||||
* Author: altamash
|
||||
* Author: altam
|
||||
*/
|
||||
#include "ivec_rte.h"
|
||||
|
||||
#include "ivec_cmplx_queue.h"
|
||||
#include "ivec_cmplx_vFrame.h"
|
||||
#include "../ivec_ECU/ivec_ecu_uart/inc/ivec_ecu_uart.h"
|
||||
#include "../ivec_ECU/ivec_ecu_can/inc/ivec_ecu_can.h"
|
||||
#include "../../Core/Include/ivec_mcal_gpio.h"
|
||||
#include <ivec_BSW/ivec_bsw_display/inc/ivec_bsw_display.h>
|
||||
#include "ivec_bsw_nfc.h"
|
||||
#include "socTouchDisplay.h"
|
||||
#include "../../TM1650_SDK/inc/ivec_TM1650.h"
|
||||
#include"ivec_bsw_nfc.h"
|
||||
|
||||
#include "ivec_rte.h"
|
||||
|
||||
// UART Handles
|
||||
IVEC_EcuUartHandle_s g_xUartHandle = {0};
|
||||
IVEC_EcuUartHandle_s g_xUart3DisplayHandle = {0};
|
||||
IVEC_EcuUartHandle_s __gprv_UartCcHandle = {0};
|
||||
IVEC_EcuCANHandle_s g_xCanHandle = {0};
|
||||
|
||||
// Configuration Macros
|
||||
#define rteCONFIG_BASIL_BATTERY_SMART_u8 1
|
||||
#define rteCONFIG_BASIL_u8 2
|
||||
#define rteCONFIG_MOTHER_BOARD_u8 3
|
||||
|
||||
// UART Configuration
|
||||
#define rteUART_PIN_SELECTION_u8 rteCONFIG_MOTHER_BOARD_u8
|
||||
|
||||
uint8_t g_pu8UartBuffer[ecuUART_MAX_PACKET_LENGTH_u8] = {0};
|
||||
volatile uint32_t g_u32CanId = 0x1FFFFFFF;
|
||||
|
||||
// CAN UART Buffer
|
||||
#define eteCAN_UART_BUFFER_MAX_SIZE_u32 4096
|
||||
#define RTE_UART3_DISPLAY_BUFFER_MAX 512
|
||||
volatile uint8_t g_prvU8CanUartDataBuffer[eteCAN_UART_BUFFER_MAX_SIZE_u32];
|
||||
|
||||
// CAN Filters
|
||||
bool g_bl_bIsExtendedId[ecuMAX_FILTERS_u8];
|
||||
|
||||
// Display
|
||||
static BswDisplayCtx_s s_disp = {0};
|
||||
static bool s_disp_inited = false;
|
||||
|
||||
// Filter Information
|
||||
uint16_t g_u16ExtendedFilter = 0;
|
||||
uint16_t g_u16StandardFilter = 0;
|
||||
|
||||
// Private Static Variables
|
||||
static uint8_t __gprv_U8Index = 0;
|
||||
|
||||
// External Variables
|
||||
extern ExtU_socTouchDisplay_T socTouchDisplay_U;
|
||||
extern ExtY_socTouchDisplay_T socTouchDisplay_Y;
|
||||
|
||||
#define CAN_UART_BUFFER_MAX_SIZE 300
|
||||
uint8_t g_prv_u8CANUartDataBuffer[CAN_UART_BUFFER_MAX_SIZE];
|
||||
uint8_t g_u8Uart3DisplayBuffer[RTE_UART3_DISPLAY_BUFFER_MAX] = {0};
|
||||
uint32_t g_prv_u32CanUartDataAvailable = 0;
|
||||
|
||||
|
||||
// CAN UART Buffer
|
||||
#define eteCAN_UART_Cc_BUFFER_MAX_SIZE_u32 4096
|
||||
volatile uint8_t __gprv_u8CcUartDataBuffer[eteCAN_UART_Cc_BUFFER_MAX_SIZE_u32];
|
||||
|
|
@ -53,31 +65,228 @@ uint8_t g_u8SmdReceived = 0;
|
|||
IVEC_EcuCommonCanFrame_s g_xSmdCanMsg = {0};
|
||||
int32_t g_u32LastSendTick = 0; // Last time we sent over CAN/UART
|
||||
|
||||
/**
|
||||
* @brief Sets the state of the MCU temperature data pin (SDA) for TM1650.
|
||||
*
|
||||
* @param[in] u8State The state to set on the SDA pin (0 for low, 1 for high).
|
||||
*
|
||||
* @note This function controls the SDA pin of the TM1650 by setting it to
|
||||
* either low or high based on the input state.
|
||||
*/
|
||||
|
||||
|
||||
void vRTE_SetMcuTempDataPin(uint8_t u8State)
|
||||
{
|
||||
if(u8State == 0){
|
||||
vMCAL_gpioWrite(TM1650_PORT, TM1650_SDA_PIN_PIN, 0);
|
||||
}
|
||||
else if(u8State == 1){
|
||||
vMCAL_gpioWrite(TM1650_PORT, TM1650_SDA_PIN_PIN, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the state of the MCU temperature clock pin (SCL) for TM1650.
|
||||
*
|
||||
* @param[in] u8State The state to set on the SCL pin (0 for low, 1 for high).
|
||||
*
|
||||
* @note This function controls the SCL pin of the TM1650 by setting it to
|
||||
* either low or high based on the input state.
|
||||
*/
|
||||
|
||||
void vRTE_McuSetTempClkPin(uint8_t u8State)
|
||||
{
|
||||
if(u8State == 0){
|
||||
vMCAL_gpioWrite(TM1650_PORT, TM1650_SCL_PIN_PIN, 0);
|
||||
}
|
||||
else if(u8State == 1){
|
||||
vMCAL_gpioWrite(TM1650_PORT, TM1650_SCL_PIN_PIN, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reads the state of the MCU temperature data pin (SDA) for TM1650.
|
||||
*
|
||||
* This function configures the SDA pin as an input, reads the pin state,
|
||||
* and then restores the pin's direction to output.
|
||||
*
|
||||
* @returns The state of the SDA pin (0 for low, 1 for high).
|
||||
*
|
||||
* @note The pin direction is temporarily set to input to read the pin state.
|
||||
*/
|
||||
|
||||
static uint8_t _prv_RteReadMcuTempPin(void) {
|
||||
uint8_t l_u8ReadBuffer = 0;
|
||||
vMCAL_setGpioDirection(TM1650_SDA_PIN_IOMUX,false);
|
||||
l_u8ReadBuffer = u32MCAL_gpioRead(TM1650_PORT, TM1650_SDA_PIN_PIN);
|
||||
vMCAL_setGpioDirection(TM1650_SDA_PIN_IOMUX,true);
|
||||
return l_u8ReadBuffer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initializes the MATLAB interface for MCU and TM1650.
|
||||
*
|
||||
* This function performs the following initialization steps:
|
||||
* - Initializes GPIO pins for communication.
|
||||
* - Initializes the TM1650 display with the specified parameters.
|
||||
* - Turns off the TM1650 screen, waits for a short delay, and then hides the
|
||||
* decimal points on the digits.
|
||||
* - Initializes the touch display for user interaction.
|
||||
*
|
||||
* @returns None
|
||||
*
|
||||
* @note The function uses `vMCAL_delayTicks` for a delay after turning off the display.
|
||||
*/
|
||||
|
||||
void vRTE_MatlabInit(void)
|
||||
{
|
||||
u8MCAL_gpioInit();
|
||||
tm1650_Init(TM_1650_BRIGHT_6, TM_1650_Segment_8, TM_1650_Normal_Mode, TM_1650_Screen_ON, TM_1650_DIG_3, (void*)&vRTE_SetMcuTempDataPin , (void*)&vRTE_McuSetTempClkPin , &_prv_RteReadMcuTempPin);
|
||||
tm1650_displaySwitch(TM_1650_Screen_OFF);
|
||||
vMCAL_delayTicks(500);
|
||||
tm1650_showDot(TM_1650_DIG_1,false);
|
||||
tm1650_showDot(TM_1650_DIG_2,false);
|
||||
tm1650_showDot(TM_1650_DIG_3,false);
|
||||
socTouchDisplay_initialize();
|
||||
}
|
||||
|
||||
|
||||
void vRTE_InitUartCc(void)
|
||||
{
|
||||
__gprv_UartCcHandle.u8Qbuffer = __gprv_u8CcUartDataBuffer;
|
||||
__gprv_UartCcHandle.u16QbufSize = eteCAN_UART_Cc_BUFFER_MAX_SIZE_u32;
|
||||
__gprv_UartCcHandle.eUartPortNumber = IVEC_ECU_UART_PORT3;
|
||||
__gprv_UartCcHandle.eUartPortNumber = IVEC_ECU_UART_PORT4;
|
||||
__gprv_UartCcHandle.u32BaudRate = IVEC_ECU_UART_BAUD_230400;
|
||||
|
||||
xECU_UartInit(&__gprv_UartCcHandle);
|
||||
}
|
||||
/**
|
||||
* @brief Runs the MATLAB interface for MCU and TM1650 during operation.
|
||||
*
|
||||
* This function performs several actions:
|
||||
* - Detects if a touch input is active and sets display and touch durations.
|
||||
* - Executes the display update step with `socTouchDisplay_step()`.
|
||||
* - Clears and resets the CAN message buffer.
|
||||
* - Based on the display and error statuses, it updates the TM1650 display:
|
||||
* - If display status is active, it shows the appropriate digits or alphabet.
|
||||
* - If an error is detected, it displays an error message on the TM1650.
|
||||
* - If neither status is active, it turns off the display.
|
||||
*
|
||||
* @returns None
|
||||
*/
|
||||
|
||||
void vRTE_MatlabRun(void)
|
||||
{
|
||||
socTouchDisplay_U.in_bTouchDetected = (u32MCAL_gpioRead(GPIOB, DL_GPIO_PIN_17) == DL_GPIO_PIN_17) ? 1 : 0;
|
||||
socTouchDisplay_U.ip_u32DisplayDuration_msec = 10000;
|
||||
socTouchDisplay_U.ip_u32TouchDuration_msec = 100;
|
||||
socTouchDisplay_U.ip_u32canId = g_u32CanId;
|
||||
|
||||
socTouchDisplay_step();
|
||||
|
||||
memset(&socTouchDisplay_U.Input[0], 0, sizeof(CAN_MESSAGE_BUS)*MAX_CAN_MESSAGE_INSTANCE);
|
||||
__gprv_U8Index = 0;
|
||||
|
||||
if( socTouchDisplay_Y.op_bDisplayStatus )
|
||||
{
|
||||
tm1650_displaySwitch(TM_1650_Screen_ON);
|
||||
tm1650_showDot(TM_1650_DIG_1,false);
|
||||
tm1650_showDot(TM_1650_DIG_2,false);
|
||||
tm1650_showDot(TM_1650_DIG_3,false);
|
||||
|
||||
if( socTouchDisplay_Y.op_u8HundredsPlace == 1 && \
|
||||
socTouchDisplay_Y.op_u8TensPlace == 0 && \
|
||||
socTouchDisplay_Y.op_u8OnesPlace == 0)
|
||||
{
|
||||
char l_cData = 'F';
|
||||
tm1650_showAlphabet(TM_1650_DIG_2, (char*)&l_cData);
|
||||
l_cData = 'C';
|
||||
tm1650_showAlphabet(TM_1650_DIG_3, (char*)&l_cData);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
tm1650_showNum(TM_1650_DIG_3, socTouchDisplay_Y.op_u8OnesPlace);
|
||||
tm1650_showNum(TM_1650_DIG_2, socTouchDisplay_Y.op_u8TensPlace);
|
||||
}
|
||||
// tm1650_showNum(TM_1650_DIG_1, socTouchDisplay_Y.op_u8HundredsPlace);
|
||||
|
||||
}
|
||||
if( socTouchDisplay_Y.op_bErrorStatus )
|
||||
{
|
||||
tm1650_displaySwitch(TM_1650_Screen_ON);
|
||||
tm1650_showDot(TM_1650_DIG_1,false);
|
||||
tm1650_showDot(TM_1650_DIG_2,false);
|
||||
tm1650_showDot(TM_1650_DIG_3,false);
|
||||
|
||||
char l_cData = 'R';
|
||||
l_cData = 'C';
|
||||
tm1650_showAlphabet(TM_1650_DIG_2, (char*)&l_cData);
|
||||
l_cData = 'E';
|
||||
tm1650_showAlphabet(TM_1650_DIG_3, (char*)&l_cData);
|
||||
}
|
||||
if( !socTouchDisplay_Y.op_bDisplayStatus && !socTouchDisplay_Y.op_bErrorStatus )
|
||||
{
|
||||
tm1650_displaySwitch(TM_1650_Screen_OFF);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief Initializes the application run processes.
|
||||
*
|
||||
* This function processes UART and CAN data to perform necessary tasks during
|
||||
* the application runtime.
|
||||
*
|
||||
* @returns None
|
||||
*/
|
||||
|
||||
|
||||
void vRTE_AppInit(void)
|
||||
{
|
||||
#if rteUART_PIN_SELECTION_u8 == 1
|
||||
vRTE_MatlabInit();
|
||||
vRTE_InitUartCc();
|
||||
#endif
|
||||
|
||||
vRTE_InitUartCanEcho();
|
||||
bBSW_NfcInit();
|
||||
vRte_InitDisplayUart();
|
||||
// Uncomment for UART-to-CAN transmission, if required
|
||||
// iECU_UartInitiateTransmit(&g_xUartHandle, 0x6, NULL, 0);
|
||||
// xECU_WriteDataOverCAN(&g_xCanHandle, NULL , 0x6, 1, 0);
|
||||
|
||||
|
||||
#if rteUART_PIN_SELECTION_u8 == 3
|
||||
vRTE_NfcInit();
|
||||
#endif
|
||||
}
|
||||
/**
|
||||
* @brief Callback function for timer interrupt.
|
||||
*
|
||||
* This function is triggered by a timer interrupt and performs the following actions:
|
||||
* - Calls the `vRTE_MatlabRun()` function if the battery smart configuration is enabled.
|
||||
* - Clears the interrupt flag for Timer 1.
|
||||
*
|
||||
* @returns None
|
||||
*/
|
||||
|
||||
|
||||
|
||||
void vRTE_InitUartCanEcho(void)
|
||||
{
|
||||
g_xUartHandle.u8Qbuffer = g_prvU8CanUartDataBuffer;
|
||||
g_xUartHandle.u16QbufSize = eteCAN_UART_BUFFER_MAX_SIZE_u32;
|
||||
|
||||
#if (rteUART_PIN_SELECTION_u8 == 1)
|
||||
g_xUartHandle.eUartPortNumber = IVEC_ECU_UART_PORT3;
|
||||
g_xUartHandle.u32BaudRate = IVEC_ECU_UART_BAUD_115200;
|
||||
#elif (rteUART_PIN_SELECTION_u8 == 2)
|
||||
g_xUartHandle.eUartPortNumber = IVEC_ECU_UART_PORT2;
|
||||
g_xUartHandle.u32BaudRate = IVEC_ECU_UART_BAUD_115200;
|
||||
#elif (rteUART_PIN_SELECTION_u8 == 3)
|
||||
g_xUartHandle.eUartPortNumber = IVEC_ECU_UART_PORT2;
|
||||
g_xUartHandle.u32BaudRate = IVEC_ECU_UART_BAUD_115200;
|
||||
#endif
|
||||
|
||||
xECU_UartInit(&g_xUartHandle);
|
||||
|
||||
g_xCanHandle.u16Speed = IVEC_ECU_CAN_SPEED_500;
|
||||
g_xCanHandle.pMCAN = CANFD0;
|
||||
g_xCanHandle.i32MaskCount = -1;
|
||||
|
|
@ -90,26 +299,10 @@ void vRTE_InitUartCanEcho(void)
|
|||
xECU_CANInit(&g_xCanHandle);
|
||||
}
|
||||
|
||||
void vRte_InitDisplayUart(void) {
|
||||
g_xUart3DisplayHandle.u8Qbuffer = g_u8Uart3DisplayBuffer;
|
||||
g_xUart3DisplayHandle.u16QbufSize = (uint16_t) RTE_UART3_DISPLAY_BUFFER_MAX;
|
||||
g_xUart3DisplayHandle.eUartPortNumber = IVEC_ECU_UART_PORT4;
|
||||
g_xUart3DisplayHandle.u32BaudRate = IVEC_ECU_UART_BAUD_115200;
|
||||
|
||||
if (xECU_UartInit(&g_xUart3DisplayHandle) != commonMCAL_SUCCESS) {
|
||||
s_disp_inited = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (IVEC_BswDisplay_Init(&s_disp, &g_xUart3DisplayHandle, true) != DISPLAY_STATUS_OK) {
|
||||
s_disp_inited = false;
|
||||
return;
|
||||
}
|
||||
|
||||
s_disp_inited = true;
|
||||
void vRTE_NfcInit(void)
|
||||
{
|
||||
bBSW_NfcInit();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initializes the application run processes.
|
||||
*
|
||||
|
|
@ -137,14 +330,6 @@ void vRTE_UartNfcProcess(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (bBSW_NfcGetStatus() == false)
|
||||
{
|
||||
bBSW_NfcConfigure();
|
||||
i328BSW_NfcAutoPollMIFARE();
|
||||
g_bConfigured = true;
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t l_pu8Uid[16] = { 0 };
|
||||
int l_UidLen = i328BSW_NfcScanMIFARE(l_pu8Uid);
|
||||
|
||||
|
|
@ -209,13 +394,18 @@ void vRTE_UartNfcProcess(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void vRTE_AppRun(void)
|
||||
{
|
||||
vRTE_ProcessUartData();
|
||||
vRTE_ProcessCanData();
|
||||
|
||||
#if rteUART_PIN_SELECTION_u8 == 1
|
||||
vRTE_CcUartRxProcess();
|
||||
#endif
|
||||
|
||||
#if rteUART_PIN_SELECTION_u8 == 3
|
||||
vRTE_UartNfcProcess();
|
||||
// vRte_Display();
|
||||
#endif
|
||||
}
|
||||
/**
|
||||
* @brief Callback function for timer interrupt.
|
||||
|
|
@ -229,6 +419,10 @@ void vRTE_AppRun(void)
|
|||
|
||||
void vMCAL_TimerCallback(void)
|
||||
{
|
||||
#if rteUART_PIN_SELECTION_u8 == 1
|
||||
vRTE_MatlabRun();
|
||||
#endif
|
||||
|
||||
DL_TimerA_clearInterruptStatus(TIMER_1_INST, GPTIMER_CPU_INT_IMASK_Z_SET);
|
||||
}
|
||||
/**
|
||||
|
|
@ -529,43 +723,6 @@ void vRTE_CcUartRxProcess(void)
|
|||
|
||||
|
||||
}
|
||||
|
||||
void vRte_Display(void)
|
||||
{
|
||||
if (!s_disp_inited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IVEC_ECU_CANBuff_s canBuffer = (IVEC_ECU_CANBuff_s){0};
|
||||
volatile uint8_t transmitBurstMessagesCount = 0;
|
||||
|
||||
while (xECU_CANGetData(&g_xCanHandle, &canBuffer) == commonECU_SUCCESS)
|
||||
{
|
||||
if (canBuffer.u8Length >= 3)
|
||||
{
|
||||
if (canBuffer.u32UlId >> 8 == 0x52069)
|
||||
{
|
||||
uint8_t slotNumber = (uint8_t)(canBuffer.u32UlId & 0xFF);
|
||||
|
||||
if ((slotNumber >= 1) && (slotNumber <= 9))
|
||||
{
|
||||
uint8_t stateOfCharge = canBuffer.u8Data[2];
|
||||
if (stateOfCharge > 100) { stateOfCharge = 100; }
|
||||
(void)IVEC_BswDisplay_WriteSOC(&s_disp, slotNumber, stateOfCharge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (transmitBurstMessagesCount < 16) { transmitBurstMessagesCount++; } else { break; }
|
||||
}
|
||||
|
||||
(void)xECU_CANGetStatus(&g_xCanHandle);
|
||||
vMCAL_WDG_Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Processes UART data to manage CAN and UART communication.
|
||||
*
|
||||
|
|
@ -707,9 +864,26 @@ void vRTE_ProcessCanData(void)
|
|||
vMCAL_softReset();
|
||||
}
|
||||
|
||||
#if rteUART_PIN_SELECTION_u8 == 1
|
||||
int l_i32RetSize = 0;
|
||||
uint8_t l_u8UartBuffer[30] = { 0 };
|
||||
int l_i32Status = -1;
|
||||
l_i32RetSize = u16CMPLX_vFrameEncode((uint32_t)l_xCanBuff.u32UlId, (uint8_t*)&l_xCanBuff.u8Data[0], (int32_t)l_xCanBuff.u8Length, l_u8UartBuffer, 30);
|
||||
if(l_xCanBuff.u32UlId == g_u32CanId)
|
||||
{
|
||||
|
||||
l_i32RetSize = u16CMPLX_vFrameEncode((uint32_t)0xabcdef, (uint8_t*)&l_xCanBuff.u8Data[0], (int32_t)l_xCanBuff.u8Length, l_u8UartBuffer, 30);
|
||||
}
|
||||
|
||||
l_i32Status = IVEC_ECUUartWrite(&__gprv_UartCcHandle, l_u8UartBuffer, l_i32RetSize);
|
||||
#endif
|
||||
|
||||
iECU_UartInitiateTransmit(&g_xUartHandle, (uint32_t)l_xCanBuff.u32UlId, (uint8_t*)&l_xCanBuff.u8Data[0], (uint8_t)l_xCanBuff.u8Length);
|
||||
|
||||
socTouchDisplay_U.Input[__gprv_U8Index].ID = l_xCanBuff.u32UlId;
|
||||
socTouchDisplay_U.Input[__gprv_U8Index].Length = l_xCanBuff.u8Length;
|
||||
memcpy(&socTouchDisplay_U.Input[__gprv_U8Index].Data[0], &l_xCanBuff.u8Data[0], 8);
|
||||
__gprv_U8Index = (__gprv_U8Index + 1) % MAX_CAN_MESSAGE_INSTANCE;
|
||||
if(l_u8TxBurstMessages < 16)
|
||||
l_u8TxBurstMessages++;
|
||||
else
|
||||
|
|
|
|||
2
main.c
2
main.c
|
|
@ -28,7 +28,7 @@ static void vApp_TimerConfig(void)
|
|||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
{
|
||||
__enable_irq();
|
||||
volatile DL_SYSCTL_RESET_CAUSE l_xResetCause = DL_SYSCTL_getResetCause();
|
||||
vMCAL_WDG_Refresh();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -11,9 +9,7 @@
|
|||
|
||||
|
||||
<configuration XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe_0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -21,9 +17,7 @@
|
|||
|
||||
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS110 USB Debug Probe_0" href="connections/TIXDS110_Connection.xml" id="Texas Instruments XDS110 USB Debug Probe_0" xml="TIXDS110_Connection.xml" xmlpath="connections"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -31,9 +25,7 @@
|
|||
|
||||
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe_0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -41,9 +33,7 @@
|
|||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds510cs_dap.xml" id="drivers" xml="tixds510cs_dap.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -51,9 +41,7 @@
|
|||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds510cortexM0.xml" id="drivers" xml="tixds510cortexM0.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -61,9 +49,7 @@
|
|||
|
||||
|
||||
<instance XML_version="1.2" href="drivers/tixds510sec_ap.xml" id="drivers" xml="tixds510sec_ap.xml" xmlpath="drivers"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -71,9 +57,7 @@
|
|||
|
||||
|
||||
<property Type="choicelist" Value="1" id="The JTAG TCLK Frequency (MHz)">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -81,9 +65,7 @@
|
|||
|
||||
|
||||
<choice Name="Fixed with user specified value" value="SPECIFIC">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -91,9 +73,7 @@
|
|||
|
||||
|
||||
<property Type="stringfield" Value="1MHz" id="-- Enter a value from 100.0kHz to 2.5MHz"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -101,9 +81,7 @@
|
|||
|
||||
|
||||
</choice>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -111,9 +89,7 @@
|
|||
|
||||
|
||||
</property>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -121,9 +97,7 @@
|
|||
|
||||
|
||||
<property Type="choicelist" Value="2" id="SWD Mode Settings">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -131,9 +105,7 @@
|
|||
|
||||
|
||||
<choice Name="SWD Mode - Aux COM port is target TDO pin" value="nothing"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -141,64 +113,50 @@
|
|||
|
||||
|
||||
</property>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<property Type="choicelist" Value="0" id="Debug Probe Selection">
|
||||
|
||||
|
||||
|
||||
<property Type="choicelist" Value="1" id="Debug Probe Selection">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<choice Name="Select by serial number" value="0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<property Type="stringfield" Value="LS41021K" id="-- Enter the serial number"/>
|
||||
|
||||
|
||||
|
||||
<property Type="stringfield" Value="LS4103ID" id="-- Enter the serial number"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</choice>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</property>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</property>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -206,9 +164,7 @@
|
|||
|
||||
|
||||
<instance XML_version="1.2" desc="MSPM0G3507_0" href="devices/MSPM0G3507.xml" id="MSPM0G3507_0" xml="MSPM0G3507.xml" xmlpath="devices"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -216,9 +172,7 @@
|
|||
|
||||
|
||||
</platform>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -226,9 +180,7 @@
|
|||
|
||||
|
||||
</connection>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -236,9 +188,7 @@
|
|||
|
||||
|
||||
</configuration>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue