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_scis.c
13 * C-MEX S-function block for RPP Serial Communication send.
20 * <matlabroot>/bin/mex sfunction_scis.c
27 Category: Communication
32 - { name: "Send", type: "uint8" }
35 - { name: "ErrFlag", type: "bool" }
39 # Description and Help is in Markdown mark-up
42 This block sends a byte to the SCI.
44 The ErrFlag is set to true `rpp_sci_write_nb()` returns an error, to
51 RPP API functions used:
60 #define S_FUNCTION_NAME sfunction_scis
64 static void mdlInitializeSizes(SimStruct *S)
67 * Configure parameters: 0
69 if (!rppSetNumParams(S, 0)) {
74 * Configure input ports: 1
77 if (!ssSetNumInputPorts(S, 1)) {
80 rppAddInputPort(S, 0, SS_UINT8);
83 * Configure output ports: 1
86 if (!ssSetNumOutputPorts(S, 1)) {
89 rppAddOutputPort(S, 0, SS_BOOLEAN);
91 /* Set standard options for this block */
92 rppSetStandardOptions(S);
96 #define COMMON_MDLINITIALIZESAMPLETIMES_INHERIT
97 #define UNUSED_MDLCHECKPARAMETERS
98 #define UNUSED_MDLOUTPUTS
99 #define UNUSED_MDLTERMINATE