# MATLAB 23550 **** - [ ](#--) - [ ](#--) - [ ](#-) - [ ](#-) - [ ](#-) - [ ](#-) - [](#) - [ ](#-) - [ ](#--) - [ ](#--) - [ ](#) ## S-Function ***Inu***. : - ** ([ ](#-))**: S-Function, - ** ([_app_wrapper_](#-))**: S-Function - ** ([_Src_](#-))**: - ** (beta) ([_xilinx_wrapper_](#-))**: ( ) . MATLAB [](#) ## : - [ ](#-) - [ ](#-) - [ ](#-) - [ (beta)](#-) ### (. wrapper) MATLAB ( , TMS). S-Function - Simulink, . MSVC-. S-Function : `n` . , S-Function `n+1`. , . S-Function: - . , - , . S-Function . - . while. while, . , `while()` `main()` . 4 : - ***mcu_wrapper.c***     - , . / , S-Function. - ***MCU.c***          - S-Function MATLAB. ***mcu_wrapper.c*** - ***mcu_wrapper_conf.h***   - ***mcu_wrapper.c*** ***MCU.c*** . S-Function, . - ***run_mex.bat***       - MSVC. ***.h***, ***.c*** . : - `RUN_APP_MAIN_FUNC_THREAD` - main() - `DEKSTOP_CYCLES_FOR_MCU_APP` - for(;;), main() - `MCU_CORE_CLOCK` - ( ) - `IN_PORT_WIDTH` - S-Function - `IN_PORT_NUMB` - S-Function - `OUT_PORT_WIDTH` - S-Function - `OUT_PORT_NUMB` - S-Function _Note: `RUN_APP_MAIN_FUNC_THREAD` main() )_ _Note for future: _ ### . , / S-Function : - ***app_includes.h***     - ARM MSVC. - ***app_init.c/.h***      - - ***app_io.c/.h***        - / / S-Function - ***app_wrapper.c/.h***      - - ***def.h***          - ( ) ***\app_wrapper\device_support*** TMS, MSVC ( `volatile`, `interrupt`, `asm`, `cregister`, IQlib). ### . , [ ](#-). . ### . - , S-Function. . ###### adc_sim ***adc_sim.c/.h*** - ( ) ###### pwm_sim ***pwm_sim.c/.h*** - : - (PWM_SIMULATION_MODE_REGULAR_PWM) - (PWM_SIMULATION_MODE_TK_LINES). ## MATLAB . . 1. [ MATLAB](#-) ( 2) 2. [ ](#--). : - , [ ](#--) 2. - , 3. 3. . : - , [ ](#--) [ ](#--) 3. - , , [ ](#--) [ ](#--) 3. - , , 4. 4. . : - - . - - 2. #### . "***\Src***". "[run_bat.mex](#-)" (***\Includes***) . "***.c***" . - , , . #### ***mexing.m***. MATLAB-, "[***run_bat.mex***](#-)" . [](#--) #### ***mexing.m*** ***run_mex.bat*** `debug`, . Visual Studio, ( ). ***MATLAB.exe***. . MATLAB , Visual Studio , , . , . . . . #### ##### - - . . MSVC, , `volatile`, `interrupt`, `asm`... DPS. -define ##### . . , . (. `ReadMemory`/`WriteMemory` - "" )