]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blob - rpp/blocks/README.txt
Improved documentation.
[jenkicar/rpp-simulink.git] / rpp / blocks / README.txt
1 #####################################
2 # Simulink Block Library for RPP    #
3 #####################################
4
5 This library includes Simulink blocks for RPP board peripherals. Each block is
6 implemented as a Matlab C-MEX S-Functions.
7
8 The blocks ideally included in this library are:
9
10     CATEGORY    NAME                        STATUS*     MNEMONIC    LRH*
11     ----------------------------------------------------------------------------
12
13     System blocks
14                 Configuration block         X           [----]      RppConfig.h
15
16     Logic IO blocks
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
21
22     Power output blocks
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
26
27     Communication blocks
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 -
39
40     Logging/Storage blocks
41                 SD Card write block         T           [SDCW]      rpp_sdc.h
42                 SDRAM write block           X           [SDRW]      rpp_sdr.h
43
44     Trigger blocks
45                 Overrun detected block      X
46                 Stack overflow detected     X
47                     block
48                 Malloc Failed detected      X
49                     block
50
51     ** Legend **
52         *LRH    : Library Reference Header.
53         *STATUS : X - Unimplemented. Files non present.
54                   P - Unimplemented. Files present.
55                   W - Work in progress.
56                   I - Implemented.
57                   T - Implemented and tested.
58
59
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.
62
63
64
65 Library file layout:
66
67     -> header.c and trailer.c
68
69         RPP framework for simple S-Functions.
70
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.
77
78         Reference:
79             None.
80
81
82     -> sfunction_{mnemonic}.c
83
84         C-MEX S-Function implementation for {mnemonic} block.
85
86         This file implements the {mnemonic} block using C-MEX S-Function API.
87         See the reference for information about the S-Function API.
88
89         Reference:
90             <repo>/refs/sfunctions.pdf
91
92
93     -> tlc_c/sfunction_{mnemonic}.tlc
94
95         Target Language Compiler (TLC) file for {mnemonic} block.
96
97         This file implements the C code inlining for {mnemonic} block. See the
98         reference for information about the TLC API.
99
100         Reference:
101             <repo>/refs/rtw_tlc.pdf
102
103
104     -> tlc_c/common.tlc
105
106         Common TLC functions.
107
108         This file implements common TLC functions used by all the blocks.
109
110         Reference:
111             None.
112
113
114     -> slblocks.m
115
116         Simulink library control file.
117
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.
122
123         Reference:
124             <repo>/refs/rtw_ug.pdf p. 1127
125
126
127     -> rpp_lib.slx
128
129         RPP Simulink block library.
130
131         Simulink block library that includes all the blocks. This file is
132         referenced by slblocks.m
133
134         Reference:
135             None.
136
137
138     -> compile_blocks.m
139
140         Blocks compilation script.
141
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.
146
147         Reference:
148             None.
149
150
151
152 Library block description:
153
154 The following are the currently specified Simulink blocks.
155
156
157 [DIN] Digital Input block ======================================================
158     Inputs      : 0
159         None
160
161     Outputs     : 2
162         bool    Digital Input
163         bool    ErrFlag
164
165     Parameters  : 2
166         uint8   Pin number [1-16]
167         bool    Use variable threshold
168
169
170 [LOUT] Digital Output block ====================================================
171     Inputs      : 1
172         bool    Digital Output
173
174     Outputs     : 1
175         bool    ErrFlag
176
177     Parameters  : 1
178         uint8   Pin number [1-8]
179
180
181 [AIN] Analog Input block =======================================================
182     Inputs      : 0
183         None
184
185     Outputs     : 2
186         uint16  Analog Input
187         bool    ErrFlag
188
189     Parameters  : 1
190         uint8   Pin number [1-12]
191
192
193 [AOUT] Analog Output block =====================================================
194     Inputs      : 1
195         uint16  Analog Output
196
197     Outputs     : 1
198         bool    ErrFlag
199
200     Parameters  : 1
201         uint8   Pin number [1-4]
202         bool    UseVoltage
203
204
205 [HBR] H-Bridge Control block ===================================================
206     Inputs      : 1
207         double  Control
208
209     Outputs     : 1
210         bool    ErrFlag
211
212     Parameters  : 0
213         None
214
215
216 [MOUT] Power Output block ======================================================
217     Inputs      : 1
218         bool    Power Output
219
220     Outputs     : 1
221         bool    ErrFlag
222
223     Parameters  : 1
224         uint8   Pin number [1-6]
225
226
227 [CANR] CAN Receive =============================================================
228     Inputs      : 0
229         None
230
231     Outputs     : 2
232         uint8   Payload
233         bool    ErrFlag
234
235     Parameters  : 1
236         uint8   CAN Interface [1-4]
237
238
239 [CANS] CAN Send ================================================================
240     Inputs      : 1
241         uint8   Payload
242
243     Outputs     : 1
244         bool    ErrFlag
245
246     Parameters  : 1
247         uint8   CAN Interface [1-4]
248
249
250 [SCIR] Serial Comm. Interface Receive ==========================================
251     Inputs      : 0
252         None
253
254     Outputs     : 2
255         uint8   Data
256         bool    ErrFlag
257
258     Parameters  : 0
259         None
260
261
262 [SCIS] Serial Comm. Interface Send =============================================
263     Inputs      : 1
264         uint8   Data
265
266     Outputs     : 1
267         bool    ErrFlag
268
269     Parameters  : 2
270         bool    UsePrintf
271         string  PrintFormat [SETTING]
272
273
274 [SCIC] Serial Comm. Interface Configure ========================================
275     Inputs      : 0
276         None
277
278     Outputs     : 0
279         None
280
281     Parameters  : 1
282         uint32  Baud rate
283
284
285 [SDRW] SD-RAM Write (Logging) ==================================================
286     Inputs      : 1
287         double  Data
288
289     Outputs     : 1
290         bool    ErrFlag
291
292     Parameters  : 2
293         uint8   Block ID
294         string  PrintFormat [SETTING]