⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ms_reset.c

📁 MatLab图像传感器网络仿真平台WiSNAP
💻 C
字号:
/*******************************************************************************
 * Mouse sensor reset.                                                         *
 * Syntax: Status = Ms_Reset(Port)                                             *
 *                                                                             *
 *    Input Parameters:                                                        *
 *    ================                                                         *
 *                                                                             *
 *       Port --------> Parallel port base address decimal (positive integer). *
 *                                                                             *
 *    Output Parameters:                                                       *
 *    =================                                                        *
 *                                                                             *
 *       Status ------> Success status (-1 = error, +1 = success).             *
 *                                                                             *
 *    See also Ms_Frame(), Ms_Power().                                         *
 *                                                                             *
 * Compile: mex -v ms_reset.c ms_spi.c inpout32.lib                            *
 * Version: 02-02-2005                                                         *
 *                                                                             *
 * (C) 2005 Stephan Hengstler, Stanford Wireless Sensor Networks Lab           *
 *******************************************************************************/


#include <stdio.h>
#include <windows.h>
#include "mex.h"

void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
{
	double		*result;
	int         status;
	short	      port;

	/* get the value(s) of the input variable(s) */
	port 			= (short) mxGetScalar(prhs[0]);

	/* call the respective subroutine(s) */
   status     	= ms_reset(port);

	/* set the value(s) of the output variable(s) */
	plhs[0] 		= mxCreateDoubleMatrix(1, 1, mxREAL);
   result		= mxGetPr(plhs[0]);
	*result		= status;

	/* show debug information */
	if (nrhs == 2)
	{
		printf("Debug Information\n");
		printf("port      = %d\n", port);
		printf("status    = %d\n", status);
	}

	/* clean exit */
	return;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -