--- /dev/null
+/* Copyright (C) 2013 Czech Technical University in Prague
+ *
+ * Authors:
+ * - Carlos Jenkins <carlos@jenkins.co.cr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * File : sfunction_sdrw.c
+ * Abstract:
+ * C-MEX S-function block for RPP SD-RAM log write.
+ *
+ * References:
+ * header.c
+ * trailer.c
+ *
+ * Compile with:
+ * <matlabroot>/bin/mex sfunction_sdrw.c
+ */
+
+
+#define S_FUNCTION_NAME sfunction_sdrw
+#include "header.c"
+
+
+static void mdlInitializeSizes(SimStruct *S)
+{
+ /*
+ * Configure parameters: 1
+ * - Block ID.
+ */
+ if(!rppSetNumParams(S, 1)) {
+ return;
+ }
+
+ /*
+ * Configure input ports: 1
+ * - Data.
+ */
+ if(!ssSetNumInputPorts(S, 1)) {
+ return;
+ }
+ rppAddInputPort(S, 0, SS_DOUBLE);
+
+ /*
+ * Configure output ports: 1
+ * - Error flag.
+ */
+ if(!ssSetNumOutputPorts(S, 1)) {
+ return;
+ }
+ rppAddOutputPort(S, 0, SS_BOOLEAN);
+
+ /* Set standard options for this block */
+ rppSetStandardOptions(S);
+}
+
+
+#ifdef MATLAB_MEX_FILE
+#define MDL_CHECK_PARAMETERS
+static void mdlCheckParameters(SimStruct *S)
+{
+ /* Check the parameter 1 */
+ if(!rppValidParamRange(S, 0, 0, 255)) {
+ return;
+ }
+}
+#endif
+
+
+#ifdef MATLAB_MEX_FILE
+#define MDL_SET_WORK_WIDTHS
+static void mdlSetWorkWidths(SimStruct *S)
+{
+ /* Set number of run-time parameters */
+ if(!ssSetNumRunTimeParams(S, 1)) {
+ return;
+ }
+
+ /* Register the run-time parameter 1 */
+ ssRegDlgParamAsRunTimeParam(S, 0, 0, "p1", SS_UINT8);
+}
+#endif
+
+
+#define COMMON_MDLINITIALIZESAMPLETIMES_INHERIT
+#define UNUSED_MDLOUTPUTS
+#define UNUSED_MDLTERMINATE
+#include "trailer.c"