]> rtime.felk.cvut.cz Git - pes-rpp/rpp-simulink.git/blob - rpp/blocks/tlc_c/sfunction_dinc.tlc
2fb52e8403acf2c3172fb9bbeab361ceb05a55d5
[pes-rpp/rpp-simulink.git] / rpp / blocks / tlc_c / sfunction_dinc.tlc
1 %% Copyright (C) 2013-2014 Czech Technical University in Prague
2 %%
3 %% Authors:
4 %%     - Karel Kočí
5 %%
6 %% This document contains proprietary information belonging to Czech
7 %% Technical University in Prague. Passing on and copying of this
8 %% document, and communication of its contents is not permitted
9 %% without prior written authorization.
10 %%
11 %% File : sfunction_dinc.tlc
12 %% Abstract:
13 %%     TLC file for inlining RPP digital input configuration block.
14 %%
15 %% References:
16 %%     BlockTypeSetup() : rtw_tlc.pdf p. 277
17 %%     Start()          : rtw_tlc.pdf p. 279
18 %%     Outputs()        : rtw_tlc.pdf p. 281
19
20
21 %implements sfunction_dinc "C"
22
23 %include "common.tlc"
24
25
26 %% Function: BlockInstanceSetup ================================================
27 %function BlockInstanceSetup(block, system) void
28     %if EXISTS("rpp_dinc_in_model") == 0
29         %<LibAddToCommonIncludes("rpp/rpp.h")>
30         %assign ::rpp_dinc_in_model = 1
31     %else
32         %<LibBlockReportError(block, "Only one Digital Input Configure block is allowed in the model.")>
33     %endif
34     %assign ::rpp_din_present=1
35 %endfunction
36
37 %% Function: BlockTypeSetup ====================================================
38 %function BlockTypeSetup(block, system) void
39
40     %% Ensure required header files are included
41     %<RppCommonBlockTypeSetup(block, system)>
42
43 %endfunction
44
45
46 %% Function: Start =============================================================
47 %function Start(block, system) Output
48
49     %if !SLibCodeGenForSim()
50         %assign ref_a = LibBlockParameterValue(p1, 0)
51         %assign ref_b = LibBlockParameterValue(p2, 1)
52         rpp_din_ref(%<ref_a>, %<ref_b>);
53     %endif
54
55 %endfunction
56
57 %% [EOF]