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.c
13 * C-MEX S-function block for RPP digital output.
20 * <matlabroot>/bin/mex sfunction_lout.c
24 #define S_FUNCTION_NAME sfunction_lout
28 static void mdlInitializeSizes(SimStruct *S)
31 * Configure parameters: 1
34 if (!rppSetNumParams(S, 1)) {
39 * Configure input ports: 1
42 if (!ssSetNumInputPorts(S, 1)) {
45 rppAddInputPort(S, 0, SS_BOOLEAN);
48 * Configure output ports: 1
51 if (!ssSetNumOutputPorts(S, 1)) {
54 rppAddOutputPort(S, 0, SS_BOOLEAN);
56 /* Set standard options for this block */
57 rppSetStandardOptions(S);
61 #ifdef MATLAB_MEX_FILE
62 #define MDL_CHECK_PARAMETERS
63 static void mdlCheckParameters(SimStruct *S)
65 /* Check the parameter 1 */
66 if (!rppValidParamRange(S, 0, 1, 8)) {
73 #ifdef MATLAB_MEX_FILE
74 #define MDL_SET_WORK_WIDTHS
75 static void mdlSetWorkWidths(SimStruct *S)
77 /* Set number of run-time parameters */
78 if (!ssSetNumRunTimeParams(S, 1)) {
82 /* Register the run-time parameter 1 */
83 ssRegDlgParamAsRunTimeParam(S, 0, 0, "p1", SS_UINT8);
88 #define COMMON_MDLINITIALIZESAMPLETIMES_INHERIT
89 #define UNUSED_MDLOUTPUTS
90 #define UNUSED_MDLTERMINATE