-
Notifications
You must be signed in to change notification settings - Fork 3
/
notch.tlc
116 lines (99 loc) · 3.37 KB
/
notch.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
110
111
%% File : notch.tlc
%% Created: Thu Sep 9 09:08:44 2021
%%
%% Description:
%% Simulink Coder wrapper functions interface generated for
%% S-function "notch.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 notch "C"
%% Function: BlockTypeSetup ===================================================
%%
%% Purpose:
%% Set up external references for wrapper functions in the
%% generated code.
%%
%function BlockTypeSetup(block, system) Output
%openfile externs
extern void notch_Outputs_wrapper(real_T *out,
const real_T *xD,
const real_T *Ts, const int_T p_width0);
extern void notch_Update_wrapper(const real_T *in,
const real_T *freq,
const real_T *gmin,
const real_T *damp,
real_T *out,
real_T *xD,
const real_T *Ts, const int_T p_width0);
%closefile externs
%<LibCacheExtern(externs)>
%%
%endfunction
%% InitializeConditions =========================================================
%%
%function InitializeConditions(block, system) Output
/* %<Type> Block: %<Name> */
{
real_T initVector[3] = {0,0,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 py0 = LibBlockOutputSignalAddr(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
notch_Outputs_wrapper( %<py0>, %<pxd>, %<pp1>, %<param_width1>);
%%
%endfunction
%% Function: Update ==========================================================
%% Abstract:
%% Update
%%
%%
%function Update(block, system) Output
/* S-Function "notch_wrapper" Block: %<Name> */
%assign pu0 = LibBlockInputSignalAddr(0, "", "", 0)
%assign pu1 = LibBlockInputSignalAddr(1, "", "", 0)
%assign pu2 = LibBlockInputSignalAddr(2, "", "", 0)
%assign pu3 = LibBlockInputSignalAddr(3, "", "", 0)
%assign py0 = LibBlockOutputSignalAddr(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
notch_Update_wrapper(%<pu0>, %<pu1>, %<pu2>, %<pu3>, %<py0>, %<pxd>, %<pp1>, %<param_width1>);
%%
%endfunction
%% [EOF] notch.tlc