diff --git a/MCU_Wrapper/WrapperConfig.json b/MCU_Wrapper/WrapperConfig.json new file mode 100644 index 0000000..74c7309 --- /dev/null +++ b/MCU_Wrapper/WrapperConfig.json @@ -0,0 +1,71 @@ +{ + "wrapperPath": { + "Prompt": "", + "Type": "edit", + "Default": ".\\MCU_Wrapper" + }, + "enableDebug": { + "Prompt": "Enable Debug", + "Type": "checkbox", + "Default": true + }, + "mcuClk": { + "Prompt": "MCU Core Clock (MHz)", + "Type": "edit", + "Default": "72*10^6", + "Def": "MCU_CORE_CLOCK" + }, + "threadCycles": { + "Prompt": "Deckstop cycles per MCU simulation step", + "Type": "edit", + "Default": 255, + "Def": "DEKSTOP_CYCLES_FOR_MCU_APP" + }, + "enableThreading": { + "Prompt": "Run MCU main() in a separate thread", + "Type": "checkbox", + "Default": false, + "Def": "RUN_APP_MAIN_FUNC_THREAD" + }, + "enableDeinit": { + "Prompt": "Deinitialize model after simulation", + "Type": "checkbox", + "Default": true, + "Def": "DEINITIALIZE_AFTER_SIM" + }, + "appWrapperPath": { + "Prompt": "", + "Type": "edit", + "Default": ".\\app_wrapper" + }, + "srcTable": { + "Prompt": "", + "Type": "customtable", + "Default": [ + "..\\mcu_project\\upp\\Core\\Src\\gpio.c", + "..\\mcu_project\\upp\\Core\\Src\\stm32f1xx_hal_msp.c", + "..\\mcu_project\\upp\\Core\\Src\\stm32f1xx_it.c", + "..\\mcu_project\\upp\\Core\\Src\\system_stm32f1xx.c", + "..\\mcu_project\\upp\\Core\\Src\\tim.c", + "..\\mcu_project\\upp\\Core\\upp\\tiristor.c", + "..\\mcu_project\\upp\\Core\\upp\\upp.c", + "..\\mcu_project\\upp\\Core\\upp\\zero_cross.c", + "..\\mcu_project\\upp\\Core\\Src\\adc.c" + ], + "Def": "Files" + }, + "incTable": { + "Prompt": "", + "Type": "customtable", + "Default": [ + "..\\mcu_project\\upp\\Core\\Inc", + "..\\mcu_project\\upp\\Core\\upp" + ], + "Def": "Paths" + }, + "userDefs": { + "Prompt": "User Defines", + "Type": "textarea", + "Default": "USE_HAL_DRIVER\nSTM32F103xB" + } +} \ No newline at end of file diff --git a/MCU_Wrapper/mcu_wrapper.c b/MCU_Wrapper/mcu_wrapper.c index 37f1dc2..032c353 100644 --- a/MCU_Wrapper/mcu_wrapper.c +++ b/MCU_Wrapper/mcu_wrapper.c @@ -21,26 +21,32 @@ SIM__MCUHandleTypeDef hmcu; ///< Хендл для управления * @brief Таблица длин массивов IN */ const int inLengths[IN_PORT_NUMB] = { - IN_PORT_1_WIDTH + IN_PORT_1_WIDTH, + IN_PORT_2_WIDTH }; /** * @brief Таблица смещений в выходном массиве IN */ const int inOffsets[IN_PORT_NUMB] = { - OFFSET_IN_ARRAY_1 + OFFSET_IN_ARRAY_1, + OFFSET_IN_ARRAY_2 }; /** * @brief Таблица длин массивов OUT */ const int outLengths[OUT_PORT_NUMB] = { - OUT_PORT_1_WIDTH + OUT_PORT_1_WIDTH, + OUT_PORT_2_WIDTH, + OUT_PORT_3_WIDTH }; /** * @brief Таблица смещений в выходном массиве OUT */ const int outOffsets[OUT_PORT_NUMB] = { - OFFSET_OUT_ARRAY_1 + OFFSET_OUT_ARRAY_1, + OFFSET_OUT_ARRAY_2, + OFFSET_OUT_ARRAY_3 }; // INPUT/OUTPUTS AUTO-PARAMS END diff --git a/MCU_Wrapper/mcu_wrapper_conf.h b/MCU_Wrapper/mcu_wrapper_conf.h index a5bfe95..6879f93 100644 --- a/MCU_Wrapper/mcu_wrapper_conf.h +++ b/MCU_Wrapper/mcu_wrapper_conf.h @@ -51,11 +51,14 @@ // Parameters of S_Function // INPUT/OUTPUTS PARAMS START -#define IN_PORT_NUMB 1 -#define IN_PORT_1_WIDTH 16 +#define IN_PORT_NUMB 2 +#define IN_PORT_1_WIDTH 3 +#define IN_PORT_2_WIDTH 6 -#define OUT_PORT_NUMB 1 +#define OUT_PORT_NUMB 3 #define OUT_PORT_1_WIDTH 16 +#define OUT_PORT_2_WIDTH 16 +#define OUT_PORT_3_WIDTH 16 // INPUT/OUTPUTS PARAMS END /** WRAPPER_CONF @@ -87,16 +90,19 @@ // INPUT/OUTPUTS AUTO-PARAMS START /// === Полный размер буфера === -#define TOTAL_IN_SIZE (IN_PORT_1_WIDTH) +#define TOTAL_IN_SIZE (IN_PORT_1_WIDTH + IN_PORT_2_WIDTH) /// === Смещения массивов (внутри общего буфера) === #define OFFSET_IN_ARRAY_1 0 +#define OFFSET_IN_ARRAY_2 (OFFSET_IN_ARRAY_1 + IN_PORT_1_WIDTH) /// === Полный размер буфера === -#define TOTAL_OUT_SIZE (OUT_PORT_1_WIDTH) +#define TOTAL_OUT_SIZE (OUT_PORT_1_WIDTH + OUT_PORT_2_WIDTH + OUT_PORT_3_WIDTH) /// === Смещения массивов (внутри общего буфера) === #define OFFSET_OUT_ARRAY_1 0 +#define OFFSET_OUT_ARRAY_2 (OFFSET_OUT_ARRAY_1 + OUT_PORT_1_WIDTH) +#define OFFSET_OUT_ARRAY_3 (OFFSET_OUT_ARRAY_2 + OUT_PORT_2_WIDTH) // INPUT/OUTPUTS AUTO-PARAMS END diff --git a/mcu_test_r2023.slx b/mcu_test_r2023.slx index a74b77d..1d8691c 100644 Binary files a/mcu_test_r2023.slx and b/mcu_test_r2023.slx differ