NIFPGA.Interop.cs 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net.Http.Headers;
  5. using System.Reflection;
  6. using System.Runtime.InteropServices;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using FxpConvert.Common;
  10. namespace NIFPGA
  11. {
  12. partial class Interop
  13. {
  14. public enum NiFpga_FifoProperty
  15. {
  16. /// NiFpga_FifoProperty_BytesPerElement -> 1
  17. NiFpga_FifoProperty_BytesPerElement = 1,
  18. /// NiFpga_FifoProperty_HostBufferAllocationGranularity -> 2
  19. NiFpga_FifoProperty_HostBufferAllocationGranularity = 2,
  20. /// NiFpga_FifoProperty_HostBufferSize -> 3
  21. NiFpga_FifoProperty_HostBufferSize = 3,
  22. /// NiFpga_FifoProperty_HostBufferMirrorSize -> 4
  23. NiFpga_FifoProperty_HostBufferMirrorSize = 4,
  24. /// NiFpga_FifoProperty_HostBufferType -> 5
  25. NiFpga_FifoProperty_HostBufferType = 5,
  26. /// NiFpga_FifoProperty_HostBuffer -> 6
  27. NiFpga_FifoProperty_HostBuffer = 6,
  28. /// NiFpga_FifoProperty_FlowControl -> 7
  29. NiFpga_FifoProperty_FlowControl = 7,
  30. /// NiFpga_FifoProperty_ElementsCurrentlyAcquired -> 8
  31. NiFpga_FifoProperty_ElementsCurrentlyAcquired = 8,
  32. }
  33. public enum NiFpga_CloseAttribute
  34. {
  35. /// NiFpga_CloseAttribute_NoResetIfLastSession -> 1
  36. NiFpga_CloseAttribute_NoResetIfLastSession = 1,
  37. }
  38. public enum NiFpga_RunAttribute
  39. {
  40. NiFpga_RunAttribute_None=0,
  41. /// NiFpga_RunAttribute_WaitUntilDone -> 1
  42. NiFpga_RunAttribute_WaitUntilDone = 1,
  43. }
  44. public static Boolean NiFpga_IsError(NiFpga_Status status) => status < NiFpga_Status.Success;
  45. public static Boolean NiFpga_IsNotError(NiFpga_Status status) => status >= NiFpga_Status.Success;
  46. public static float NiFpga_CalculateFxpDeltaFloat(NiFpga_FxpTypeInfo typeInfo)
  47. {
  48. int exponent = typeInfo.integerWordLength - typeInfo.wordLength;
  49. return (float)ldexp(FLT_EPSILON, exponent + FLT_MANT_DIG - 1);
  50. }
  51. public static double NiFpga_CalculateFxpDeltaDouble(NiFpga_FxpTypeInfo typeInfo)
  52. {
  53. int exponent = typeInfo.integerWordLength - typeInfo.wordLength;
  54. return ldexp(DBL_EPSILON, exponent + DBL_MANT_DIG - 1);
  55. }
  56. public static float NiFpga_ConvertFromFxpToFloat(NiFpga_FxpTypeInfo typeInfo,ulong data)
  57. {
  58. float delta = NiFpga_CalculateFxpDeltaFloat(typeInfo);
  59. return (float)NiFpga_Private_FxpToFloatingPoint(typeInfo, delta, data);
  60. }
  61. public static double NiFpga_ConvertFromFxpToDouble(NiFpga_FxpTypeInfo typeInfo, ulong data)
  62. {
  63. double delta = NiFpga_CalculateFxpDeltaDouble(typeInfo);
  64. return NiFpga_Private_FxpToFloatingPoint(typeInfo, delta, data);
  65. }
  66. static double NiFpga_Private_FxpToFloatingPoint(NiFpga_FxpTypeInfo typeInfo,double delta,ulong data)
  67. {
  68. ulong wordLengthMask = (1UL << typeInfo.wordLength) -1;
  69. data &= wordLengthMask;
  70. if(typeInfo.isSigned)
  71. {
  72. ulong signedMask = 1UL << (typeInfo.wordLength - 1);
  73. if((data& signedMask)!=0)
  74. {
  75. long signedData = (long)(data ^ wordLengthMask);
  76. signedData = (signedData + 1) * -1;
  77. return delta * signedData;
  78. }
  79. }
  80. return delta * data;
  81. }
  82. public static ulong NiFpga_ConvertFromFloatToFxp(NiFpga_FxpTypeInfo typeInfo, float data)
  83. {
  84. float delta = NiFpga_CalculateFxpDeltaFloat(typeInfo);
  85. return NiFpga_Private_FloatingPointToFxp(typeInfo, delta, data);
  86. }
  87. public static ulong NiFpga_ConvertFromDoubleToFxp(NiFpga_FxpTypeInfo typeInfo, double data)
  88. {
  89. double delta = NiFpga_CalculateFxpDeltaDouble(typeInfo);
  90. return NiFpga_Private_FloatingPointToFxp(typeInfo, delta, data);
  91. }
  92. static ulong NiFpga_Private_FloatingPointToFxp(NiFpga_FxpTypeInfo typeInfo, double delta, double data)
  93. {
  94. ulong wordLengthMask = (1UL << typeInfo.wordLength) - 1;
  95. if (data < 0)
  96. {
  97. if (typeInfo.isSigned)
  98. {
  99. long fxpRepresentation = (long)(data / delta);
  100. fxpRepresentation ^= (long)wordLengthMask;
  101. fxpRepresentation += 1;
  102. fxpRepresentation *= -1;
  103. if ((long)(fxpRepresentation & (long)wordLengthMask) == fxpRepresentation)
  104. {
  105. return (ulong)fxpRepresentation;
  106. }
  107. else /* minimum */
  108. {
  109. return (ulong)(-1L * (1L << (typeInfo.wordLength - 1)))& wordLengthMask;
  110. }
  111. }
  112. else
  113. {
  114. return 0;
  115. }
  116. }
  117. else
  118. {
  119. ulong fxpRepresentation = (ulong)(data / delta);
  120. if ((fxpRepresentation & wordLengthMask) == fxpRepresentation)
  121. {
  122. return fxpRepresentation;
  123. }
  124. else /* maxmimum */
  125. {
  126. byte magnitude = (byte)(typeInfo.wordLength - (typeInfo.isSigned? 1 : 0));
  127. return (ulong)(1 << magnitude) - 1;
  128. }
  129. }
  130. }
  131. const int DBL_MANT_DIG = 53;
  132. const double DBL_EPSILON = 2.2204460492503131e-016;
  133. const long DBL_EXP_MASK = 0x7ff0000000000000L;
  134. const int DBL_MANT_BITS = 52;
  135. const long DBL_MANT_MASK = 0x000fffffffffffffL;
  136. const long DBL_SGN_MASK = -1 - 0x7fffffffffffffffL;
  137. const long DBL_EXP_CLR_MASK = DBL_SGN_MASK | DBL_MANT_MASK;
  138. const float FLT_EPSILON =1.192092896e-07F;
  139. const int FLT_MANT_DIG = 24;
  140. public static double ldexp(double number, long exponent)
  141. {
  142. long bits = System.BitConverter.DoubleToInt64Bits(number);
  143. int exp = (int)((bits & DBL_EXP_MASK) >> DBL_MANT_BITS);
  144. // Check for infinity or NaN.
  145. if (exp == 0x7ff)
  146. return number;
  147. // Check for 0 or subnormal.
  148. if (exp == 0)
  149. {
  150. // Check for 0.
  151. if ((bits & DBL_MANT_MASK) == 0)
  152. return number;
  153. // Subnormal, scale number so that it is in [1, 2).
  154. number *= System.BitConverter.Int64BitsToDouble(0x4350000000000000L); // 2^54
  155. bits = System.BitConverter.DoubleToInt64Bits(number);
  156. exp = (int)((bits & DBL_EXP_MASK) >> DBL_MANT_BITS) - 54;
  157. }
  158. // Check for underflow.
  159. if (exponent < -50000)
  160. return Math.CopySign(0D, number);
  161. // Check for overflow.
  162. if (exponent > 50000 || (long)exp + exponent > 0x7feL)
  163. return Math.CopySign(System.Double.PositiveInfinity, number);
  164. exp += (int)exponent;
  165. // Check for normal.
  166. if (exp > 0)
  167. return System.BitConverter.Int64BitsToDouble((bits & DBL_EXP_CLR_MASK) | ((long)exp << DBL_MANT_BITS));
  168. // Check for underflow.
  169. if (exp <= -54)
  170. return Math.CopySign(0D, number);
  171. // Subnormal.
  172. exp += 54;
  173. number = System.BitConverter.Int64BitsToDouble((bits & DBL_EXP_CLR_MASK) | ((long)exp << DBL_MANT_BITS));
  174. return number * System.BitConverter.Int64BitsToDouble(0x3c90000000000000L); // 2^-54
  175. }
  176. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  177. public delegate NiFpga_Status NiFpgaDll_Open([System.Runtime.InteropServices.InAttribute()][System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string bitfile, [System.Runtime.InteropServices.InAttribute()][System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string signature, [System.Runtime.InteropServices.InAttribute()][System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string resource, NiFpga_OpenAttribute attribute, ref uint session);
  178. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  179. public delegate NiFpga_Status NiFpgaDll_Finalize();
  180. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  181. public delegate NiFpga_Status NiFpgaDll_Close(uint session, NiFpga_CloseAttribute attribute);
  182. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  183. public delegate NiFpga_Status NiFpgaDll_Run(uint session, NiFpga_RunAttribute attribute);
  184. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  185. public delegate NiFpga_Status NiFpgaDll_Abort(uint session);
  186. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  187. public delegate NiFpga_Status NiFpgaDll_Reset(uint session);
  188. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  189. public delegate NiFpga_Status NiFpgaDll_Download(uint session);
  190. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  191. public delegate NiFpga_Status NiFpgaDll_ReadBool(uint session, uint indicator, ref byte value);
  192. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  193. public delegate NiFpga_Status NiFpgaDll_ReadI8(uint session, uint indicator, ref sbyte value);
  194. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  195. public delegate NiFpga_Status NiFpgaDll_ReadU8(uint session, uint indicator, ref byte value);
  196. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  197. public delegate NiFpga_Status NiFpgaDll_ReadI16(uint session, uint indicator, ref short value);
  198. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  199. public delegate NiFpga_Status NiFpgaDll_ReadU16(uint session, uint indicator, ref ushort value);
  200. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  201. public delegate NiFpga_Status NiFpgaDll_ReadI32(uint session, uint indicator, ref int value);
  202. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  203. public delegate NiFpga_Status NiFpgaDll_ReadU32(uint session, uint indicator, ref uint value);
  204. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  205. public delegate NiFpga_Status NiFpgaDll_ReadI64(uint session, uint indicator, ref long value);
  206. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  207. public delegate NiFpga_Status NiFpgaDll_ReadU64(uint session, uint indicator, ref ulong value);
  208. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  209. public delegate NiFpga_Status NiFpgaDll_ReadSgl(uint session, uint indicator, ref float value);
  210. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  211. public delegate NiFpga_Status NiFpgaDll_ReadDbl(uint session, uint indicator, ref double value);
  212. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  213. public delegate NiFpga_Status NiFpgaDll_WriteBool(uint session, uint control, byte value);
  214. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  215. public delegate NiFpga_Status NiFpgaDll_WriteI8(uint session, uint control, sbyte value);
  216. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  217. public delegate NiFpga_Status NiFpgaDll_WriteU8(uint session, uint control, byte value);
  218. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  219. public delegate NiFpga_Status NiFpgaDll_WriteI16(uint session, uint control, short value);
  220. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  221. public delegate NiFpga_Status NiFpgaDll_WriteU16(uint session, uint control, ushort value);
  222. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  223. public delegate NiFpga_Status NiFpgaDll_WriteI32(uint session, uint control, int value);
  224. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  225. public delegate NiFpga_Status NiFpgaDll_WriteU32(uint session, uint control, uint value);
  226. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  227. public delegate NiFpga_Status NiFpgaDll_WriteI64(uint session, uint control, long value);
  228. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  229. public delegate NiFpga_Status NiFpgaDll_WriteU64(uint session, uint control, ulong value);
  230. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  231. public delegate NiFpga_Status NiFpgaDll_WriteSgl(uint session, uint control, float value);
  232. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  233. public delegate NiFpga_Status NiFpgaDll_WriteDbl(uint session, uint control, double value);
  234. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  235. public delegate NiFpga_Status NiFpgaDll_ReadArrayBool(uint session, uint indicator, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  236. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  237. public delegate NiFpga_Status NiFpgaDll_ReadArrayI8(uint session, uint indicator, ref sbyte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  238. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  239. public delegate NiFpga_Status NiFpgaDll_ReadArrayU8(uint session, uint indicator, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  240. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  241. public delegate NiFpga_Status NiFpgaDll_ReadArrayI16(uint session, uint indicator, ref short array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  242. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  243. public delegate NiFpga_Status NiFpgaDll_ReadArrayU16(uint session, uint indicator, ref ushort array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  244. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  245. public delegate NiFpga_Status NiFpgaDll_ReadArrayI32(uint session, uint indicator, ref int array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  246. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  247. public delegate NiFpga_Status NiFpgaDll_ReadArrayU32(uint session, uint indicator, ref uint array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  248. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  249. public delegate NiFpga_Status NiFpgaDll_ReadArrayI64(uint session, uint indicator, ref long array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  250. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  251. public delegate NiFpga_Status NiFpgaDll_ReadArrayU64(uint session, uint indicator, ref ulong array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  252. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  253. public delegate NiFpga_Status NiFpgaDll_ReadArraySgl(uint session, uint indicator, ref float array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  254. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  255. public delegate NiFpga_Status NiFpgaDll_ReadArrayDbl(uint session, uint indicator, ref double array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  256. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  257. public delegate NiFpga_Status NiFpgaDll_WriteArrayBool(uint session, uint control, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  258. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  259. public delegate NiFpga_Status NiFpgaDll_WriteArrayI8(uint session, uint control, ref sbyte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  260. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  261. public delegate NiFpga_Status NiFpgaDll_WriteArrayU8(uint session, uint control, ref byte array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  262. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  263. public delegate NiFpga_Status NiFpgaDll_WriteArrayI16(uint session, uint control, ref short array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  264. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  265. public delegate NiFpga_Status NiFpgaDll_WriteArrayU16(uint session, uint control, ref ushort array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  266. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  267. public delegate NiFpga_Status NiFpgaDll_WriteArrayI32(uint session, uint control, ref int array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  268. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  269. public delegate NiFpga_Status NiFpgaDll_WriteArrayU32(uint session, uint control, ref uint array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  270. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  271. public delegate NiFpga_Status NiFpgaDll_WriteArrayI64(uint session, uint control, ref long array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  272. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  273. public delegate NiFpga_Status NiFpgaDll_WriteArrayU64(uint session, uint control, ref ulong array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  274. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  275. public delegate NiFpga_Status NiFpgaDll_WriteArraySgl(uint session, uint control, ref float array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  276. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  277. public delegate NiFpga_Status NiFpgaDll_WriteArrayDbl(uint session, uint control, ref double array, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint size);
  278. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  279. public delegate NiFpga_Status NiFpgaDll_ReserveIrqContext(uint session, ref System.IntPtr context);
  280. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  281. public delegate NiFpga_Status NiFpgaDll_UnreserveIrqContext(uint session, System.IntPtr context);
  282. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  283. public delegate NiFpga_Status NiFpgaDll_WaitOnIrqs(uint session, System.IntPtr context, NiFpga_Irq irqs, uint timeout, ref uint irqsAsserted, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.I1)] ref bool timedOut);
  284. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  285. public delegate NiFpga_Status NiFpgaDll_AcknowledgeIrqs(uint session, NiFpga_Irq irqs);
  286. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  287. public delegate NiFpga_Status NiFpgaDll_ConfigureFifo(uint session, uint fifo, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint depth);
  288. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  289. public delegate NiFpga_Status NiFpgaDll_ConfigureFifo2(uint session, uint fifo, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint requestedDepth, ref uint actualDepth);
  290. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  291. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyU32(uint session, uint fifo, NiFpga_FifoProperty property, uint value);
  292. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  293. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyI32(uint session, uint fifo, NiFpga_FifoProperty property, int value);
  294. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  295. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyU64(uint session, uint fifo, NiFpga_FifoProperty property, ulong value);
  296. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  297. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyI64(uint session, uint fifo, NiFpga_FifoProperty property, long value);
  298. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  299. public delegate NiFpga_Status NiFpgaDll_SetFifoPropertyPtr(uint session, uint fifo, NiFpga_FifoProperty property, IntPtr value);
  300. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  301. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyU32(uint session, uint fifo, NiFpga_FifoProperty property, ref uint value);
  302. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  303. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyI32(uint session, uint fifo, NiFpga_FifoProperty property, ref int value);
  304. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  305. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyU64(uint session, uint fifo, NiFpga_FifoProperty property, ref ulong value);
  306. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  307. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyI64(uint session, uint fifo, NiFpga_FifoProperty property, ref long value);
  308. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  309. public delegate NiFpga_Status NiFpgaDll_GetFifoPropertyPtr(uint session, uint fifo, NiFpga_FifoProperty property, ref IntPtr value);
  310. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  311. public delegate NiFpga_Status NiFpgaDll_CommitFifoConfiguration(uint session, uint fifo);
  312. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  313. public delegate NiFpga_Status NiFpgaDll_StartFifo(uint session, uint fifo);
  314. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  315. public delegate NiFpga_Status NiFpgaDll_StopFifo(uint session, uint fifo);
  316. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  317. public delegate NiFpga_Status NiFpgaDll_UnreserveFifo(uint session, uint fifo);
  318. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  319. public delegate NiFpga_Status NiFpgaDll_ReadFifoBool(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  320. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  321. public delegate NiFpga_Status NiFpgaDll_ReadFifoI8(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  322. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  323. public delegate NiFpga_Status NiFpgaDll_ReadFifoU8(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  324. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  325. public delegate NiFpga_Status NiFpgaDll_ReadFifoI16(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  326. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  327. public delegate NiFpga_Status NiFpgaDll_ReadFifoU16(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  328. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  329. public delegate NiFpga_Status NiFpgaDll_ReadFifoI32(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  330. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  331. public delegate NiFpga_Status NiFpgaDll_ReadFifoU32(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  332. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  333. public delegate NiFpga_Status NiFpgaDll_ReadFifoI64(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  334. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  335. public delegate NiFpga_Status NiFpgaDll_ReadFifoU64(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  336. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  337. public delegate NiFpga_Status NiFpgaDll_ReadFifoSgl(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  338. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  339. public delegate NiFpga_Status NiFpgaDll_ReadFifoDbl(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  340. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  341. public delegate NiFpga_Status NiFpgaDll_ReadFifoComposite(uint session, uint fifo, ref byte data, uint bytesPerElement, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint elementsRemaining);
  342. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  343. public delegate NiFpga_Status NiFpgaDll_WriteFifoBool(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  344. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  345. public delegate NiFpga_Status NiFpgaDll_WriteFifoI8(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  346. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  347. public delegate NiFpga_Status NiFpgaDll_WriteFifoU8(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  348. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  349. public delegate NiFpga_Status NiFpgaDll_WriteFifoI16(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  350. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  351. public delegate NiFpga_Status NiFpgaDll_WriteFifoU16(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  352. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  353. public delegate NiFpga_Status NiFpgaDll_WriteFifoI32(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  354. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  355. public delegate NiFpga_Status NiFpgaDll_WriteFifoU32(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  356. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  357. public delegate NiFpga_Status NiFpgaDll_WriteFifoI64(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  358. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  359. public delegate NiFpga_Status NiFpgaDll_WriteFifoU64(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  360. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  361. public delegate NiFpga_Status NiFpgaDll_WriteFifoSgl(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  362. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  363. public delegate NiFpga_Status NiFpgaDll_WriteFifoDbl(uint session, uint fifo, ref byte data, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  364. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  365. public delegate NiFpga_Status NiFpgaDll_WriteFifoComposite(uint session, uint fifo, ref byte data, uint bytesPerElement, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint numberOfElements, uint timeout, ref uint emptyElementsRemaining);
  366. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  367. public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsBool(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  368. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  369. public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsI8(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  370. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  371. public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsU8(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  372. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsI16(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  373. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsU16(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  374. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsI32(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  375. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsI64(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  376. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsU64(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  377. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsSgl(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  378. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoReadElementsDbl(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  379. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsBool(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  380. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsI8(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  381. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsU8(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  382. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsI16(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  383. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsU16(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  384. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsI32(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  385. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsU32(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  386. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsI64(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  387. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsU64(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  388. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsSgl(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  389. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_AcquireFifoWriteElementsDbl(uint session, uint fifo, ref System.IntPtr elements, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elementsRequested, uint timeout, ref uint elementsAcquired, ref uint elementsRemaining);
  390. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_ReleaseFifoElements(uint session, uint fifo, [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.U4)] uint elements);
  391. [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate NiFpga_Status NiFpgaDll_GetPeerToPeerFifoEndpoint(uint session, uint fifo, ref uint endpoint);
  392. }
  393. }