1 %% Copyright (C) 2013-2014 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_hbr.tlc
13 %% TLC file for inlining RPP H-Bridge control 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_hbr "C"
26 %% Function: BlockTypeSetup ====================================================
27 %function BlockTypeSetup(block, system) void
29 %% Ensure required header files are included
30 %<RppCommonBlockTypeSetup(block, system)>
35 %% Function: Start =============================================================
36 %function Start(block, system) Output
38 %if !SLibCodeGenForSim()
45 %% Function: Outputs ===========================================================
46 %function Outputs(block, system) Output
48 %if !SLibCodeGenForSim()
51 %assign enable = LibBlockInputSignal(0, "", "", 0)
52 %assign control = LibBlockInputSignal(1, "", "", 0)
53 %assign err_flag = LibBlockOutputSignal(0, "", "", 0)
56 rpp_hbr_enable(-1); %% enable if not enabled
57 if (rpp_hbr_control(%<control>) != SUCCESS) {
61 rpp_hbr_disable(); %% disable if not disabled