asbDio (asbDio.dll)
Posted wang_xy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了asbDio (asbDio.dll)相关的知识,希望对你有一定的参考价值。
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace WagweiCSharpDIO_AWP_ASB
{
public class Wagwei_asbDio
{
//**************************************************************
//asbDioInitialize
[DllImport("asbDio.dll")]
public static extern int asbDioInitialize();
public const string asbDioInitializeRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-2 ASBDIO_RESOURCE_ERROR
//-3 ASBDIO_TIMEOUT_ERROR
//-5 ASBDIO_DRIVER_ERROR
//-7 ASBDIO_THREAD_ERROR
//-8 ASBDIO_NO_TARGET_BOARD
//-9 ASBDIO_NOT_SUPPORT_FPGA";
//asbDioFinalize
[DllImport("asbDio.dll")]
public static extern int asbDioFinalize();
public const string asbDioFinalizeRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-5 ASBDIO_DRIVER_ERROR
//-6 ASBDIO_EVENT_ERROR
//-7 ASBDIO_THREAD_ERROR";
//**************************************************************
//asbDioGetDeviceInfo
[DllImport("asbDio.dll")]
public static extern int asbDioGetDeviceInfo(out DEVICE_INFO pDevInfo);
public struct DEVICE_INFO
{
long FpgaVer;
long BoardRev;
long DriverVer;
long LibraryVer;
long BitMax;
}
public const string asbDioGetDeviceInfoRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-4 ASBDIO_INVALID_PARAMETER
//-5 ASBDIO_DRIVER_ERROR";
//**************************************************************
//asbDioRead
[DllImport("asbDio.dll")]
public static extern int asbDioRead(out uint pRdata);
//pRdata LPDWORD
public const string asbDioReadRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//asbDioWrite
[DllImport("asbDio.dll")]
public static extern int asbDioWrite(uint Wdata, uint Mask);
//Wdata DWORD
//Mask DWORD
//事例
//DWORD Wdata (0 << 2) | (1 << 1) | (1 << 0); //0,1为High;2为Low
//DWORD Mask (1 << 2) | (1 << 1) | <1 << 0); //0,1,2有效
public const string asbDioWriteRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//asbDioReadBack
[DllImport("asbDio.dll")]
public static extern int asbDioReadBack(out uint pRdata);
//pRdata LPDWORD
public const string asbDioReadBackRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//**************************************************************
//asbDiosetIntMask
[DllImport("asbDio.dll")]
public static extern int asbDioSetIntMask(uint SetMask);
//SetMask DWORD
public const string asbDioSetIntMaskRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//asbDioGetIntMask
[DllImport("asbDio.dll")]
public static extern int asbDioGetIntMask(out uint pGetMask);
//pGetMask LPWORD
public const string asbDioGetIntMaskRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//asbDioSetIntPolarity
[DllImport("asbDio.dll")]
public static extern int asbDioSetIntPolarity(uint SetPolarity);
//SetPolarity DWORD
public const string asbDioSetIntPolarityRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//asbDioGetIntPolarity
[DllImport("asbDio.dll")]
public static extern int asbDioGetIntPolarity(out uint pGetPolarity);
//pGetPolarity LPDWORD
public const string asbDioGetIntPolarityRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//asbDioRegistCallback
[DllImport("asbDio.dll")]
public static extern int asbDioRegistCallback(UserCallBack HookFunc);
public const string asbDioRegistCallbackRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST";
public delegate void UserCallBack(INT_BUFFER intBuffer);
public struct INT_BUFFER
{
ulong ulPin;
ulong ulPort;
ulong ulTime;
}
//**************************************************************
//asbDioReadOnBoardTimer
[DllImport("asbDio.dll")]
public static extern int asbDioReadOnBoardTimer(out uint pTimerCount);
//pTimerCount LPDWORD
public const string asbDioReadOnBoardTimerRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//**************************************************************
//asbDioSetDigitalFilter
[DllImport("asbDio.dll")]
public static extern int asbDioSetDigitalFilter(uint SetFilter);
//SetFilter DWORD
public const string asbDioSetDigitalFilterRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
//asbDioGetDigitalFilter
[DllImport("asbDio.dll")]
public static extern int asbDioGetDigitalFilter(out uint pGetFilter);
//pGetFilter LPDWORD
public const string asbDioGetDigitalFilterRtn = @"
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER";
// 0 ASBDIO_NO_ERROR
//-1 ASBDIO_INVALID_REQUEST
//-2 ASBDIO_RESOURCE_ERROR
//-3 ASBDIO_TIMEOUT_ERROR
//-4 ASBDIO_INVALID_PARAMETER
//-5 ASBDIO_DRIVER_ERROR
//-6 ASBDIO_EVENT_ERROR
//-7 ASBDIO_THREAD_ERROR
//-8 ASBDIO_NO_TARGET_BOARD
//-9 ASBDIO_NOT_SUPPORT_FPGA
}
}
以上是关于asbDio (asbDio.dll)的主要内容,如果未能解决你的问题,请参考以下文章