-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsfbuilder_bus.tlc
113 lines (94 loc) · 3.59 KB
/
sfbuilder_bus.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
%% File : sfbuilder_bus.tlc
%% Created: Fri Aug 16 18:25:11 2013
%%
%% Description:
%% Simulink Coder wrapper functions interface generated for
%% S-function "sfbuilder_bus.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 sfbuilder_bus "C"
%% Function: BlockTypeSetup ===================================================
%%
%% Purpose:
%% Set up external references for wrapper functions in the
%% generated code.
%%
%function BlockTypeSetup(block, system) Output
%if IsModelReferenceSimTarget() || CodeFormat=="S-Function"
%assign hFileName = "sfbuilder_bus_accel_wrapper"
%assign hFileNameMacro = FEVAL("upper", hFileName)
%openfile hFile = "%<hFileName>.h"
%selectfile hFile
#ifndef _%<hFileNameMacro>_H_
#define _%<hFileNameMacro>_H_
#include "tmwtypes.h"
extern void sfbuilder_bus_Outputs_wrapper_accel(const void *u0, void *__u0BUS,
const int32_T *u1,
void *y0, void *__y0BUS,
int32_T *y1);
#endif
%closefile hFile
%assign cFileName = "sfbuilder_bus_accel_wrapper"
%openfile cFile = "%<cFileName>.c"
%selectfile cFile
#include <string.h>
#include "tmwtypes.h"
#include "sfbuilder_bus_bus.h"
void sfbuilder_bus_Outputs_wrapper_accel(const void *u0, void *__u0BUS,
const int32_T *u1,
void *y0, void *__y0BUS,
int32_T *y1){
%assign dTypeId = LibBlockInputSignalDataTypeId(0)
%<SLibAssignSLStructToUserStruct(dTypeId, "(*(SFB_COUNTERBUS*) __u0BUS)", "(char *)u0", 0)>
sfbuilder_bus_Outputs_wrapper((SFB_COUNTERBUS *) __u0BUS,
u1,
(SFB_COUNTERBUS *) __y0BUS,
y1);
%assign dTypeId = LibBlockOutputSignalDataTypeId(0)
%<SLibAssignUserStructToSLStruct(dTypeId, "(char *)y0", "(*(SFB_COUNTERBUS*) __y0BUS)", 0)>
}
%closefile cFile
%<LibAddToCommonIncludes("%<hFileName>.h")>
%<LibAddToModelSources("%<cFileName>")>
%else
%openfile externs
extern void sfbuilder_bus_Outputs_wrapper(const SFB_COUNTERBUS *u0,
const int32_T *u1,
SFB_COUNTERBUS *y0,
int32_T *y1);
%closefile externs
%<LibCacheExtern(externs)>
%endif
%%
%endfunction
%% Function: Outputs ==========================================================
%%
%% Purpose:
%% Code generation rules for mdlOutputs function.
%%
%function Outputs(block, system) Output
%%
%assign pu0 = LibBlockInputSignalAddr(0, "", "", 0)
%assign pu1 = LibBlockInputSignalAddr(1, "", "", 0)
%assign py0 = LibBlockOutputSignalAddr(0, "", "", 0)
%assign py1 = LibBlockOutputSignalAddr(1, "", "", 0)
%assign py_width = LibBlockOutputSignalWidth(0)
%assign pu_width = LibBlockInputSignalWidth(0)
%if IsModelReferenceSimTarget() || CodeFormat=="S-Function"
%assign u0BUS_ptr = LibBlockDWorkAddr(u0BUS, "", "", 0)
%assign y0BUS_ptr = LibBlockDWorkAddr(y0BUS, "", "", 0)
sfbuilder_bus_Outputs_wrapper_accel(%<pu0>, %<u0BUS_ptr>, %<pu1>, %<py0>, %<y0BUS_ptr>, %<py1> );
%else
sfbuilder_bus_Outputs_wrapper(%<pu0>, %<pu1>, %<py0>, %<py1> );
%endif
%%
%endfunction
%% [EOF] sfbuilder_bus.tlc