码迷,mamicode.com
首页 > 其他好文 > 详细

asbDio (asbDio.dll)

时间:2019-12-16 19:09:30      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:text   timer   adb   ring   finalize   write   stc   static   eric   

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)

标签:text   timer   adb   ring   finalize   write   stc   static   eric   

原文地址:https://www.cnblogs.com/wang_xy/p/12050617.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!