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_scic.c
13 * C-MEX S-function block for configuring RPP Serial Communication.
20 * <matlabroot>/bin/mex sfunction_scic.c
36 # Description is in Markdown mark-up
46 RPP API functions used:
52 #define S_FUNCTION_NAME sfunction_scic
56 static void mdlInitializeSizes(SimStruct *S)
59 * Configure parameters: 1
62 if (!rppSetNumParams(S, 1)) {
67 * Configure input ports: 0
69 if (!ssSetNumInputPorts(S, 0)) {
74 * Configure output ports: 0
76 if (!ssSetNumOutputPorts(S, 0)) {
80 /* Set standard options for this block */
81 rppSetStandardOptions(S);
85 #ifdef MATLAB_MEX_FILE
86 #define MDL_CHECK_PARAMETERS
87 static void mdlCheckParameters(SimStruct *S)
89 /* Check the parameter 1 (top baud rate is arbitrary) */
90 if (!rppValidParamRange(S, 0, 0, 1000000)) {
97 #ifdef MATLAB_MEX_FILE
98 #define MDL_SET_WORK_WIDTHS
99 static void mdlSetWorkWidths(SimStruct *S)
101 /* Set number of run-time parameters */
102 if (!ssSetNumRunTimeParams(S, 1)) {
106 /* Register the run-time parameter 1 */
107 ssRegDlgParamAsRunTimeParam(S, 0, 0, "p1", SS_UINT32);
112 #define COMMON_MDLINITIALIZESAMPLETIMES_INHERIT
113 #define UNUSED_MDLOUTPUTS
114 #define UNUSED_MDLTERMINATE