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_scic.c
13 * C-MEX S-function block for configuring RPP Serial Communication.
20 * <matlabroot>/bin/mex sfunction_scic.c
24 #define S_FUNCTION_NAME sfunction_scic
28 static void mdlInitializeSizes(SimStruct *S)
31 * Configure parameters: 1
34 if (!rppSetNumParams(S, 1)) {
39 * Configure input ports: 0
41 if (!ssSetNumInputPorts(S, 0)) {
46 * Configure output ports: 0
48 if (!ssSetNumOutputPorts(S, 0)) {
52 /* Set standard options for this block */
53 rppSetStandardOptions(S);
57 #ifdef MATLAB_MEX_FILE
58 #define MDL_CHECK_PARAMETERS
59 static void mdlCheckParameters(SimStruct *S)
61 /* Check the parameter 1 (top baud rate is arbitrary) */
62 if (!rppValidParamRange(S, 0, 0, 1000000)) {
69 #ifdef MATLAB_MEX_FILE
70 #define MDL_SET_WORK_WIDTHS
71 static void mdlSetWorkWidths(SimStruct *S)
73 /* Set number of run-time parameters */
74 if (!ssSetNumRunTimeParams(S, 1)) {
78 /* Register the run-time parameter 1 */
79 ssRegDlgParamAsRunTimeParam(S, 0, 0, "p1", SS_UINT32);
84 #define COMMON_MDLINITIALIZESAMPLETIMES_INHERIT
85 #define UNUSED_MDLOUTPUTS
86 #define UNUSED_MDLTERMINATE