资源简介
Visual studio 工程文件, 里面有内存映射、发送和接收的子程序,可以单独运行,检测反射内存卡的发送和接收功能。
代码片段和文件信息
/*
===============================================================================
COPYRIGHT NOTICE
Copyright (C) 2002 2006-2010 GE Intelligent Platforms embedded Systems Inc.
International Copyright Secured. All Rights Reserved.
-------------------------------------------------------------------------------
$Workfile: rfm2g_map.c $
$Revision: 20 $
$Modtime: 1/22/09 3:27p $
-------------------------------------------------------------------------------
Description: Sample program using PCI RFM2g to map memory for use by application
===============================================================================
*/
#if (defined(WIN32))
#include “rfm2g_windows.h“
#endif
#include
#include
#include
#include “rfm2g_api.h“
#if (defined(RFM2G_LINUX))
#ifdef CONFIG_DEVFS_FS
#define DEVICE_PREFIX “/dev/rfm2g/“
#else
#define DEVICE_PREFIX “/dev/rfm2g“
#endif
#define PROCFILE “/proc/rfm2g“
#elif defined(RFM2G_VXWORKS)
#define DEVICE_PREFIX “RFM2G_“
#elif defined(SOLARIS)
#define DEVICE_PREFIX “/dev/rfm2g“
#elif defined(WIN32)
#define DEVICE_PREFIX “\\\\.\\rfm2g“
#else
#error Please define DEVICE_PREFIX for your driver
#endif
#define BUF_SIZE 40
#if (defined(RFM2G_VXWORKS))
RFM2G_INT32 rfm2g_map(void)
#else
int
main( int argc char *argv[] )
#endif
{
RFM2G_STATUS result; /* Return codes from RFM2Get API calls */
volatile RFM2G_UINT32 * outbuffer; /* Pointer mapped to RFM area */
RFM2G_UINT32 inbuffer[BUF_SIZE]; /* Data read from RFM area */
RFM2G_INT32 i; /* Loop variable */
RFM2G_CHAR device[40]; /* Name of RFM2G device to use */
RFM2GHANDLE Handle = NULL;
RFM2G_INT32 numDevice = 0;
printf(“\n PCI RFM2g Map\n\n“);
clearerr(stdin);
printf(“Please enter device number: “);
while ((fgets( device sizeof(device) stdin ) == (char *) NULL ) ||
(strlen(device) < 2))
{
}
sscanf(device “%d“ &numDevice);
/* if sscanf fails then numDevice will stay 0 */
sprintf(device “%s%d“ DEVICE_PREFIX numDevice);
/* Open the Reflective Memory device */
result = RFM2gOpen( device &Handle );
if( result != RFM2G_SUCCESS )
{
printf( “ERROR: RFM2gOpen() failed.\n“ );
printf( “ERROR MSG: %s\n“ RFM2gErrorMsg(result));
return(-1);
}
result = RFM2gUserMemory(Handle (volatile void **)(&outbuffer) 0 1);
if( result != RFM2G_SUCCESS )
{
printf( “ERROR: RFM2gUserMemory() failed.\n“ );
printf( “ERROR MSG: %s\n“ RFM2gErrorMsg(result));
/* Close the Reflective Memory device */
RFM2gClose( &Handle );
return(-1);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 42496 2017-12-28 17:26 Samples\.vs\Samples\v14\.suo
文件 3547 2010-03-19 11:39 Samples\Backup\Samples.sln
文件 3298 2017-12-06 10:26 Samples\Backup1\Samples.sln
..A..H. 22016 2017-12-06 12:23 Samples\Backup1\Samples.v12.suo
文件 3298 2017-12-06 12:24 Samples\Backup2\Samples.sln
文件 3236 2017-12-27 18:29 Samples\Backup3\Samples.sln
文件 3236 2017-12-28 14:08 Samples\Backup4\Samples.sln
文件 3238 2017-12-28 16:17 Samples\Backup5\Samples.sln
文件 3236 2017-12-28 16:49 Samples\Backup6\Samples.sln
文件 32094 2010-03-26 17:48 Samples\inc\pmc5565_nt.h
文件 2169 2010-03-26 19:01 Samples\inc\rfm2gdll_stdc.h
文件 8643 2010-03-26 19:00 Samples\inc\rfm2g_api.h
文件 9950 2010-03-26 19:00 Samples\inc\rfm2g_defs.h
文件 4292 2010-03-26 19:00 Samples\inc\rfm2g_errno.h
文件 7128 2010-03-26 19:00 Samples\inc\rfm2g_osspec.h
文件 10451 2010-03-26 19:00 Samples\inc\rfm2g_regs.h
文件 2625 2010-03-26 19:01 Samples\inc\rfm2g_types.h
文件 617 2010-02-23 15:59 Samples\inc\rfm2g_windows.h
文件 18176 2010-05-03 13:26 Samples\lib\rfm2gdll_stdc.lib
文件 18176 2010-05-03 13:26 Samples\lib\rfm2gdll_stdc_32.lib
文件 17798 2010-03-25 17:45 Samples\lib\rfm2gdll_stdc_64.lib
文件 897536 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.exe
文件 1983568 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.ilk
文件 177 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.log
文件 6565888 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.pdb
文件 1340 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.tlog\cl.command.1.tlog
文件 21732 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.tlog\CL.read.1.tlog
文件 412 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.tlog\CL.write.1.tlog
文件 1074 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.tlog\li
文件 2806 2017-12-28 17:18 Samples\MemoryMap\Debug\MemoryMap.tlog\li
............此处省略98个文件信息
评论
共有 条评论