STM MATLAB Simulator
Loading...
Searching...
No Matches
Functions | Variables
mcu_wrapper.c File Reference
#include "mcu_wrapper_conf.h"
+ Include dependency graph for mcu_wrapper.c:

Functions

int main (void)
 Main function of MCU app.
 
unsigned __stdcall MCU_App_Thread (void)
 Thread that run MCU code.
 
void MCU_Step_Simulation (SimStruct *S, time_T time)
 Read from simulink S-Block Inputs and write to MCU I/O ports.
 
void MCU_Periph_Simulation (void)
 Simulate peripheral of MCU.
 
void MCU_readInputs (SimStruct *S)
 Read from simulink S-Block Inputs and write to MCU I/O ports.
 
void MCU_writeOutputs (SimStruct *S)
 Read from MCU I/O ports and write to simulink S-Block Outputs.
 
void SIM_writeOutputs (SimStruct *S)
 Write S-Function Output ports to inputs.
 
void SIM_Initialize_Simulation (void)
 Initialize structures and variables for simulating MCU.
 
void SIM_deInitialize_Simulation (void)
 Deinitialize structures and variables for simulating MCU.
 

Variables

SIM__MCUHandleTypeDef hmcu
 extern для видимости переменной во всех файлах
 
double SystemClockDouble = 0
 
double SystemClock_step = 0
 
uint64_t SystemClock
 

Function Documentation

◆ main()

int main ( void )
extern

Main function of MCU app.

Функция с которой начинается выполнение кода МК. Выход из данной функции происходит только в конце симуляции mdlTerminate

◆ MCU_App_Thread()

unsigned __stdcall MCU_App_Thread ( void )

Thread that run MCU code.

THREAD FOR MCU APP

Поток, который запускает и выполняет код МК (main).

+ Here is the call graph for this function:

◆ MCU_Step_Simulation()

void MCU_Step_Simulation ( SimStruct * S,
time_T time )

Read from simulink S-Block Inputs and write to MCU I/O ports.

SIMULATE MCU FOR ONE SIMULATION STEP

Parameters
time- current time of simulation (in second).

Запускает поток, который выполняет код МК и управляет ходом потока: Если прошел таймаут, поток прерывается, симулируется периферия и на следующем шаге поток возобнавляется.

+ Here is the call graph for this function:

◆ MCU_Periph_Simulation()

void MCU_Periph_Simulation ( void )

Simulate peripheral of MCU.

SIMULATE MCU PERIPHERAL

Пользовательский код, который симулирует работу периферии МК.

+ Here is the call graph for this function:

◆ MCU_readInputs()

void MCU_readInputs ( SimStruct * S)

Read from simulink S-Block Inputs and write to MCU I/O ports.

READ INPUTS S-FUNCTION TO MCU REGS

Parameters
in- inputs of S-Function.

Пользовательский код, который записывает в порты ввода-вывода из disc.

+ Here is the call graph for this function:

◆ MCU_writeOutputs()

void MCU_writeOutputs ( SimStruct * S)

Read from MCU I/O ports and write to simulink S-Block Outputs.

WRITE OUTPUTS BUFFER S-FUNCTION FROM MCU REGS

Parameters
disc- discrete array of S-Function. Outputs would be written from disc.

Пользовательский код, который записывает в disc порты ввода-вывода.

+ Here is the call graph for this function:

◆ SIM_writeOutputs()

void SIM_writeOutputs ( SimStruct * S)

Write S-Function Output ports to inputs.

WRITE OUTPUTS OF S-BLOCK

Parameters
disc- discrete array of S-Function. Outputs would be written from disc.

Пользовательский код, который записывает выходы S-Function.

◆ SIM_Initialize_Simulation()

void SIM_Initialize_Simulation ( void )

Initialize structures and variables for simulating MCU.

MCU WRAPPER DEINITIALIZATION

Пользовательский код, который будет настраивать все структуры для симуляции.

+ Here is the call graph for this function:

◆ SIM_deInitialize_Simulation()

void SIM_deInitialize_Simulation ( void )

Deinitialize structures and variables for simulating MCU.

MCU WRAPPER DEINITIALIZATION

Пользовательский код, который будет очищать все структуры после окончания симуляции.

+ Here is the call graph for this function:

Variable Documentation

◆ hmcu

extern для видимости переменной во всех файлах

◆ SystemClockDouble

double SystemClockDouble = 0

◆ SystemClock_step

double SystemClock_step = 0

◆ SystemClock

uint64_t SystemClock