1 %% Copyright (C) 2013 Czech Technical University in Prague
4 %% - Carlos Jenkins <carlos@jenkins.co.cr>
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.
11 %% File : sfunction_lout.tlc
13 %% TLC file for inlining RPP digital output block.
16 %% BlockTypeSetup() : refs/rtw_tlc.pdf p. 277
17 %% Start() : refs/rtw_tlc.pdf p. 279
18 %% Outputs() : refs/rtw_tlc.pdf p. 281
21 %implements sfunction_lout "C"
26 %% Function: BlockTypeSetup ====================================================
27 %function BlockTypeSetup(block, system) void
29 %% Ensure required header files are included
30 %<RppCommonBlockTypeSetup(block, system)>
31 %<LibAddToCommonIncludes("rpp/rpp.h")>
32 %assign ::rpp_lout_present=1
37 %% Function: Start =============================================================
38 %function Start(block, system) Output
40 %if !SLibCodeGenForSim()
41 %%No initialization needed for this block
47 %% Function: Outputs ===========================================================
48 %function Outputs(block, system) Output
50 %if !SLibCodeGenForSim()
53 %assign pin_num = LibBlockParameterValue(p1, 0)
56 %assign digital_out = LibBlockInputSignal(0, "", "", 0)
57 %assign err_flag = LibBlockOutputSignal(0, "", "", 0)
59 if (rpp_lout_set(%<pin_num>, %<digital_out>) != SUCCESS) {
64 %% FIXME: Improve to call this function only once per step on the
66 %% But... what happens if the next block want to check it's
67 %% diagnostic value and is not the last LOUT block?
68 if (rpp_lout_update() != SUCCESS) {