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_lout.c
13 * C-MEX S-function block for RPP digital output.
20 * <matlabroot>/bin/mex sfunction_lout.c
37 # Description is in Markdown mark-up
47 RPP API functions used:
53 #define S_FUNCTION_NAME sfunction_lout
57 static void mdlInitializeSizes(SimStruct *S)
60 * Configure parameters: 1
63 if (!rppSetNumParams(S, 1)) {
68 * Configure input ports: 1
71 if (!ssSetNumInputPorts(S, 1)) {
74 rppAddInputPort(S, 0, SS_BOOLEAN);
77 * Configure output ports: 1
80 if (!ssSetNumOutputPorts(S, 1)) {
83 rppAddOutputPort(S, 0, SS_BOOLEAN);
85 /* Set standard options for this block */
86 rppSetStandardOptions(S);
90 #ifdef MATLAB_MEX_FILE
91 #define MDL_CHECK_PARAMETERS
92 static void mdlCheckParameters(SimStruct *S)
94 /* Check the parameter 1 */
95 if (!rppValidParamRange(S, 0, 1, 8)) {
102 #ifdef MATLAB_MEX_FILE
103 #define MDL_SET_WORK_WIDTHS
104 static void mdlSetWorkWidths(SimStruct *S)
106 /* Set number of run-time parameters */
107 if (!ssSetNumRunTimeParams(S, 1)) {
111 /* Register the run-time parameter 1 */
112 ssRegDlgParamAsRunTimeParam(S, 0, 0, "p1", SS_UINT8);
117 #define COMMON_MDLINITIALIZESAMPLETIMES_INHERIT
118 #define UNUSED_MDLOUTPUTS
119 #define UNUSED_MDLTERMINATE