-
Notifications
You must be signed in to change notification settings - Fork 0
/
sfcn_PWM_Out3.tlc
109 lines (92 loc) · 3.28 KB
/
sfcn_PWM_Out3.tlc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
%% File : sfcn_PWM_Out3.tlc
%% Created: Mon Feb 15 01:06:32 2016
%%
%% Description:
%% Simulink Coder wrapper functions interface generated for
%% S-function "sfcn_PWM_Out3.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 sfcn_PWM_Out3 "C"
%% Function: BlockTypeSetup ===================================================
%%
%% Purpose:
%% Set up external references for wrapper functions in the
%% generated code.
%%
%function BlockTypeSetup(block, system) Output
%openfile externs
extern void sfcn_PWM_Out3_Outputs_wrapper(const uint8_T *motor2,
const real_T *xD,
const uint8_T *pin2, const int_T p_width0);
extern void sfcn_PWM_Out3_Update_wrapper(const uint8_T *motor2,
real_T *xD,
const uint8_T *pin2, const int_T p_width0);
%closefile externs
%<LibCacheExtern(externs)>
%%
%endfunction
%% InitializeConditions =========================================================
%%
%function InitializeConditions(block, system) Output
/* %<Type> Block: %<Name> */
{
real_T initVector[1] = {0};
%assign rollVars = ["<dwork>/DSTATE"]
%assign rollRegions = [0:%<LibBlockDWorkWidth(DSTATE)-1>]
%roll sigIdx = rollRegions, lcv = 1, block, "Roller", rollVars
%if %<LibBlockDWorkWidth(DSTATE)> == 1
%<LibBlockDWork(DSTATE, "", lcv, sigIdx)> = initVector[0];
%else
%<LibBlockDWork(DSTATE, "", lcv, sigIdx)> = initVector[%<lcv>];
%endif
%endroll
}
%endfunction
%% Function: Outputs ==========================================================
%%
%% Purpose:
%% Code generation rules for mdlOutputs function.
%%
%function Outputs(block, system) Output
%%
%assign pu0 = LibBlockInputSignalAddr(0, "", "", 0)
%assign pxd = LibBlockDWorkAddr(DSTATE, "", "", 0)
%assign nelements1 = LibBlockParameterSize(P1)
%assign param_width1 = nelements1[0] * nelements1[1]
%if (param_width1) > 1
%assign pp1 = LibBlockMatrixParameterBaseAddr(P1)
%else
%assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
%endif
%assign pu_width = LibBlockInputSignalWidth(0)
sfcn_PWM_Out3_Outputs_wrapper(%<pu0>, %<pxd>, %<pp1>, %<param_width1>);
%%
%endfunction
%% Function: Update ==========================================================
%% Abstract:
%% Update
%%
%%
%function Update(block, system) Output
/* S-Function "sfcn_PWM_Out3_wrapper" Block: %<Name> */
%assign pu0 = LibBlockInputSignalAddr(0, "", "", 0)
%assign pxd = LibBlockDWorkAddr(DSTATE, "", "", 0)
%assign nelements1 = LibBlockParameterSize(P1)
%assign param_width1 = nelements1[0] * nelements1[1]
%if (param_width1) > 1
%assign pp1 = LibBlockMatrixParameterBaseAddr(P1)
%else
%assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
%endif
sfcn_PWM_Out3_Update_wrapper(%<pu0>, %<pxd>, %<pp1>, %<param_width1>);
%%
%endfunction
%% [EOF] sfcn_PWM_Out3.tlc