1 #####################################
2 # Simulink Block Library for RPP #
3 #####################################
5 This library includes Simulink blocks for RPP board peripherals. Each block is
6 implemented as a Matlab C-MEX S-Functions.
8 The blocks ideally included in this library are:
10 CATEGORY NAME STATUS* MNEMONIC LRH*
11 ----------------------------------------------------------------------------
14 Configuration block X [----] RppConfig.h
17 Digital Input block I [DIN ] rpp_din.h
18 Digital Output block T [LOUT] rpp_lout.h
19 Analog Input block T [AIN ] rpp_ain.h
20 Analog Output block T [AOUT] rpp_aout.h
23 H-Bridge Control block T [HBR ] rpp_hbr.h
24 Power output block T [MOUT] rpp_mout.h
25 High-Power output block X [HOUT] rpp_hout.h
28 CAN Bus receive block X [CANR] rpp_can.h
29 CAN Bus send msg block X [CANS] - Idem -
30 LIN receive block X [LINR] rpp_lin.h
31 LIN send msg block X [LINS] - Idem -
32 FlexRay receive block X [FRR ] rpp_fr.h
33 FlexRay send msg block X [FRS ] - Idem -
34 SCI receive block T [SCIR] rpp_sci.h
35 SCI send msg block T [SCIS] - Idem -
36 SCI configure block T [SCIC] - Idem -
37 Ethernet receive block X [ETHR] rpp_eth.h
38 Ethernet send msg block X [ETHS] - Idem -
40 Logging/Storage blocks
41 SD Card write block T [SDCW] rpp_sdc.h
42 SDRAM write block X [SDRW] rpp_sdr.h
45 Overrun detected block X
46 Stack overflow detected X
48 Malloc Failed detected X
52 *LRH : Library Reference Header.
53 *STATUS : X - Unimplemented. Files non present.
54 P - Unimplemented. Files present.
57 T - Implemented and tested.
60 Note: Each block that can detect fault condition should have a trigger output.
61 High-power output provides current flow as an input to the model.
67 -> header.c and trailer.c
69 RPP framework for simple S-Functions.
71 This files are included at the head and tail of each S-Function file.
72 They include refactored and commonly repeated structures that pollute
73 S-Functions implementations. They include basic includes, required
74 definitions, macro definitions, common functions implementations and
75 documentation on optional functions and commented prototypes for
76 optional model calls/hooks.
82 -> sfunction_{mnemonic}.c
84 C-MEX S-Function implementation for {mnemonic} block.
86 This file implements the {mnemonic} block using C-MEX S-Function API.
87 See the reference for information about the S-Function API.
90 <repo>/refs/sfunctions.pdf
93 -> tlc_c/sfunction_{mnemonic}.tlc
95 Target Language Compiler (TLC) file for {mnemonic} block.
97 This file implements the C code inlining for {mnemonic} block. See the
98 reference for information about the TLC API.
101 <repo>/refs/rtw_tlc.pdf
106 Common TLC functions.
108 This file implements common TLC functions used by all the blocks.
116 Simulink library control file.
118 This file allows a group of blocks to be integrated into the Simulink
119 Library and Simulink Library Browser. This file is required by Simulink
120 in order to interpret this folder as a block library. For information
121 about this file see the references.
124 <repo>/refs/rtw_ug.pdf p. 1127
129 RPP Simulink block library.
131 Simulink block library that includes all the blocks. This file is
132 referenced by slblocks.m
140 Blocks compilation script.
142 This script compiles all the sfunction blocks to MEX executables. This
143 script is called by the rpp_setup() function in order make all the
144 blocks available to the Simulink environment or it can be called
145 independently when developing S-Functions.
152 Library block description:
154 The following are the currently specified Simulink blocks.
157 [DIN] Digital Input block ======================================================
166 uint8 Pin number [1-16]
167 bool Use variable threshold
170 [LOUT] Digital Output block ====================================================
178 uint8 Pin number [1-8]
181 [AIN] Analog Input block =======================================================
190 uint8 Pin number [1-12]
193 [AOUT] Analog Output block =====================================================
201 uint8 Pin number [1-4]
205 [HBR] H-Bridge Control block ===================================================
216 [MOUT] Power Output block ======================================================
224 uint8 Pin number [1-6]
227 [CANR] CAN Receive =============================================================
236 uint8 CAN Interface [1-4]
239 [CANS] CAN Send ================================================================
247 uint8 CAN Interface [1-4]
250 [SCIR] Serial Comm. Interface Receive ==========================================
262 [SCIS] Serial Comm. Interface Send =============================================
271 string PrintFormat [SETTING]
274 [SCIC] Serial Comm. Interface Configure ========================================
285 [SDRW] SD-RAM Write (Logging) ==================================================
294 string PrintFormat [SETTING]